From 30f8f951971d02e87e90ea697ba7604ce25d64a2 Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Sat, 16 Mar 2002 08:11:53 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'ZendEngine2'. --- CODING_STANDARDS | 226 - CREDITS | 2 - ChangeLog | 5388 ------ ChangeLog.1999.gz | Bin 78772 -> 0 bytes ChangeLog.2000.gz | Bin 159518 -> 0 bytes ChangeLog.2001.gz | Bin 198003 -> 0 bytes EXTENSIONS | 463 - INSTALL | 411 - LICENSE | 75 - Makefile.frag | 16 - Makefile.global | 70 - NEWS | 1908 -- README.CVS-RULES | 114 - README.EXTENSIONS | 39 - README.EXT_SKEL | 184 - README.PARAMETER_PARSING_API | 118 - README.QNX | 57 - README.SELF-CONTAINED-EXTENSIONS | 154 - README.STREAMS | 243 - README.TESTING | 175 - README.Zeus | 126 - RELEASE_PROCESS | 186 - TODO | 170 - TODO.BUILDv5 | 3 - TSRM/LICENSE | 26 - TSRM/Makefile.am | 6 - TSRM/TODO | 2 - TSRM/TSRM.c | 588 - TSRM/TSRM.dsp | 186 - TSRM/TSRM.h | 143 - TSRM/acconfig.h | 1 - TSRM/acinclude.m4 | 5 - TSRM/build.mk | 43 - TSRM/buildconf | 33 - TSRM/configure.in | 31 - TSRM/readdir.h | 44 - TSRM/threads.m4 | 160 - TSRM/tsrm.m4 | 124 - TSRM/tsrm_config.w32.h | 15 - TSRM/tsrm_config_common.h | 58 - TSRM/tsrm_strtok_r.c | 63 - TSRM/tsrm_strtok_r.h | 6 - TSRM/tsrm_virtual_cwd.c | 773 - TSRM/tsrm_virtual_cwd.h | 221 - TSRM/tsrm_win32.c | 359 - TSRM/tsrm_win32.h | 107 - Zend/ChangeLog | 8817 --------- Zend/FlexLexer.h | 186 - Zend/LICENSE | 56 - Zend/Makefile.am | 50 - Zend/OBJECTS2_HOWTO | 190 - Zend/RFCs/001.txt | 136 - Zend/RFCs/002.txt | 169 - Zend/RFCs/003.txt | 72 - Zend/ZEND_CHANGES | 641 - Zend/Zend.dsp | 506 - Zend/Zend.m4 | 202 - Zend/ZendCore.dep | 258 - Zend/ZendTS.dsp | 667 - Zend/acconfig.h | 76 - Zend/acinclude.m4 | 47 - Zend/build.mk | 43 - Zend/buildconf | 33 - Zend/configure.in | 45 - Zend/flex.skl | 1628 -- Zend/tests/zend2.php | 339 - Zend/zend.c | 876 - Zend/zend.h | 551 - Zend/zend.ico | Bin 1382 -> 0 bytes Zend/zend_API.c | 1417 -- Zend/zend_API.h | 435 - Zend/zend_alloc.c | 768 - Zend/zend_alloc.h | 141 - Zend/zend_builtin_functions.c | 1216 -- Zend/zend_builtin_functions.h | 26 - Zend/zend_compile.c | 3026 --- Zend/zend_compile.h | 693 - Zend/zend_config.w32.h | 88 - Zend/zend_constants.c | 277 - Zend/zend_constants.h | 68 - Zend/zend_dynamic_array.c | 62 - Zend/zend_dynamic_array.h | 38 - Zend/zend_errors.h | 40 - Zend/zend_execute.c | 3217 ---- Zend/zend_execute.h | 164 - Zend/zend_execute_API.c | 908 - Zend/zend_execute_locks.h | 32 - Zend/zend_extensions.c | 218 - Zend/zend_extensions.h | 116 - Zend/zend_fast_cache.h | 140 - Zend/zend_globals.h | 254 - Zend/zend_globals_macros.h | 109 - Zend/zend_hash.c | 1307 -- Zend/zend_hash.h | 219 - Zend/zend_highlight.c | 242 - Zend/zend_highlight.h | 52 - Zend/zend_indent.c | 147 - Zend/zend_indent.h | 26 - Zend/zend_ini.c | 487 - Zend/zend_ini.h | 199 - Zend/zend_ini_parser.y | 236 - Zend/zend_ini_scanner.h | 12 - Zend/zend_ini_scanner.l | 228 - Zend/zend_istdiostream.h | 15 - Zend/zend_language_parser.y | 831 - Zend/zend_language_scanner.h | 41 - Zend/zend_language_scanner.l | 1480 -- Zend/zend_list.c | 391 - Zend/zend_list.h | 109 - Zend/zend_llist.c | 305 - Zend/zend_llist.h | 79 - Zend/zend_modules.h | 88 - Zend/zend_object_handlers.c | 259 - Zend/zend_object_handlers.h | 76 - Zend/zend_objects.c | 257 - Zend/zend_objects.h | 41 - Zend/zend_opcode.c | 409 - Zend/zend_operators.c | 1750 -- Zend/zend_operators.h | 272 - Zend/zend_ptr_stack.c | 110 - Zend/zend_ptr_stack.h | 58 - Zend/zend_qsort.c | 106 - Zend/zend_qsort.h | 26 - Zend/zend_sprintf.c | 40 - Zend/zend_stack.c | 164 - Zend/zend_stack.h | 47 - Zend/zend_static_allocator.c | 76 - Zend/zend_static_allocator.h | 45 - Zend/zend_variables.c | 204 - Zend/zend_variables.h | 59 - acconfig.h.in | 1 - acinclude.m4 | 1342 -- apidoc-zend.txt | 280 - apidoc.txt | 492 - build/build.mk | 71 - build/build2.mk | 59 - build/buildcheck.sh | 93 - build/genif.sh | 41 - build/mkdep.awk | 75 - build/print_include.awk | 6 - build/program.mk | 23 - build/rules.mk | 68 - build/rules_common.mk | 77 - build/rules_pear.mk | 76 - build/shtool | 787 - buildconf | 36 - config.guess | 1308 -- config.sub | 1417 -- configure.in | 1264 -- cvsclean | 3 - ext/aspell/CREDITS | 2 - ext/aspell/aspell.c | 228 - ext/aspell/config.m4 | 30 - ext/aspell/php_aspell.h | 41 - ext/bcmath/CREDITS | 2 - ext/bcmath/bcmath.c | 506 - ext/bcmath/config.m4 | 17 - ext/bcmath/libbcmath/AUTHORS | 3 - ext/bcmath/libbcmath/COPYING.LIB | 515 - ext/bcmath/libbcmath/ChangeLog | 10 - ext/bcmath/libbcmath/FAQ | 21 - ext/bcmath/libbcmath/INSTALL | 9 - ext/bcmath/libbcmath/Makefile.am | 12 - ext/bcmath/libbcmath/NEWS | 3 - ext/bcmath/libbcmath/README | 9 - ext/bcmath/libbcmath/acconfig.h | 9 - ext/bcmath/libbcmath/aclocal.m4 | 127 - ext/bcmath/libbcmath/config.h.in | 41 - ext/bcmath/libbcmath/configure | 1859 -- ext/bcmath/libbcmath/configure.in | 18 - ext/bcmath/libbcmath/doc/Makefile.am | 3 - ext/bcmath/libbcmath/doc/Makefile.in | 171 - ext/bcmath/libbcmath/doc/bcmath.1 | 1 - ext/bcmath/libbcmath/install-sh | 238 - ext/bcmath/libbcmath/missing | 134 - ext/bcmath/libbcmath/mkinstalldirs | 36 - ext/bcmath/libbcmath/src/Makefile.am | 22 - ext/bcmath/libbcmath/src/add.c | 88 - ext/bcmath/libbcmath/src/bcmath.h | 158 - ext/bcmath/libbcmath/src/compare.c | 161 - ext/bcmath/libbcmath/src/config.h | 9 - ext/bcmath/libbcmath/src/debug.c | 70 - ext/bcmath/libbcmath/src/div.c | 276 - ext/bcmath/libbcmath/src/divmod.c | 91 - ext/bcmath/libbcmath/src/doaddsub.c | 232 - ext/bcmath/libbcmath/src/init.c | 135 - ext/bcmath/libbcmath/src/int2num.c | 84 - ext/bcmath/libbcmath/src/nearzero.c | 69 - ext/bcmath/libbcmath/src/neg.c | 49 - ext/bcmath/libbcmath/src/num2long.c | 70 - ext/bcmath/libbcmath/src/num2str.c | 79 - ext/bcmath/libbcmath/src/outofmem.c | 46 - ext/bcmath/libbcmath/src/output.c | 212 - ext/bcmath/libbcmath/src/private.h | 41 - ext/bcmath/libbcmath/src/raise.c | 126 - ext/bcmath/libbcmath/src/raisemod.c | 99 - ext/bcmath/libbcmath/src/recmul.c | 304 - ext/bcmath/libbcmath/src/rmzero.c | 55 - ext/bcmath/libbcmath/src/rt.c | 65 - ext/bcmath/libbcmath/src/sqrt.c | 131 - ext/bcmath/libbcmath/src/str2num.c | 112 - ext/bcmath/libbcmath/src/sub.c | 90 - ext/bcmath/libbcmath/src/zero.c | 65 - ext/bcmath/php_bcmath.h | 50 - ext/calendar/CREDITS | 2 - ext/calendar/cal_unix.c | 88 - ext/calendar/calendar.c | 546 - ext/calendar/config.m4 | 11 - ext/calendar/dow.c | 76 - ext/calendar/easter.c | 142 - ext/calendar/french.c | 160 - ext/calendar/gregor.c | 265 - ext/calendar/jewish.c | 741 - ext/calendar/julian.c | 249 - ext/calendar/php_calendar.h | 35 - ext/calendar/sdncal.h | 96 - ext/ccvs/CREDITS | 2 - ext/ccvs/TODO | 7 - ext/ccvs/ccvs.c | 607 - ext/ccvs/ccvs.h | 59 - ext/ccvs/config.m4 | 27 - ext/com/COM.c | 1852 -- ext/com/CREDITS | 2 - ext/com/TODO | 27 - ext/com/VARIANT.c | 341 - ext/com/com.h | 71 - ext/com/conversion.c | 847 - ext/com/conversion.h | 23 - ext/com/php_COM.h | 52 - ext/com/php_VARIANT.h | 19 - ext/com/variant.h | 32 - ext/cpdf/CREDITS | 2 - ext/cpdf/config.m4 | 70 - ext/cpdf/cpdf.c | 2719 --- ext/cpdf/cpdf.dsp | 111 - ext/cpdf/php_cpdf.h | 121 - ext/crack/CREDITS | 2 - ext/crack/EXPERIMENTAL | 5 - ext/crack/config.m4 | 33 - ext/crack/crack.c | 277 - ext/crack/php_crack.h | 72 - ext/crack/tests/001.phpt | 23 - ext/ctype/CREDITS | 2 - ext/ctype/README | 5 - ext/ctype/config.m4 | 11 - ext/ctype/ctype.c | 216 - ext/ctype/ctype.dsp | 107 - ext/ctype/ctype.xml | 245 - ext/ctype/php_ctype.h | 83 - ext/ctype/tests/001.phpt | 41 - ext/ctype/tests/002.phpt | 43 - ext/curl/CREDITS | 2 - ext/curl/config.m4 | 62 - ext/curl/curl.c | 1097 -- ext/curl/curl.dsp | 177 - ext/curl/php_curl.h | 101 - ext/cybercash/CREDITS | 2 - ext/cybercash/config.m4 | 29 - ext/cybercash/cybercash.c | 230 - ext/cybercash/cybercash.dsp | 110 - ext/cybercash/cybercash.h | 40 - ext/cybercash/cyberlib.php | 215 - ext/cybercash/test.php | 26 - ext/cybermut/config.m4 | 48 - ext/cybermut/cybermut.c | 178 - ext/cybermut/cybermut.xml | 214 - ext/cybermut/php_cybermut.h | 72 - ext/cybermut/tests/001.phpt | 23 - ext/cyrus/CREDITS | 2 - ext/cyrus/config.m4 | 47 - ext/cyrus/cyrus.c | 516 - ext/cyrus/php_cyrus.h | 78 - ext/db/CREDITS | 2 - ext/db/config.m4 | 58 - ext/db/db.c | 1209 -- ext/db/db.dsp | 122 - ext/db/php_db.h | 81 - ext/db/tests/001.phpt | 13 - ext/db/tests/002.phpt | 16 - ext/db/tests/003.phpt | 17 - ext/db/tests/004.phpt | 21 - ext/db/tests/005.phpt | 25 - ext/db/tests/006.phpt | 27 - ext/dba/CREDITS | 2 - ext/dba/config.m4 | 238 - ext/dba/dba.c | 523 - ext/dba/dba.dsp | 157 - ext/dba/dba_cdb.c | 218 - ext/dba/dba_db2.c | 201 - ext/dba/dba_db3.c | 208 - ext/dba/dba_dbm.c | 184 - ext/dba/dba_gdbm.c | 187 - ext/dba/dba_ndbm.c | 164 - ext/dba/php_cdb.h | 12 - ext/dba/php_db2.h | 12 - ext/dba/php_db3.h | 12 - ext/dba/php_dba.h | 104 - ext/dba/php_dbm.h | 12 - ext/dba/php_gdbm.h | 12 - ext/dba/php_ndbm.h | 12 - ext/dbase/CREDITS | 2 - ext/dbase/config.m4 | 13 - ext/dbase/dbase.c | 842 - ext/dbase/dbase.dsp | 151 - ext/dbase/dbf.h | 94 - ext/dbase/dbf_head.c | 290 - ext/dbase/dbf_head.h | 11 - ext/dbase/dbf_misc.c | 179 - ext/dbase/dbf_misc.h | 13 - ext/dbase/dbf_ndx.c | 191 - ext/dbase/dbf_ndx.h | 98 - ext/dbase/dbf_rec.c | 201 - ext/dbase/dbf_rec.h | 10 - ext/dbase/php_dbase.h | 44 - ext/dbplus/CREDITS | 2 - ext/dbplus/EXPERIMENTAL | 5 - ext/dbplus/README | 3 - ext/dbplus/config.m4 | 47 - ext/dbplus/dbplus.c | 247 - ext/dbplus/php_dbplus.c | 1557 -- ext/dbplus/php_dbplus.h | 122 - ext/dbplus/tests/001.phpt | 23 - ext/dbx/CREDITS | 2 - ext/dbx/INSTALL | 25 - ext/dbx/config.m4 | 10 - ext/dbx/dbx.c | 819 - ext/dbx/dbx.dsp | 173 - ext/dbx/dbx.h | 58 - ext/dbx/dbx_fbsql.c | 257 - ext/dbx/dbx_fbsql.h | 61 - ext/dbx/dbx_mssql.c | 257 - ext/dbx/dbx_mssql.h | 60 - ext/dbx/dbx_mysql.c | 263 - ext/dbx/dbx_mysql.h | 60 - ext/dbx/dbx_oci8.c | 244 - ext/dbx/dbx_oci8.h | 60 - ext/dbx/dbx_odbc.c | 281 - ext/dbx/dbx_odbc.h | 60 - ext/dbx/dbx_pgsql.c | 283 - ext/dbx/dbx_pgsql.h | 56 - ext/dbx/dbx_sybasect.c | 282 - ext/dbx/dbx_sybasect.h | 60 - ext/dbx/howto_extend_dbx.html | 316 - ext/dbx/php_dbx.h | 87 - ext/dbx/tests/001.phpt | 12 - ext/dbx/tests/002.phpt | 28 - ext/dbx/tests/003.phpt | 107 - ext/dbx/tests/004.phpt | 30 - ext/dbx/tests/005.phpt | 93 - ext/dbx/tests/006.phpt | 55 - ext/dbx/tests/007.phpt | 74 - ext/dbx/tests/008.phpt | 146 - ext/dbx/tests/dbx_test.p | 62 - ext/dbx/tests/dbx_test.pgsql.script | 37 - ext/dbx/tests/dbx_test.script | 38 - ext/dio/EXPERIMENTAL | 0 ext/dio/config.m4 | 10 - ext/dio/dio.c | 428 - ext/dio/php_dio.h | 61 - ext/dio/tests/001.phpt | 23 - ext/domxml/CREDITS | 2 - ext/domxml/EXPERIMENTAL | 5 - ext/domxml/TODO | 17 - ext/domxml/config.m4 | 193 - ext/domxml/domxml.dsp | 114 - ext/domxml/php_domxml.c | 3828 ---- ext/domxml/php_domxml.h | 191 - ext/dotnet/CREDITS | 2 - ext/dotnet/EXPERIMENTAL | 5 - ext/dotnet/README | 32 - ext/dotnet/dotnet.cpp | 237 - ext/dotnet/dotnet.dsp | 171 - ext/dotnet/dotnet.php | 8 - ext/dotnet/php_dotnet.h | 21 - ext/ereg/ereg.c | 658 - ext/ereg/php_ereg.h | 50 - ext/ereg/php_regex.h | 45 - ext/ereg/regex/COPYRIGHT | 20 - ext/ereg/regex/Makefile.in | 5 - ext/ereg/regex/README | 32 - ext/ereg/regex/WHATSNEW | 92 - ext/ereg/regex/cclass.h | 30 - ext/ereg/regex/cname.h | 102 - ext/ereg/regex/debug.c | 242 - ext/ereg/regex/debug.ih | 14 - ext/ereg/regex/engine.c | 1019 - ext/ereg/regex/engine.ih | 35 - ext/ereg/regex/main.c | 510 - ext/ereg/regex/main.ih | 19 - ext/ereg/regex/mkh | 76 - ext/ereg/regex/regcomp.c | 1608 -- ext/ereg/regex/regcomp.ih | 53 - ext/ereg/regex/regerror.c | 126 - ext/ereg/regex/regerror.ih | 12 - ext/ereg/regex/regex.3 | 502 - ext/ereg/regex/regex.7 | 233 - ext/ereg/regex/regex.dsp | 106 - ext/ereg/regex/regex.dsw | 29 - ext/ereg/regex/regex.h | 83 - ext/ereg/regex/regex.mak | 304 - ext/ereg/regex/regex2.h | 140 - ext/ereg/regex/regex_extra.h | 23 - ext/ereg/regex/regexec.c | 138 - ext/ereg/regex/regfree.c | 37 - ext/ereg/regex/split.c | 316 - ext/ereg/regex/tests | 475 - ext/ereg/regex/utils.h | 25 - ext/ereg/tests/001.phpt | 9 - ext/ereg/tests/002.phpt | 9 - ext/ereg/tests/003.phpt | 10 - ext/ereg/tests/004.phpt | 16 - ext/ereg/tests/005.phpt | 20 - ext/ereg/tests/006.phpt | 10 - ext/ereg/tests/007.phpt | 12 - ext/ereg/tests/008.phpt | 10 - ext/ereg/tests/009.phpt | 19 - ext/ereg/tests/010.phpt | 9 - ext/ereg/tests/011.phpt | 9 - ext/ereg/tests/012.phpt | 9 - ext/ereg/tests/013.phpt | 9 - ext/ereg/tests/014.phpt | 9 - ext/ereg/tests/015.phpt | 8 - ext/ereg/tests/016.phpt | 8 - ext/exif/CREDITS | 2 - ext/exif/config.m4 | 11 - ext/exif/example.php | 23 - ext/exif/exif.c | 3263 ---- ext/exif/exif.dsp | 113 - ext/exif/php_exif.h | 30 - ext/exif/test.php | 3 - ext/exif/test.txt | 365 - ext/exif/tests/001.phpt | 28 - ext/exif/tests/002.phpt | 26 - ext/exif/tests/test1.jpg | Bin 523 -> 0 bytes ext/exif/tests/test2.jpg | Bin 1240 -> 0 bytes ext/ext_skel | 274 - ext/fbsql/CREDITS | 2 - ext/fbsql/Readme_w32.txt | 22 - ext/fbsql/config.m4 | 42 - ext/fbsql/fbsql.dsp | 171 - ext/fbsql/php_fbsql.c | 3500 ---- ext/fbsql/php_fbsql.h | 145 - ext/fdf/CREDITS | 2 - ext/fdf/config.m4 | 36 - ext/fdf/fdf.c | 802 - ext/fdf/fdf.dsp | 114 - ext/fdf/php_fdf.h | 62 - ext/filepro/CREDITS | 2 - ext/filepro/config.m4 | 13 - ext/filepro/filepro.c | 592 - ext/filepro/filepro.dsp | 109 - ext/filepro/php_filepro.h | 48 - ext/fribidi/CREDITS | 2 - ext/fribidi/README | 53 - ext/fribidi/config.m4 | 79 - ext/fribidi/fribidi.c | 257 - ext/fribidi/fribidi.php | 10 - ext/fribidi/php_fribidi.h | 89 - ext/ftp/CREDITS | 2 - ext/ftp/config.m4 | 11 - ext/ftp/ftp.c | 1287 -- ext/ftp/ftp.h | 156 - ext/ftp/php_ftp.c | 770 - ext/ftp/php_ftp.h | 65 - ext/gd/CREDITS | 2 - ext/gd/config.m4 | 263 - ext/gd/gd.c | 3647 ---- ext/gd/gd.dsp | 203 - ext/gd/gd_ctx.c | 106 - ext/gd/gdcache.c | 201 - ext/gd/gdcache.h | 87 - ext/gd/gdt1.c | 548 - ext/gd/gdt1.h | 35 - ext/gd/gdttf.c | 868 - ext/gd/gdttf.h | 16 - ext/gd/php_gd.h | 180 - ext/gettext/CREDITS | 2 - ext/gettext/config.m4 | 52 - ext/gettext/gettext.c | 311 - ext/gettext/gettext.dsp | 113 - ext/gettext/php_gettext.h | 58 - ext/gmp/CREDITS | 2 - ext/gmp/README | 5 - ext/gmp/TODO | 22 - ext/gmp/config.m4 | 25 - ext/gmp/gmp.c | 1253 -- ext/gmp/php_gmp.h | 115 - ext/gmp/tests/001.phpt | 23 - ext/gmp/tests/002.phpt | 19 - ext/gmp/tests/003.phpt | 49 - ext/hyperwave/CREDITS | 2 - ext/hyperwave/config.m4 | 20 - ext/hyperwave/debug.h | 206 - ext/hyperwave/hg_comm.c | 5846 ------ ext/hyperwave/hg_comm.h | 238 - ext/hyperwave/hw.c | 4482 ----- ext/hyperwave/hw_error.h | 111 - ext/hyperwave/hyperwave.dsp | 120 - ext/hyperwave/php_hyperwave.h | 147 - ext/icap/CREDITS | 2 - ext/icap/config.m4 | 17 - ext/icap/php_icap.c | 949 - ext/icap/php_icap.h | 42 - ext/iconv/EXPERIMENTAL | 5 - ext/iconv/Makefile.in | 8 - ext/iconv/config.m4 | 40 - ext/iconv/iconv.c | 392 - ext/iconv/iconv.dsp | 107 - ext/iconv/php_iconv.h | 74 - ext/iconv/tests/001.phpt | 18 - ext/iconv/tests/002.inc | 14 - ext/iconv/tests/002.phpt | 11 - ext/iconv/tests/eucjp2iso2022jp.inc | 47 - ext/iconv/tests/eucjp2iso2022jp.phpt | 10 - ext/iconv/tests/eucjp2sjis.inc | 47 - ext/iconv/tests/eucjp2sjis.phpt | 11 - ext/iconv/tests/eucjp2utf8.inc | 47 - ext/iconv/tests/eucjp2utf8.phpt | 10 - ext/iconv/tests/skipif.inc | 11 - ext/imap/CREDITS | 2 - ext/imap/IMAP_Win32_HOWTO.txt | 32 - ext/imap/config.m4 | 169 - ext/imap/imap.dsp | 183 - ext/imap/imap.h | 103 - ext/imap/php_imap.c | 4147 ----- ext/imap/php_imap.h | 223 - ext/informix/CREDITS | 2 - ext/informix/Makefile.frag | 10 - ext/informix/config.m4 | 96 - ext/informix/ifx.dsp | 134 - ext/informix/ifx.ec | 4260 ----- ext/informix/php_informix.h | 180 - ext/informix/stub.c | 0 ext/ingres_ii/CREDITS | 2 - ext/ingres_ii/EXPERIMENTAL | 5 - ext/ingres_ii/README | 13 - ext/ingres_ii/config.m4 | 35 - ext/ingres_ii/ii.c | 1467 -- ext/ingres_ii/ii.h | 65 - ext/ingres_ii/ingres.dsp | 111 - ext/ingres_ii/php_ii.h | 100 - ext/interbase/CREDITS | 2 - ext/interbase/config.m4 | 23 - ext/interbase/interbase.c | 3127 ---- ext/interbase/interbase.dsp | 113 - ext/interbase/php_interbase.h | 185 - ext/interbase/tests/001.phpt | 34 - ext/interbase/tests/002.phpt | 35 - ext/interbase/tests/003.phpt | 93 - ext/interbase/tests/004.phpt | 179 - ext/interbase/tests/005.phpt | 275 - ext/interbase/tests/006.phpt | 227 - ext/interbase/tests/extension | 1 - ext/interbase/tests/interbase.inc | 77 - ext/java/CREDITS | 2 - ext/java/EXPERIMENTAL | 5 - ext/java/Makefile.in | 25 - ext/java/README | 243 - ext/java/config.m4 | 121 - ext/java/except.php | 23 - ext/java/java.c | 786 - ext/java/java.dsp | 254 - ext/java/jawt.php | 27 - ext/java/jver.php | 17 - ext/java/reflect.java | 419 - ext/ldap/CREDITS | 2 - ext/ldap/LDAP_Win32_HOWTO.txt | 33 - ext/ldap/config.m4 | 108 - ext/ldap/ldap.c | 2168 --- ext/ldap/ldap.dsp | 230 - ext/ldap/php_ldap.h | 119 - ext/mailparse/CREDITS | 2 - ext/mailparse/EXPERIMENTAL | 5 - ext/mailparse/README | 79 - ext/mailparse/config.m4 | 14 - ext/mailparse/libs.mk | 7 - ext/mailparse/mailparse.c | 900 - ext/mailparse/mailparse_rfc822.h | 161 - ext/mailparse/php_mailparse.h | 88 - ext/mailparse/rfc2045.c | 1174 -- ext/mailparse/rfc2045.h | 208 - ext/mailparse/rfc2045acchk.c | 123 - ext/mailparse/rfc2045acprep.c | 99 - ext/mailparse/rfc2045appendurl.c | 136 - ext/mailparse/rfc2045cdecode.c | 127 - ext/mailparse/rfc2045decode.c | 40 - ext/mailparse/rfc2045find.c | 47 - ext/mailparse/rfc822.c | 716 - ext/mailparse/rfc822_getaddr.c | 99 - ext/mailparse/rfc822_getaddrs.c | 92 - ext/mailparse/tests/001.phpt | 12 - ext/mailparse/tests/002.phpt | 22 - ext/mailparse/try.php | 53 - ext/mbstring/CREDITS | 2 - ext/mbstring/README_PHP3-i18n-ja | 774 - ext/mbstring/config.m4 | 39 - ext/mbstring/cp932_table.h | 66 - ext/mbstring/mbfilter.c | 8230 --------- ext/mbstring/mbfilter.h | 549 - ext/mbstring/mbfilter_ja.c | 1273 -- ext/mbstring/mbfilter_ja.h | 98 - ext/mbstring/mbregex.c | 4679 ----- ext/mbstring/mbregex.h | 213 - ext/mbstring/mbstring.c | 2891 --- ext/mbstring/mbstring.dsp | 131 - ext/mbstring/mbstring.h | 188 - ext/mbstring/php_mbregex.c | 983 - ext/mbstring/tests/001.phpt | 34 - ext/mbstring/tests/002.inc | 44 - ext/mbstring/tests/002.phpt | 28 - ext/mbstring/tests/003.inc | 32 - ext/mbstring/tests/003.phpt | 15 - ext/mbstring/tests/004.inc | 56 - ext/mbstring/tests/004.phpt | 32 - ext/mbstring/tests/005.inc | 40 - ext/mbstring/tests/005.phpt | 21 - ext/mbstring/tests/006.inc | 32 - ext/mbstring/tests/006.phpt | 19 - ext/mbstring/tests/007.inc | 11 - ext/mbstring/tests/007.phpt | 11 - ext/mbstring/tests/008.inc | 41 - ext/mbstring/tests/008.phpt | 22 - ext/mbstring/tests/009.inc | 70 - ext/mbstring/tests/009.phpt | 33 - ext/mbstring/tests/010.inc | 110 - ext/mbstring/tests/010.phpt | 67 - ext/mbstring/tests/011.inc | 57 - ext/mbstring/tests/011.phpt | 31 - ext/mbstring/tests/012.inc | 19 - ext/mbstring/tests/012.phpt | 15 - ext/mbstring/tests/013.inc | 19 - ext/mbstring/tests/013.phpt | 15 - ext/mbstring/tests/014.inc | 23 - ext/mbstring/tests/014.phpt | 20 - ext/mbstring/tests/015.inc | 127 - ext/mbstring/tests/015.phpt | 36 - ext/mbstring/tests/016.inc | 86 - ext/mbstring/tests/016.phpt | 31 - ext/mbstring/tests/017.inc | 91 - ext/mbstring/tests/017.phpt | 30 - ext/mbstring/tests/018.inc | 24 - ext/mbstring/tests/018.phpt | 10 - ext/mbstring/tests/019.inc | 68 - ext/mbstring/tests/019.phpt | 38 - ext/mbstring/tests/common.inc | 53 - ext/mbstring/tests/skipif.inc | 11 - ext/mbstring/unicode_table.h | 347 - ext/mbstring/unicode_table_ja.h | 5961 ------ ext/mcal/CREDITS | 2 - ext/mcal/config.m4 | 50 - ext/mcal/php_mcal.c | 1631 -- ext/mcal/php_mcal.h | 68 - ext/mcrypt/CREDITS | 2 - ext/mcrypt/TODO | 6 - ext/mcrypt/config.m4 | 51 - ext/mcrypt/mcrypt.c | 1646 -- ext/mcrypt/mcrypt.dsp | 117 - ext/mcrypt/php_mcrypt.h | 106 - ext/mcrypt/tests/001.phpt | 32 - ext/mcve/CREDITS | 2 - ext/mcve/config.m4 | 25 - ext/mcve/mcve.c | 1712 -- ext/mcve/mcve.php | 12 - ext/mcve/php_mcve.h | 97 - ext/mcve/tests/001.phpt | 23 - ext/mcve/tests/mcve_simple_test.php | 19 - ext/mcve/tests/mcve_test1.php | 83 - ext/mcve/tests/mcve_test2.php | 68 - ext/mhash/CREDITS | 2 - ext/mhash/config.m4 | 25 - ext/mhash/mhash.c | 284 - ext/mhash/mhash.dsp | 115 - ext/mhash/php_mhash.h | 27 - ext/ming/CREDITS | 2 - ext/ming/EXPERIMENTAL | 5 - ext/ming/config.m4 | 32 - ext/ming/ming.c | 3159 ---- ext/ming/ming.dsp | 107 - ext/ming/php_ming.h | 167 - ext/mnogosearch/CREDITS | 2 - ext/mnogosearch/README | 17 - ext/mnogosearch/config.m4 | 54 - ext/mnogosearch/index.php | 996 - ext/mnogosearch/php_mnogo.c | 1688 -- ext/mnogosearch/php_mnogo.h | 103 - ext/msession/CREDITS | 3 - ext/msession/README | 33 - ext/msession/config.m4 | 34 - ext/msession/msession-test.php | 125 - ext/msession/msession.c | 1156 -- ext/msession/msession.php | 10 - ext/msession/php_msession.h | 106 - ext/msession/reqclient.h | 140 - ext/msql/CREDITS | 2 - ext/msql/config.m4 | 42 - ext/msql/msql.dsp | 107 - ext/msql/php_msql.c | 1321 -- ext/msql/php_msql.h | 82 - ext/mssql/CREDITS | 2 - ext/mssql/mssql.dsp | 117 - ext/mssql/mssql_win32_howto.txt | 35 - ext/mssql/php_mssql.c | 2137 --- ext/mssql/php_mssql.h | 159 - ext/mysql/CREDITS | 2 - ext/mysql/config.m4 | 113 - ext/mysql/libmysql/acinclude.m4 | 380 - ext/mysql/libmysql/array.c | 163 - ext/mysql/libmysql/bchange.c | 25 - ext/mysql/libmysql/bmove.c | 63 - ext/mysql/libmysql/bmove_upp.c | 37 - ext/mysql/libmysql/charset.c | 551 - ext/mysql/libmysql/config-win.h | 293 - ext/mysql/libmysql/ctype.c | 54 - ext/mysql/libmysql/ctype_autoconf.c | 44 - ext/mysql/libmysql/ctype_extra_sources.c | 82 - ext/mysql/libmysql/dbug.c | 2076 --- ext/mysql/libmysql/dbug.h | 80 - ext/mysql/libmysql/default.c | 384 - ext/mysql/libmysql/dll.c | 98 - ext/mysql/libmysql/errmsg.c | 68 - ext/mysql/libmysql/errmsg.h | 41 - ext/mysql/libmysql/errors.c | 78 - ext/mysql/libmysql/fix_copyright | 35 - ext/mysql/libmysql/get_password.c | 198 - ext/mysql/libmysql/global.h | 917 - ext/mysql/libmysql/int2str.c | 141 - ext/mysql/libmysql/is_prefix.c | 20 - ext/mysql/libmysql/libmysql.c | 2566 --- ext/mysql/libmysql/libmysql.dsp | 585 - ext/mysql/libmysql/list.c | 102 - ext/mysql/libmysql/longlong2str.c | 129 - ext/mysql/libmysql/m_ctype.h | 144 - ext/mysql/libmysql/m_string.h | 227 - ext/mysql/libmysql/mf_casecnv.c | 238 - ext/mysql/libmysql/mf_dirname.c | 92 - ext/mysql/libmysql/mf_fn_ext.c | 32 - ext/mysql/libmysql/mf_format.c | 142 - ext/mysql/libmysql/mf_loadpath.c | 40 - ext/mysql/libmysql/mf_pack.c | 518 - ext/mysql/libmysql/mf_path.c | 106 - ext/mysql/libmysql/mf_unixpath.c | 19 - ext/mysql/libmysql/mf_wcomp.c | 54 - ext/mysql/libmysql/mulalloc.c | 39 - ext/mysql/libmysql/my_alarm.h | 46 - ext/mysql/libmysql/my_alloc.c | 140 - ext/mysql/libmysql/my_compress.c | 73 - ext/mysql/libmysql/my_config.h | 15 - ext/mysql/libmysql/my_create.c | 50 - ext/mysql/libmysql/my_delete.c | 22 - ext/mysql/libmysql/my_dir.h | 86 - ext/mysql/libmysql/my_div.c | 17 - ext/mysql/libmysql/my_error.c | 110 - ext/mysql/libmysql/my_fopen.c | 160 - ext/mysql/libmysql/my_getwd.c | 172 - ext/mysql/libmysql/my_init.c | 312 - ext/mysql/libmysql/my_lib.c | 597 - ext/mysql/libmysql/my_list.h | 33 - ext/mysql/libmysql/my_malloc.c | 70 - ext/mysql/libmysql/my_messnc.c | 22 - ext/mysql/libmysql/my_net.c | 35 - ext/mysql/libmysql/my_net.h | 27 - ext/mysql/libmysql/my_once.c | 74 - ext/mysql/libmysql/my_open.c | 113 - ext/mysql/libmysql/my_pthread.c | 462 - ext/mysql/libmysql/my_pthread.h | 565 - ext/mysql/libmysql/my_read.c | 52 - ext/mysql/libmysql/my_realloc.c | 51 - ext/mysql/libmysql/my_static.c | 86 - ext/mysql/libmysql/my_static.h | 56 - ext/mysql/libmysql/my_sys.h | 589 - ext/mysql/libmysql/my_tempnam.c | 128 - ext/mysql/libmysql/my_thr_init.c | 212 - ext/mysql/libmysql/my_wincond.c | 128 - ext/mysql/libmysql/my_winthread.c | 105 - ext/mysql/libmysql/my_write.c | 75 - ext/mysql/libmysql/mysql.h | 294 - ext/mysql/libmysql/mysql.m4 | 16 - ext/mysql/libmysql/mysql_com.h | 225 - ext/mysql/libmysql/mysql_version.h | 27 - ext/mysql/libmysql/mysqld_error.h | 211 - ext/mysql/libmysql/mysys_err.h | 47 - ext/mysql/libmysql/mysys_priv.h | 18 - ext/mysql/libmysql/net.c | 664 - ext/mysql/libmysql/password.c | 178 - ext/mysql/libmysql/raid.h | 147 - ext/mysql/libmysql/safemalloc.c | 510 - ext/mysql/libmysql/stamp-h.in | 1 - ext/mysql/libmysql/str2int.c | 188 - ext/mysql/libmysql/strcend.c | 42 - ext/mysql/libmysql/strcont.c | 32 - ext/mysql/libmysql/strend.c | 33 - ext/mysql/libmysql/strfill.c | 22 - ext/mysql/libmysql/string.c | 113 - ext/mysql/libmysql/strinstr.c | 36 - ext/mysql/libmysql/strmake.c | 39 - ext/mysql/libmysql/strmov.c | 45 - ext/mysql/libmysql/strnmov.c | 22 - ext/mysql/libmysql/strto.c | 190 - ext/mysql/libmysql/strtoll.c | 11 - ext/mysql/libmysql/strtoull.c | 12 - ext/mysql/libmysql/strxmov.c | 33 - ext/mysql/libmysql/thr_alarm.h | 98 - ext/mysql/libmysql/thr_mutex.c | 217 - ext/mysql/libmysql/typelib.c | 92 - ext/mysql/libmysql/update_sources | 103 - ext/mysql/libmysql/violite.c | 411 - ext/mysql/libmysql/violite.h | 103 - ext/mysql/mysql.dsp | 171 - ext/mysql/php_mysql.c | 2087 --- ext/mysql/php_mysql.h | 115 - ext/ncurses/CREDITS | 2 - ext/ncurses/EXPERIMENTAL | 0 ext/ncurses/c-prototypes | 263 - ext/ncurses/config.m4 | 55 - ext/ncurses/example1.php | 28 - ext/ncurses/ncurses.c | 306 - ext/ncurses/ncurses.php | 10 - ext/ncurses/ncurses_fe.c | 175 - ext/ncurses/ncurses_functions.c | 1746 -- ext/ncurses/php_ncurses.h | 78 - ext/ncurses/php_ncurses_fe.h | 161 - ext/ncurses/tests/001.phpt | 23 - ext/notes/notes.dsp | 202 - ext/notes/notes.dsw | 29 - ext/notes/php_notes.c | 2712 --- ext/notes/php_notes.h | 47 - ext/oci8/CREDITS | 2 - ext/oci8/config.m4 | 86 - ext/oci8/oci8.c | 5326 ------ ext/oci8/oci8.dsp | 113 - ext/oci8/oci8.dsw | 29 - ext/oci8/php_oci8.h | 214 - ext/odbc/CREDITS | 2 - ext/odbc/birdstep.c | 717 - ext/odbc/config.m4 | 552 - ext/odbc/php_birdstep.h | 92 - ext/odbc/php_odbc.c | 3547 ---- ext/odbc/php_odbc.h | 356 - ext/openssl/CREDITS | 2 - ext/openssl/EXPERIMENTAL | 5 - ext/openssl/README | 321 - ext/openssl/config.m4 | 8 - ext/openssl/openssl.c | 2828 --- ext/openssl/openssl.dsp | 107 - ext/openssl/php_openssl.h | 81 - ext/oracle/CREDITS | 2 - ext/oracle/config.m4 | 160 - ext/oracle/oracle.c | 1789 -- ext/oracle/oracle.dsp | 113 - ext/oracle/php_oracle.h | 137 - ext/overload/CREDITS | 2 - ext/overload/README | 94 - ext/overload/config.m4 | 11 - ext/overload/overload.c | 706 - ext/overload/overload.dsp | 108 - ext/overload/php_overload.h | 65 - ext/ovrimos/CREDITS | 2 - ext/ovrimos/config.m4 | 28 - ext/ovrimos/ovrimos.c | 1326 -- ext/ovrimos/php_ovrimos.h | 44 - ext/pcntl/CREDITS | 2 - ext/pcntl/EXPERIMENTAL | 5 - ext/pcntl/README | 16 - ext/pcntl/config.m4 | 18 - ext/pcntl/pcntl.c | 651 - ext/pcntl/php_pcntl.h | 84 - ext/pcntl/php_signal.c | 46 - ext/pcntl/php_signal.h | 28 - ext/pcntl/test-pcntl.php | 35 - ext/pcntl/tests/001.phpt | 81 - ext/pcre/CREDITS | 2 - ext/pcre/config.m4 | 55 - ext/pcre/config0.m4 | 55 - ext/pcre/pcrelib/AUTHORS | 6 - ext/pcre/pcrelib/COPYING | 46 - ext/pcre/pcrelib/ChangeLog | 655 - ext/pcre/pcrelib/INSTALL | 185 - ext/pcre/pcrelib/LICENCE | 46 - ext/pcre/pcrelib/NEWS | 54 - ext/pcre/pcrelib/NON-UNIX-USE | 50 - ext/pcre/pcrelib/README | 270 - ext/pcre/pcrelib/RunTest | 148 - ext/pcre/pcrelib/chartables.c | 183 - ext/pcre/pcrelib/dftables.c | 148 - ext/pcre/pcrelib/dll.mk | 60 - ext/pcre/pcrelib/doc/Tech.Notes | 243 - ext/pcre/pcrelib/doc/pcre.3 | 1810 -- ext/pcre/pcrelib/doc/pcre.html | 2397 --- ext/pcre/pcrelib/doc/pcre.txt | 2125 --- ext/pcre/pcrelib/doc/pcregrep.1 | 76 - ext/pcre/pcrelib/doc/pcregrep.html | 105 - ext/pcre/pcrelib/doc/pcregrep.txt | 87 - ext/pcre/pcrelib/doc/pcreposix.3 | 149 - ext/pcre/pcrelib/doc/pcreposix.html | 191 - ext/pcre/pcrelib/doc/pcreposix.txt | 159 - ext/pcre/pcrelib/doc/pcretest.txt | 246 - ext/pcre/pcrelib/doc/perltest.txt | 29 - ext/pcre/pcrelib/get.c | 227 - ext/pcre/pcrelib/internal.h | 385 - ext/pcre/pcrelib/maketables.c | 132 - ext/pcre/pcrelib/pcre-config.in | 59 - ext/pcre/pcrelib/pcre.c | 5151 ------ ext/pcre/pcrelib/pcre.def | 19 - ext/pcre/pcrelib/pcre.h | 111 - ext/pcre/pcrelib/pcregrep.c | 228 - ext/pcre/pcrelib/pcreposix.c | 280 - ext/pcre/pcrelib/pcreposix.h | 88 - ext/pcre/pcrelib/pcretest.c | 1225 -- ext/pcre/pcrelib/perltest | 169 - ext/pcre/pcrelib/perltest8 | 208 - ext/pcre/pcrelib/study.c | 397 - ext/pcre/pcrelib/testdata/testinput1 | 1922 -- ext/pcre/pcrelib/testdata/testinput2 | 712 - ext/pcre/pcrelib/testdata/testinput3 | 1724 -- ext/pcre/pcrelib/testdata/testinput4 | 65 - ext/pcre/pcrelib/testdata/testinput5 | 118 - ext/pcre/pcrelib/testdata/testinput6 | 52 - ext/pcre/pcrelib/testdata/testoutput1 | 2966 --- ext/pcre/pcrelib/testdata/testoutput2 | 2075 --- ext/pcre/pcrelib/testdata/testoutput3 | 2991 --- ext/pcre/pcrelib/testdata/testoutput4 | 116 - ext/pcre/pcrelib/testdata/testoutput5 | 242 - ext/pcre/pcrelib/testdata/testoutput6 | 185 - ext/pcre/php_pcre.c | 1422 -- ext/pcre/php_pcre.h | 78 - ext/pdf/CREDITS | 2 - ext/pdf/config.m4 | 124 - ext/pdf/pdf.c | 3239 ---- ext/pdf/pdf.dsp | 114 - ext/pdf/php_pdf.h | 179 - ext/pfpro/CREDITS | 2 - ext/pfpro/TODO | 12 - ext/pfpro/config.m4 | 64 - ext/pfpro/pfpro.c | 600 - ext/pfpro/php_pfpro.h | 86 - ext/pgsql/CREDITS | 2 - ext/pgsql/README | 192 - ext/pgsql/config.m4 | 68 - ext/pgsql/pgsql.c | 2618 --- ext/pgsql/pgsql.dsp | 167 - ext/pgsql/php_pgsql.h | 171 - ext/pgsql/tests/01createdb.phpt | 10 - ext/pgsql/tests/02connection.phpt | 10 - ext/pgsql/tests/03sync_query.phpt | 10 - ext/pgsql/tests/04async_query.phpt | 10 - ext/pgsql/tests/05large_object.phpt | 11 - ext/pgsql/tests/06copy.phpt | 10 - ext/pgsql/tests/07optional.phpt | 10 - ext/pgsql/tests/98old_api.phpt | 10 - ext/pgsql/tests/9999dropdb.phpt | 10 - ext/pgsql/tests/async_query.inc | 59 - ext/pgsql/tests/config.inc | 12 - ext/pgsql/tests/connection.inc | 44 - ext/pgsql/tests/copy.inc | 8 - ext/pgsql/tests/createdb.inc | 22 - ext/pgsql/tests/dropdb.inc | 11 - ext/pgsql/tests/large_object.inc | 36 - ext/pgsql/tests/old_api.inc | 26 - ext/pgsql/tests/optional.inc | 13 - ext/pgsql/tests/skipif.inc | 22 - ext/pgsql/tests/sync_query.inc | 47 - ext/posix/CREDITS | 2 - ext/posix/config.m4 | 13 - ext/posix/php_posix.h | 124 - ext/posix/posix.c | 1002 - ext/pspell/CREDITS | 2 - ext/pspell/README | 51 - ext/pspell/config.m4 | 35 - ext/pspell/php_pspell.h | 52 - ext/pspell/pspell.c | 821 - ext/qtdom/CREDITS | 2 - ext/qtdom/EXPERIMENTAL | 5 - ext/qtdom/config.m4 | 34 - ext/qtdom/qtdom.c | 272 - ext/qtdom/qtdom.h | 74 - ext/qtdom/qtdom.php | 10 - ext/qtdom/qtdom_qt.cpp | 371 - ext/qtdom/qtdom_qt.h | 67 - ext/readline/CREDITS | 2 - ext/readline/README.libedit | 4 - ext/readline/config.m4 | 92 - ext/readline/php_readline.h | 39 - ext/readline/readline.c | 439 - ext/recode/CREDITS | 2 - ext/recode/config.m4 | 63 - ext/recode/php_recode.h | 79 - ext/recode/recode.c | 237 - ext/rpc/CREDITS | 2 - ext/rpc/EXPERIMENTAL | 5 - ext/rpc/Makefile.in | 25 - ext/rpc/com/CREDITS | 2 - ext/rpc/com/TODO | 27 - ext/rpc/com/com.c | 11 - ext/rpc/com/com_wrapper.c | 1852 -- ext/rpc/com/com_wrapper.h | 71 - ext/rpc/com/conversion.c | 847 - ext/rpc/com/conversion.h | 23 - ext/rpc/com/php_com.h | 52 - ext/rpc/com/php_variant.h | 19 - ext/rpc/com/variant.c | 341 - ext/rpc/com/variant.h | 32 - ext/rpc/dotnet/CREDITS | 2 - ext/rpc/dotnet/EXPERIMENTAL | 5 - ext/rpc/dotnet/README | 32 - ext/rpc/dotnet/dotnet.cpp | 237 - ext/rpc/dotnet/dotnet.dsp | 171 - ext/rpc/dotnet/dotnet.php | 8 - ext/rpc/dotnet/php_dotnet.h | 21 - ext/rpc/handler.h | 48 - ext/rpc/java/CREDITS | 2 - ext/rpc/java/EXPERIMENTAL | 5 - ext/rpc/java/Makefile.in | 25 - ext/rpc/java/README | 243 - ext/rpc/java/config.m4 | 121 - ext/rpc/java/except.php | 23 - ext/rpc/java/java.c | 786 - ext/rpc/java/java.dsp | 254 - ext/rpc/java/jawt.php | 27 - ext/rpc/java/jver.php | 17 - ext/rpc/java/reflect.java | 419 - ext/rpc/layer.h | 12 - ext/rpc/php_rpc.h | 40 - ext/rpc/rpc.c | 469 - ext/rpc/rpc.dsp | 203 - ext/rpc/rpc.h | 20 - ext/rpc/tests/test1.php | 11 - ext/rpc/xmlrpc/CREDITS | 2 - ext/rpc/xmlrpc/EXPERIMENTAL | 5 - ext/rpc/xmlrpc/config.m4 | 97 - ext/rpc/xmlrpc/libxmlrpc/README | 17 - ext/rpc/xmlrpc/libxmlrpc/acinclude.m4 | 32 - ext/rpc/xmlrpc/libxmlrpc/base64.c | 193 - ext/rpc/xmlrpc/libxmlrpc/base64.h | 38 - ext/rpc/xmlrpc/libxmlrpc/encodings.c | 103 - ext/rpc/xmlrpc/libxmlrpc/encodings.h | 46 - ext/rpc/xmlrpc/libxmlrpc/libs.mk | 7 - ext/rpc/xmlrpc/libxmlrpc/queue.c | 981 - ext/rpc/xmlrpc/libxmlrpc/queue.h | 89 - ext/rpc/xmlrpc/libxmlrpc/simplestring.c | 234 - ext/rpc/xmlrpc/libxmlrpc/simplestring.h | 75 - ext/rpc/xmlrpc/libxmlrpc/system_methods.c | 371 - .../xmlrpc/libxmlrpc/system_methods_private.h | 91 - ext/rpc/xmlrpc/libxmlrpc/xml_element.c | 714 - ext/rpc/xmlrpc/libxmlrpc/xml_element.h | 202 - ext/rpc/xmlrpc/libxmlrpc/xml_to_dandarpc.c | 319 - ext/rpc/xmlrpc/libxmlrpc/xml_to_dandarpc.h | 44 - ext/rpc/xmlrpc/libxmlrpc/xml_to_soap.c | 673 - ext/rpc/xmlrpc/libxmlrpc/xml_to_soap.h | 44 - ext/rpc/xmlrpc/libxmlrpc/xml_to_xmlrpc.c | 390 - ext/rpc/xmlrpc/libxmlrpc/xml_to_xmlrpc.h | 45 - ext/rpc/xmlrpc/libxmlrpc/xmlrpc.c | 2798 --- ext/rpc/xmlrpc/libxmlrpc/xmlrpc.h | 441 - ext/rpc/xmlrpc/libxmlrpc/xmlrpc.m4 | 12 - .../xmlrpc/libxmlrpc/xmlrpc_introspection.c | 594 - .../xmlrpc/libxmlrpc/xmlrpc_introspection.h | 101 - .../libxmlrpc/xmlrpc_introspection_private.h | 106 - ext/rpc/xmlrpc/libxmlrpc/xmlrpc_private.h | 178 - ext/rpc/xmlrpc/libxmlrpc/xmlrpc_win32.h | 11 - ext/rpc/xmlrpc/php_config.h.in | 11 - ext/rpc/xmlrpc/php_xmlrpc.h | 119 - ext/rpc/xmlrpc/xmlrpc-epi-php.c | 1461 -- ext/rpc/xmlrpc/xmlrpc.dsp | 211 - ext/satellite/CREDITS | 2 - ext/satellite/EXPERIMENTAL | 5 - ext/satellite/README | 8 - ext/session/CREDITS | 2 - ext/session/config.m4 | 35 - ext/session/mod_files.c | 349 - ext/session/mod_files.h | 27 - ext/session/mod_files.sh | 16 - ext/session/mod_mm.c | 446 - ext/session/mod_mm.h | 41 - ext/session/mod_user.c | 184 - ext/session/mod_user.h | 39 - ext/session/php_session.h | 202 - ext/session/session.c | 1521 -- ext/session/tests/001.phpt | 31 - ext/session/tests/002.phpt | 12 - ext/session/tests/003.phpt | 40 - ext/session/tests/004.phpt | 108 - ext/session/tests/005.phpt | 144 - ext/session/tests/006.phpt | 68 - ext/session/tests/skipif.inc | 13 - ext/shmop/CREDITS | 2 - ext/shmop/README | 69 - ext/shmop/config.m4 | 8 - ext/shmop/php_shmop.h | 84 - ext/shmop/shmop.c | 380 - ext/shmop/shmop.dsp | 107 - ext/skeleton/CREDITS | 1 - ext/skeleton/EXPERIMENTAL | 0 ext/skeleton/create_stubs | 282 - ext/skeleton/php_skeleton.h | 56 - ext/skeleton/skeleton.c | 167 - ext/skeleton/skeleton.php | 19 - ext/skeleton/tests/001.phpt | 23 - ext/snmp/CREDITS | 2 - ext/snmp/config.m4 | 84 - ext/snmp/php_snmp.h | 49 - ext/snmp/snmp.c | 453 - ext/snmp/snmp.dsp | 109 - ext/snmp/winsnmp.c | 252 - ext/sockets/CREDITS | 2 - ext/sockets/EXPERIMENTAL | 5 - ext/sockets/config.m4 | 15 - ext/sockets/php_sockets.h | 125 - ext/sockets/php_sockets_win.c | 177 - ext/sockets/php_sockets_win.h | 82 - ext/sockets/sockets.c | 1940 -- ext/sockets/sockets.dsp | 117 - ext/sockets/sockets.php | 10 - ext/standard/CREDITS | 3 - ext/standard/Makefile.frag | 8 - ext/standard/aggregation.c | 625 - ext/standard/aggregation.h | 51 - ext/standard/array.c | 3371 ---- ext/standard/assert.c | 301 - ext/standard/base64.c | 201 - ext/standard/base64.h | 37 - ext/standard/basic_functions.c | 2596 --- ext/standard/basic_functions.h | 209 - ext/standard/browscap.c | 269 - ext/standard/config.m4 | 246 - ext/standard/crc32.c | 52 - ext/standard/crc32.h | 109 - ext/standard/credits.c | 125 - ext/standard/credits.h | 42 - ext/standard/credits_ext.h | 98 - ext/standard/credits_sapi.h | 28 - ext/standard/crypt.c | 173 - ext/standard/cyr_convert.c | 299 - ext/standard/cyr_convert.h | 29 - ext/standard/datetime.c | 854 - ext/standard/datetime.h | 45 - ext/standard/dir.c | 357 - ext/standard/dl.c | 231 - ext/standard/dl.h | 34 - ext/standard/dns.c | 355 - ext/standard/dns.h | 41 - ext/standard/exec.c | 491 - ext/standard/exec.h | 35 - ext/standard/file.c | 2010 -- ext/standard/file.h | 120 - ext/standard/filestat.c | 865 - ext/standard/flock_compat.c | 225 - ext/standard/flock_compat.h | 49 - ext/standard/formatted_print.c | 712 - ext/standard/fsock.c | 272 - ext/standard/fsock.h | 46 - ext/standard/ftok.c | 66 - ext/standard/ftp_fopen_wrapper.c | 282 - ext/standard/head.c | 177 - ext/standard/head.h | 32 - ext/standard/html.c | 691 - ext/standard/html.h | 41 - ext/standard/http_fopen_wrapper.c | 325 - ext/standard/image.c | 797 - ext/standard/incomplete_class.c | 151 - ext/standard/info.c | 592 - ext/standard/info.h | 80 - ext/standard/iptc.c | 396 - ext/standard/lcg.c | 126 - ext/standard/levenshtein.c | 157 - ext/standard/link.c | 173 - ext/standard/mail.c | 213 - ext/standard/math.c | 1068 -- ext/standard/md5.c | 437 - ext/standard/md5.h | 65 - ext/standard/metaphone.c | 469 - ext/standard/microtime.c | 149 - ext/standard/microtime.h | 28 - ext/standard/pack.c | 903 - ext/standard/pack.h | 28 - ext/standard/pageinfo.c | 166 - ext/standard/pageinfo.h | 35 - ext/standard/parsedate.y | 1041 -- ext/standard/php_array.h | 102 - ext/standard/php_assert.h | 32 - ext/standard/php_browscap.h | 29 - ext/standard/php_crypt.h | 39 - ext/standard/php_dir.h | 38 - ext/standard/php_ext_syslog.h | 39 - ext/standard/php_filestat.h | 76 - ext/standard/php_fopen_wrapper.c | 68 - ext/standard/php_fopen_wrappers.h | 32 - ext/standard/php_ftok.h | 30 - ext/standard/php_image.h | 50 - ext/standard/php_incomplete_class.h | 62 - ext/standard/php_iptc.h | 27 - ext/standard/php_lcg.h | 44 - ext/standard/php_link.h | 33 - ext/standard/php_mail.h | 33 - ext/standard/php_math.h | 151 - ext/standard/php_metaphone.h | 26 - ext/standard/php_parsedate.h | 26 - ext/standard/php_rand.h | 50 - ext/standard/php_smart_str.h | 139 - ext/standard/php_smart_str_public.h | 30 - ext/standard/php_standard.h | 70 - ext/standard/php_string.h | 156 - ext/standard/php_type.h | 41 - ext/standard/php_var.h | 66 - ext/standard/php_versioning.h | 30 - ext/standard/quot_print.c | 138 - ext/standard/quot_print.h | 26 - ext/standard/rand.c | 414 - ext/standard/reg.c | 658 - ext/standard/reg.h | 50 - ext/standard/scanf.c | 1253 -- ext/standard/scanf.h | 50 - ext/standard/soundex.c | 115 - ext/standard/string.c | 3879 ---- ext/standard/strnatcmp.c | 173 - ext/standard/syslog.c | 283 - ext/standard/tests/aggregation/aggregate.lib | 65 - ext/standard/tests/aggregation/aggregate.phpt | 20 - .../tests/aggregation/aggregate_methods.phpt | 25 - .../aggregate_methods_by_list.phpt | 22 - .../aggregate_methods_by_regexp.phpt | 20 - .../aggregation/aggregate_properties.phpt | 19 - .../aggregate_properties_by_list.phpt | 20 - .../aggregate_properties_by_regexp.phpt | 20 - .../tests/aggregation/aggregation_info.phpt | 31 - .../tests/aggregation/deaggregate.phpt | 72 - ext/standard/tests/array/001.phpt | 15410 ---------------- ext/standard/tests/array/array_data.txt | 195 - ext/standard/tests/array/array_search.phpt | 25 - ext/standard/tests/array/count_recursive.phpt | 45 - ext/standard/tests/assert/assert.phpt | 39 - ext/standard/tests/file/001.phpt | 150 - ext/standard/tests/general_functions/001.phpt | 55 - ext/standard/tests/general_functions/002.phpt | 13 - ext/standard/tests/general_functions/003.phpt | 54 - ext/standard/tests/general_functions/004.data | 4 - ext/standard/tests/general_functions/004.phpt | 18 - ext/standard/tests/general_functions/005.phpt | 26 - ext/standard/tests/math/abs.phpt | 26 - ext/standard/tests/math/floorceil.phpt | 47 - ext/standard/tests/math/pow.phpt | 145 - ext/standard/tests/math/round.phpt | 39 - ext/standard/tests/reg/001.phpt | 9 - ext/standard/tests/reg/002.phpt | 9 - ext/standard/tests/reg/003.phpt | 10 - ext/standard/tests/reg/004.phpt | 16 - ext/standard/tests/reg/005.phpt | 20 - ext/standard/tests/reg/006.phpt | 10 - ext/standard/tests/reg/007.phpt | 12 - ext/standard/tests/reg/008.phpt | 10 - ext/standard/tests/reg/009.phpt | 19 - ext/standard/tests/reg/010.phpt | 9 - ext/standard/tests/reg/011.phpt | 9 - ext/standard/tests/reg/012.phpt | 9 - ext/standard/tests/reg/013.phpt | 9 - ext/standard/tests/reg/014.phpt | 9 - ext/standard/tests/reg/015.phpt | 8 - ext/standard/tests/reg/016.phpt | 8 - ext/standard/tests/serialize/001.phpt | 115 - ext/standard/tests/serialize/002.phpt | 36 - ext/standard/tests/strings/strtr.phpt | 11 - ext/standard/tests/strings/trim.phpt | 29 - ext/standard/tests/strings/wordwrap.phpt | 35 - ext/standard/tests/time/001.phpt | 24 - ext/standard/tests/time/002.phpt | 62 - .../tests/versioning/version_compare.phpt | 600 - ext/standard/type.c | 369 - ext/standard/uniqid.c | 99 - ext/standard/uniqid.h | 26 - ext/standard/url.c | 446 - ext/standard/url.h | 54 - ext/standard/url_scanner.c | 382 - ext/standard/url_scanner.h | 54 - ext/standard/url_scanner_ex.c | 892 - ext/standard/url_scanner_ex.h | 56 - ext/standard/url_scanner_ex.re | 408 - ext/standard/var.c | 673 - ext/standard/var_unserializer.c | 754 - ext/standard/var_unserializer.re | 402 - ext/standard/versioning.c | 219 - ext/swf/CREDITS | 2 - ext/swf/config.m4 | 35 - ext/swf/php_swf.h | 119 - ext/swf/swf.c | 1255 -- ext/sybase/CREDITS | 2 - ext/sybase/config.m4 | 30 - ext/sybase/php_sybase_db.c | 1429 -- ext/sybase/php_sybase_db.h | 89 - ext/sybase_ct/CREDITS | 2 - ext/sybase_ct/config.m4 | 51 - ext/sybase_ct/php_sybase_ct.c | 1715 -- ext/sybase_ct/php_sybase_ct.h | 112 - ext/sybase_ct/sybase_ct.dsp | 114 - ext/sysvsem/CREDITS | 2 - ext/sysvsem/config.m4 | 29 - ext/sysvsem/php_sysvsem.h | 56 - ext/sysvsem/sysvsem.c | 438 - ext/sysvshm/CREDITS | 2 - ext/sysvshm/config.m4 | 11 - ext/sysvshm/php_sysvshm.h | 85 - ext/sysvshm/sysvshm.c | 434 - ext/tokenizer/CREDITS | 2 - ext/tokenizer/EXPERIMENTAL | 0 ext/tokenizer/config.m4 | 48 - ext/tokenizer/php_tokenizer.h | 80 - ext/tokenizer/tokenizer.c | 518 - ext/tokenizer/tokenizer.dsp | 108 - ext/tokenizer/tokenizer.php | 35 - ext/vpopmail/CREDITS | 2 - ext/vpopmail/EXPERIMENTAL | 5 - ext/vpopmail/README | 194 - ext/vpopmail/config.m4 | 62 - ext/vpopmail/php_vpopmail.c | 934 - ext/vpopmail/php_vpopmail.h | 97 - ext/w32api/CREDITS | 2 - ext/w32api/EXPERIMENTAL | 0 ext/w32api/README | 49 - ext/w32api/TODO | 5 - ext/w32api/examples/uptime.php | 64 - ext/w32api/php_w32api.h | 137 - ext/w32api/test_dll/dll_test.h | 31 - ext/w32api/test_dll/test.php | 10 - ext/w32api/test_dll/test_dll.c | 33 - ext/w32api/test_dll/test_dll.def | 2 - ext/w32api/test_dll/test_dll.dsp | 110 - ext/w32api/test_dll/test_dll.dsw | 29 - ext/w32api/w32api.c | 898 - ext/w32api/w32api.dsp | 114 - ext/wddx/CREDITS | 2 - ext/wddx/config.m4 | 15 - ext/wddx/php_wddx.h | 46 - ext/wddx/php_wddx_api.h | 66 - ext/wddx/wddx.c | 1305 -- ext/xml/CREDITS | 2 - ext/xml/config.m4 | 48 - ext/xml/expat/Changes | 46 - ext/xml/expat/README | 72 - ext/xml/expat/README.php | 11 - ext/xml/expat/ascii.h | 86 - ext/xml/expat/asciitab.h | 37 - ext/xml/expat/expat.h | 736 - ext/xml/expat/iasciitab.h | 38 - ext/xml/expat/latin1tab.h | 37 - ext/xml/expat/nametab.h | 150 - ext/xml/expat/utf8tab.h | 38 - ext/xml/expat/winconfig.h | 27 - ext/xml/expat/xmlparse.c | 4637 ----- ext/xml/expat/xmlrole.c | 1277 -- ext/xml/expat/xmlrole.h | 100 - ext/xml/expat/xmltok.c | 1568 -- ext/xml/expat/xmltok.h | 299 - ext/xml/expat/xmltok_impl.c | 1770 -- ext/xml/expat/xmltok_impl.h | 46 - ext/xml/expat/xmltok_ns.c | 100 - ext/xml/php_xml.h | 154 - ext/xml/tests/001.phpt | 97 - ext/xml/tests/002.phpt | 91 - ext/xml/tests/003.phpt | 90 - ext/xml/tests/004.phpt | 60 - ext/xml/tests/006.phpt | 14 - ext/xml/tests/007.phpt | 42 - ext/xml/tests/inc.ent | 1 - ext/xml/tests/skipif.inc | 9 - ext/xml/tests/xmltest.xml | 20 - ext/xml/xml.c | 1619 -- ext/xmlrpc/CREDITS | 2 - ext/xmlrpc/EXPERIMENTAL | 5 - ext/xmlrpc/config.m4 | 97 - ext/xmlrpc/libxmlrpc/README | 17 - ext/xmlrpc/libxmlrpc/acinclude.m4 | 32 - ext/xmlrpc/libxmlrpc/base64.c | 193 - ext/xmlrpc/libxmlrpc/base64.h | 38 - ext/xmlrpc/libxmlrpc/encodings.c | 103 - ext/xmlrpc/libxmlrpc/encodings.h | 46 - ext/xmlrpc/libxmlrpc/libs.mk | 7 - ext/xmlrpc/libxmlrpc/queue.c | 981 - ext/xmlrpc/libxmlrpc/queue.h | 89 - ext/xmlrpc/libxmlrpc/simplestring.c | 234 - ext/xmlrpc/libxmlrpc/simplestring.h | 75 - ext/xmlrpc/libxmlrpc/system_methods.c | 371 - ext/xmlrpc/libxmlrpc/system_methods_private.h | 91 - ext/xmlrpc/libxmlrpc/xml_element.c | 714 - ext/xmlrpc/libxmlrpc/xml_element.h | 202 - ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c | 319 - ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h | 44 - ext/xmlrpc/libxmlrpc/xml_to_soap.c | 673 - ext/xmlrpc/libxmlrpc/xml_to_soap.h | 44 - ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c | 390 - ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h | 45 - ext/xmlrpc/libxmlrpc/xmlrpc.c | 2798 --- ext/xmlrpc/libxmlrpc/xmlrpc.h | 441 - ext/xmlrpc/libxmlrpc/xmlrpc.m4 | 12 - ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c | 594 - ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h | 101 - .../libxmlrpc/xmlrpc_introspection_private.h | 106 - ext/xmlrpc/libxmlrpc/xmlrpc_private.h | 178 - ext/xmlrpc/libxmlrpc/xmlrpc_win32.h | 11 - ext/xmlrpc/php_config.h.in | 11 - ext/xmlrpc/php_xmlrpc.h | 119 - ext/xmlrpc/xmlrpc-epi-php.c | 1461 -- ext/xmlrpc/xmlrpc.dsp | 211 - ext/xslt/EXPERIMENTAL | 5 - ext/xslt/README.XSLT-BACKENDS | 284 - ext/xslt/config.m4 | 116 - ext/xslt/php_sablot.h | 126 - ext/xslt/php_xslt.h | 63 - ext/xslt/sablot.c | 1574 -- ext/xslt/tests/001.phpt | 12 - ext/xslt/xslt.c | 258 - ext/xslt/xslt.dsp | 115 - ext/yaz/CREDITS | 2 - ext/yaz/README | 5 - ext/yaz/config.m4 | 41 - ext/yaz/php_yaz.c | 2687 --- ext/yaz/php_yaz.h | 82 - ext/yaz/yaz.dsp | 111 - ext/yp/CREDITS | 2 - ext/yp/config.m4 | 15 - ext/yp/php_yp.h | 69 - ext/yp/yp.c | 418 - ext/zip/CREDITS | 2 - ext/zip/config.m4 | 37 - ext/zip/php_zip.h | 66 - ext/zip/tests/001.phpt | 23 - ext/zip/zip.c | 318 - ext/zlib/CREDITS | 2 - ext/zlib/config0.m4 | 52 - ext/zlib/php_zlib.h | 82 - ext/zlib/tests/001.phpt | 26 - ext/zlib/tests/002.phpt | 17 - ext/zlib/tests/003.phpt | 16 - ext/zlib/zlib.c | 1372 -- ext/zlib/zlib.dsp | 113 - ext/zlib/zlib_fopen_wrapper.c | 130 - ext/zlib/zlib_win32_howto.txt | 16 - footer | 8 - genfiles | 24 - header | 19 - ltmain.sh | 4946 ----- main/Makefile.in | 27 - main/SAPI.c | 691 - main/SAPI.h | 228 - main/alloca.c | 499 - main/build-defs.h.in | 88 - main/config.w32.h | 271 - main/fopen_wrappers.c | 534 - main/fopen_wrappers.h | 82 - main/internal_functions.c.in | 57 - main/internal_functions_registry.h | 38 - main/logos.h | 1059 -- main/main.c | 1489 -- main/mergesort.c | 356 - main/network.c | 823 - main/output.c | 774 - main/php.h | 372 - main/php3_compat.h | 102 - main/php_compat.h | 97 - main/php_content_types.c | 65 - main/php_content_types.h | 10 - main/php_globals.h | 144 - main/php_ini.c | 393 - main/php_ini.h | 74 - main/php_logos.c | 98 - main/php_logos.h | 10 - main/php_main.h | 60 - main/php_network.h | 129 - main/php_open_temporary_file.c | 204 - main/php_open_temporary_file.h | 24 - main/php_output.h | 98 - main/php_realpath.c | 283 - main/php_reentrancy.h | 128 - main/php_regex.h | 45 - main/php_sprintf.c | 51 - main/php_streams.h | 164 - main/php_syslog.h | 32 - main/php_ticks.c | 81 - main/php_ticks.h | 37 - main/php_variables.c | 338 - main/php_variables.h | 41 - main/php_version.h | 3 - main/reentrancy.c | 441 - main/rfc1867.c | 917 - main/rfc1867.h | 12 - main/safe_mode.c | 198 - main/safe_mode.h | 15 - main/snprintf.c | 949 - main/snprintf.h | 44 - main/streams.c | 917 - main/strlcat.c | 86 - main/strlcpy.c | 83 - main/win95nt.h | 63 - makedist | 148 - makerpm | 156 - pear/Archive/Tar.php | 1127 -- pear/CMD.php | 285 - pear/CODING_STANDARDS | 8 - pear/Console/Getopt.php | 231 - pear/DB.php | 876 - pear/HTTP.php | 172 - pear/ITX.xml | 21 - pear/Mail.php | 186 - pear/Makefile.frag | 179 - pear/PEAR.php | 761 - pear/PEAR/Autoloader.php | 167 - pear/PEAR/Command.php | 156 - pear/PEAR/Command/Common.php | 68 - pear/PEAR/Command/Install.php | 99 - pear/PEAR/CommandResponse.php | 123 - pear/PEAR/Common.php | 428 - pear/PEAR/Config.php | 722 - pear/PEAR/Dependency.php | 246 - pear/PEAR/Installer.php | 397 - pear/PEAR/Packager.php | 165 - pear/PEAR/Registry.php | 383 - pear/PEAR/Remote.php | 102 - pear/PEAR/Uploader.php | 60 - pear/PEAR/WebInstaller.php | 631 - pear/README | 18 - pear/System.php | 412 - pear/catalog | 1 - pear/install-pear.txt | 11 - pear/package.dtd | 83 - pear/pear.m4 | 103 - pear/scripts/pear-get.in | 58 - pear/scripts/pear.bat | 31 - pear/scripts/pear.in | 58 - pear/scripts/pearcmd-common.php | 197 - pear/scripts/pearcmd-help.php | 9 - pear/scripts/pearcmd-info.php | 10 - pear/scripts/pearcmd-install.php | 33 - pear/scripts/pearcmd-list.php | 20 - pear/scripts/pearcmd-package.php | 15 - pear/scripts/pearcmd-remote-list.php | 30 - pear/scripts/pearcmd-show-config.php | 16 - pear/scripts/pearcmd-uninstall.php | 26 - pear/scripts/pearize.in | 225 - pear/scripts/pearwin.php | 233 - pear/scripts/php-config.in | 26 - pear/scripts/phpextdist | 27 - pear/scripts/phpize.in | 29 - pear/scripts/phptar.in | 236 - pear/tests/merge.input | 1 - pear/tests/pear1.phpt | 87 - pear/tests/pear_autoloader.phpt | 80 - pear/tests/pear_config.phpt | 211 - pear/tests/pear_error.phpt | 153 - pear/tests/pear_error2.phpt | 24 - pear/tests/pear_error3.phpt | 52 - pear/tests/pear_error4.phpt | 89 - pear/tests/pear_registry.phpt | 92 - pear/tests/pear_system.phpt | 95 - pear/tests/php.ini | 2 - pear/tests/system.input | 1 - pear/tests/toonew.conf | 2 - pear/tests/user.input | 0 pear/tests/user2.input | 1 - php.gif | Bin 3872 -> 0 bytes php.ini-dist | 889 - php.ini-recommended | 896 - php4.spec.in | 48 - regex/COPYRIGHT | 20 - regex/Makefile.in | 5 - regex/README | 32 - regex/WHATSNEW | 92 - regex/cclass.h | 30 - regex/cname.h | 102 - regex/debug.c | 242 - regex/debug.ih | 14 - regex/engine.c | 1019 - regex/engine.ih | 35 - regex/main.c | 510 - regex/main.ih | 19 - regex/mkh | 76 - regex/regcomp.c | 1608 -- regex/regcomp.ih | 53 - regex/regerror.c | 126 - regex/regerror.ih | 12 - regex/regex.3 | 502 - regex/regex.7 | 233 - regex/regex.dsp | 106 - regex/regex.dsw | 29 - regex/regex.h | 83 - regex/regex.mak | 304 - regex/regex2.h | 140 - regex/regex_extra.h | 23 - regex/regexec.c | 138 - regex/regfree.c | 37 - regex/split.c | 316 - regex/tests | 475 - regex/utils.h | 25 - run-tests.php | 614 - sapi/aolserver/CREDITS | 2 - sapi/aolserver/README | 69 - sapi/aolserver/aolserver.c | 622 - sapi/aolserver/config.m4 | 33 - sapi/aolserver/php.sym | 2 - sapi/aolserver/php4aolserver.dsp | 135 - sapi/apache/CREDITS | 3 - sapi/apache/apMakefile.libdir | 4 - sapi/apache/apMakefile.tmpl | 77 - sapi/apache/config.m4 | 245 - sapi/apache/libphp4.module.in | 7 - sapi/apache/mod_php4.c | 913 - sapi/apache/mod_php4.exp | 1 - sapi/apache/mod_php4.h | 54 - sapi/apache/php.sym | 1 - sapi/apache/php4apache.dsp | 151 - sapi/apache/php_apache.c | 495 - sapi/apache/php_apache_http.h | 24 - sapi/apache/sapi_apache.c | 110 - sapi/apache2filter/CREDITS | 2 - sapi/apache2filter/README | 64 - sapi/apache2filter/apache_config.c | 164 - sapi/apache2filter/config.m4 | 60 - sapi/apache2filter/php.sym | 1 - sapi/apache2filter/php4apache2.dsp | 142 - sapi/apache2filter/php_apache.h | 51 - sapi/apache2filter/php_functions.c | 171 - sapi/apache2filter/sapi_apache2.c | 494 - sapi/caudium/CREDITS | 2 - sapi/caudium/README | 16 - sapi/caudium/TODO | 30 - sapi/caudium/caudium.c | 784 - sapi/caudium/config.m4 | 99 - sapi/cgi/CREDITS | 2 - sapi/cgi/cgi_main.c | 1107 -- sapi/cgi/config.m4 | 99 - sapi/cgi/getopt.c | 175 - sapi/cgi/libfcgi/LICENSE.TERMS | 28 - sapi/cgi/libfcgi/fcgi_stdio.c | 801 - sapi/cgi/libfcgi/fcgiapp.c | 2307 --- sapi/cgi/libfcgi/include/fastcgi.h | 136 - sapi/cgi/libfcgi/include/fcgi_config.h | 111 - sapi/cgi/libfcgi/include/fcgi_config_x86.h | 103 - sapi/cgi/libfcgi/include/fcgi_stdio.h | 249 - sapi/cgi/libfcgi/include/fcgiapp.h | 626 - sapi/cgi/libfcgi/include/fcgiappmisc.h | 50 - sapi/cgi/libfcgi/include/fcgimisc.h | 38 - sapi/cgi/libfcgi/include/fcgio.h | 147 - sapi/cgi/libfcgi/include/fcgios.h | 132 - sapi/cgi/libfcgi/os_unix.c | 1265 -- sapi/cgi/libfcgi/os_win32.c | 1913 -- sapi/cgi/libfcgi/strerror.c | 91 - sapi/cgi/php.sym | 0 sapi/cgi/php_getopt.h | 7 - sapi/cli/CREDITS | 2 - sapi/cli/README | 15 - sapi/cli/config.m4 | 26 - sapi/cli/getopt.c | 175 - sapi/cli/php_cli.c | 663 - sapi/cli/php_getopt.h | 7 - sapi/fastcgi/CREDITS | 4 - sapi/fastcgi/README.Apache | 53 - sapi/fastcgi/README.FastCGI | 91 - sapi/fastcgi/config.m4 | 26 - sapi/fastcgi/fastcgi.c | 609 - sapi/fastcgi/fastcgi.dsp | 195 - sapi/fastcgi/php.sym | 0 sapi/fastcgi/php_fastcgi.h | 28 - sapi/fastcgi/windows.txt | 35 - sapi/fhttpd/CREDITS | 2 - sapi/fhttpd/fhttpd.c | 185 - sapi/isapi/CREDITS | 2 - sapi/isapi/config.m4 | 27 - sapi/isapi/php.sym | 5 - sapi/isapi/php4isapi.c | 861 - sapi/isapi/php4isapi.def | 5 - sapi/isapi/php4isapi.dsp | 165 - sapi/isapi/stresstest/getopt.c | 175 - sapi/isapi/stresstest/getopt.h | 12 - sapi/isapi/stresstest/notes.txt | 56 - sapi/isapi/stresstest/stresstest.cpp | 936 - sapi/isapi/stresstest/stresstest.dsp | 108 - sapi/nsapi/CREDITS | 2 - sapi/nsapi/config.m4 | 38 - sapi/nsapi/nsapi-readme.txt | 76 - sapi/nsapi/nsapi.c | 542 - sapi/nsapi/php4nsapi.dsp | 135 - sapi/phttpd/CREDITS | 2 - sapi/phttpd/README | 5 - sapi/phttpd/config.m4 | 25 - sapi/phttpd/php.sym | 4 - sapi/phttpd/php_phttpd.h | 24 - sapi/phttpd/phttpd.c | 312 - sapi/pi3web/CREDITS | 2 - sapi/pi3web/README | 50 - sapi/pi3web/config.m4 | 27 - sapi/pi3web/php.sym | 0 sapi/pi3web/php4pi3web.dsp | 136 - sapi/pi3web/pi3web_sapi.c | 482 - sapi/pi3web/pi3web_sapi.h | 95 - sapi/roxen/README | 18 - sapi/roxen/TODO | 33 - sapi/roxen/config.m4 | 60 - sapi/roxen/roxen.c | 728 - sapi/servlet/CREDITS | 2 - sapi/servlet/EXPERIMENTAL | 5 - sapi/servlet/Makefile.frag | 19 - sapi/servlet/README | 122 - sapi/servlet/config.m4 | 52 - sapi/servlet/cookies.php | 41 - sapi/servlet/date.php | 28 - sapi/servlet/formatter.java | 31 - sapi/servlet/jinfo.php | 5 - sapi/servlet/jver.php | 17 - sapi/servlet/reqheaders.php | 24 - sapi/servlet/reqinfo.php | 29 - sapi/servlet/reqparams.php | 35 - sapi/servlet/servlet.c | 404 - sapi/servlet/servlet.dsp | 286 - sapi/servlet/servlet.java | 219 - sapi/servlet/sessions.php | 60 - sapi/servlet/web.xml | 40 - sapi/thttpd/CREDITS | 2 - sapi/thttpd/README | 59 - sapi/thttpd/config.m4 | 27 - sapi/thttpd/php.sym | 3 - sapi/thttpd/php_thttpd.h | 35 - sapi/thttpd/stub.c | 0 sapi/thttpd/thttpd.c | 652 - sapi/thttpd/thttpd_patch | 240 - sapi/tux/CREDITS | 2 - sapi/tux/README | 86 - sapi/tux/config.m4 | 18 - sapi/tux/php.sym | 2 - sapi/tux/php_tux.c | 444 - sapi/webjames/CREDITS | 2 - sapi/webjames/README | 28 - sapi/webjames/config.m4 | 21 - sapi/webjames/php_webjames.h | 28 - sapi/webjames/webjames.c | 324 - scan_makefile_in.awk | 32 - scripts/apache/apconf-conv.sh | 24 - scripts/apache/aphtaccess-conv.sh | 24 - scripts/apache/conffix.awk | 23 - scripts/apache/htaccessfix.awk | 23 - scripts/config-stubs | 8 - scripts/conv_proto | 30 - scripts/conv_z_macros | 61 - scripts/credits | 26 - snapshot | 7 - stamp-h.in | 1 - strtok_r.c | 113 - stub.c | 1 - tests/README | 60 - tests/basic/001.phpt | 8 - tests/basic/002.phpt | 12 - tests/basic/003.phpt | 14 - tests/basic/004.phpt | 13 - tests/basic/005.phpt | 13 - tests/basic/006.phpt | 8 - tests/basic/007.phpt | 8 - tests/basic/008.phpt | 8 - tests/basic/009.phpt | 8 - tests/basic/010.phpt | 8 - tests/basic/011.phpt | 25 - tests/bin-info.inc | 21 - tests/classes/class_example.phpt | 87 - tests/classes/inheritance.phpt | 58 - tests/dirname.phpt | 30 - tests/foo | 5 - tests/foo2 | 3 - tests/foo3 | 43 - tests/foo4 | 41 - tests/func/001.phpt | 8 - tests/func/002.phpt | 22 - tests/func/003.phpt | 289 - tests/func/004.phpt | 65 - tests/func/005.phpt | 22 - tests/lang/001.phpt | 8 - tests/lang/002.phpt | 12 - tests/lang/003.phpt | 19 - tests/lang/004.phpt | 13 - tests/lang/005.phpt | 15 - tests/lang/006.phpt | 21 - tests/lang/007.phpt | 25 - tests/lang/008.phpt | 16 - tests/lang/009.phpt | 11 - tests/lang/010.phpt | 13 - tests/lang/011.phpt | 25 - tests/lang/012.phpt | 20 - tests/lang/013.phpt | 12 - tests/lang/014.phpt | 15 - tests/lang/015.inc | 3 - tests/lang/015.phpt | 10 - tests/lang/016.inc | 5 - tests/lang/016.phpt | 11 - tests/lang/017.phpt | 18 - tests/lang/018.phpt | 36 - tests/lang/019.phpt | 38 - tests/lang/020.phpt | 78 - tests/lang/021.phpt | 44 - tests/lang/022.phpt | 65 - tests/lang/023-1.inc | 356 - tests/lang/023-2.inc | 6 - tests/lang/023.phpt | 256 - tests/lang/024.phpt | 11625 ------------ tests/lang/025.phpt | 540 - tests/lang/026.phpt | 8 - tests/lang/027.phpt | 14 - tests/lang/028.phpt | 1060 -- tests/lang/029.phpt | 30 - tests/lang/030.phpt | 33 - tests/odbc-display.php | 19 - tests/odbc-t1.php | 38 - tests/odbc-t2.php | 82 - tests/odbc-t3.php | 95 - tests/odbc-t4.php | 91 - tests/odbc-t5.php | 137 - tests/quicktester.inc | 75 - tests/recurse | 21 - tests/run.html | 11 - tests/run.php | 17 - tests/scan_cases | 28 - tests/strings/001.phpt | 209 - tests/strings/002.phpt | 74 - tests/strings/003.phpt | 19 - tests/test.php4 | 15 - tests/test.pl | 34 - tests/test_class_inheritance | 29 - tests/testarray | 21 - tests/testarray.pl | 5 - tests/testarray2 | 5 - tests/testarray2.pl | 3 - tests/testclassfunc | 9 - tests/testcom | 11 - tests/testcpdf | 97 - tests/testcpdfclock | 87 - tests/testdom | 73 - tests/testfe | 18 - tests/testfunc | 33 - tests/testfunc.pl | 20 - tests/testfunc2 | 19 - tests/testfunc2.pl | 22 - tests/testfuncref | 10 - tests/testhyperwave | 235 - tests/testinclude | 5 - tests/testobj | 29 - tests/testpfpro.php | 39 - tests/testscanf.php | 113 - tests/testswf | 120 - win32/crypt_win32.c | 343 - win32/crypt_win32.h | 57 - win32/flock.c | 83 - win32/flock.h | 11 - win32/grp.h | 31 - win32/imap_sendmail.c | 256 - win32/imap_sendmail.h | 11 - win32/install.txt | 617 - win32/param.h | 16 - win32/php4.dsp | 134 - win32/php4.dsw | 119 - win32/php4dll.dsp | 1755 -- win32/php4ts.dsp | 183 - win32/php4ts.dsw | 220 - win32/php4ts_cli.dsp | 167 - win32/php5ts.dsw | 220 - win32/php_modules.dsw | 581 - win32/php_registry.h | 7 - win32/pwd.c | 74 - win32/pwd.h | 57 - win32/pws-php4cgi.reg | 6 - win32/pws-php4isapi.reg | 5 - win32/readdir.c | 140 - win32/readdir.h | 44 - win32/registry.c | 88 - win32/sendmail.c | 549 - win32/sendmail.h | 46 - win32/signal.h | 16 - win32/syslog.h | 73 - win32/testsuite.dsp | 150 - win32/time.c | 242 - win32/time.h | 43 - win32/unistd.h | 4 - win32/wfile.c | 17 - win32/wfile.h | 16 - win32/winutil.c | 31 - win32/winutil.h | 21 - win32/wsyslog.c | 122 - 1877 files changed, 515219 deletions(-) delete mode 100644 CODING_STANDARDS delete mode 100644 CREDITS delete mode 100644 ChangeLog delete mode 100644 ChangeLog.1999.gz delete mode 100644 ChangeLog.2000.gz delete mode 100644 ChangeLog.2001.gz delete mode 100644 EXTENSIONS delete mode 100644 INSTALL delete mode 100644 LICENSE delete mode 100644 Makefile.frag delete mode 100644 Makefile.global delete mode 100644 NEWS delete mode 100644 README.CVS-RULES delete mode 100644 README.EXTENSIONS delete mode 100644 README.EXT_SKEL delete mode 100644 README.PARAMETER_PARSING_API delete mode 100644 README.QNX delete mode 100644 README.SELF-CONTAINED-EXTENSIONS delete mode 100644 README.STREAMS delete mode 100644 README.TESTING delete mode 100644 README.Zeus delete mode 100644 RELEASE_PROCESS delete mode 100644 TODO delete mode 100644 TODO.BUILDv5 delete mode 100644 TSRM/LICENSE delete mode 100644 TSRM/Makefile.am delete mode 100644 TSRM/TODO delete mode 100644 TSRM/TSRM.c delete mode 100644 TSRM/TSRM.dsp delete mode 100644 TSRM/TSRM.h delete mode 100644 TSRM/acconfig.h delete mode 100644 TSRM/acinclude.m4 delete mode 100644 TSRM/build.mk delete mode 100755 TSRM/buildconf delete mode 100644 TSRM/configure.in delete mode 100644 TSRM/readdir.h delete mode 100644 TSRM/threads.m4 delete mode 100644 TSRM/tsrm.m4 delete mode 100644 TSRM/tsrm_config.w32.h delete mode 100644 TSRM/tsrm_config_common.h delete mode 100644 TSRM/tsrm_strtok_r.c delete mode 100644 TSRM/tsrm_strtok_r.h delete mode 100644 TSRM/tsrm_virtual_cwd.c delete mode 100644 TSRM/tsrm_virtual_cwd.h delete mode 100644 TSRM/tsrm_win32.c delete mode 100644 TSRM/tsrm_win32.h delete mode 100644 Zend/ChangeLog delete mode 100644 Zend/FlexLexer.h delete mode 100644 Zend/LICENSE delete mode 100644 Zend/Makefile.am delete mode 100644 Zend/OBJECTS2_HOWTO delete mode 100644 Zend/RFCs/001.txt delete mode 100644 Zend/RFCs/002.txt delete mode 100644 Zend/RFCs/003.txt delete mode 100644 Zend/ZEND_CHANGES delete mode 100644 Zend/Zend.dsp delete mode 100644 Zend/Zend.m4 delete mode 100644 Zend/ZendCore.dep delete mode 100644 Zend/ZendTS.dsp delete mode 100644 Zend/acconfig.h delete mode 100644 Zend/acinclude.m4 delete mode 100644 Zend/build.mk delete mode 100755 Zend/buildconf delete mode 100644 Zend/configure.in delete mode 100644 Zend/flex.skl delete mode 100644 Zend/tests/zend2.php delete mode 100644 Zend/zend.c delete mode 100644 Zend/zend.h delete mode 100644 Zend/zend.ico delete mode 100644 Zend/zend_API.c delete mode 100644 Zend/zend_API.h delete mode 100644 Zend/zend_alloc.c delete mode 100644 Zend/zend_alloc.h delete mode 100644 Zend/zend_builtin_functions.c delete mode 100644 Zend/zend_builtin_functions.h delete mode 100644 Zend/zend_compile.c delete mode 100644 Zend/zend_compile.h delete mode 100644 Zend/zend_config.w32.h delete mode 100644 Zend/zend_constants.c delete mode 100644 Zend/zend_constants.h delete mode 100644 Zend/zend_dynamic_array.c delete mode 100644 Zend/zend_dynamic_array.h delete mode 100644 Zend/zend_errors.h delete mode 100644 Zend/zend_execute.c delete mode 100644 Zend/zend_execute.h delete mode 100644 Zend/zend_execute_API.c delete mode 100644 Zend/zend_execute_locks.h delete mode 100644 Zend/zend_extensions.c delete mode 100644 Zend/zend_extensions.h delete mode 100644 Zend/zend_fast_cache.h delete mode 100644 Zend/zend_globals.h delete mode 100644 Zend/zend_globals_macros.h delete mode 100644 Zend/zend_hash.c delete mode 100644 Zend/zend_hash.h delete mode 100644 Zend/zend_highlight.c delete mode 100644 Zend/zend_highlight.h delete mode 100644 Zend/zend_indent.c delete mode 100644 Zend/zend_indent.h delete mode 100644 Zend/zend_ini.c delete mode 100644 Zend/zend_ini.h delete mode 100644 Zend/zend_ini_parser.y delete mode 100644 Zend/zend_ini_scanner.h delete mode 100644 Zend/zend_ini_scanner.l delete mode 100644 Zend/zend_istdiostream.h delete mode 100644 Zend/zend_language_parser.y delete mode 100644 Zend/zend_language_scanner.h delete mode 100644 Zend/zend_language_scanner.l delete mode 100644 Zend/zend_list.c delete mode 100644 Zend/zend_list.h delete mode 100644 Zend/zend_llist.c delete mode 100644 Zend/zend_llist.h delete mode 100644 Zend/zend_modules.h delete mode 100644 Zend/zend_object_handlers.c delete mode 100644 Zend/zend_object_handlers.h delete mode 100644 Zend/zend_objects.c delete mode 100644 Zend/zend_objects.h delete mode 100644 Zend/zend_opcode.c delete mode 100644 Zend/zend_operators.c delete mode 100644 Zend/zend_operators.h delete mode 100644 Zend/zend_ptr_stack.c delete mode 100644 Zend/zend_ptr_stack.h delete mode 100644 Zend/zend_qsort.c delete mode 100644 Zend/zend_qsort.h delete mode 100644 Zend/zend_sprintf.c delete mode 100644 Zend/zend_stack.c delete mode 100644 Zend/zend_stack.h delete mode 100644 Zend/zend_static_allocator.c delete mode 100644 Zend/zend_static_allocator.h delete mode 100644 Zend/zend_variables.c delete mode 100644 Zend/zend_variables.h delete mode 100644 acconfig.h.in delete mode 100644 acinclude.m4 delete mode 100644 apidoc-zend.txt delete mode 100644 apidoc.txt delete mode 100644 build/build.mk delete mode 100644 build/build2.mk delete mode 100755 build/buildcheck.sh delete mode 100644 build/genif.sh delete mode 100644 build/mkdep.awk delete mode 100644 build/print_include.awk delete mode 100644 build/program.mk delete mode 100644 build/rules.mk delete mode 100644 build/rules_common.mk delete mode 100644 build/rules_pear.mk delete mode 100755 build/shtool delete mode 100755 buildconf delete mode 100644 config.guess delete mode 100644 config.sub delete mode 100644 configure.in delete mode 100755 cvsclean delete mode 100644 ext/aspell/CREDITS delete mode 100644 ext/aspell/aspell.c delete mode 100644 ext/aspell/config.m4 delete mode 100644 ext/aspell/php_aspell.h delete mode 100644 ext/bcmath/CREDITS delete mode 100644 ext/bcmath/bcmath.c delete mode 100644 ext/bcmath/config.m4 delete mode 100644 ext/bcmath/libbcmath/AUTHORS delete mode 100644 ext/bcmath/libbcmath/COPYING.LIB delete mode 100644 ext/bcmath/libbcmath/ChangeLog delete mode 100644 ext/bcmath/libbcmath/FAQ delete mode 100644 ext/bcmath/libbcmath/INSTALL delete mode 100644 ext/bcmath/libbcmath/Makefile.am delete mode 100644 ext/bcmath/libbcmath/NEWS delete mode 100644 ext/bcmath/libbcmath/README delete mode 100644 ext/bcmath/libbcmath/acconfig.h delete mode 100644 ext/bcmath/libbcmath/aclocal.m4 delete mode 100644 ext/bcmath/libbcmath/config.h.in delete mode 100644 ext/bcmath/libbcmath/configure delete mode 100644 ext/bcmath/libbcmath/configure.in delete mode 100644 ext/bcmath/libbcmath/doc/Makefile.am delete mode 100644 ext/bcmath/libbcmath/doc/Makefile.in delete mode 100644 ext/bcmath/libbcmath/doc/bcmath.1 delete mode 100644 ext/bcmath/libbcmath/install-sh delete mode 100644 ext/bcmath/libbcmath/missing delete mode 100644 ext/bcmath/libbcmath/mkinstalldirs delete mode 100644 ext/bcmath/libbcmath/src/Makefile.am delete mode 100644 ext/bcmath/libbcmath/src/add.c delete mode 100644 ext/bcmath/libbcmath/src/bcmath.h delete mode 100644 ext/bcmath/libbcmath/src/compare.c delete mode 100644 ext/bcmath/libbcmath/src/config.h delete mode 100644 ext/bcmath/libbcmath/src/debug.c delete mode 100644 ext/bcmath/libbcmath/src/div.c delete mode 100644 ext/bcmath/libbcmath/src/divmod.c delete mode 100644 ext/bcmath/libbcmath/src/doaddsub.c delete mode 100644 ext/bcmath/libbcmath/src/init.c delete mode 100644 ext/bcmath/libbcmath/src/int2num.c delete mode 100644 ext/bcmath/libbcmath/src/nearzero.c delete mode 100644 ext/bcmath/libbcmath/src/neg.c delete mode 100644 ext/bcmath/libbcmath/src/num2long.c delete mode 100644 ext/bcmath/libbcmath/src/num2str.c delete mode 100644 ext/bcmath/libbcmath/src/outofmem.c delete mode 100644 ext/bcmath/libbcmath/src/output.c delete mode 100644 ext/bcmath/libbcmath/src/private.h delete mode 100644 ext/bcmath/libbcmath/src/raise.c delete mode 100644 ext/bcmath/libbcmath/src/raisemod.c delete mode 100644 ext/bcmath/libbcmath/src/recmul.c delete mode 100644 ext/bcmath/libbcmath/src/rmzero.c delete mode 100644 ext/bcmath/libbcmath/src/rt.c delete mode 100644 ext/bcmath/libbcmath/src/sqrt.c delete mode 100644 ext/bcmath/libbcmath/src/str2num.c delete mode 100644 ext/bcmath/libbcmath/src/sub.c delete mode 100644 ext/bcmath/libbcmath/src/zero.c delete mode 100644 ext/bcmath/php_bcmath.h delete mode 100644 ext/calendar/CREDITS delete mode 100644 ext/calendar/cal_unix.c delete mode 100644 ext/calendar/calendar.c delete mode 100644 ext/calendar/config.m4 delete mode 100644 ext/calendar/dow.c delete mode 100644 ext/calendar/easter.c delete mode 100644 ext/calendar/french.c delete mode 100644 ext/calendar/gregor.c delete mode 100644 ext/calendar/jewish.c delete mode 100644 ext/calendar/julian.c delete mode 100644 ext/calendar/php_calendar.h delete mode 100644 ext/calendar/sdncal.h delete mode 100644 ext/ccvs/CREDITS delete mode 100644 ext/ccvs/TODO delete mode 100644 ext/ccvs/ccvs.c delete mode 100644 ext/ccvs/ccvs.h delete mode 100644 ext/ccvs/config.m4 delete mode 100644 ext/com/COM.c delete mode 100644 ext/com/CREDITS delete mode 100644 ext/com/TODO delete mode 100644 ext/com/VARIANT.c delete mode 100644 ext/com/com.h delete mode 100644 ext/com/conversion.c delete mode 100644 ext/com/conversion.h delete mode 100644 ext/com/php_COM.h delete mode 100644 ext/com/php_VARIANT.h delete mode 100644 ext/com/variant.h delete mode 100644 ext/cpdf/CREDITS delete mode 100644 ext/cpdf/config.m4 delete mode 100644 ext/cpdf/cpdf.c delete mode 100644 ext/cpdf/cpdf.dsp delete mode 100644 ext/cpdf/php_cpdf.h delete mode 100644 ext/crack/CREDITS delete mode 100644 ext/crack/EXPERIMENTAL delete mode 100644 ext/crack/config.m4 delete mode 100644 ext/crack/crack.c delete mode 100644 ext/crack/php_crack.h delete mode 100644 ext/crack/tests/001.phpt delete mode 100644 ext/ctype/CREDITS delete mode 100644 ext/ctype/README delete mode 100644 ext/ctype/config.m4 delete mode 100644 ext/ctype/ctype.c delete mode 100644 ext/ctype/ctype.dsp delete mode 100644 ext/ctype/ctype.xml delete mode 100644 ext/ctype/php_ctype.h delete mode 100644 ext/ctype/tests/001.phpt delete mode 100644 ext/ctype/tests/002.phpt delete mode 100644 ext/curl/CREDITS delete mode 100644 ext/curl/config.m4 delete mode 100644 ext/curl/curl.c delete mode 100644 ext/curl/curl.dsp delete mode 100644 ext/curl/php_curl.h delete mode 100644 ext/cybercash/CREDITS delete mode 100644 ext/cybercash/config.m4 delete mode 100644 ext/cybercash/cybercash.c delete mode 100644 ext/cybercash/cybercash.dsp delete mode 100644 ext/cybercash/cybercash.h delete mode 100644 ext/cybercash/cyberlib.php delete mode 100644 ext/cybercash/test.php delete mode 100644 ext/cybermut/config.m4 delete mode 100644 ext/cybermut/cybermut.c delete mode 100644 ext/cybermut/cybermut.xml delete mode 100644 ext/cybermut/php_cybermut.h delete mode 100644 ext/cybermut/tests/001.phpt delete mode 100644 ext/cyrus/CREDITS delete mode 100644 ext/cyrus/config.m4 delete mode 100644 ext/cyrus/cyrus.c delete mode 100644 ext/cyrus/php_cyrus.h delete mode 100644 ext/db/CREDITS delete mode 100644 ext/db/config.m4 delete mode 100644 ext/db/db.c delete mode 100644 ext/db/db.dsp delete mode 100644 ext/db/php_db.h delete mode 100644 ext/db/tests/001.phpt delete mode 100644 ext/db/tests/002.phpt delete mode 100644 ext/db/tests/003.phpt delete mode 100644 ext/db/tests/004.phpt delete mode 100644 ext/db/tests/005.phpt delete mode 100644 ext/db/tests/006.phpt delete mode 100644 ext/dba/CREDITS delete mode 100644 ext/dba/config.m4 delete mode 100644 ext/dba/dba.c delete mode 100644 ext/dba/dba.dsp delete mode 100644 ext/dba/dba_cdb.c delete mode 100644 ext/dba/dba_db2.c delete mode 100644 ext/dba/dba_db3.c delete mode 100644 ext/dba/dba_dbm.c delete mode 100644 ext/dba/dba_gdbm.c delete mode 100644 ext/dba/dba_ndbm.c delete mode 100644 ext/dba/php_cdb.h delete mode 100644 ext/dba/php_db2.h delete mode 100644 ext/dba/php_db3.h delete mode 100644 ext/dba/php_dba.h delete mode 100644 ext/dba/php_dbm.h delete mode 100644 ext/dba/php_gdbm.h delete mode 100644 ext/dba/php_ndbm.h delete mode 100644 ext/dbase/CREDITS delete mode 100644 ext/dbase/config.m4 delete mode 100644 ext/dbase/dbase.c delete mode 100644 ext/dbase/dbase.dsp delete mode 100644 ext/dbase/dbf.h delete mode 100644 ext/dbase/dbf_head.c delete mode 100644 ext/dbase/dbf_head.h delete mode 100644 ext/dbase/dbf_misc.c delete mode 100644 ext/dbase/dbf_misc.h delete mode 100644 ext/dbase/dbf_ndx.c delete mode 100644 ext/dbase/dbf_ndx.h delete mode 100644 ext/dbase/dbf_rec.c delete mode 100644 ext/dbase/dbf_rec.h delete mode 100644 ext/dbase/php_dbase.h delete mode 100644 ext/dbplus/CREDITS delete mode 100644 ext/dbplus/EXPERIMENTAL delete mode 100644 ext/dbplus/README delete mode 100644 ext/dbplus/config.m4 delete mode 100644 ext/dbplus/dbplus.c delete mode 100644 ext/dbplus/php_dbplus.c delete mode 100644 ext/dbplus/php_dbplus.h delete mode 100644 ext/dbplus/tests/001.phpt delete mode 100644 ext/dbx/CREDITS delete mode 100644 ext/dbx/INSTALL delete mode 100644 ext/dbx/config.m4 delete mode 100644 ext/dbx/dbx.c delete mode 100644 ext/dbx/dbx.dsp delete mode 100644 ext/dbx/dbx.h delete mode 100644 ext/dbx/dbx_fbsql.c delete mode 100644 ext/dbx/dbx_fbsql.h delete mode 100644 ext/dbx/dbx_mssql.c delete mode 100644 ext/dbx/dbx_mssql.h delete mode 100644 ext/dbx/dbx_mysql.c delete mode 100644 ext/dbx/dbx_mysql.h delete mode 100644 ext/dbx/dbx_oci8.c delete mode 100644 ext/dbx/dbx_oci8.h delete mode 100644 ext/dbx/dbx_odbc.c delete mode 100644 ext/dbx/dbx_odbc.h delete mode 100644 ext/dbx/dbx_pgsql.c delete mode 100644 ext/dbx/dbx_pgsql.h delete mode 100644 ext/dbx/dbx_sybasect.c delete mode 100644 ext/dbx/dbx_sybasect.h delete mode 100644 ext/dbx/howto_extend_dbx.html delete mode 100644 ext/dbx/php_dbx.h delete mode 100644 ext/dbx/tests/001.phpt delete mode 100644 ext/dbx/tests/002.phpt delete mode 100644 ext/dbx/tests/003.phpt delete mode 100644 ext/dbx/tests/004.phpt delete mode 100644 ext/dbx/tests/005.phpt delete mode 100644 ext/dbx/tests/006.phpt delete mode 100644 ext/dbx/tests/007.phpt delete mode 100644 ext/dbx/tests/008.phpt delete mode 100644 ext/dbx/tests/dbx_test.p delete mode 100644 ext/dbx/tests/dbx_test.pgsql.script delete mode 100644 ext/dbx/tests/dbx_test.script delete mode 100644 ext/dio/EXPERIMENTAL delete mode 100644 ext/dio/config.m4 delete mode 100644 ext/dio/dio.c delete mode 100644 ext/dio/php_dio.h delete mode 100644 ext/dio/tests/001.phpt delete mode 100644 ext/domxml/CREDITS delete mode 100644 ext/domxml/EXPERIMENTAL delete mode 100644 ext/domxml/TODO delete mode 100644 ext/domxml/config.m4 delete mode 100644 ext/domxml/domxml.dsp delete mode 100644 ext/domxml/php_domxml.c delete mode 100644 ext/domxml/php_domxml.h delete mode 100644 ext/dotnet/CREDITS delete mode 100644 ext/dotnet/EXPERIMENTAL delete mode 100644 ext/dotnet/README delete mode 100644 ext/dotnet/dotnet.cpp delete mode 100644 ext/dotnet/dotnet.dsp delete mode 100644 ext/dotnet/dotnet.php delete mode 100644 ext/dotnet/php_dotnet.h delete mode 100644 ext/ereg/ereg.c delete mode 100644 ext/ereg/php_ereg.h delete mode 100644 ext/ereg/php_regex.h delete mode 100644 ext/ereg/regex/COPYRIGHT delete mode 100644 ext/ereg/regex/Makefile.in delete mode 100644 ext/ereg/regex/README delete mode 100644 ext/ereg/regex/WHATSNEW delete mode 100644 ext/ereg/regex/cclass.h delete mode 100644 ext/ereg/regex/cname.h delete mode 100644 ext/ereg/regex/debug.c delete mode 100644 ext/ereg/regex/debug.ih delete mode 100644 ext/ereg/regex/engine.c delete mode 100644 ext/ereg/regex/engine.ih delete mode 100644 ext/ereg/regex/main.c delete mode 100644 ext/ereg/regex/main.ih delete mode 100644 ext/ereg/regex/mkh delete mode 100644 ext/ereg/regex/regcomp.c delete mode 100644 ext/ereg/regex/regcomp.ih delete mode 100644 ext/ereg/regex/regerror.c delete mode 100644 ext/ereg/regex/regerror.ih delete mode 100644 ext/ereg/regex/regex.3 delete mode 100644 ext/ereg/regex/regex.7 delete mode 100644 ext/ereg/regex/regex.dsp delete mode 100644 ext/ereg/regex/regex.dsw delete mode 100644 ext/ereg/regex/regex.h delete mode 100644 ext/ereg/regex/regex.mak delete mode 100644 ext/ereg/regex/regex2.h delete mode 100644 ext/ereg/regex/regex_extra.h delete mode 100644 ext/ereg/regex/regexec.c delete mode 100644 ext/ereg/regex/regfree.c delete mode 100644 ext/ereg/regex/split.c delete mode 100644 ext/ereg/regex/tests delete mode 100644 ext/ereg/regex/utils.h delete mode 100644 ext/ereg/tests/001.phpt delete mode 100644 ext/ereg/tests/002.phpt delete mode 100644 ext/ereg/tests/003.phpt delete mode 100644 ext/ereg/tests/004.phpt delete mode 100644 ext/ereg/tests/005.phpt delete mode 100644 ext/ereg/tests/006.phpt delete mode 100644 ext/ereg/tests/007.phpt delete mode 100644 ext/ereg/tests/008.phpt delete mode 100644 ext/ereg/tests/009.phpt delete mode 100644 ext/ereg/tests/010.phpt delete mode 100644 ext/ereg/tests/011.phpt delete mode 100644 ext/ereg/tests/012.phpt delete mode 100644 ext/ereg/tests/013.phpt delete mode 100644 ext/ereg/tests/014.phpt delete mode 100644 ext/ereg/tests/015.phpt delete mode 100644 ext/ereg/tests/016.phpt delete mode 100644 ext/exif/CREDITS delete mode 100644 ext/exif/config.m4 delete mode 100644 ext/exif/example.php delete mode 100644 ext/exif/exif.c delete mode 100644 ext/exif/exif.dsp delete mode 100644 ext/exif/php_exif.h delete mode 100644 ext/exif/test.php delete mode 100644 ext/exif/test.txt delete mode 100644 ext/exif/tests/001.phpt delete mode 100644 ext/exif/tests/002.phpt delete mode 100644 ext/exif/tests/test1.jpg delete mode 100644 ext/exif/tests/test2.jpg delete mode 100755 ext/ext_skel delete mode 100644 ext/fbsql/CREDITS delete mode 100644 ext/fbsql/Readme_w32.txt delete mode 100644 ext/fbsql/config.m4 delete mode 100644 ext/fbsql/fbsql.dsp delete mode 100644 ext/fbsql/php_fbsql.c delete mode 100644 ext/fbsql/php_fbsql.h delete mode 100644 ext/fdf/CREDITS delete mode 100644 ext/fdf/config.m4 delete mode 100644 ext/fdf/fdf.c delete mode 100644 ext/fdf/fdf.dsp delete mode 100644 ext/fdf/php_fdf.h delete mode 100644 ext/filepro/CREDITS delete mode 100644 ext/filepro/config.m4 delete mode 100644 ext/filepro/filepro.c delete mode 100644 ext/filepro/filepro.dsp delete mode 100644 ext/filepro/php_filepro.h delete mode 100644 ext/fribidi/CREDITS delete mode 100644 ext/fribidi/README delete mode 100644 ext/fribidi/config.m4 delete mode 100755 ext/fribidi/fribidi.c delete mode 100644 ext/fribidi/fribidi.php delete mode 100644 ext/fribidi/php_fribidi.h delete mode 100644 ext/ftp/CREDITS delete mode 100644 ext/ftp/config.m4 delete mode 100644 ext/ftp/ftp.c delete mode 100644 ext/ftp/ftp.h delete mode 100644 ext/ftp/php_ftp.c delete mode 100644 ext/ftp/php_ftp.h delete mode 100644 ext/gd/CREDITS delete mode 100644 ext/gd/config.m4 delete mode 100644 ext/gd/gd.c delete mode 100644 ext/gd/gd.dsp delete mode 100644 ext/gd/gd_ctx.c delete mode 100644 ext/gd/gdcache.c delete mode 100644 ext/gd/gdcache.h delete mode 100644 ext/gd/gdt1.c delete mode 100644 ext/gd/gdt1.h delete mode 100644 ext/gd/gdttf.c delete mode 100644 ext/gd/gdttf.h delete mode 100644 ext/gd/php_gd.h delete mode 100644 ext/gettext/CREDITS delete mode 100644 ext/gettext/config.m4 delete mode 100644 ext/gettext/gettext.c delete mode 100644 ext/gettext/gettext.dsp delete mode 100644 ext/gettext/php_gettext.h delete mode 100644 ext/gmp/CREDITS delete mode 100644 ext/gmp/README delete mode 100644 ext/gmp/TODO delete mode 100644 ext/gmp/config.m4 delete mode 100644 ext/gmp/gmp.c delete mode 100644 ext/gmp/php_gmp.h delete mode 100644 ext/gmp/tests/001.phpt delete mode 100644 ext/gmp/tests/002.phpt delete mode 100644 ext/gmp/tests/003.phpt delete mode 100644 ext/hyperwave/CREDITS delete mode 100644 ext/hyperwave/config.m4 delete mode 100644 ext/hyperwave/debug.h delete mode 100644 ext/hyperwave/hg_comm.c delete mode 100644 ext/hyperwave/hg_comm.h delete mode 100644 ext/hyperwave/hw.c delete mode 100644 ext/hyperwave/hw_error.h delete mode 100644 ext/hyperwave/hyperwave.dsp delete mode 100644 ext/hyperwave/php_hyperwave.h delete mode 100644 ext/icap/CREDITS delete mode 100644 ext/icap/config.m4 delete mode 100644 ext/icap/php_icap.c delete mode 100644 ext/icap/php_icap.h delete mode 100644 ext/iconv/EXPERIMENTAL delete mode 100644 ext/iconv/Makefile.in delete mode 100644 ext/iconv/config.m4 delete mode 100644 ext/iconv/iconv.c delete mode 100644 ext/iconv/iconv.dsp delete mode 100644 ext/iconv/php_iconv.h delete mode 100644 ext/iconv/tests/001.phpt delete mode 100644 ext/iconv/tests/002.inc delete mode 100644 ext/iconv/tests/002.phpt delete mode 100644 ext/iconv/tests/eucjp2iso2022jp.inc delete mode 100644 ext/iconv/tests/eucjp2iso2022jp.phpt delete mode 100644 ext/iconv/tests/eucjp2sjis.inc delete mode 100644 ext/iconv/tests/eucjp2sjis.phpt delete mode 100644 ext/iconv/tests/eucjp2utf8.inc delete mode 100644 ext/iconv/tests/eucjp2utf8.phpt delete mode 100644 ext/iconv/tests/skipif.inc delete mode 100644 ext/imap/CREDITS delete mode 100644 ext/imap/IMAP_Win32_HOWTO.txt delete mode 100644 ext/imap/config.m4 delete mode 100644 ext/imap/imap.dsp delete mode 100644 ext/imap/imap.h delete mode 100644 ext/imap/php_imap.c delete mode 100644 ext/imap/php_imap.h delete mode 100644 ext/informix/CREDITS delete mode 100644 ext/informix/Makefile.frag delete mode 100644 ext/informix/config.m4 delete mode 100644 ext/informix/ifx.dsp delete mode 100644 ext/informix/ifx.ec delete mode 100644 ext/informix/php_informix.h delete mode 100644 ext/informix/stub.c delete mode 100644 ext/ingres_ii/CREDITS delete mode 100644 ext/ingres_ii/EXPERIMENTAL delete mode 100644 ext/ingres_ii/README delete mode 100644 ext/ingres_ii/config.m4 delete mode 100644 ext/ingres_ii/ii.c delete mode 100644 ext/ingres_ii/ii.h delete mode 100644 ext/ingres_ii/ingres.dsp delete mode 100644 ext/ingres_ii/php_ii.h delete mode 100644 ext/interbase/CREDITS delete mode 100644 ext/interbase/config.m4 delete mode 100644 ext/interbase/interbase.c delete mode 100644 ext/interbase/interbase.dsp delete mode 100644 ext/interbase/php_interbase.h delete mode 100644 ext/interbase/tests/001.phpt delete mode 100644 ext/interbase/tests/002.phpt delete mode 100644 ext/interbase/tests/003.phpt delete mode 100644 ext/interbase/tests/004.phpt delete mode 100644 ext/interbase/tests/005.phpt delete mode 100644 ext/interbase/tests/006.phpt delete mode 100755 ext/interbase/tests/extension delete mode 100755 ext/interbase/tests/interbase.inc delete mode 100644 ext/java/CREDITS delete mode 100644 ext/java/EXPERIMENTAL delete mode 100644 ext/java/Makefile.in delete mode 100644 ext/java/README delete mode 100644 ext/java/config.m4 delete mode 100644 ext/java/except.php delete mode 100644 ext/java/java.c delete mode 100644 ext/java/java.dsp delete mode 100644 ext/java/jawt.php delete mode 100644 ext/java/jver.php delete mode 100644 ext/java/reflect.java delete mode 100644 ext/ldap/CREDITS delete mode 100644 ext/ldap/LDAP_Win32_HOWTO.txt delete mode 100644 ext/ldap/config.m4 delete mode 100644 ext/ldap/ldap.c delete mode 100644 ext/ldap/ldap.dsp delete mode 100644 ext/ldap/php_ldap.h delete mode 100644 ext/mailparse/CREDITS delete mode 100644 ext/mailparse/EXPERIMENTAL delete mode 100644 ext/mailparse/README delete mode 100644 ext/mailparse/config.m4 delete mode 100644 ext/mailparse/libs.mk delete mode 100755 ext/mailparse/mailparse.c delete mode 100644 ext/mailparse/mailparse_rfc822.h delete mode 100755 ext/mailparse/php_mailparse.h delete mode 100755 ext/mailparse/rfc2045.c delete mode 100755 ext/mailparse/rfc2045.h delete mode 100644 ext/mailparse/rfc2045acchk.c delete mode 100644 ext/mailparse/rfc2045acprep.c delete mode 100644 ext/mailparse/rfc2045appendurl.c delete mode 100755 ext/mailparse/rfc2045cdecode.c delete mode 100644 ext/mailparse/rfc2045decode.c delete mode 100644 ext/mailparse/rfc2045find.c delete mode 100755 ext/mailparse/rfc822.c delete mode 100644 ext/mailparse/rfc822_getaddr.c delete mode 100644 ext/mailparse/rfc822_getaddrs.c delete mode 100644 ext/mailparse/tests/001.phpt delete mode 100644 ext/mailparse/tests/002.phpt delete mode 100755 ext/mailparse/try.php delete mode 100644 ext/mbstring/CREDITS delete mode 100644 ext/mbstring/README_PHP3-i18n-ja delete mode 100644 ext/mbstring/config.m4 delete mode 100644 ext/mbstring/cp932_table.h delete mode 100644 ext/mbstring/mbfilter.c delete mode 100644 ext/mbstring/mbfilter.h delete mode 100644 ext/mbstring/mbfilter_ja.c delete mode 100644 ext/mbstring/mbfilter_ja.h delete mode 100644 ext/mbstring/mbregex.c delete mode 100644 ext/mbstring/mbregex.h delete mode 100644 ext/mbstring/mbstring.c delete mode 100644 ext/mbstring/mbstring.dsp delete mode 100644 ext/mbstring/mbstring.h delete mode 100644 ext/mbstring/php_mbregex.c delete mode 100644 ext/mbstring/tests/001.phpt delete mode 100644 ext/mbstring/tests/002.inc delete mode 100644 ext/mbstring/tests/002.phpt delete mode 100644 ext/mbstring/tests/003.inc delete mode 100644 ext/mbstring/tests/003.phpt delete mode 100644 ext/mbstring/tests/004.inc delete mode 100644 ext/mbstring/tests/004.phpt delete mode 100644 ext/mbstring/tests/005.inc delete mode 100644 ext/mbstring/tests/005.phpt delete mode 100644 ext/mbstring/tests/006.inc delete mode 100644 ext/mbstring/tests/006.phpt delete mode 100644 ext/mbstring/tests/007.inc delete mode 100644 ext/mbstring/tests/007.phpt delete mode 100644 ext/mbstring/tests/008.inc delete mode 100644 ext/mbstring/tests/008.phpt delete mode 100644 ext/mbstring/tests/009.inc delete mode 100644 ext/mbstring/tests/009.phpt delete mode 100644 ext/mbstring/tests/010.inc delete mode 100644 ext/mbstring/tests/010.phpt delete mode 100644 ext/mbstring/tests/011.inc delete mode 100644 ext/mbstring/tests/011.phpt delete mode 100644 ext/mbstring/tests/012.inc delete mode 100644 ext/mbstring/tests/012.phpt delete mode 100644 ext/mbstring/tests/013.inc delete mode 100644 ext/mbstring/tests/013.phpt delete mode 100644 ext/mbstring/tests/014.inc delete mode 100644 ext/mbstring/tests/014.phpt delete mode 100644 ext/mbstring/tests/015.inc delete mode 100644 ext/mbstring/tests/015.phpt delete mode 100644 ext/mbstring/tests/016.inc delete mode 100644 ext/mbstring/tests/016.phpt delete mode 100644 ext/mbstring/tests/017.inc delete mode 100644 ext/mbstring/tests/017.phpt delete mode 100644 ext/mbstring/tests/018.inc delete mode 100644 ext/mbstring/tests/018.phpt delete mode 100644 ext/mbstring/tests/019.inc delete mode 100644 ext/mbstring/tests/019.phpt delete mode 100644 ext/mbstring/tests/common.inc delete mode 100644 ext/mbstring/tests/skipif.inc delete mode 100644 ext/mbstring/unicode_table.h delete mode 100644 ext/mbstring/unicode_table_ja.h delete mode 100644 ext/mcal/CREDITS delete mode 100644 ext/mcal/config.m4 delete mode 100644 ext/mcal/php_mcal.c delete mode 100644 ext/mcal/php_mcal.h delete mode 100644 ext/mcrypt/CREDITS delete mode 100644 ext/mcrypt/TODO delete mode 100644 ext/mcrypt/config.m4 delete mode 100644 ext/mcrypt/mcrypt.c delete mode 100644 ext/mcrypt/mcrypt.dsp delete mode 100644 ext/mcrypt/php_mcrypt.h delete mode 100644 ext/mcrypt/tests/001.phpt delete mode 100644 ext/mcve/CREDITS delete mode 100644 ext/mcve/config.m4 delete mode 100644 ext/mcve/mcve.c delete mode 100644 ext/mcve/mcve.php delete mode 100644 ext/mcve/php_mcve.h delete mode 100644 ext/mcve/tests/001.phpt delete mode 100644 ext/mcve/tests/mcve_simple_test.php delete mode 100644 ext/mcve/tests/mcve_test1.php delete mode 100644 ext/mcve/tests/mcve_test2.php delete mode 100644 ext/mhash/CREDITS delete mode 100644 ext/mhash/config.m4 delete mode 100644 ext/mhash/mhash.c delete mode 100644 ext/mhash/mhash.dsp delete mode 100644 ext/mhash/php_mhash.h delete mode 100644 ext/ming/CREDITS delete mode 100644 ext/ming/EXPERIMENTAL delete mode 100644 ext/ming/config.m4 delete mode 100644 ext/ming/ming.c delete mode 100644 ext/ming/ming.dsp delete mode 100644 ext/ming/php_ming.h delete mode 100644 ext/mnogosearch/CREDITS delete mode 100644 ext/mnogosearch/README delete mode 100644 ext/mnogosearch/config.m4 delete mode 100644 ext/mnogosearch/index.php delete mode 100644 ext/mnogosearch/php_mnogo.c delete mode 100644 ext/mnogosearch/php_mnogo.h delete mode 100644 ext/msession/CREDITS delete mode 100644 ext/msession/README delete mode 100644 ext/msession/config.m4 delete mode 100644 ext/msession/msession-test.php delete mode 100644 ext/msession/msession.c delete mode 100644 ext/msession/msession.php delete mode 100644 ext/msession/php_msession.h delete mode 100644 ext/msession/reqclient.h delete mode 100644 ext/msql/CREDITS delete mode 100644 ext/msql/config.m4 delete mode 100644 ext/msql/msql.dsp delete mode 100644 ext/msql/php_msql.c delete mode 100644 ext/msql/php_msql.h delete mode 100644 ext/mssql/CREDITS delete mode 100644 ext/mssql/mssql.dsp delete mode 100644 ext/mssql/mssql_win32_howto.txt delete mode 100644 ext/mssql/php_mssql.c delete mode 100644 ext/mssql/php_mssql.h delete mode 100644 ext/mysql/CREDITS delete mode 100644 ext/mysql/config.m4 delete mode 100644 ext/mysql/libmysql/acinclude.m4 delete mode 100644 ext/mysql/libmysql/array.c delete mode 100644 ext/mysql/libmysql/bchange.c delete mode 100644 ext/mysql/libmysql/bmove.c delete mode 100644 ext/mysql/libmysql/bmove_upp.c delete mode 100644 ext/mysql/libmysql/charset.c delete mode 100644 ext/mysql/libmysql/config-win.h delete mode 100644 ext/mysql/libmysql/ctype.c delete mode 100644 ext/mysql/libmysql/ctype_autoconf.c delete mode 100644 ext/mysql/libmysql/ctype_extra_sources.c delete mode 100644 ext/mysql/libmysql/dbug.c delete mode 100644 ext/mysql/libmysql/dbug.h delete mode 100644 ext/mysql/libmysql/default.c delete mode 100644 ext/mysql/libmysql/dll.c delete mode 100644 ext/mysql/libmysql/errmsg.c delete mode 100644 ext/mysql/libmysql/errmsg.h delete mode 100644 ext/mysql/libmysql/errors.c delete mode 100755 ext/mysql/libmysql/fix_copyright delete mode 100644 ext/mysql/libmysql/get_password.c delete mode 100644 ext/mysql/libmysql/global.h delete mode 100644 ext/mysql/libmysql/int2str.c delete mode 100644 ext/mysql/libmysql/is_prefix.c delete mode 100644 ext/mysql/libmysql/libmysql.c delete mode 100644 ext/mysql/libmysql/libmysql.dsp delete mode 100644 ext/mysql/libmysql/list.c delete mode 100644 ext/mysql/libmysql/longlong2str.c delete mode 100644 ext/mysql/libmysql/m_ctype.h delete mode 100644 ext/mysql/libmysql/m_string.h delete mode 100644 ext/mysql/libmysql/mf_casecnv.c delete mode 100644 ext/mysql/libmysql/mf_dirname.c delete mode 100644 ext/mysql/libmysql/mf_fn_ext.c delete mode 100644 ext/mysql/libmysql/mf_format.c delete mode 100644 ext/mysql/libmysql/mf_loadpath.c delete mode 100644 ext/mysql/libmysql/mf_pack.c delete mode 100644 ext/mysql/libmysql/mf_path.c delete mode 100644 ext/mysql/libmysql/mf_unixpath.c delete mode 100644 ext/mysql/libmysql/mf_wcomp.c delete mode 100644 ext/mysql/libmysql/mulalloc.c delete mode 100644 ext/mysql/libmysql/my_alarm.h delete mode 100644 ext/mysql/libmysql/my_alloc.c delete mode 100644 ext/mysql/libmysql/my_compress.c delete mode 100644 ext/mysql/libmysql/my_config.h delete mode 100644 ext/mysql/libmysql/my_create.c delete mode 100644 ext/mysql/libmysql/my_delete.c delete mode 100644 ext/mysql/libmysql/my_dir.h delete mode 100644 ext/mysql/libmysql/my_div.c delete mode 100644 ext/mysql/libmysql/my_error.c delete mode 100644 ext/mysql/libmysql/my_fopen.c delete mode 100644 ext/mysql/libmysql/my_getwd.c delete mode 100644 ext/mysql/libmysql/my_init.c delete mode 100644 ext/mysql/libmysql/my_lib.c delete mode 100644 ext/mysql/libmysql/my_list.h delete mode 100644 ext/mysql/libmysql/my_malloc.c delete mode 100644 ext/mysql/libmysql/my_messnc.c delete mode 100644 ext/mysql/libmysql/my_net.c delete mode 100644 ext/mysql/libmysql/my_net.h delete mode 100644 ext/mysql/libmysql/my_once.c delete mode 100644 ext/mysql/libmysql/my_open.c delete mode 100644 ext/mysql/libmysql/my_pthread.c delete mode 100644 ext/mysql/libmysql/my_pthread.h delete mode 100644 ext/mysql/libmysql/my_read.c delete mode 100644 ext/mysql/libmysql/my_realloc.c delete mode 100644 ext/mysql/libmysql/my_static.c delete mode 100644 ext/mysql/libmysql/my_static.h delete mode 100644 ext/mysql/libmysql/my_sys.h delete mode 100644 ext/mysql/libmysql/my_tempnam.c delete mode 100644 ext/mysql/libmysql/my_thr_init.c delete mode 100644 ext/mysql/libmysql/my_wincond.c delete mode 100644 ext/mysql/libmysql/my_winthread.c delete mode 100644 ext/mysql/libmysql/my_write.c delete mode 100644 ext/mysql/libmysql/mysql.h delete mode 100644 ext/mysql/libmysql/mysql.m4 delete mode 100644 ext/mysql/libmysql/mysql_com.h delete mode 100644 ext/mysql/libmysql/mysql_version.h delete mode 100644 ext/mysql/libmysql/mysqld_error.h delete mode 100644 ext/mysql/libmysql/mysys_err.h delete mode 100644 ext/mysql/libmysql/mysys_priv.h delete mode 100644 ext/mysql/libmysql/net.c delete mode 100644 ext/mysql/libmysql/password.c delete mode 100644 ext/mysql/libmysql/raid.h delete mode 100644 ext/mysql/libmysql/safemalloc.c delete mode 100644 ext/mysql/libmysql/stamp-h.in delete mode 100644 ext/mysql/libmysql/str2int.c delete mode 100644 ext/mysql/libmysql/strcend.c delete mode 100644 ext/mysql/libmysql/strcont.c delete mode 100644 ext/mysql/libmysql/strend.c delete mode 100644 ext/mysql/libmysql/strfill.c delete mode 100644 ext/mysql/libmysql/string.c delete mode 100644 ext/mysql/libmysql/strinstr.c delete mode 100644 ext/mysql/libmysql/strmake.c delete mode 100644 ext/mysql/libmysql/strmov.c delete mode 100644 ext/mysql/libmysql/strnmov.c delete mode 100644 ext/mysql/libmysql/strto.c delete mode 100644 ext/mysql/libmysql/strtoll.c delete mode 100644 ext/mysql/libmysql/strtoull.c delete mode 100644 ext/mysql/libmysql/strxmov.c delete mode 100644 ext/mysql/libmysql/thr_alarm.h delete mode 100644 ext/mysql/libmysql/thr_mutex.c delete mode 100644 ext/mysql/libmysql/typelib.c delete mode 100755 ext/mysql/libmysql/update_sources delete mode 100644 ext/mysql/libmysql/violite.c delete mode 100644 ext/mysql/libmysql/violite.h delete mode 100644 ext/mysql/mysql.dsp delete mode 100644 ext/mysql/php_mysql.c delete mode 100644 ext/mysql/php_mysql.h delete mode 100644 ext/ncurses/CREDITS delete mode 100644 ext/ncurses/EXPERIMENTAL delete mode 100644 ext/ncurses/c-prototypes delete mode 100644 ext/ncurses/config.m4 delete mode 100644 ext/ncurses/example1.php delete mode 100644 ext/ncurses/ncurses.c delete mode 100644 ext/ncurses/ncurses.php delete mode 100644 ext/ncurses/ncurses_fe.c delete mode 100644 ext/ncurses/ncurses_functions.c delete mode 100644 ext/ncurses/php_ncurses.h delete mode 100644 ext/ncurses/php_ncurses_fe.h delete mode 100644 ext/ncurses/tests/001.phpt delete mode 100644 ext/notes/notes.dsp delete mode 100644 ext/notes/notes.dsw delete mode 100644 ext/notes/php_notes.c delete mode 100644 ext/notes/php_notes.h delete mode 100644 ext/oci8/CREDITS delete mode 100644 ext/oci8/config.m4 delete mode 100644 ext/oci8/oci8.c delete mode 100644 ext/oci8/oci8.dsp delete mode 100644 ext/oci8/oci8.dsw delete mode 100644 ext/oci8/php_oci8.h delete mode 100644 ext/odbc/CREDITS delete mode 100644 ext/odbc/birdstep.c delete mode 100644 ext/odbc/config.m4 delete mode 100644 ext/odbc/php_birdstep.h delete mode 100644 ext/odbc/php_odbc.c delete mode 100644 ext/odbc/php_odbc.h delete mode 100644 ext/openssl/CREDITS delete mode 100644 ext/openssl/EXPERIMENTAL delete mode 100644 ext/openssl/README delete mode 100644 ext/openssl/config.m4 delete mode 100644 ext/openssl/openssl.c delete mode 100644 ext/openssl/openssl.dsp delete mode 100644 ext/openssl/php_openssl.h delete mode 100644 ext/oracle/CREDITS delete mode 100644 ext/oracle/config.m4 delete mode 100644 ext/oracle/oracle.c delete mode 100644 ext/oracle/oracle.dsp delete mode 100644 ext/oracle/php_oracle.h delete mode 100644 ext/overload/CREDITS delete mode 100644 ext/overload/README delete mode 100644 ext/overload/config.m4 delete mode 100644 ext/overload/overload.c delete mode 100644 ext/overload/overload.dsp delete mode 100644 ext/overload/php_overload.h delete mode 100644 ext/ovrimos/CREDITS delete mode 100644 ext/ovrimos/config.m4 delete mode 100644 ext/ovrimos/ovrimos.c delete mode 100644 ext/ovrimos/php_ovrimos.h delete mode 100644 ext/pcntl/CREDITS delete mode 100644 ext/pcntl/EXPERIMENTAL delete mode 100644 ext/pcntl/README delete mode 100644 ext/pcntl/config.m4 delete mode 100755 ext/pcntl/pcntl.c delete mode 100644 ext/pcntl/php_pcntl.h delete mode 100644 ext/pcntl/php_signal.c delete mode 100644 ext/pcntl/php_signal.h delete mode 100755 ext/pcntl/test-pcntl.php delete mode 100644 ext/pcntl/tests/001.phpt delete mode 100644 ext/pcre/CREDITS delete mode 100644 ext/pcre/config.m4 delete mode 100644 ext/pcre/config0.m4 delete mode 100644 ext/pcre/pcrelib/AUTHORS delete mode 100644 ext/pcre/pcrelib/COPYING delete mode 100644 ext/pcre/pcrelib/ChangeLog delete mode 100644 ext/pcre/pcrelib/INSTALL delete mode 100644 ext/pcre/pcrelib/LICENCE delete mode 100644 ext/pcre/pcrelib/NEWS delete mode 100644 ext/pcre/pcrelib/NON-UNIX-USE delete mode 100644 ext/pcre/pcrelib/README delete mode 100755 ext/pcre/pcrelib/RunTest delete mode 100644 ext/pcre/pcrelib/chartables.c delete mode 100644 ext/pcre/pcrelib/dftables.c delete mode 100644 ext/pcre/pcrelib/dll.mk delete mode 100644 ext/pcre/pcrelib/doc/Tech.Notes delete mode 100644 ext/pcre/pcrelib/doc/pcre.3 delete mode 100644 ext/pcre/pcrelib/doc/pcre.html delete mode 100644 ext/pcre/pcrelib/doc/pcre.txt delete mode 100644 ext/pcre/pcrelib/doc/pcregrep.1 delete mode 100644 ext/pcre/pcrelib/doc/pcregrep.html delete mode 100644 ext/pcre/pcrelib/doc/pcregrep.txt delete mode 100644 ext/pcre/pcrelib/doc/pcreposix.3 delete mode 100644 ext/pcre/pcrelib/doc/pcreposix.html delete mode 100644 ext/pcre/pcrelib/doc/pcreposix.txt delete mode 100644 ext/pcre/pcrelib/doc/pcretest.txt delete mode 100644 ext/pcre/pcrelib/doc/perltest.txt delete mode 100644 ext/pcre/pcrelib/get.c delete mode 100644 ext/pcre/pcrelib/internal.h delete mode 100644 ext/pcre/pcrelib/maketables.c delete mode 100644 ext/pcre/pcrelib/pcre-config.in delete mode 100644 ext/pcre/pcrelib/pcre.c delete mode 100644 ext/pcre/pcrelib/pcre.def delete mode 100644 ext/pcre/pcrelib/pcre.h delete mode 100644 ext/pcre/pcrelib/pcregrep.c delete mode 100644 ext/pcre/pcrelib/pcreposix.c delete mode 100644 ext/pcre/pcrelib/pcreposix.h delete mode 100644 ext/pcre/pcrelib/pcretest.c delete mode 100755 ext/pcre/pcrelib/perltest delete mode 100755 ext/pcre/pcrelib/perltest8 delete mode 100644 ext/pcre/pcrelib/study.c delete mode 100644 ext/pcre/pcrelib/testdata/testinput1 delete mode 100644 ext/pcre/pcrelib/testdata/testinput2 delete mode 100644 ext/pcre/pcrelib/testdata/testinput3 delete mode 100644 ext/pcre/pcrelib/testdata/testinput4 delete mode 100644 ext/pcre/pcrelib/testdata/testinput5 delete mode 100644 ext/pcre/pcrelib/testdata/testinput6 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput1 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput2 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput3 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput4 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput5 delete mode 100644 ext/pcre/pcrelib/testdata/testoutput6 delete mode 100644 ext/pcre/php_pcre.c delete mode 100644 ext/pcre/php_pcre.h delete mode 100644 ext/pdf/CREDITS delete mode 100644 ext/pdf/config.m4 delete mode 100644 ext/pdf/pdf.c delete mode 100644 ext/pdf/pdf.dsp delete mode 100644 ext/pdf/php_pdf.h delete mode 100644 ext/pfpro/CREDITS delete mode 100644 ext/pfpro/TODO delete mode 100644 ext/pfpro/config.m4 delete mode 100644 ext/pfpro/pfpro.c delete mode 100644 ext/pfpro/php_pfpro.h delete mode 100644 ext/pgsql/CREDITS delete mode 100644 ext/pgsql/README delete mode 100644 ext/pgsql/config.m4 delete mode 100644 ext/pgsql/pgsql.c delete mode 100644 ext/pgsql/pgsql.dsp delete mode 100644 ext/pgsql/php_pgsql.h delete mode 100644 ext/pgsql/tests/01createdb.phpt delete mode 100644 ext/pgsql/tests/02connection.phpt delete mode 100644 ext/pgsql/tests/03sync_query.phpt delete mode 100644 ext/pgsql/tests/04async_query.phpt delete mode 100644 ext/pgsql/tests/05large_object.phpt delete mode 100644 ext/pgsql/tests/06copy.phpt delete mode 100644 ext/pgsql/tests/07optional.phpt delete mode 100644 ext/pgsql/tests/98old_api.phpt delete mode 100644 ext/pgsql/tests/9999dropdb.phpt delete mode 100644 ext/pgsql/tests/async_query.inc delete mode 100644 ext/pgsql/tests/config.inc delete mode 100644 ext/pgsql/tests/connection.inc delete mode 100644 ext/pgsql/tests/copy.inc delete mode 100644 ext/pgsql/tests/createdb.inc delete mode 100644 ext/pgsql/tests/dropdb.inc delete mode 100644 ext/pgsql/tests/large_object.inc delete mode 100644 ext/pgsql/tests/old_api.inc delete mode 100644 ext/pgsql/tests/optional.inc delete mode 100644 ext/pgsql/tests/skipif.inc delete mode 100644 ext/pgsql/tests/sync_query.inc delete mode 100644 ext/posix/CREDITS delete mode 100644 ext/posix/config.m4 delete mode 100644 ext/posix/php_posix.h delete mode 100644 ext/posix/posix.c delete mode 100644 ext/pspell/CREDITS delete mode 100644 ext/pspell/README delete mode 100644 ext/pspell/config.m4 delete mode 100644 ext/pspell/php_pspell.h delete mode 100644 ext/pspell/pspell.c delete mode 100644 ext/qtdom/CREDITS delete mode 100644 ext/qtdom/EXPERIMENTAL delete mode 100644 ext/qtdom/config.m4 delete mode 100644 ext/qtdom/qtdom.c delete mode 100644 ext/qtdom/qtdom.h delete mode 100644 ext/qtdom/qtdom.php delete mode 100644 ext/qtdom/qtdom_qt.cpp delete mode 100644 ext/qtdom/qtdom_qt.h delete mode 100644 ext/readline/CREDITS delete mode 100644 ext/readline/README.libedit delete mode 100644 ext/readline/config.m4 delete mode 100644 ext/readline/php_readline.h delete mode 100644 ext/readline/readline.c delete mode 100644 ext/recode/CREDITS delete mode 100644 ext/recode/config.m4 delete mode 100644 ext/recode/php_recode.h delete mode 100644 ext/recode/recode.c delete mode 100644 ext/rpc/CREDITS delete mode 100644 ext/rpc/EXPERIMENTAL delete mode 100644 ext/rpc/Makefile.in delete mode 100644 ext/rpc/com/CREDITS delete mode 100644 ext/rpc/com/TODO delete mode 100644 ext/rpc/com/com.c delete mode 100644 ext/rpc/com/com_wrapper.c delete mode 100644 ext/rpc/com/com_wrapper.h delete mode 100644 ext/rpc/com/conversion.c delete mode 100644 ext/rpc/com/conversion.h delete mode 100644 ext/rpc/com/php_com.h delete mode 100644 ext/rpc/com/php_variant.h delete mode 100644 ext/rpc/com/variant.c delete mode 100644 ext/rpc/com/variant.h delete mode 100644 ext/rpc/dotnet/CREDITS delete mode 100644 ext/rpc/dotnet/EXPERIMENTAL delete mode 100644 ext/rpc/dotnet/README delete mode 100644 ext/rpc/dotnet/dotnet.cpp delete mode 100644 ext/rpc/dotnet/dotnet.dsp delete mode 100644 ext/rpc/dotnet/dotnet.php delete mode 100644 ext/rpc/dotnet/php_dotnet.h delete mode 100644 ext/rpc/handler.h delete mode 100644 ext/rpc/java/CREDITS delete mode 100644 ext/rpc/java/EXPERIMENTAL delete mode 100644 ext/rpc/java/Makefile.in delete mode 100644 ext/rpc/java/README delete mode 100644 ext/rpc/java/config.m4 delete mode 100644 ext/rpc/java/except.php delete mode 100644 ext/rpc/java/java.c delete mode 100644 ext/rpc/java/java.dsp delete mode 100644 ext/rpc/java/jawt.php delete mode 100644 ext/rpc/java/jver.php delete mode 100644 ext/rpc/java/reflect.java delete mode 100644 ext/rpc/layer.h delete mode 100644 ext/rpc/php_rpc.h delete mode 100644 ext/rpc/rpc.c delete mode 100644 ext/rpc/rpc.dsp delete mode 100644 ext/rpc/rpc.h delete mode 100644 ext/rpc/tests/test1.php delete mode 100644 ext/rpc/xmlrpc/CREDITS delete mode 100644 ext/rpc/xmlrpc/EXPERIMENTAL delete mode 100644 ext/rpc/xmlrpc/config.m4 delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/README delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/acinclude.m4 delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/base64.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/base64.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/encodings.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/encodings.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/libs.mk delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/queue.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/queue.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/simplestring.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/simplestring.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/system_methods.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/system_methods_private.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_element.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_element.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_dandarpc.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_dandarpc.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_soap.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_soap.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_xmlrpc.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xml_to_xmlrpc.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc.m4 delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc_introspection.c delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc_introspection.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc_private.h delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/xmlrpc_win32.h delete mode 100644 ext/rpc/xmlrpc/php_config.h.in delete mode 100644 ext/rpc/xmlrpc/php_xmlrpc.h delete mode 100644 ext/rpc/xmlrpc/xmlrpc-epi-php.c delete mode 100644 ext/rpc/xmlrpc/xmlrpc.dsp delete mode 100644 ext/satellite/CREDITS delete mode 100644 ext/satellite/EXPERIMENTAL delete mode 100644 ext/satellite/README delete mode 100644 ext/session/CREDITS delete mode 100644 ext/session/config.m4 delete mode 100644 ext/session/mod_files.c delete mode 100644 ext/session/mod_files.h delete mode 100644 ext/session/mod_files.sh delete mode 100644 ext/session/mod_mm.c delete mode 100644 ext/session/mod_mm.h delete mode 100644 ext/session/mod_user.c delete mode 100644 ext/session/mod_user.h delete mode 100644 ext/session/php_session.h delete mode 100644 ext/session/session.c delete mode 100644 ext/session/tests/001.phpt delete mode 100644 ext/session/tests/002.phpt delete mode 100644 ext/session/tests/003.phpt delete mode 100644 ext/session/tests/004.phpt delete mode 100644 ext/session/tests/005.phpt delete mode 100644 ext/session/tests/006.phpt delete mode 100644 ext/session/tests/skipif.inc delete mode 100644 ext/shmop/CREDITS delete mode 100644 ext/shmop/README delete mode 100644 ext/shmop/config.m4 delete mode 100644 ext/shmop/php_shmop.h delete mode 100644 ext/shmop/shmop.c delete mode 100644 ext/shmop/shmop.dsp delete mode 100644 ext/skeleton/CREDITS delete mode 100644 ext/skeleton/EXPERIMENTAL delete mode 100755 ext/skeleton/create_stubs delete mode 100644 ext/skeleton/php_skeleton.h delete mode 100644 ext/skeleton/skeleton.c delete mode 100644 ext/skeleton/skeleton.php delete mode 100644 ext/skeleton/tests/001.phpt delete mode 100644 ext/snmp/CREDITS delete mode 100644 ext/snmp/config.m4 delete mode 100644 ext/snmp/php_snmp.h delete mode 100644 ext/snmp/snmp.c delete mode 100644 ext/snmp/snmp.dsp delete mode 100644 ext/snmp/winsnmp.c delete mode 100644 ext/sockets/CREDITS delete mode 100644 ext/sockets/EXPERIMENTAL delete mode 100644 ext/sockets/config.m4 delete mode 100644 ext/sockets/php_sockets.h delete mode 100644 ext/sockets/php_sockets_win.c delete mode 100644 ext/sockets/php_sockets_win.h delete mode 100644 ext/sockets/sockets.c delete mode 100644 ext/sockets/sockets.dsp delete mode 100644 ext/sockets/sockets.php delete mode 100644 ext/standard/CREDITS delete mode 100644 ext/standard/Makefile.frag delete mode 100644 ext/standard/aggregation.c delete mode 100644 ext/standard/aggregation.h delete mode 100644 ext/standard/array.c delete mode 100644 ext/standard/assert.c delete mode 100644 ext/standard/base64.c delete mode 100644 ext/standard/base64.h delete mode 100644 ext/standard/basic_functions.c delete mode 100644 ext/standard/basic_functions.h delete mode 100644 ext/standard/browscap.c delete mode 100644 ext/standard/config.m4 delete mode 100644 ext/standard/crc32.c delete mode 100644 ext/standard/crc32.h delete mode 100644 ext/standard/credits.c delete mode 100644 ext/standard/credits.h delete mode 100644 ext/standard/credits_ext.h delete mode 100644 ext/standard/credits_sapi.h delete mode 100644 ext/standard/crypt.c delete mode 100644 ext/standard/cyr_convert.c delete mode 100644 ext/standard/cyr_convert.h delete mode 100644 ext/standard/datetime.c delete mode 100644 ext/standard/datetime.h delete mode 100644 ext/standard/dir.c delete mode 100644 ext/standard/dl.c delete mode 100644 ext/standard/dl.h delete mode 100644 ext/standard/dns.c delete mode 100644 ext/standard/dns.h delete mode 100644 ext/standard/exec.c delete mode 100644 ext/standard/exec.h delete mode 100644 ext/standard/file.c delete mode 100644 ext/standard/file.h delete mode 100644 ext/standard/filestat.c delete mode 100644 ext/standard/flock_compat.c delete mode 100644 ext/standard/flock_compat.h delete mode 100644 ext/standard/formatted_print.c delete mode 100644 ext/standard/fsock.c delete mode 100644 ext/standard/fsock.h delete mode 100644 ext/standard/ftok.c delete mode 100644 ext/standard/ftp_fopen_wrapper.c delete mode 100644 ext/standard/head.c delete mode 100644 ext/standard/head.h delete mode 100644 ext/standard/html.c delete mode 100644 ext/standard/html.h delete mode 100644 ext/standard/http_fopen_wrapper.c delete mode 100644 ext/standard/image.c delete mode 100644 ext/standard/incomplete_class.c delete mode 100644 ext/standard/info.c delete mode 100644 ext/standard/info.h delete mode 100644 ext/standard/iptc.c delete mode 100644 ext/standard/lcg.c delete mode 100644 ext/standard/levenshtein.c delete mode 100644 ext/standard/link.c delete mode 100644 ext/standard/mail.c delete mode 100644 ext/standard/math.c delete mode 100644 ext/standard/md5.c delete mode 100644 ext/standard/md5.h delete mode 100644 ext/standard/metaphone.c delete mode 100644 ext/standard/microtime.c delete mode 100644 ext/standard/microtime.h delete mode 100644 ext/standard/pack.c delete mode 100644 ext/standard/pack.h delete mode 100644 ext/standard/pageinfo.c delete mode 100644 ext/standard/pageinfo.h delete mode 100644 ext/standard/parsedate.y delete mode 100644 ext/standard/php_array.h delete mode 100644 ext/standard/php_assert.h delete mode 100644 ext/standard/php_browscap.h delete mode 100644 ext/standard/php_crypt.h delete mode 100644 ext/standard/php_dir.h delete mode 100644 ext/standard/php_ext_syslog.h delete mode 100644 ext/standard/php_filestat.h delete mode 100644 ext/standard/php_fopen_wrapper.c delete mode 100644 ext/standard/php_fopen_wrappers.h delete mode 100644 ext/standard/php_ftok.h delete mode 100644 ext/standard/php_image.h delete mode 100644 ext/standard/php_incomplete_class.h delete mode 100644 ext/standard/php_iptc.h delete mode 100644 ext/standard/php_lcg.h delete mode 100644 ext/standard/php_link.h delete mode 100644 ext/standard/php_mail.h delete mode 100644 ext/standard/php_math.h delete mode 100644 ext/standard/php_metaphone.h delete mode 100644 ext/standard/php_parsedate.h delete mode 100644 ext/standard/php_rand.h delete mode 100644 ext/standard/php_smart_str.h delete mode 100644 ext/standard/php_smart_str_public.h delete mode 100644 ext/standard/php_standard.h delete mode 100644 ext/standard/php_string.h delete mode 100644 ext/standard/php_type.h delete mode 100644 ext/standard/php_var.h delete mode 100644 ext/standard/php_versioning.h delete mode 100644 ext/standard/quot_print.c delete mode 100644 ext/standard/quot_print.h delete mode 100644 ext/standard/rand.c delete mode 100644 ext/standard/reg.c delete mode 100644 ext/standard/reg.h delete mode 100644 ext/standard/scanf.c delete mode 100644 ext/standard/scanf.h delete mode 100644 ext/standard/soundex.c delete mode 100644 ext/standard/string.c delete mode 100644 ext/standard/strnatcmp.c delete mode 100644 ext/standard/syslog.c delete mode 100644 ext/standard/tests/aggregation/aggregate.lib delete mode 100644 ext/standard/tests/aggregation/aggregate.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_methods.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_methods_by_list.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_methods_by_regexp.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_properties.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_properties_by_list.phpt delete mode 100644 ext/standard/tests/aggregation/aggregate_properties_by_regexp.phpt delete mode 100644 ext/standard/tests/aggregation/aggregation_info.phpt delete mode 100644 ext/standard/tests/aggregation/deaggregate.phpt delete mode 100644 ext/standard/tests/array/001.phpt delete mode 100644 ext/standard/tests/array/array_data.txt delete mode 100644 ext/standard/tests/array/array_search.phpt delete mode 100644 ext/standard/tests/array/count_recursive.phpt delete mode 100644 ext/standard/tests/assert/assert.phpt delete mode 100644 ext/standard/tests/file/001.phpt delete mode 100644 ext/standard/tests/general_functions/001.phpt delete mode 100644 ext/standard/tests/general_functions/002.phpt delete mode 100644 ext/standard/tests/general_functions/003.phpt delete mode 100644 ext/standard/tests/general_functions/004.data delete mode 100644 ext/standard/tests/general_functions/004.phpt delete mode 100644 ext/standard/tests/general_functions/005.phpt delete mode 100644 ext/standard/tests/math/abs.phpt delete mode 100644 ext/standard/tests/math/floorceil.phpt delete mode 100644 ext/standard/tests/math/pow.phpt delete mode 100644 ext/standard/tests/math/round.phpt delete mode 100644 ext/standard/tests/reg/001.phpt delete mode 100644 ext/standard/tests/reg/002.phpt delete mode 100644 ext/standard/tests/reg/003.phpt delete mode 100644 ext/standard/tests/reg/004.phpt delete mode 100644 ext/standard/tests/reg/005.phpt delete mode 100644 ext/standard/tests/reg/006.phpt delete mode 100644 ext/standard/tests/reg/007.phpt delete mode 100644 ext/standard/tests/reg/008.phpt delete mode 100644 ext/standard/tests/reg/009.phpt delete mode 100644 ext/standard/tests/reg/010.phpt delete mode 100644 ext/standard/tests/reg/011.phpt delete mode 100644 ext/standard/tests/reg/012.phpt delete mode 100644 ext/standard/tests/reg/013.phpt delete mode 100644 ext/standard/tests/reg/014.phpt delete mode 100644 ext/standard/tests/reg/015.phpt delete mode 100644 ext/standard/tests/reg/016.phpt delete mode 100644 ext/standard/tests/serialize/001.phpt delete mode 100644 ext/standard/tests/serialize/002.phpt delete mode 100644 ext/standard/tests/strings/strtr.phpt delete mode 100644 ext/standard/tests/strings/trim.phpt delete mode 100644 ext/standard/tests/strings/wordwrap.phpt delete mode 100644 ext/standard/tests/time/001.phpt delete mode 100644 ext/standard/tests/time/002.phpt delete mode 100644 ext/standard/tests/versioning/version_compare.phpt delete mode 100644 ext/standard/type.c delete mode 100644 ext/standard/uniqid.c delete mode 100644 ext/standard/uniqid.h delete mode 100644 ext/standard/url.c delete mode 100644 ext/standard/url.h delete mode 100644 ext/standard/url_scanner.c delete mode 100644 ext/standard/url_scanner.h delete mode 100644 ext/standard/url_scanner_ex.c delete mode 100644 ext/standard/url_scanner_ex.h delete mode 100644 ext/standard/url_scanner_ex.re delete mode 100644 ext/standard/var.c delete mode 100644 ext/standard/var_unserializer.c delete mode 100644 ext/standard/var_unserializer.re delete mode 100644 ext/standard/versioning.c delete mode 100644 ext/swf/CREDITS delete mode 100644 ext/swf/config.m4 delete mode 100644 ext/swf/php_swf.h delete mode 100644 ext/swf/swf.c delete mode 100644 ext/sybase/CREDITS delete mode 100644 ext/sybase/config.m4 delete mode 100644 ext/sybase/php_sybase_db.c delete mode 100644 ext/sybase/php_sybase_db.h delete mode 100644 ext/sybase_ct/CREDITS delete mode 100644 ext/sybase_ct/config.m4 delete mode 100644 ext/sybase_ct/php_sybase_ct.c delete mode 100644 ext/sybase_ct/php_sybase_ct.h delete mode 100644 ext/sybase_ct/sybase_ct.dsp delete mode 100644 ext/sysvsem/CREDITS delete mode 100644 ext/sysvsem/config.m4 delete mode 100644 ext/sysvsem/php_sysvsem.h delete mode 100644 ext/sysvsem/sysvsem.c delete mode 100644 ext/sysvshm/CREDITS delete mode 100644 ext/sysvshm/config.m4 delete mode 100644 ext/sysvshm/php_sysvshm.h delete mode 100644 ext/sysvshm/sysvshm.c delete mode 100644 ext/tokenizer/CREDITS delete mode 100644 ext/tokenizer/EXPERIMENTAL delete mode 100644 ext/tokenizer/config.m4 delete mode 100644 ext/tokenizer/php_tokenizer.h delete mode 100644 ext/tokenizer/tokenizer.c delete mode 100644 ext/tokenizer/tokenizer.dsp delete mode 100644 ext/tokenizer/tokenizer.php delete mode 100644 ext/vpopmail/CREDITS delete mode 100644 ext/vpopmail/EXPERIMENTAL delete mode 100644 ext/vpopmail/README delete mode 100644 ext/vpopmail/config.m4 delete mode 100644 ext/vpopmail/php_vpopmail.c delete mode 100644 ext/vpopmail/php_vpopmail.h delete mode 100644 ext/w32api/CREDITS delete mode 100644 ext/w32api/EXPERIMENTAL delete mode 100644 ext/w32api/README delete mode 100644 ext/w32api/TODO delete mode 100644 ext/w32api/examples/uptime.php delete mode 100644 ext/w32api/php_w32api.h delete mode 100644 ext/w32api/test_dll/dll_test.h delete mode 100644 ext/w32api/test_dll/test.php delete mode 100644 ext/w32api/test_dll/test_dll.c delete mode 100644 ext/w32api/test_dll/test_dll.def delete mode 100644 ext/w32api/test_dll/test_dll.dsp delete mode 100644 ext/w32api/test_dll/test_dll.dsw delete mode 100644 ext/w32api/w32api.c delete mode 100644 ext/w32api/w32api.dsp delete mode 100644 ext/wddx/CREDITS delete mode 100644 ext/wddx/config.m4 delete mode 100644 ext/wddx/php_wddx.h delete mode 100644 ext/wddx/php_wddx_api.h delete mode 100644 ext/wddx/wddx.c delete mode 100644 ext/xml/CREDITS delete mode 100644 ext/xml/config.m4 delete mode 100644 ext/xml/expat/Changes delete mode 100644 ext/xml/expat/README delete mode 100644 ext/xml/expat/README.php delete mode 100644 ext/xml/expat/ascii.h delete mode 100644 ext/xml/expat/asciitab.h delete mode 100644 ext/xml/expat/expat.h delete mode 100644 ext/xml/expat/iasciitab.h delete mode 100644 ext/xml/expat/latin1tab.h delete mode 100644 ext/xml/expat/nametab.h delete mode 100644 ext/xml/expat/utf8tab.h delete mode 100644 ext/xml/expat/winconfig.h delete mode 100644 ext/xml/expat/xmlparse.c delete mode 100644 ext/xml/expat/xmlrole.c delete mode 100644 ext/xml/expat/xmlrole.h delete mode 100644 ext/xml/expat/xmltok.c delete mode 100644 ext/xml/expat/xmltok.h delete mode 100644 ext/xml/expat/xmltok_impl.c delete mode 100644 ext/xml/expat/xmltok_impl.h delete mode 100644 ext/xml/expat/xmltok_ns.c delete mode 100644 ext/xml/php_xml.h delete mode 100644 ext/xml/tests/001.phpt delete mode 100644 ext/xml/tests/002.phpt delete mode 100644 ext/xml/tests/003.phpt delete mode 100644 ext/xml/tests/004.phpt delete mode 100644 ext/xml/tests/006.phpt delete mode 100644 ext/xml/tests/007.phpt delete mode 100644 ext/xml/tests/inc.ent delete mode 100644 ext/xml/tests/skipif.inc delete mode 100644 ext/xml/tests/xmltest.xml delete mode 100644 ext/xml/xml.c delete mode 100644 ext/xmlrpc/CREDITS delete mode 100644 ext/xmlrpc/EXPERIMENTAL delete mode 100644 ext/xmlrpc/config.m4 delete mode 100644 ext/xmlrpc/libxmlrpc/README delete mode 100644 ext/xmlrpc/libxmlrpc/acinclude.m4 delete mode 100644 ext/xmlrpc/libxmlrpc/base64.c delete mode 100644 ext/xmlrpc/libxmlrpc/base64.h delete mode 100644 ext/xmlrpc/libxmlrpc/encodings.c delete mode 100644 ext/xmlrpc/libxmlrpc/encodings.h delete mode 100644 ext/xmlrpc/libxmlrpc/libs.mk delete mode 100644 ext/xmlrpc/libxmlrpc/queue.c delete mode 100644 ext/xmlrpc/libxmlrpc/queue.h delete mode 100644 ext/xmlrpc/libxmlrpc/simplestring.c delete mode 100644 ext/xmlrpc/libxmlrpc/simplestring.h delete mode 100644 ext/xmlrpc/libxmlrpc/system_methods.c delete mode 100644 ext/xmlrpc/libxmlrpc/system_methods_private.h delete mode 100644 ext/xmlrpc/libxmlrpc/xml_element.c delete mode 100644 ext/xmlrpc/libxmlrpc/xml_element.h delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_dandarpc.c delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_dandarpc.h delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_soap.c delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_soap.h delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c delete mode 100644 ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.h delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc.c delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc.h delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc.m4 delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc_introspection.c delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc_introspection.h delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.h delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc_private.h delete mode 100644 ext/xmlrpc/libxmlrpc/xmlrpc_win32.h delete mode 100644 ext/xmlrpc/php_config.h.in delete mode 100644 ext/xmlrpc/php_xmlrpc.h delete mode 100644 ext/xmlrpc/xmlrpc-epi-php.c delete mode 100644 ext/xmlrpc/xmlrpc.dsp delete mode 100644 ext/xslt/EXPERIMENTAL delete mode 100644 ext/xslt/README.XSLT-BACKENDS delete mode 100644 ext/xslt/config.m4 delete mode 100644 ext/xslt/php_sablot.h delete mode 100644 ext/xslt/php_xslt.h delete mode 100644 ext/xslt/sablot.c delete mode 100644 ext/xslt/tests/001.phpt delete mode 100644 ext/xslt/xslt.c delete mode 100644 ext/xslt/xslt.dsp delete mode 100644 ext/yaz/CREDITS delete mode 100644 ext/yaz/README delete mode 100644 ext/yaz/config.m4 delete mode 100644 ext/yaz/php_yaz.c delete mode 100644 ext/yaz/php_yaz.h delete mode 100644 ext/yaz/yaz.dsp delete mode 100644 ext/yp/CREDITS delete mode 100644 ext/yp/config.m4 delete mode 100644 ext/yp/php_yp.h delete mode 100644 ext/yp/yp.c delete mode 100644 ext/zip/CREDITS delete mode 100644 ext/zip/config.m4 delete mode 100644 ext/zip/php_zip.h delete mode 100644 ext/zip/tests/001.phpt delete mode 100644 ext/zip/zip.c delete mode 100644 ext/zlib/CREDITS delete mode 100644 ext/zlib/config0.m4 delete mode 100644 ext/zlib/php_zlib.h delete mode 100644 ext/zlib/tests/001.phpt delete mode 100644 ext/zlib/tests/002.phpt delete mode 100644 ext/zlib/tests/003.phpt delete mode 100644 ext/zlib/zlib.c delete mode 100644 ext/zlib/zlib.dsp delete mode 100644 ext/zlib/zlib_fopen_wrapper.c delete mode 100644 ext/zlib/zlib_win32_howto.txt delete mode 100644 footer delete mode 100755 genfiles delete mode 100644 header delete mode 100644 ltmain.sh delete mode 100644 main/Makefile.in delete mode 100644 main/SAPI.c delete mode 100644 main/SAPI.h delete mode 100644 main/alloca.c delete mode 100644 main/build-defs.h.in delete mode 100644 main/config.w32.h delete mode 100644 main/fopen_wrappers.c delete mode 100644 main/fopen_wrappers.h delete mode 100644 main/internal_functions.c.in delete mode 100644 main/internal_functions_registry.h delete mode 100644 main/logos.h delete mode 100644 main/main.c delete mode 100644 main/mergesort.c delete mode 100644 main/network.c delete mode 100644 main/output.c delete mode 100644 main/php.h delete mode 100644 main/php3_compat.h delete mode 100644 main/php_compat.h delete mode 100644 main/php_content_types.c delete mode 100644 main/php_content_types.h delete mode 100644 main/php_globals.h delete mode 100644 main/php_ini.c delete mode 100644 main/php_ini.h delete mode 100644 main/php_logos.c delete mode 100644 main/php_logos.h delete mode 100644 main/php_main.h delete mode 100644 main/php_network.h delete mode 100644 main/php_open_temporary_file.c delete mode 100644 main/php_open_temporary_file.h delete mode 100644 main/php_output.h delete mode 100644 main/php_realpath.c delete mode 100644 main/php_reentrancy.h delete mode 100644 main/php_regex.h delete mode 100644 main/php_sprintf.c delete mode 100755 main/php_streams.h delete mode 100644 main/php_syslog.h delete mode 100644 main/php_ticks.c delete mode 100644 main/php_ticks.h delete mode 100644 main/php_variables.c delete mode 100644 main/php_variables.h delete mode 100644 main/php_version.h delete mode 100644 main/reentrancy.c delete mode 100644 main/rfc1867.c delete mode 100644 main/rfc1867.h delete mode 100644 main/safe_mode.c delete mode 100644 main/safe_mode.h delete mode 100644 main/snprintf.c delete mode 100644 main/snprintf.h delete mode 100755 main/streams.c delete mode 100644 main/strlcat.c delete mode 100644 main/strlcpy.c delete mode 100644 main/win95nt.h delete mode 100755 makedist delete mode 100644 makerpm delete mode 100644 pear/Archive/Tar.php delete mode 100755 pear/CMD.php delete mode 100644 pear/CODING_STANDARDS delete mode 100644 pear/Console/Getopt.php delete mode 100644 pear/DB.php delete mode 100644 pear/HTTP.php delete mode 100644 pear/ITX.xml delete mode 100644 pear/Mail.php delete mode 100644 pear/Makefile.frag delete mode 100644 pear/PEAR.php delete mode 100644 pear/PEAR/Autoloader.php delete mode 100644 pear/PEAR/Command.php delete mode 100644 pear/PEAR/Command/Common.php delete mode 100644 pear/PEAR/Command/Install.php delete mode 100644 pear/PEAR/CommandResponse.php delete mode 100644 pear/PEAR/Common.php delete mode 100644 pear/PEAR/Config.php delete mode 100644 pear/PEAR/Dependency.php delete mode 100644 pear/PEAR/Installer.php delete mode 100644 pear/PEAR/Packager.php delete mode 100644 pear/PEAR/Registry.php delete mode 100644 pear/PEAR/Remote.php delete mode 100644 pear/PEAR/Uploader.php delete mode 100644 pear/PEAR/WebInstaller.php delete mode 100644 pear/README delete mode 100644 pear/System.php delete mode 100644 pear/catalog delete mode 100644 pear/install-pear.txt delete mode 100644 pear/package.dtd delete mode 100644 pear/pear.m4 delete mode 100644 pear/scripts/pear-get.in delete mode 100755 pear/scripts/pear.bat delete mode 100644 pear/scripts/pear.in delete mode 100644 pear/scripts/pearcmd-common.php delete mode 100644 pear/scripts/pearcmd-help.php delete mode 100644 pear/scripts/pearcmd-info.php delete mode 100644 pear/scripts/pearcmd-install.php delete mode 100644 pear/scripts/pearcmd-list.php delete mode 100644 pear/scripts/pearcmd-package.php delete mode 100644 pear/scripts/pearcmd-remote-list.php delete mode 100644 pear/scripts/pearcmd-show-config.php delete mode 100644 pear/scripts/pearcmd-uninstall.php delete mode 100644 pear/scripts/pearize.in delete mode 100644 pear/scripts/pearwin.php delete mode 100644 pear/scripts/php-config.in delete mode 100755 pear/scripts/phpextdist delete mode 100644 pear/scripts/phpize.in delete mode 100755 pear/scripts/phptar.in delete mode 100644 pear/tests/merge.input delete mode 100644 pear/tests/pear1.phpt delete mode 100644 pear/tests/pear_autoloader.phpt delete mode 100644 pear/tests/pear_config.phpt delete mode 100644 pear/tests/pear_error.phpt delete mode 100644 pear/tests/pear_error2.phpt delete mode 100644 pear/tests/pear_error3.phpt delete mode 100644 pear/tests/pear_error4.phpt delete mode 100644 pear/tests/pear_registry.phpt delete mode 100644 pear/tests/pear_system.phpt delete mode 100644 pear/tests/php.ini delete mode 100644 pear/tests/system.input delete mode 100644 pear/tests/toonew.conf delete mode 100644 pear/tests/user.input delete mode 100644 pear/tests/user2.input delete mode 100644 php.gif delete mode 100644 php.ini-dist delete mode 100644 php.ini-recommended delete mode 100644 php4.spec.in delete mode 100644 regex/COPYRIGHT delete mode 100644 regex/Makefile.in delete mode 100644 regex/README delete mode 100644 regex/WHATSNEW delete mode 100644 regex/cclass.h delete mode 100644 regex/cname.h delete mode 100644 regex/debug.c delete mode 100644 regex/debug.ih delete mode 100644 regex/engine.c delete mode 100644 regex/engine.ih delete mode 100644 regex/main.c delete mode 100644 regex/main.ih delete mode 100644 regex/mkh delete mode 100644 regex/regcomp.c delete mode 100644 regex/regcomp.ih delete mode 100644 regex/regerror.c delete mode 100644 regex/regerror.ih delete mode 100644 regex/regex.3 delete mode 100644 regex/regex.7 delete mode 100644 regex/regex.dsp delete mode 100644 regex/regex.dsw delete mode 100644 regex/regex.h delete mode 100644 regex/regex.mak delete mode 100644 regex/regex2.h delete mode 100644 regex/regex_extra.h delete mode 100644 regex/regexec.c delete mode 100644 regex/regfree.c delete mode 100644 regex/split.c delete mode 100644 regex/tests delete mode 100644 regex/utils.h delete mode 100755 run-tests.php delete mode 100644 sapi/aolserver/CREDITS delete mode 100644 sapi/aolserver/README delete mode 100644 sapi/aolserver/aolserver.c delete mode 100644 sapi/aolserver/config.m4 delete mode 100644 sapi/aolserver/php.sym delete mode 100644 sapi/aolserver/php4aolserver.dsp delete mode 100644 sapi/apache/CREDITS delete mode 100644 sapi/apache/apMakefile.libdir delete mode 100644 sapi/apache/apMakefile.tmpl delete mode 100644 sapi/apache/config.m4 delete mode 100644 sapi/apache/libphp4.module.in delete mode 100644 sapi/apache/mod_php4.c delete mode 100644 sapi/apache/mod_php4.exp delete mode 100644 sapi/apache/mod_php4.h delete mode 100644 sapi/apache/php.sym delete mode 100644 sapi/apache/php4apache.dsp delete mode 100644 sapi/apache/php_apache.c delete mode 100644 sapi/apache/php_apache_http.h delete mode 100644 sapi/apache/sapi_apache.c delete mode 100644 sapi/apache2filter/CREDITS delete mode 100644 sapi/apache2filter/README delete mode 100644 sapi/apache2filter/apache_config.c delete mode 100644 sapi/apache2filter/config.m4 delete mode 100644 sapi/apache2filter/php.sym delete mode 100644 sapi/apache2filter/php4apache2.dsp delete mode 100644 sapi/apache2filter/php_apache.h delete mode 100644 sapi/apache2filter/php_functions.c delete mode 100644 sapi/apache2filter/sapi_apache2.c delete mode 100644 sapi/caudium/CREDITS delete mode 100644 sapi/caudium/README delete mode 100644 sapi/caudium/TODO delete mode 100644 sapi/caudium/caudium.c delete mode 100644 sapi/caudium/config.m4 delete mode 100644 sapi/cgi/CREDITS delete mode 100644 sapi/cgi/cgi_main.c delete mode 100644 sapi/cgi/config.m4 delete mode 100644 sapi/cgi/getopt.c delete mode 100644 sapi/cgi/libfcgi/LICENSE.TERMS delete mode 100644 sapi/cgi/libfcgi/fcgi_stdio.c delete mode 100644 sapi/cgi/libfcgi/fcgiapp.c delete mode 100644 sapi/cgi/libfcgi/include/fastcgi.h delete mode 100644 sapi/cgi/libfcgi/include/fcgi_config.h delete mode 100644 sapi/cgi/libfcgi/include/fcgi_config_x86.h delete mode 100644 sapi/cgi/libfcgi/include/fcgi_stdio.h delete mode 100644 sapi/cgi/libfcgi/include/fcgiapp.h delete mode 100644 sapi/cgi/libfcgi/include/fcgiappmisc.h delete mode 100644 sapi/cgi/libfcgi/include/fcgimisc.h delete mode 100644 sapi/cgi/libfcgi/include/fcgio.h delete mode 100644 sapi/cgi/libfcgi/include/fcgios.h delete mode 100644 sapi/cgi/libfcgi/os_unix.c delete mode 100644 sapi/cgi/libfcgi/os_win32.c delete mode 100644 sapi/cgi/libfcgi/strerror.c delete mode 100644 sapi/cgi/php.sym delete mode 100644 sapi/cgi/php_getopt.h delete mode 100644 sapi/cli/CREDITS delete mode 100644 sapi/cli/README delete mode 100644 sapi/cli/config.m4 delete mode 100644 sapi/cli/getopt.c delete mode 100644 sapi/cli/php_cli.c delete mode 100644 sapi/cli/php_getopt.h delete mode 100644 sapi/fastcgi/CREDITS delete mode 100644 sapi/fastcgi/README.Apache delete mode 100644 sapi/fastcgi/README.FastCGI delete mode 100644 sapi/fastcgi/config.m4 delete mode 100644 sapi/fastcgi/fastcgi.c delete mode 100644 sapi/fastcgi/fastcgi.dsp delete mode 100644 sapi/fastcgi/php.sym delete mode 100644 sapi/fastcgi/php_fastcgi.h delete mode 100644 sapi/fastcgi/windows.txt delete mode 100644 sapi/fhttpd/CREDITS delete mode 100644 sapi/fhttpd/fhttpd.c delete mode 100644 sapi/isapi/CREDITS delete mode 100644 sapi/isapi/config.m4 delete mode 100644 sapi/isapi/php.sym delete mode 100644 sapi/isapi/php4isapi.c delete mode 100644 sapi/isapi/php4isapi.def delete mode 100644 sapi/isapi/php4isapi.dsp delete mode 100644 sapi/isapi/stresstest/getopt.c delete mode 100644 sapi/isapi/stresstest/getopt.h delete mode 100644 sapi/isapi/stresstest/notes.txt delete mode 100644 sapi/isapi/stresstest/stresstest.cpp delete mode 100644 sapi/isapi/stresstest/stresstest.dsp delete mode 100644 sapi/nsapi/CREDITS delete mode 100644 sapi/nsapi/config.m4 delete mode 100644 sapi/nsapi/nsapi-readme.txt delete mode 100644 sapi/nsapi/nsapi.c delete mode 100644 sapi/nsapi/php4nsapi.dsp delete mode 100644 sapi/phttpd/CREDITS delete mode 100644 sapi/phttpd/README delete mode 100644 sapi/phttpd/config.m4 delete mode 100644 sapi/phttpd/php.sym delete mode 100644 sapi/phttpd/php_phttpd.h delete mode 100644 sapi/phttpd/phttpd.c delete mode 100644 sapi/pi3web/CREDITS delete mode 100644 sapi/pi3web/README delete mode 100644 sapi/pi3web/config.m4 delete mode 100644 sapi/pi3web/php.sym delete mode 100644 sapi/pi3web/php4pi3web.dsp delete mode 100644 sapi/pi3web/pi3web_sapi.c delete mode 100644 sapi/pi3web/pi3web_sapi.h delete mode 100644 sapi/roxen/README delete mode 100644 sapi/roxen/TODO delete mode 100644 sapi/roxen/config.m4 delete mode 100644 sapi/roxen/roxen.c delete mode 100644 sapi/servlet/CREDITS delete mode 100644 sapi/servlet/EXPERIMENTAL delete mode 100644 sapi/servlet/Makefile.frag delete mode 100644 sapi/servlet/README delete mode 100644 sapi/servlet/config.m4 delete mode 100644 sapi/servlet/cookies.php delete mode 100644 sapi/servlet/date.php delete mode 100644 sapi/servlet/formatter.java delete mode 100644 sapi/servlet/jinfo.php delete mode 100644 sapi/servlet/jver.php delete mode 100644 sapi/servlet/reqheaders.php delete mode 100644 sapi/servlet/reqinfo.php delete mode 100644 sapi/servlet/reqparams.php delete mode 100644 sapi/servlet/servlet.c delete mode 100644 sapi/servlet/servlet.dsp delete mode 100644 sapi/servlet/servlet.java delete mode 100644 sapi/servlet/sessions.php delete mode 100644 sapi/servlet/web.xml delete mode 100644 sapi/thttpd/CREDITS delete mode 100644 sapi/thttpd/README delete mode 100644 sapi/thttpd/config.m4 delete mode 100644 sapi/thttpd/php.sym delete mode 100644 sapi/thttpd/php_thttpd.h delete mode 100644 sapi/thttpd/stub.c delete mode 100644 sapi/thttpd/thttpd.c delete mode 100644 sapi/thttpd/thttpd_patch delete mode 100644 sapi/tux/CREDITS delete mode 100644 sapi/tux/README delete mode 100644 sapi/tux/config.m4 delete mode 100644 sapi/tux/php.sym delete mode 100644 sapi/tux/php_tux.c delete mode 100644 sapi/webjames/CREDITS delete mode 100644 sapi/webjames/README delete mode 100644 sapi/webjames/config.m4 delete mode 100644 sapi/webjames/php_webjames.h delete mode 100644 sapi/webjames/webjames.c delete mode 100644 scan_makefile_in.awk delete mode 100755 scripts/apache/apconf-conv.sh delete mode 100755 scripts/apache/aphtaccess-conv.sh delete mode 100644 scripts/apache/conffix.awk delete mode 100644 scripts/apache/htaccessfix.awk delete mode 100755 scripts/config-stubs delete mode 100755 scripts/conv_proto delete mode 100755 scripts/conv_z_macros delete mode 100755 scripts/credits delete mode 100755 snapshot delete mode 100644 stamp-h.in delete mode 100644 strtok_r.c delete mode 100644 stub.c delete mode 100755 tests/README delete mode 100644 tests/basic/001.phpt delete mode 100644 tests/basic/002.phpt delete mode 100644 tests/basic/003.phpt delete mode 100644 tests/basic/004.phpt delete mode 100644 tests/basic/005.phpt delete mode 100644 tests/basic/006.phpt delete mode 100644 tests/basic/007.phpt delete mode 100644 tests/basic/008.phpt delete mode 100644 tests/basic/009.phpt delete mode 100644 tests/basic/010.phpt delete mode 100644 tests/basic/011.phpt delete mode 100644 tests/bin-info.inc delete mode 100644 tests/classes/class_example.phpt delete mode 100644 tests/classes/inheritance.phpt delete mode 100644 tests/dirname.phpt delete mode 100644 tests/foo delete mode 100644 tests/foo2 delete mode 100644 tests/foo3 delete mode 100644 tests/foo4 delete mode 100644 tests/func/001.phpt delete mode 100644 tests/func/002.phpt delete mode 100644 tests/func/003.phpt delete mode 100644 tests/func/004.phpt delete mode 100644 tests/func/005.phpt delete mode 100644 tests/lang/001.phpt delete mode 100644 tests/lang/002.phpt delete mode 100644 tests/lang/003.phpt delete mode 100644 tests/lang/004.phpt delete mode 100644 tests/lang/005.phpt delete mode 100644 tests/lang/006.phpt delete mode 100644 tests/lang/007.phpt delete mode 100644 tests/lang/008.phpt delete mode 100644 tests/lang/009.phpt delete mode 100644 tests/lang/010.phpt delete mode 100644 tests/lang/011.phpt delete mode 100644 tests/lang/012.phpt delete mode 100644 tests/lang/013.phpt delete mode 100644 tests/lang/014.phpt delete mode 100755 tests/lang/015.inc delete mode 100644 tests/lang/015.phpt delete mode 100755 tests/lang/016.inc delete mode 100644 tests/lang/016.phpt delete mode 100644 tests/lang/017.phpt delete mode 100644 tests/lang/018.phpt delete mode 100644 tests/lang/019.phpt delete mode 100644 tests/lang/020.phpt delete mode 100644 tests/lang/021.phpt delete mode 100644 tests/lang/022.phpt delete mode 100755 tests/lang/023-1.inc delete mode 100755 tests/lang/023-2.inc delete mode 100644 tests/lang/023.phpt delete mode 100644 tests/lang/024.phpt delete mode 100644 tests/lang/025.phpt delete mode 100644 tests/lang/026.phpt delete mode 100644 tests/lang/027.phpt delete mode 100644 tests/lang/028.phpt delete mode 100644 tests/lang/029.phpt delete mode 100644 tests/lang/030.phpt delete mode 100644 tests/odbc-display.php delete mode 100644 tests/odbc-t1.php delete mode 100644 tests/odbc-t2.php delete mode 100644 tests/odbc-t3.php delete mode 100644 tests/odbc-t4.php delete mode 100644 tests/odbc-t5.php delete mode 100644 tests/quicktester.inc delete mode 100644 tests/recurse delete mode 100644 tests/run.html delete mode 100644 tests/run.php delete mode 100644 tests/scan_cases delete mode 100644 tests/strings/001.phpt delete mode 100644 tests/strings/002.phpt delete mode 100644 tests/strings/003.phpt delete mode 100644 tests/test.php4 delete mode 100644 tests/test.pl delete mode 100644 tests/test_class_inheritance delete mode 100644 tests/testarray delete mode 100644 tests/testarray.pl delete mode 100644 tests/testarray2 delete mode 100644 tests/testarray2.pl delete mode 100644 tests/testclassfunc delete mode 100644 tests/testcom delete mode 100644 tests/testcpdf delete mode 100644 tests/testcpdfclock delete mode 100644 tests/testdom delete mode 100644 tests/testfe delete mode 100644 tests/testfunc delete mode 100644 tests/testfunc.pl delete mode 100644 tests/testfunc2 delete mode 100644 tests/testfunc2.pl delete mode 100644 tests/testfuncref delete mode 100644 tests/testhyperwave delete mode 100644 tests/testinclude delete mode 100644 tests/testobj delete mode 100644 tests/testpfpro.php delete mode 100644 tests/testscanf.php delete mode 100644 tests/testswf delete mode 100644 win32/crypt_win32.c delete mode 100644 win32/crypt_win32.h delete mode 100644 win32/flock.c delete mode 100644 win32/flock.h delete mode 100644 win32/grp.h delete mode 100644 win32/imap_sendmail.c delete mode 100644 win32/imap_sendmail.h delete mode 100644 win32/install.txt delete mode 100644 win32/param.h delete mode 100644 win32/php4.dsp delete mode 100644 win32/php4.dsw delete mode 100644 win32/php4dll.dsp delete mode 100644 win32/php4ts.dsp delete mode 100644 win32/php4ts.dsw delete mode 100644 win32/php4ts_cli.dsp delete mode 100644 win32/php5ts.dsw delete mode 100644 win32/php_modules.dsw delete mode 100644 win32/php_registry.h delete mode 100644 win32/pwd.c delete mode 100644 win32/pwd.h delete mode 100644 win32/pws-php4cgi.reg delete mode 100644 win32/pws-php4isapi.reg delete mode 100644 win32/readdir.c delete mode 100644 win32/readdir.h delete mode 100644 win32/registry.c delete mode 100644 win32/sendmail.c delete mode 100644 win32/sendmail.h delete mode 100644 win32/signal.h delete mode 100644 win32/syslog.h delete mode 100644 win32/testsuite.dsp delete mode 100644 win32/time.c delete mode 100644 win32/time.h delete mode 100644 win32/unistd.h delete mode 100644 win32/wfile.c delete mode 100644 win32/wfile.h delete mode 100644 win32/winutil.c delete mode 100644 win32/winutil.h delete mode 100644 win32/wsyslog.c diff --git a/CODING_STANDARDS b/CODING_STANDARDS deleted file mode 100644 index 55f402626cd..00000000000 --- a/CODING_STANDARDS +++ /dev/null @@ -1,226 +0,0 @@ -PHP Coding Standards -==================== - - -This file lists several standards that any programmer, adding or changing -code in PHP, should follow. Since this file was added at a very late -stage of the development of PHP v3.0, the code base does not (yet) fully -follow it, but it's going in that general direction. Since we are now -well into the version 4 releases, many sections have been recoded to use -these rules. - - -Code Implementation -------------------- - -[1] Functions that are given pointers to resources should not free them - -For instance, function int mail(char *to, char *from) should NOT free -to and/or from. -Exceptions: - - - The function's designated behavior is freeing that resource. E.g. efree() - - The function is given a boolean argument, that controls whether or not - the function may free its arguments (if true - the function must free its - arguments, if false - it must not) - - Low-level parser routines, that are tightly integrated with the token - cache and the bison code for minimum memory copying overhead. - -[2] Functions that are tightly integrated with other functions within the - same module, and rely on each other non-trivial behavior, should be - documented as such and declared 'static'. They should be avoided if - possible. - -[3] Use definitions and macros whenever possible, so that constants have - meaningful names and can be easily manipulated. The only exceptions - to this rule are 0 and 1, when used as false and true (respectively). - Any other use of a numeric constant to specify different behavior - or actions should be done through a #define. - -[4] When writing functions that deal with strings, be sure to remember - that PHP holds the length property of each string, and that it - shouldn't be calculated with strlen(). Write your functions in a such - a way so that they'll take advantage of the length property, both - for efficiency and in order for them to be binary-safe. - Functions that change strings and obtain their new lengths while - doing so, should return that new length, so it doesn't have to be - recalculated with strlen() (e.g. php_addslashes()) - -[5] Use php_error() to report any errors/warnings during code execution. - Use descriptive error messages, and try to avoid using identical - error strings for different stages of an error. For example, - if in order to obtain a URL you have to parse the URL, connect, - and retreive the text, assuming something can go wrong at each - of these stages, don't report an error "Unable to get URL" - on all of them, but instead, write something like "Unable - to parse URL", "Unable to connect to URL server" and "Unable - to fetch URL text", respectively. - -[6] NEVER USE strncat(). If you're absolutely sure you know what you're doing, - check its man page again, and only then, consider using it, and even then, - try avoiding it. - -[7] Use ZEND_* macros instead of PHP_* macros. Use of PHP_* macros is not - recommended. Since most of the PHP_* macros are ZEND_* macro aliases, using - the PHP_* macros makes browsing the source code with a tag search harder. - -[8] Use assert(). assert.h is included in php.h if it is available. Not only - does good assertion catch bugs, but it also helps with code readability. - -Naming Conventions ------------------- - -[1] Function names for user-level functions should be enclosed with in - the PHP_FUNCTION() macro. They should be in lowercase, with words - underscore delimited, with care taken to minimize the letter count. - Abbreviations should not be used when they greatly decrease the - readability of the function name itself. - - Good: - 'mcrypt_enc_self_test' - 'mysql_list_fields' - - Ok: - 'mcrypt_module_get_algo_supported_key_sizes' - (could be 'mcrypt_mod_get_algo_sup_key_sizes'?) - 'get_html_translation_table' - (could be 'html_get_trans_table'?) - - Bad: - 'hw_GetObjectByQueryCollObj' - 'pg_setclientencoding' - 'jf_n_s_i' - - -[2] If they are part of a "parent set" of functions, that parent should - be included in the user function name, and should be clearly related - to the parent program or function family. This should be in the form - of parent_*. - - A family of 'foo' functions, for example: - Good: - 'foo_select_bar' - 'foo_insert_baz' - 'foo_delete_baz' - - Bad: - 'fooselect_bar' - 'fooinsertbaz' - 'delete_foo_baz' - -[3] Function names used by user functions should be prefixed - with "_php_", and followed by a word or an underscore-delimited list of - words, in lowercase letters, that describes the function. If applicable, - they should be declared 'static'. - -[4] Variable names must be meaningful. One letter variable names must be - avoided, except for places where the variable has no real meaning or - a trivial meaning (e.g. for (i=0; i<100; i++) ...). - -[5] Variable names should be in lowercase. Use underscores to separate - between words. - - -Syntax and indentation ----------------------- - -[1] Never use C++ style comments (i.e. // comment). Always use C-style - comments instead. PHP is written in C, and is aimed at compiling - under any ANSI-C compliant compiler. Even though many compilers - accept C++-style comments in C code, you have to ensure that your - code would compile with other compilers as well. - The only exception to this rule is code that is Win32-specific, - because the Win32 port is MS-Visual C++ specific, and this compiler - is known to accept C++-style comments in C code. - -[2] Use K&R-style. Of course, we can't and don't want to - force anybody to use a style he or she is not used to, but, - at the very least, when you write code that goes into the core - of PHP or one of its standard modules, please maintain the K&R - style. This applies to just about everything, starting with - indentation and comment styles and up to function declaration - syntax. - - (see also http://www.tuxedo.org/~esr/jargon/html/entry/indent-style.html) - -[3] Be generous with whitespace and braces. Always prefer: - - if (foo) { - bar; - } - - to: - - if(foo)bar; - - Keep one empty line between the variable declaration section and - the statements in a block, as well as between logical statement - groups in a block. Maintain at least one empty line between - two functions, preferably two. - -[4] When indenting, use the tab character. A tab is expected to represent - four spaces. It is important to maintain consistency in indenture so - that definitions, comments, and control structures line up correctly. - -Documentation and Folding Hooks -------------------------------- - -In order to make sure that the online documentation stays in line with -the code, each user-level function should have its user-level function -prototype before it along with a brief one-line description of what the -function does. It would look like this: - -/* {{{ proto int abs(int number) - Returns the absolute value of the number */ -PHP_FUNCTION(abs) -{ - ... -} -/* }}} */ - -The {{{ symbols are the default folding symbols for the folding mode in -Emacs and vim (set fdm=marker). Folding is very useful when dealing with -large files because you can scroll through the file quickly and just unfold -the function you wish to work on. The }}} at the end of each function marks -the end of the fold, and should be on a separate line. - -The "proto" keyword there is just a helper for the doc/genfuncsummary script -which generates a full function summary. Having this keyword in front of the -function prototypes allows us to put folds elsewhere in the code without -messing up the function summary. - -Optional arguments are written like this: - -/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]]) - Returns a header object with the defined parameters */ - -And yes, please keep the prototype on a single line, even if that line -is massive. - -New and Experimental Functions ------------------------------------ -To reduce the problems normally associated with the first public -implementation of a new set of functions, it has been suggested -that the first implementation include a file labeled 'EXPERIMENTAL' -in the function directory, and that the functions follow the -standard prefixing conventions during their initial implementation. - -The file labelled 'EXPERIMENTAL' should include the following -information: - Any authoring information (known bugs, future directions of the module). - Ongoing status notes which may not be appropriate for CVS comments. - -Aliases & Legacy Documentation ------------------------------------ -You may also have some deprecated aliases with close to duplicate -names, for example, somedb_select_result and somedb_selectresult. For -documentation purposes, these will only be documented by the most -current name, with the aliases listed in the documentation for -the parent function. For ease of reference, user-functions with -completely different names, that alias to the same function (such as -highlight_file and show_source), will be separately documented. The -proto should still be included, describing which function is aliased. - -Backwards compatible functions and names should be maintained as long -as the code can be reasonably be kept as part of the codebase. See -/phpdoc/README for more information on documentation. diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 345084885c4..00000000000 --- a/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -For the list of people who've put work into PHP 4.0, please see -http://www.php.net/credits.php diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index fb19540784e..00000000000 --- a/ChangeLog +++ /dev/null @@ -1,5388 +0,0 @@ -2002-03-15 Harald Radi - - * ext/rpc/com/com.c - ext/rpc/rpc.dsp - ext/rpc/rpc.h - ext/rpc/tests/test1.php - ext/rpc/handler.h - ext/rpc/php_rpc.h - ext/rpc/rpc.c: ongoing development ... - -2002-03-15 Jani Taskinen - - * NEWS: MFH - - * NEWS: This entry belongs under 4.2.0. - -2002-03-15 Harald Radi - - * NEWS: MFH - -2002-03-15 Wez Furlong - - * main/php_network.h - main/php_streams.h - main/streams.c - tests/strings/003.phpt - main/fopen_wrappers.c - main/fopen_wrappers.h - main/internal_functions.c.in - main/main.c - main/network.c - ext/zlib/zlib_fopen_wrapper.c - ext/standard/http_fopen_wrapper.c - ext/standard/image.c - ext/standard/info.c - ext/standard/php_fopen_wrapper.c - ext/standard/php_fopen_wrappers.h - ext/standard/php_image.h - ext/zlib/php_zlib.h - ext/zlib/zlib.c - ext/standard/exec.c - ext/standard/file.c - ext/standard/file.h - ext/standard/fsock.c - ext/standard/fsock.h - ext/standard/ftp_fopen_wrapper.c - ext/standard/html.c - ext/standard/html.h - ext/standard/basic_functions.c - ext/pgsql/pgsql.c - ext/recode/recode.c - ext/ming/ming.c - ext/pdf/pdf.c - ext/mailparse/mailparse.c - ext/hyperwave/hw.c - ext/interbase/interbase.c - ext/ftp/ftp.c - ext/ftp/ftp.h - ext/ftp/php_ftp.c - ext/gd/gd.c - ext/exif/exif.c - ext/bz2/bz2.c - ext/curl/curl.c - configure.in: New PHP streams... - -2002-03-15 Harald Radi - - * ext/com/COM.c: MFH - - * ext/com/COM.c: - fixed a bug that caused php to crash in php_COM_get_ids_of_names() (Harald, Paul) - -2002-03-15 Jani Taskinen - - * NEWS: MFH - - * NEWS: - Corrected these entries. (catched by Derick) - - * NEWS: - - Fixed grammar, made some entries make more sense...etc. (proof read please :) - -2002-03-15 Derick Rethans - - * ext/domxml/php_domxml.c: - Fix proto (again) - - * ext/domxml/php_domxml.c: - proto fixes - -2002-03-15 jim winstead - - * main/php.h: don't redefine NDEBUG if it is already defined. yeesh. - -2002-03-15 Daniela Mariaschi - - * ext/interbase/php_interbase.h - ext/interbase/interbase.c: added new ibase_fetch_assoc() php function - -2002-03-15 Stig Bakken - - * ext/xmlrpc/config.m4 - ext/xslt/config.m4: * MFH: "new and improved" iconv test - - * ext/iconv/config.m4: * MFH: yet another iconv fix - - * ext/xslt/config.m4 - ext/xmlrpc/config.m4: * "new and improved" iconv test - -2002-03-15 Harald Radi - - * ext/rpc/handler.h - ext/rpc/php_rpc.h - ext/rpc/rpc.c - ext/rpc/rpc.h: fixed HashTable allocation - -2002-03-15 Stig Bakken - - * ext/dba/config.m4: * fix for db3 from ports on freebsd - -2002-03-15 Marcus Börger - - * sapi/cli/CREDITS: -2002-03-15 Andi Gutmans - - * main/php.h: - - Revert assert fix until it becomes clear what was wrong with my previous - - fix. I don't see any warnings when building with VC++ English. - -2002-03-15 Stig Bakken - - * ext/iconv/config.m4: - * yet another iconv config fix, should be able to handle most or all - configurations now (giconv/iconv, static libs only, iconv in libc etc.) - -2002-03-15 Yasuo Ohgaki - - * main/php.h: Avoid warnings under VC. - - * NEWS: Added some fix. Clean up a bit. - -2002-03-15 Wez Furlong - - * ext/standard/var.c: it's late; no more commits from me tonight... - - * ext/standard/var.c: should have diffed first... - - * ext/standard/var.c: fix for ZE2 compile - -2002-03-15 Harald Radi - - * ext/rpc/.cvsignore - ext/rpc/CREDITS - ext/rpc/EXPERIMENTAL - ext/rpc/README - ext/rpc/com/com.c - ext/rpc/handler.h - ext/rpc/layer.h - ext/rpc/php_rpc.h - ext/rpc/rpc.c - ext/rpc/rpc.dsp - ext/rpc/tests/test1.php: rpc apstraction module - does only work with ZendEngine2 - -2002-03-14 Rasmus Lerdorf - - * main/safe_mode.c: MFH of safe_mode.c typo - -2002-03-14 Derick Rethans - - * ext/standard/var.c: - Fix bug #16078 - -2002-03-14 Zeev Suraski - - * ext/standard/info.c: Change case for consistency - - * ext/standard/info.c: MFH - -2002-03-14 Stefan Esser - - * main/safe_mode.c: fixed a typo within checkuid - -2002-03-14 Andi Gutmans - - * main/config.w32.h: - - Define HAVE_ASSERT_H under Windows. There was a macro redefinition before - - this. - -2002-03-14 Zeev Suraski - - * main/php_version.h - configure.in: - Good suggestion, but I'm not sure we want to start receiving bug - reports with that version - -2002-03-14 Wez Furlong - - * ext/standard/var.c: fix buglet - -2002-03-14 Sterling Hughes - - * main/php_version.h - configure.in: update version - -2002-03-14 Zeev Suraski - - * configure.in - main/php_version.h: Childish, are we? - -2002-03-14 Jani Taskinen - - * configure.in - main/php_version.h: - Fixed version - -2002-03-14 Zeev Suraski - - * ext/standard/info.c: Make it clearer what this entry means - - * configure.in - main/php_version.h: Fix version number - -2002-03-14 Derick Rethans - - * ext/xmlrpc/xmlrpc-epi-php.c: - Whitespace part 1 - -2002-03-14 Stefan Esser - - * ext/filepro/filepro.c: fixed: last commit had debug code in it - - * ext/filepro/filepro.c: fixed whitespace - fixed lots of possible bufferoverflows - fixed memoryleak - -2002-03-14 Sebastian Bergmann - - * sapi/apache2filter/README - sapi/apache2filter/sapi_apache2.c: MFH (Apache2Filter update). - -2002-03-14 Yasuo Ohgaki - - * ext/standard/var.c: Fixed var_dump() crash when there is recursion. - -2002-03-14 Stefan Roehrich - - * NEWS: Added NEWS entry for gzencode() change. - - * NEWS: Fixed NEWS entry, make it consistent with other entries. - -2002-03-14 Sebastian Bergmann - - * sapi/apache2filter/README: - Add note on which version of Apache 2 this SAPI module is compatible with. - -2002-03-14 Sean Bright - - * CODING_STANDARDS: Translate to English. - -2002-03-14 Yasuo Ohgaki - - * main/php.h - CODING_STANDARDS - configure.in: Include/enable assert.h/assert() when it is available - -2002-03-14 Jani Taskinen - - * main/config.w32.h: MFH fix for the include_path issue - - * main/config.w32.h: - - Fixed bug: #16047, #15865, and propably a few more.. - -2002-03-13 Ludovico Magnocavallo - - * pear/DB/ibase.php: fixed typo in modifyLimitQuery() - beginning of error code interpretation for tests compliance - -2002-03-13 Stefan Roehrich - - * NEWS: Fixed NEWS entry. - - * ext/zlib/tests/003.phpt - ext/zlib/zlib.c: Fix for #15930 in release branch. - - * ext/zlib/tests/001.phpt - ext/zlib/zlib.c: Fix for #14939 in release branch. - -2002-03-13 Marcus Börger - - * sapi/cli/php_cli.c: -release merge - -2002-03-13 Jason Greene - - * ext/standard/credits_ext.h: Regenerate Credits for Release - - * scripts/credits - ext/overload/CREDITS - ext/w32api/CREDITS: Merge credits fixes - - * ext/overload/CREDITS - ext/w32api/CREDITS: Fix CREDIT files, remove email address - - * scripts/credits: Ignore extensions/sapis named skeleton - -2002-03-13 Sascha Schumann - - * acinclude.m4: > might not sufficiently update a timestamp. - - echo > should be good enough and should be implemented by the shell. - -2002-03-13 Sebastian Bergmann - - * ext/standard/credits_ext.h: Fix credits. - -2002-03-13 Jason Greene - - * ext/standard/credits_sapi.h: Update credits in release branch - - * ext/standard/credits_sapi.h: Update Credits - - * ext/standard/credits_ext.h: Update Credits in release branch - - * ext/standard/credits_ext.h: Update Credits - -2002-03-13 Sascha Schumann - - * ext/session/session.c: - Because of the feature "don't try to send a cookie, if the sid - was contained in get/post variables" (which I still am not convinced - of completely), we need a separate variable which determines whether - to define SID in the event that a cookie was not sent. - - Noticed by: Matt Allen - - * acinclude.m4: Some simplifications in PHP_ADD_SOURCES* - - * pear/pear.m4 - acinclude.m4 - configure.in: - a bit of refactoring and making always_shared a nop in every day life - -2002-03-13 Stig Bakken - - * ext/xmlrpc/config.m4 - ext/xslt/config.m4: * MFH: another libconv->libiconv typo - - * ext/xmlrpc/config.m4 - ext/xslt/config.m4: * another libconv->libiconv typo - -2002-03-13 Sascha Schumann - - * pear/pear.m4 - acinclude.m4 - configure.in: - Provide context-specific functions which yield the directories - of extensions (PHP 4 configure vs. self-contained module) - - * ext/cpdf/config.m4 - ext/cybercash/config.m4: - Fix leftovers from yesterday (s/PHP_EXTENSION/PHP_NEW_EXTENSION/). - -2002-03-13 Christian Stocker - - * ext/domxml/php_domxml.c: - Return attribute name in node_name(), if it's a XML_ATTRIBUTE_NODE - - * ext/domxml/php_domxml.c: - Return #document in node_name(), if it's a XML_DOCUMENT_NODE - -2002-03-13 Sebastian Bergmann - - * sapi/apache2filter/sapi_apache2.c: Sync with Apache2 Filter API change. - -2002-03-13 Boian Bonev - - * ext/vpopmail/php_vpopmail.c: fix all comments in protos - -2002-03-13 Wez Furlong - - * ext/standard/aggregation.c: - I've altered my diagnosis of segfault/leak problem - - * ext/standard/aggregation.c: - Fix some issues with ZE2, but now have some leaks. - -2002-03-13 Tomas V.V.Cox - - * pear/tests/pear_error.phpt: No more lines on this test - - * pear/PEAR.php: phpdoc update - - * pear/PEAR.php - pear/tests/pear_error3.phpt: - Fix error handling selection when both class and global are set - -2002-03-13 Yasuo Ohgaki - - * ext/mbstring/mbfilter.c: Fixed a compiler warning - -2002-03-13 Marcus Börger - - * ext/exif/tests/001.phpt: -remove filetime from test - - * ext/exif/exif.c: -handling - - * ext/exif/tests/001.phpt: -remove filetime from test - -2002-03-12 Thomas V.V.Cox - - * pear/DB/pgsql.php: - Updated the regex of simpleQuery to support "(" and new lines - -2002-03-12 Andi Gutmans - - * ext/standard/aggregation.c: - Compile fixes for Engine 2 - - * ext/sybase_ct/php_sybase_ct.c - ext/sybase/php_sybase_db.c - ext/standard/var_unserializer.re - ext/standard/browscap.c - ext/standard/var_unserializer.c - ext/pgsql/pgsql.c - ext/odbc/php_odbc.c - ext/mysql/php_mysql.c - ext/mssql/php_mssql.c - ext/msql/php_msql.c - ext/fbsql/php_fbsql.c: - - Allow duality between Engine 1 & 2 using ZEND_STANDARD_CLASS_DEF_PTR - -2002-03-12 Frank M. Kromann - - * main/config.w32.h: - Changed to PHP_CONFIG_FILE_PATH use the environment variable SystemRoot - -2002-03-12 Sascha Schumann - - * ext/zlib/config0.m4: missed zlib.c - - * ext/mysql/libmysql/Makefile.in - ext/mysql/Makefile.in: nuke old makefiles - - * ext/aspell/Makefile.in - ext/aspell/config.m4 - ext/cpdf/config.m4 - ext/cpdf/Makefile.in: php_new_extension - - * ext/xmlrpc/Makefile.in - ext/xmlrpc/libxmlrpc/Makefile.in: old makefiles - - * ext/readline/Makefile.in - ext/readline/config.m4: php_new_extension - - * ext/pcre/Makefile.in - ext/pcre/pcrelib/Makefile.in: remove old makefiles - - * ext/odbc/Makefile.in - ext/odbc/config.m4 - ext/pcntl/config.m4 - ext/pcntl/Makefile.in - ext/ncurses/Makefile.in - ext/ncurses/config.m4 - ext/hyperwave/config.m4 - ext/hyperwave/Makefile.in: php_new_extension - - * ext/db/config.m4: forgot to add _NEW_ - - * ext/db/config.m4 - ext/db/Makefile.in - ext/cybercash/config.m4 - ext/cybercash/Makefile.in: php_new_extension - - * ext/xml/expat/Makefile.in - ext/xml/Makefile.in: Remove old Makefile templates - - * ext/ctype/Makefile.in - ext/ctype/config.m4: - extension converted automatically to PHP_NEW_EXTENSION. Manually confirmed - -2002-03-12 Marcus Börger - - * ext/exif/exif.c - ext/exif/test.txt - ext/exif/tests/001.phpt: -usability - -tests - -2002-03-12 Sascha Schumann - - * ext/zlib/config0.m4 - ext/zlib/Makefile.in: php_new_extension - - * ext/zip/Makefile.in - ext/zip/config.m4 - ext/yp/Makefile.in - ext/yp/config.m4 - ext/yaz/Makefile.in - ext/yaz/config.m4 - ext/xslt/Makefile.in - ext/xslt/config.m4 - ext/wddx/Makefile.in - ext/wddx/config.m4 - ext/vpopmail/Makefile.in - ext/vpopmail/config.m4 - ext/tokenizer/Makefile.in - ext/tokenizer/config.m4 - ext/sysvshm/Makefile.in - ext/sysvshm/config.m4 - ext/sysvsem/Makefile.in - ext/sysvsem/config.m4 - ext/sybase_ct/Makefile.in - ext/sybase_ct/config.m4 - ext/sybase/Makefile.in - ext/sybase/config.m4 - ext/swf/Makefile.in - ext/swf/config.m4 - ext/sockets/Makefile.in - ext/sockets/config.m4 - ext/snmp/Makefile.in - ext/snmp/config.m4 - ext/shmop/Makefile.in - ext/shmop/config.m4 - ext/recode/Makefile.in - ext/recode/config.m4 - ext/qtdom/Makefile.in - ext/qtdom/config.m4 - ext/pspell/Makefile.in - ext/pspell/config.m4 - ext/posix/Makefile.in - ext/posix/config.m4 - ext/pgsql/Makefile.in - ext/pgsql/config.m4 - ext/pfpro/Makefile.in - ext/pfpro/config.m4 - ext/pdf/Makefile.in - ext/pdf/config.m4 - ext/ovrimos/Makefile.in - ext/ovrimos/config.m4 - ext/overload/Makefile.in - ext/overload/config.m4 - ext/oracle/Makefile.in - ext/oracle/config.m4 - ext/openssl/Makefile.in - ext/openssl/config.m4 - ext/oci8/Makefile.in - ext/oci8/config.m4 - ext/muscat/Makefile.in - ext/muscat/config.m4 - ext/msql/Makefile.in - ext/msql/config.m4 - ext/msession/Makefile.in - ext/msession/config.m4 - ext/mnogosearch/Makefile.in - ext/mnogosearch/config.m4 - ext/ming/Makefile.in - ext/ming/config.m4 - ext/mhash/Makefile.in - ext/mhash/config.m4 - ext/mcve/Makefile.in - ext/mcve/config.m4 - ext/mcrypt/Makefile.in - ext/mcrypt/config.m4 - ext/mcal/Makefile.in - ext/mcal/config.m4 - ext/mbstring/Makefile.in - ext/mbstring/config.m4 - ext/mailparse/Makefile.in - ext/mailparse/config.m4: - extension converted automatically to PHP_NEW_EXTENSION. Manually confirmed - - * ext/ircg/config.m4: add makefile fragment manually - - * ext/ldap/Makefile.in - ext/ldap/config.m4 - ext/ircg/Makefile.in - ext/ircg/config.m4 - ext/interbase/Makefile.in - ext/interbase/config.m4: - extension converted automatically to PHP_NEW_EXTENSION. Manually confirmed - - * ext/informix/config.m4: add makefile fragment manually - - * ext/ingres_ii/Makefile.in - ext/ingres_ii/config.m4 - ext/informix/Makefile.in - ext/informix/config.m4 - ext/imap/Makefile.in - ext/imap/config.m4 - ext/icap/Makefile.in - ext/icap/config.m4 - ext/gmp/Makefile.in - ext/gmp/config.m4 - ext/gettext/Makefile.in - ext/gettext/config.m4 - ext/gd/Makefile.in - ext/gd/config.m4 - ext/ftp/Makefile.in - ext/ftp/config.m4 - ext/fribidi/Makefile.in - ext/fribidi/config.m4 - ext/filepro/Makefile.in - ext/filepro/config.m4 - ext/fdf/Makefile.in - ext/fdf/config.m4 - ext/fbsql/Makefile.in - ext/fbsql/config.m4 - ext/domxml/Makefile.in - ext/domxml/config.m4 - ext/dio/Makefile.in - ext/dio/config.m4 - ext/dbx/Makefile.in - ext/dbx/config.m4 - ext/dbplus/Makefile.in - ext/dbplus/config.m4 - ext/dbase/Makefile.in - ext/dbase/config.m4 - ext/dba/Makefile.in - ext/dba/config.m4 - ext/cyrus/Makefile.in - ext/cyrus/config.m4 - ext/cybermut/Makefile.in - ext/cybermut/config.m4 - ext/curl/Makefile.in - ext/curl/config.m4 - ext/crack/Makefile.in - ext/crack/config.m4 - ext/ccvs/Makefile.in - ext/ccvs/config.m4 - ext/calendar/Makefile.in - ext/calendar/config.m4 - ext/bz2/Makefile.in - ext/bz2/config.m4 - ext/exif/Makefile.in - ext/exif/config.m4: - extension converted automatically to PHP_NEW_EXTENSION. Manually confirmed - - * ext/Makefile.in: unused file - -2002-03-12 Stig Bakken - - * ext/iconv/config.m4: - * MFH: fix compile problem on platforms without iconv in libc - - * ext/iconv/config.m4: - * fix compile problem on platforms without iconv in libc - -2002-03-12 Marcus Börger - - * ext/exif/exif.c: -return size of thumbnail even if it not read - -2002-03-12 Stefan Roehrich - - * ext/zlib/tests/003.phpt - ext/zlib/zlib.c: - (PHP gzencode) Reimplementation of gzencode(). Now works as documented - (gzencode(string data [, int level [, int encoding_mode]])), - should fix #15930. - - * ext/zlib/tests/001.phpt - ext/zlib/zlib.c: - (PHP gzinflate) Workaround for bug #14939 (buffer error in gzinflate()). - Fixed prototype and added test for #14939. - - -2002-03-12 Marcus Börger - - * ext/exif/tests/001.phpt: -reflect changes - -find image from run-tests.php - -2002-03-12 Christian Stocker - - * ext/domxml/php_domxml.c: forgot SEPARATE_ZVAL, produced segfaults. - segfaulted only in 4_2_0 (not in HEAD and 4_0_7, strange...) - -2002-03-12 Andreas Karajannis - - * ext/odbc/config.m4: - Removed sqlrte from SAP DB liblist as it is not needed. - -2002-03-12 Yasuo Ohgaki - - * README.TESTING: Catch up with recent test scripts changes - -2002-03-12 Markus Fischer - - * ext/domxml/php_domxml.c: - Remove *FETCH() statements. - - Clean up WS and parenthesis indentation. - -2002-03-12 Christian Stocker - - * ext/domxml/php_domxml.c: - nicer (optional) formated output in dump_mem and dump_mem_file - -2002-03-12 Sebastian Bergmann - - * ext/standard/array.c: Fix TSRMLS_CC. - -2002-03-12 Yasuo Ohgaki - - * ext/standard/string.c: Change php_addslashes() a little. - Since most users do not use magic_quote_sybase, be nicer to - users not using magic_quote_sybase. - - * ext/standard/array.c: Make use of TSRMLS_C/D - - * tests/bin-info.inc - run-tests.php: - Fix PHP version and sapi printed so that it does not print bogus - version and sapi name. - -2002-03-12 Marcus Börger - - * EXTENSIONS: -reflect new state of ext/exif - - * ext/exif/php_exif.h - ext/exif/exif.c - ext/exif/test.txt: -support for array tags - -better memory handling - -support for thumbnails in TIFF format - -new functions exif_imagetype - - * ext/standard/image.c - ext/standard/php_image.h: -fixed bug 15174 - -support for some broken jpegs: bug 13213 - -better memory handling - -initial jpeg2000 support (only jpc not jp2,jb2,jpx) - -2002-03-12 Yasuo Ohgaki - - * pear/DB/tests/driver/setup.inc: - Make pear tests find scripts needed at least. - -2002-03-12 Marcus Börger - - * ext/standard/image.c: -merged a wrong line - -one compiling issue - -2002-03-12 Yasuo Ohgaki - - * ext/session/tests/skipif.inc: Add missing skipif.inc - - * run-tests.php: - Do not search php binary in search path, since we are not testing older builds. - Print SAPI used. - - * run-tests.php: Use CGI binary when CGI SAPI is there. - Make "php run-tests.php" work with cli SAPI. - -2002-03-12 Jani Taskinen - - * ext/odbc/php_odbc.h: MFH - - * ext/odbc/php_odbc.h: - Fix more possible bugs (bug #16008 related) - -2002-03-11 Derick Rethans - - * ext/imap/php_imap.h: - MFH for bug #16008 - - * ext/imap/php_imap.h: - fix bug #16008 - -2002-03-11 Christian Stocker - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: - implemented domxml_elem_get_elements_by_tagname - new function domxml_doc_get_elements_by_tagname - new function domxml_doc_get_element_by_id (chregu) - -2002-03-11 Markus Fischer - - * ext/iconv/iconv.c: - Slightly unify error/warning messages. - - Switch to zend_parse_parameters(). - - Fix whitespaces. - -2002-03-11 Marcus Börger - - * EXTENSIONS: -Change status of ext/exif - - * ext/standard/image.c - ext/standard/php_image.h - ext/exif/exif.c: -fixes: memory handling & corrupted files - -2002-03-11 Shane Caraveo - - * win32/php4ts.dsp: fix on more build config - -2002-03-11 Sander Roobol - - * ext/bz2/bz2.c - ext/mcve/mcve.c: Maintain headers - -2002-03-11 Marcus Börger - - * sapi/cli/CREDITS - sapi/cli/php_cli.c: -passing arguments to CLI, see: php -h - -2002-03-11 Stig Bakken - - * Makefile.global: * make "make test TESTS=..." work again - - * pear/PEAR/Registry.php: * added file locking - * added file name to package map - -2002-03-11 Yasuo Ohgaki - - * ext/pgsql/pgsql.c: Print function names in error messages - -2002-03-11 Ben Mansell - - * sapi/fastcgi/README.Apache: - Instructions for using FastCGI-PHP with Apache - - * sapi/fastcgi/README.FastCGI: - Improved documentation for FastCGI SAPI. Documents the environment - variable tunings and the new command line usage. - - * sapi/fastcgi/fastcgi.c: - Add command line option to FastCGI SAPI to make it bind & listen to a - socket. This makes setting up 'remote' fastcgi much easier. - -2002-03-11 Sascha Schumann - - * ext/xml/config.m4: - Add global include path, so that other extensions can access - the expat header. - - * pear/Makefile.frag - configure.in: Invoke pear-related targets conditionally and - rename install-data-local target to install-pear. - Also remove PEAR_DIR, because it is unused. - - * configure.in: Use standard PHP shell check syntax - - * configure.in: - You don't need a C++ compiler to build 100% of PHP (and the largest part of - the extensions), so I don't see a reason why PHP should not build on - a system without a C++ compiler. - - If your extension uses C++ objects, put PHP_REQUIRE_CXX into your - config.m4. - - This should also be removed from the 4.2.0 branch, because it will - cause portability problems otherwise. - - * sapi/thttpd/README: MFH: refining supported thttpd version - - * sapi/thttpd/README: Add a note regarding which version we support - -2002-03-11 Sebastian Bergmann - - * sapi/cgi/libfcgi/os_win32.c: Fix warning, hope this is okay. - -2002-03-11 Shane Caraveo - - * win32/php4ts.dsp: fix include paths for fcgi headers - -2002-03-11 Yasuo Ohgaki - - * ext/pgsql/pgsql.c: WS and indent - - * ext/pgsql/pgsql.c: - Add comments for constants. Remove unneeded constants included by mistake. - - * ext/standard/reg.c: Small memory leak fix that does not matter much. - - * ext/pgsql/pgsql.c: Fix possible build error under Windows. - -2002-03-11 Sebastian Bergmann - - * ext/standard/math.c: Fix thread-safe build. - -2002-03-11 Jason Greene - - * ext/sockets/sockets.c: Fix WS - -2002-03-10 jim winstead - - * ext/standard/math.c: - handle numeric strings. this means we're less picky about the argument - types, but the math functions aren't generally that picky. - -2002-03-10 Markus Fischer - - * ext/standard/syslog.c: - Fix protos. - - * ext/iconv/iconv.c: - MFH fix for #15799. - -2002-03-10 Shane Caraveo - - * win32/php4ts.dsp: fix output directory - - * sapi/cgi/cgi_main.c: woohoo, take some credit! - - * sapi/cgi/cgi_main.c: - children should be zero by default, enable by setting PHP_FCGI_CHILDREN env var. - - * win32/php4ts.dsp: - Update makefile for compiling with fastcgi under windows - - * sapi/cgi/libfcgi/LICENSE.TERMS - sapi/cgi/libfcgi/fcgi_stdio.c - sapi/cgi/libfcgi/fcgiapp.c - sapi/cgi/libfcgi/include/fastcgi.h - sapi/cgi/libfcgi/include/fcgi_config.h - sapi/cgi/libfcgi/include/fcgi_config_x86.h - sapi/cgi/libfcgi/include/fcgi_stdio.h - sapi/cgi/libfcgi/include/fcgiapp.h - sapi/cgi/libfcgi/include/fcgiappmisc.h - sapi/cgi/libfcgi/include/fcgimisc.h - sapi/cgi/libfcgi/include/fcgio.h - sapi/cgi/libfcgi/include/fcgios.h - sapi/cgi/libfcgi/os_unix.c - sapi/cgi/libfcgi/os_win32.c - sapi/cgi/libfcgi/strerror.c - sapi/cgi/cgi_main.c: combine fastcgi capability with regular cgi binary - include fastcgi library for ease of windows builds - NOTE: included fastcgi library is modified for thread safety, but - fastcgi support in cgi_main.c is only written for single - threaded serving. This does not present any issue for using - fastcgi. - -2002-03-10 Rui Hirokawa - - * ext/mbstring/tests/007.phpt: fixed wrong include file. - - * ext/mbstring/tests/skipif.inc: fixed module name iconv->mbstring. - -2002-03-10 Stefan Esser - - * main/rfc1867.c: Fix: Now returns correct Content-Type for Opera 6.01 - - * main/rfc1867.c: Fix: Now returns correct Content-Type with Opera 6.01 - -2002-03-10 Markus Fischer - - * ext/iconv/iconv.c: - Fix crash in iconv_set_encoding(). [Closes #15799] - -2002-03-10 Jani Taskinen - - * ext/standard/tests/aggregation/aggregate.lib - ext/standard/tests/aggregation/aggregate.lib.php - ext/standard/tests/aggregation/aggregate.phpt - ext/standard/tests/aggregation/aggregate_methods.phpt - ext/standard/tests/aggregation/aggregate_methods_by_list.phpt - ext/standard/tests/aggregation/aggregate_methods_by_regexp.phpt - ext/standard/tests/aggregation/aggregate_properties.phpt - ext/standard/tests/aggregation/aggregate_properties_by_list.phpt - ext/standard/tests/aggregation/aggregate_properties_by_regexp.phpt - ext/standard/tests/aggregation/aggregation_info.phpt - ext/standard/tests/aggregation/deaggregate.phpt: - - Renamed aggregate.lib.php -> aggregate.lib (.php files are always deleted bycvsclean) - -2002-03-09 Jani Taskinen - - * Makefile.in - build/rules.mk: - Fixed bug #15748 (fixed otherwise in 4.3.0-dev) - - * ext/domxml/config.m4: MFH fix for bug #15686 and some exslt fix. - - * ext/domxml/config.m4: - Fixed bug: #15686 - - * ext/ming/config.m4: MFH fix for #15190 - - * ext/ming/config.m4: - Fixed bug: #15190 - -2002-03-09 Thomas V.V.Cox - - * pear/DB/IDEAS: more wishes :-) - -2002-03-09 Ludovico Magnocavallo - - * pear/DB/STATUS: updated status for ibase with working tests - - * pear/DB/tests/ibase/05sequences.phpt: new test, passed - -2002-03-09 Sander Roobol - - * ext/standard/datetime.c: - Oops... 1 digit is allowed too! Reverting my fix. - -2002-03-09 Stig Bakken - - * pear/HTML/Form.php: * added addPlain() by Ted Shieh - -2002-03-09 Jason Greene - - * ext/sockets/sockets.c: MFH: Recent Bug Fixes - - * ext/sockets/sockets.c: Fix build on win32 - - * ext/sockets/sockets.c: - Fixed bug where NULL specified in sec was not waiting infinately as it should - Fixed bug where socket_select was not producing an error message on error - Fixed bug where -1 was getting returned instead of FALSE in socket_recv(), - socket_send(), socket_sendto(), and socket_select() - -2002-03-09 Jani Taskinen - - * main/main.c: MFH - - * ext/ctype/ctype.c: MFH the MacosX compile fix. - - * ext/session/session.c: whitespace.. - - * main/main.c: - - Commented out the space escaping. Works now as it did before. - -2002-03-08 Joseph Tate - - * ext/domxml/php_domxml.c: - - Fixed a coredump involved in the domxml_unlink() function. Refer to bug #14522 - for more details. - -2002-03-08 Christian Stocker - - * ext/domxml/php_domxml.c: - implemented domxml_elem_get_attribute_node(attrname) (chregu) - -2002-03-08 Marcus Börger - - * ext/exif/exif.c: -support for out of section data - -2002-03-08 Sander Roobol - - * tests/basic/003.phpt - tests/basic/004.phpt - tests/basic/005.phpt - ext/session/tests/001.phpt - ext/session/tests/002.phpt - ext/session/tests/003.phpt - ext/session/tests/004.phpt - ext/session/tests/005.phpt - ext/session/tests/006.phpt - pear/tests/pear_error.phpt - tests/basic/002.phpt - ext/exif/tests/002.phpt - ext/gmp/tests/002.phpt: Fixed many tests, mostly incorrect paths. - -2002-03-08 Joseph Tate - - * ext/domxml/config.m4: - Added linking files to make build compatible with RH 7.2's updated libxslt - packages. Should not break when compiling with older versions. This may - fix bug #15942 as well. - Configure was giving a Warning message without these lines when --with-xslt was - specified. - -2002-03-08 Sander Roobol - - * ext/standard/datetime.c: - (php_date) Fixed 'r' modifier to always return two digits for the day - value (see RFC 822) (#15952). - -2002-03-08 Sascha Schumann - - * ext/ircg/ircg.c: - Add identifier which terminates a connection upon receiving a specific - CTCP message. The message must come from the specified user or will - be ignored. This can be used to disconnect a large number of users - when an event adjourns. - - Improve error reporting by notifying the IRC server why a HTTP - connection failed. - - Fix a prototype comment - - * ext/ircg/config.m4: - Adding an existing fragment is implicitly done by PHP_EXTENSION - -2002-03-08 Ludovico Magnocavallo - - * pear/DB/TESTERS: added interbase tester (myself) =) - - * pear/DB/STATUS: - changed status of ibase error mapping support to implemented, but without tests - - * pear/DB/tests/ibase/02fetch.phpt - pear/DB/tests/ibase/03simplequery.phpt - pear/DB/tests/ibase/04numcols.phpt - pear/DB/tests/ibase/06prepexec.phpt - pear/DB/tests/ibase/10errormap.phpt - pear/DB/tests/ibase/connect.inc - pear/DB/tests/ibase/mktable.inc - pear/DB/tests/ibase/skipif.inc: - all tests working except tests 6 and 10, still broken - - * pear/DB/ibase.php: beginning of error mapping support for Interbase - added ibaseRaiseError() method and errorcode_map hash - -2002-03-08 Hartmut Holzgraefe - - * ext/ctype/ctype.c: - reimplementation using macro instead of function pointer ( Bug #15951 ) - -2002-03-08 Marcus Börger - - * ext/exif/test.txt - ext/exif/example.php - ext/exif/exif.c: -change IsColor from non zero to 1 - -new test and example for documentation - -2002-03-08 Christian Stocker - - * ext/domxml/php_domxml.c: - domxml_elem_remove_attribute(attibutename) is now implemented (chregu) - -2002-03-08 Edin Kadribasic - - * sapi/cli/php_cli.c: Cleaned up previous commit. - - * sapi/cli/php_cli.c: - - Added -r option to the CLI version of PHP which executes a piece of PHP - code directly from the commmand line. - -2002-03-08 Christian Stocker - - * ext/domxml/php_domxml.c: - added formatting option to domxml_dump_mem() (chregu) - -2002-03-08 Jani Taskinen - - * main/main.c: - MFH (fix for the phpinfo() output) - -2002-03-08 Marcus Börger - - * ext/exif/tests/001.phpt: -Changes according to exif.c 1.55 - - * ext/exif/exif.c: -Support for IFD Arrays - - * ext/exif/exif.c - ext/standard/image.c: TIFF support for 'non' digicam files - -2002-03-07 Joseph Tate - - * ext/domxml/php_domxml.c: - Commented out a few lines that were causing a segfault in the unlink code. - This fixes bug #14522. I've tested that it does not cause a segfault under - RH 7.2, and retains all functionality. I recommend that this patch be - considered for the PHP_4_2_0 tree as well, as having a function that core - dumps every time is a bad thing(TM). - -2002-03-07 Rui Hirokawa - - * ext/gd/config.m4: revert my patch to fix freetype2 related problem. - -2002-03-07 Jani Taskinen - - * main/main.c: - - Fixed the phpinfo() tables not to blow up when using very long - configure line. - - * ext/exif/exif.c: - - Fixed some compile warnings and removed bogus comments. - -2002-03-07 Sascha Schumann - - * ext/session/tests/001.phpt - ext/session/tests/003.phpt - ext/session/tests/004.phpt - ext/session/tests/005.phpt - ext/session/tests/006.phpt: - These tests currently depend on register_globals=1 - -2002-03-07 Jason Greene - - * NEWS: Merge News Entry - - * NEWS: News update - -2002-03-07 Sascha Schumann - - * Makefile.global: remove -module, it is added by configure.in - - * Makefile.global: Update test target from rules.mk - -2002-03-07 Jon Parise - - * ext/ftp/ftp.c: MFH r1.45: header file correction - -2002-03-07 Jason Greene - - * ext/mysql/config.m4 - ext/mysql/libmysql/libmysql.c: - Disallow mysql's 'LOAD LOCAL' when safe mode is enabled - -2002-03-07 Sascha Schumann - - * Makefile.global: Readd ZEND_EXTRA_LIBS (as in Makefile.in rev 1.106). - -2002-03-07 Jon Parise - - * ext/ftp/ftp.c: - Correct the header file ordering. From 'man 3 inet' (FreeBSD 4.5): - - -2002-03-07 Derick Rethans - - * build/build2.mk: - Fix typo in warning suppressor - -2002-03-07 Frank M. Kromann - - * main/config.w32.h: Revert uppercase directory name to lower case. - -2002-03-07 Sascha Schumann - - * configure.in: ze2 handling - -2002-03-07 Frank M. Kromann - - * main/config.w32.h - win32/crypt_win32.c - win32/crypt_win32.h - win32/php4dllts.dsp: Enabling crypt() on Win32 - -2002-03-07 Sascha Schumann - - * configure.in: Build libphp4.la as a module which can be dlopened. - - This should not make a difference on common platforms, - but maybe esoteric ones. - -2002-03-07 Joseph Tate - - * ext/domxml/php_domxml.c: - Reverting the reverted patch. I hope this is the last time. No added functionality. Just a bug fix of #15918 - - * ext/domxml/php_domxml.c: - Reverting patch at Derick's request. Reverted to 1.118 - -2002-03-07 Sascha Schumann - - * acinclude.m4: Fix typo - -2002-03-07 Frank M. Kromann - - * ext/mbstring/unicode_table.h - ext/mbstring/unicode_table_ja.h - ext/mbstring/cp932_table.h - ext/mbstring/mbfilter.c - ext/mbstring/mbfilter_ja.c - ext/mbstring/mbstring.dsp: Making mbstring compile under WIn32 - -2002-03-07 Joseph Tate - - * ext/domxml/php_domxml.c: - Added type attributes to XML_DTD_NODE and XML_ATTRIBUTE_NODE element types. - Reported in bug #15918. - -2002-03-07 Sascha Schumann - - * NEWS: some more information - -2002-03-07 Sebastian Bergmann - - * NEWS: Add NEWS entry for the new build system. - -2002-03-07 Joseph Tate - - * ext/domxml/php_domxml.c: - Added type attribute wrappers to the remaining node types that did not have - them. I.e. XML_ATTRIBUTE_NODE and XML_CDATA_SECTION_NODE. Mentioned in - Bug #15918. - - * ext/domxml/TODO: - Added TODO item to modify new_child so that more than just element nodes - can be created. - -2002-03-07 Derick Rethans - - * ext/standard/var_unserializer.c: - Remove CVS things - -2002-03-07 Sascha Schumann - - * ext/standard/var_unserializer.c: touch file - - * configure.in: From APR CVS. - - fitz 02/03/07 07:37:09 - - Modified: build apr_hints.m4 - Log: - update for Mac OS X. -traditional-cpp is no longer recommended. - -2002-03-07 Rui Hirokawa - - * ext/gd/config.m4: reverted my patch to fix freetype2 related problem. - -2002-03-07 Sascha Schumann - - * ext/dbplus/config.m4: Bad extension. Still using AC_ADD_INCLUDE! - - * sapi/webjames/.cvsignore - sapi/servlet/.cvsignore - sapi/thttpd/.cvsignore - sapi/tux/.cvsignore - sapi/pi3web/.cvsignore - sapi/roxen/.cvsignore - sapi/isapi/.cvsignore - sapi/nsapi/.cvsignore - sapi/phttpd/.cvsignore - sapi/fastcgi/.cvsignore - sapi/fhttpd/.cvsignore - sapi/caudium/.cvsignore - sapi/cgi/.cvsignore - sapi/cli/.cvsignore - sapi/aolserver/.cvsignore - sapi/apache/.cvsignore - sapi/apache2filter/.cvsignore - main/.cvsignore - regex/.cvsignore - ext/zlib/.cvsignore - ext/zip/.cvsignore - ext/yp/.cvsignore - ext/xslt/.cvsignore - ext/yaz/.cvsignore - ext/xmlrpc/.cvsignore - ext/xmlrpc/libxmlrpc/.cvsignore - ext/xml/.cvsignore - ext/xml/expat/.cvsignore - ext/wddx/.cvsignore - ext/vpopmail/.cvsignore - ext/w32api/.cvsignore - ext/sysvshm/.cvsignore - ext/tokenizer/.cvsignore - ext/sybase_ct/.cvsignore - ext/sysvsem/.cvsignore - ext/swf/.cvsignore - ext/sybase/.cvsignore - ext/sockets/.cvsignore - ext/standard/.cvsignore - ext/snmp/.cvsignore - ext/skeleton/.cvsignore - ext/session/.cvsignore - ext/shmop/.cvsignore - ext/readline/.cvsignore - ext/recode/.cvsignore - ext/pspell/.cvsignore - ext/qtdom/.cvsignore - ext/posix/.cvsignore - ext/pdf/.cvsignore - ext/pfpro/.cvsignore - ext/pgsql/.cvsignore - ext/pcre/pcrelib/doc/.cvsignore - ext/pcre/pcrelib/testdata/.cvsignore - ext/pcre/.cvsignore - ext/pcre/pcrelib/.cvsignore - ext/ovrimos/.cvsignore - ext/pcntl/.cvsignore - ext/oracle/.cvsignore - ext/overload/.cvsignore - ext/oci8/.cvsignore - ext/odbc/.cvsignore - ext/openssl/.cvsignore - ext/ncurses/.cvsignore - ext/notes/.cvsignore - ext/mysql/libmysql/.cvsignore - ext/muscat/.cvsignore - ext/mysql/.cvsignore - ext/msql/.cvsignore - ext/mssql/.cvsignore - ext/mnogosearch/.cvsignore - ext/msession/.cvsignore - ext/mhash/.cvsignore - ext/ming/.cvsignore - ext/mcal/.cvsignore - ext/mcrypt/.cvsignore - ext/mailparse/tests/.cvsignore - ext/mbstring/.cvsignore - ext/java/.cvsignore - ext/ldap/.cvsignore - ext/mailparse/.cvsignore - ext/interbase/.cvsignore - ext/ircg/.cvsignore - ext/imap/.cvsignore - ext/informix/.cvsignore - ext/ingres_ii/.cvsignore - ext/hyperwave/.cvsignore - ext/icap/.cvsignore - ext/iconv/.cvsignore - ext/gettext/.cvsignore - ext/gmp/.cvsignore - ext/fribidi/.cvsignore - ext/ftp/.cvsignore - ext/gd/.cvsignore - ext/fdf/.cvsignore - ext/filepro/.cvsignore - ext/domxml/.cvsignore - ext/exif/.cvsignore - ext/fbsql/.cvsignore - ext/dbx/.cvsignore - ext/dio/.cvsignore - ext/dbase/.cvsignore - ext/dbplus/.cvsignore - ext/cyrus/.cvsignore - ext/db/.cvsignore - ext/dba/.cvsignore - ext/curl/.cvsignore - ext/cybercash/.cvsignore - ext/cybermut/.cvsignore - ext/cpdf/.cvsignore - ext/crack/.cvsignore - ext/ctype/.cvsignore - ext/ccvs/.cvsignore - ext/com/.cvsignore - ext/bcmath/libbcmath/src/.cvsignore - ext/bz2/.cvsignore - ext/calendar/.cvsignore - ext/aspell/.cvsignore - ext/bcmath/.cvsignore - ext/bcmath/libbcmath/.cvsignore - .cvsignore - ext/ext_skel: Remove .libs from .cvsignores, except /. - - * TODO.BUILDv5: phpize is already working, remove from todo - - * sapi/webjames/.cvsignore - sapi/webjames/Makefile.in - sapi/webjames/config.m4 - sapi/thttpd/.cvsignore - sapi/thttpd/Makefile.in - sapi/thttpd/config.m4 - sapi/tux/.cvsignore - sapi/tux/Makefile.in - sapi/tux/config.m4 - sapi/servlet/Makefile.in - sapi/servlet/config.m4 - sapi/roxen/config.m4 - sapi/servlet/.cvsignore - sapi/servlet/Makefile.frag - sapi/roxen/.cvsignore - sapi/roxen/Makefile.in - sapi/pi3web/.cvsignore - sapi/pi3web/Makefile.in - sapi/pi3web/config.m4 - sapi/nsapi/Makefile.in - sapi/nsapi/config.m4 - sapi/phttpd/.cvsignore - sapi/phttpd/Makefile.in - sapi/phttpd/config.m4 - sapi/isapi/.cvsignore - sapi/isapi/Makefile.in - sapi/isapi/config.m4 - sapi/nsapi/.cvsignore - sapi/cgi/Makefile.in - sapi/cgi/config.m4 - sapi/cli/.cvsignore - sapi/cli/Makefile.in - sapi/cli/config.m4 - sapi/fastcgi/.cvsignore - sapi/fastcgi/Makefile.in - sapi/fastcgi/config.m4 - sapi/fhttpd/.cvsignore - sapi/apache2filter/Makefile.in - sapi/apache2filter/config.m4 - sapi/caudium/.cvsignore - sapi/caudium/Makefile.in - sapi/caudium/config.m4 - sapi/cgi/.cvsignore - sapi/apache2filter/.cvsignore - sapi/aolserver/.cvsignore - sapi/aolserver/Makefile.in - sapi/aolserver/config.m4 - sapi/apache/.cvsignore - sapi/apache/Makefile.in - sapi/apache/config.m4 - pear/scripts/phpize.in - regex/.cvsignore - sapi/.cvsignore - sapi/Makefile.in - sapi/README - ext/zlib/.cvsignore - pear/.cvsignore - pear/Makefile.frag - pear/Makefile.in - pear/pear.m4 - ext/xslt/.cvsignore - ext/yaz/.cvsignore - ext/yp/.cvsignore - ext/zip/.cvsignore - ext/xmlrpc/.cvsignore - ext/xmlrpc/config.m4 - ext/xmlrpc/libxmlrpc/xmlrpc.m4 - ext/xml/.cvsignore - ext/xml/config.m4 - ext/xml/expat/.cvsignore - ext/w32api/.cvsignore - ext/wddx/.cvsignore - ext/sybase_ct/.cvsignore - ext/sysvsem/.cvsignore - ext/sysvshm/.cvsignore - ext/vpopmail/.cvsignore - ext/swf/.cvsignore - ext/sybase/.cvsignore - ext/sockets/.cvsignore - ext/standard/.cvsignore - ext/standard/Makefile.frag - ext/standard/Makefile.in - ext/standard/config.m4 - ext/snmp/.cvsignore - ext/session/config.m4 - ext/shmop/.cvsignore - ext/skeleton/.cvsignore - ext/readline/.cvsignore - ext/recode/.cvsignore - ext/session/.cvsignore - ext/session/Makefile.in - ext/pgsql/.cvsignore - ext/posix/.cvsignore - ext/pspell/.cvsignore - ext/qtdom/.cvsignore - ext/pdf/.cvsignore - ext/pdf/config.m4 - ext/pfpro/.cvsignore - ext/pcre/pcrelib/.cvsignore - ext/pcre/pcrelib/doc/.cvsignore - ext/pcre/pcrelib/testdata/.cvsignore - ext/ovrimos/.cvsignore - ext/pcntl/.cvsignore - ext/pcre/.cvsignore - ext/pcre/config.m4 - ext/openssl/.cvsignore - ext/oracle/.cvsignore - ext/overload/.cvsignore - ext/mysql/libmysql/.cvsignore - ext/mysql/libmysql/mysql.m4 - ext/ncurses/.cvsignore - ext/notes/.cvsignore - ext/oci8/.cvsignore - ext/odbc/.cvsignore - ext/mysql/.cvsignore - ext/mysql/config.m4 - ext/muscat/.cvsignore - ext/msql/.cvsignore - ext/mssql/.cvsignore - ext/msession/.cvsignore - ext/mnogosearch/.cvsignore - ext/ming/.cvsignore - ext/mhash/.cvsignore - ext/mcrypt/.cvsignore - ext/mcal/.cvsignore - ext/mbstring/.cvsignore - ext/ldap/.cvsignore - ext/java/.cvsignore - ext/ircg/.cvsignore - ext/ircg/Makefile.frag - ext/ircg/config.m4 - ext/interbase/.cvsignore - ext/informix/.cvsignore - ext/informix/Makefile.frag - ext/ingres_ii/.cvsignore - ext/imap/.cvsignore - ext/iconv/.cvsignore - ext/icap/.cvsignore - ext/hyperwave/.cvsignore - ext/gmp/.cvsignore - ext/gettext/.cvsignore - ext/ftp/.cvsignore - ext/gd/.cvsignore - ext/fribidi/.cvsignore - ext/filepro/.cvsignore - ext/fdf/.cvsignore - ext/fbsql/.cvsignore - ext/exif/.cvsignore - ext/domxml/.cvsignore - ext/domxml/config.m4 - ext/dio/.cvsignore - ext/dbx/.cvsignore - ext/dbplus/.cvsignore - ext/dbase/.cvsignore - ext/db/.cvsignore - ext/dba/.cvsignore - ext/cyrus/.cvsignore - ext/cybermut/.cvsignore - ext/cybercash/.cvsignore - ext/curl/.cvsignore - ext/ctype/.cvsignore - ext/crack/.cvsignore - ext/cpdf/.cvsignore - ext/com/.cvsignore - ext/ccvs/.cvsignore - ext/calendar/.cvsignore - ext/bz2/.cvsignore - ext/bcmath/libbcmath/src/Makefile.in - ext/bcmath/libbcmath/src/.cvsignore - ext/bcmath/libbcmath/.cvsignore - ext/bcmath/libbcmath/Makefile.in - ext/bcmath/config.m4 - ext/bcmath/.cvsignore - ext/bcmath/Makefile.in - ext/aspell/.cvsignore - ext/ext_skel - build/sysv_makefile - build/shtool - build/ltlib.mk - build/fastgen.sh - build/library.mk - build/dynlib.mk - build/bsd_makefile - build/build2.mk - scan_makefile_in.awk - dynlib.m4 - configure.in - TODO.BUILDv5 - acinclude.m4 - README.SELF-CONTAINED-EXTENSIONS - Makefile.in - .cvsignore - Makefile.frag - Makefile.global: Please welcome the new build system. - - If you encounter any problems, please make sure to email sas@php.net - directly. - - An introduction can be found on - - http://schumann.cx/buildv5.txt - -2002-03-07 Derick Rethans - - * NEWS: - Update NEWS - -2002-03-07 Yasuo Ohgaki - - * ext/mbstring/tests/002.inc - ext/mbstring/tests/003.inc - ext/mbstring/tests/004.inc - ext/mbstring/tests/005.inc - ext/mbstring/tests/006.inc - ext/mbstring/tests/008.inc - ext/mbstring/tests/009.inc - ext/mbstring/tests/010.inc - ext/mbstring/tests/011.inc - ext/mbstring/tests/012.inc - ext/mbstring/tests/013.inc - ext/mbstring/tests/014.inc - ext/mbstring/tests/015.inc - ext/mbstring/tests/016.inc - ext/mbstring/tests/017.inc - ext/mbstring/tests/018.inc - ext/mbstring/tests/019.inc - ext/mbstring/tests/019.phpt - ext/mbstring/tests/common.inc - ext/mbstring/tests/common.php: - Rename common.php to common.inc for easier deletion of garbages. - e.g. "rm -f *.php" - -2002-03-07 Jason Greene - - * NEWS: MFH - -2002-03-07 Hartmut Holzgraefe - - * ext/mcve/mcve.c: more proto stuff - -2002-03-07 Jason Greene - - * NEWS: Add news entries representing the sockets rework. - -2002-03-07 Hartmut Holzgraefe - - * ext/mcve/mcve.c: proto fixes: - - changed 'double' to 'float' - - changed 'int' to 'resource' where appropriate - - format change: proto has to be on a single line and description - on the very next one, some tools still rely on this - -2002-03-06 Dan Kalowsky - - * NEWS: iconv is back - -2002-03-06 Derick Rethans - - * main/php_version.h - configure.in: - Bump version numbers on HEAD - -2002-03-06 Jani Taskinen - - * NEWS: - - Cleaned this abit (no such long stuff should be here if it can be found - in Manual...and if it's not in manual yet, ADD IT! - - Also moved some of the major changes in the beginning where people - might even notice them. We should re-arrange this better btw. - -2002-03-06 Marcus Börger - - * ext/exif/tests/001.phpt - ext/exif/tests/002.phpt - ext/exif/tests/test1.jpg - ext/exif/tests/test2.jpg: - standard test scripts for exif - - * ext/exif/exif.c: -comments - -2002-03-06 James Cox - - * NEWS: fixed my foobarred news entry - -2002-03-06 Marcus Börger - - * ext/exif/exif.c: -comments - -2002-03-06 Jason Greene - - * ext/sockets/php_sockets.h - ext/sockets/sockets.c: Sockets Rework Patch 3 of 3 - Nuked all fd code - Rewrote socket_select to use arrays instead of the fd code - (This has the side-effect of fixing quite a few bugs) - -2002-03-06 Derick Rethans - - * ext/interbase/interbase.c: - - Fix for bug #12383 and #14755: 105.05$ becomes 105.5$ (Patch by: Giancarlo - Niccolai ) - -2002-03-06 James E. Flemer - - * ext/standard/dir.c: - (PHP opendir) Changed CHECKUID_ALLOW_ONLY_DIR to CHECKUID_ALLOW_ONLY_FILE - so that relative paths (vs absolute) work correctly. - -2002-03-06 Marcus Börger - - * ext/exif/test.txt: - -updated test to reflect third parameter of exif_read_data - - * ext/exif/exif.c: -missing efree - -incorrect index/length computing: left from jhead - -2002-03-06 Dan Kalowsky - - * ext/standard/html.c: - quelling a warning, and ensuring now undefined behavior - - * ext/posix/posix.c: - When #if BLAHING a section, ensure to make it's prototype included. Returns - build capability to MacOSX. - -2002-03-06 Derick Rethans - - * ext/sybase_ct/php_sybase_ct.c - ext/sybase/php_sybase_db.c: - - Add 'appname' parameter to sybase_connect. (Patch by Christophe Sollet - ) - - * sapi/cgi/cgi_main.c: - Put them back (and do it right) - -2002-03-06 Sascha Schumann - - * ext/session/session.c: - Do the estrdups after checking for parameter constraints. - - No real memory leaks though, because they are catched by the - memory manager. - - * ext/session/mod_mm.c: Did not revert back enough. - - This patch does not make sense, because it enforces the existence - of a single directory. - - * ext/session/session.c: - SID shall be defined to name=id, if the client did not supply - a cookie. - - * ext/session/mod_files.c - ext/session/mod_user.c - ext/session/php_session.h - ext/session/session.c: - Merge in session API changes (carry around tsrm context) - - Now PHP_SESSION_API is defined to the date of the last change, - so that externa source-code can handle changes more gracefully. - - * ext/session/session.c: Always initialize the track-vars - -2002-03-06 Derick Rethans - - * sapi/cgi/cgi_main.c: - Remove unused variables - - * ext/posix/posix.c: - More ZTS fixes - - * ext/iconv/iconv.c: - Fix build with ZTS - -2002-03-06 Marcus Börger - - * ext/exif/test.txt: -updated test - - * ext/exif/exif.c - ext/exif/php_exif.h: -new working thumbnail code - -everything uses new data structures - -new function exif_thumbnail - -2002-03-06 Sascha Schumann - - * ext/session/mod_files.c - ext/session/mod_mm.c - ext/session/mod_user.c - ext/session/php_session.h - ext/session/session.c: Weep out all recent commits of Yasuo. - - I don't have time right now to leave in the good ones and remove - only the bad ones. - - There are some semantical changes which I reject, because - they aim at fixing a bug which is at a completely other location. - - Then SID does not gefined anymore properly. (This broken patch - has not been sent to me at all.) - - Also, there were *so* many whitespace changes which already - make these commits bogus. - -2002-03-06 Yasuo Ohgaki - - * ext/session/mod_mm.c: Fixed typo :) - - * ext/session/mod_mm.c: - Use static mm file save path. Now we can safely stop web server at start up when there is an error. Older mm uses static mm file path anyway. - - * ext/session/mod_files.c: Fix crash bug #14232 - - * ext/session/mod_mm.c: Make php start even with wrong save_path. - -2002-03-06 Jason Greene - - * ext/sockets/php_sockets.h - ext/sockets/sockets.c: Socket Rework Patch 2 - Redesigned socket_recv() as outlined on php-dev - Modified socket_last_error() to no longer clear the error - Added socket_clear_error() - Fixed socket_set_nonblock() - Added socket_set_block() - Fixed a proto - Saved 1 byte of RAM : ) - -2002-03-06 Yasuo Ohgaki - - * ext/session/session.c: Oops. Fix compile failure - - * ext/session/session.c: - Using session_save_path() after starting session is obvious error. - Riase E_NOTICE error instead of E_WARNING. Since it is valid if - user uses session_save_path() with session_module_name(). - - * ext/session/session.c: - Return FALSE when session_module_name() failed. Fix a little leak. - - * ext/session/session.c: - Raise error when session module failed to open or read - - * ext/session/mod_user.c - ext/session/php_session.h: More TSRM work - - * ext/session/session.c - ext/session/mod_user.c - ext/session/mod_files.c: Remove TSRMLS_FETCH() and use TSRMLS_C/TSRMLS_D - -2002-03-05 Markus Fischer - - * NEWS: - Added recent changes done in ext/posix - -2002-03-05 Yasuo Ohgaki - - * ext/session/mod_mm.c: Fixed crash with mm save handler - - * ext/session/session.c: Fix bug #15322 and fix a little memory leak - -2002-03-05 Zeev Suraski - - * ext/session/session.c: MFH - - * ext/session/session.c: - Make $_SESSION and $HTTP_SESSION_VARS links to each other - -2002-03-05 Stig Bakken - - * pear/tests/pear_config.phpt: * PEAR_Config test complete - -2002-03-05 James Cox - - * win32/install.txt: adding installation comments for 4.1.2 - -2002-03-05 Marcus Börger - - * ext/exif/exif.c: -fixes - -changed internal data structures - -2002-03-05 Stig Bakken - - * pear/tests/merge.input - pear/tests/pear_config.phpt - pear/tests/toonew.conf - pear/tests/user2.input: * update PEAR_Config test - - * pear/PEAR/Config.php: * fix singleton() so it actually works - * insert file format version in written files - * add getSetValues() method for listing the valid values for a set value - -2002-03-05 Dan Kalowsky - - * ext/odbc/php_odbc.c: - Breaking BC, but making odbc_fetch_into behavior more consistent - -2002-03-05 Markus Fischer - - * ext/posix/php_posix.h - ext/posix/posix.c: - - Introduced posix_errno() (get error number from last error message) and - posix_strerror() (convert error number into error string). - - - Do not output any error message if any of the function fails with FALSE - return value. The proper way now is to call posix_errno() and - posix_strerror() after encountering an error condition. - - - Function not support on a system no longer issue a 'not available' error - but simply don't exist so we can safely use 'function_exists'. - - - Fixed protos. - - - Use new parameter parsing API. - - - posix_uname() may be aware of 'domainname' (GNU extension) - - - posix_getgrnam(), posix_getgrgid(): the returned information does no - longer contains mixture of string and numbered keys (hash / array) - but contains key 'member' with an array of all members in a list - (or an empty array). This breaks BC but is the right thing IMHO. - -2002-03-05 Stig Bakken - - * pear/PEAR.php: - * fix PEAR::setErrorHandling() settings so they apply when using raiseError() - -2002-03-05 Derick Rethans - - * pear/DB/tests/driver/15quote.phpt - pear/DB/tests/driver/02fetch.phpt - pear/DB/tests/driver/03simplequery.phpt - pear/DB/tests/driver/04numcols.phpt - pear/DB/tests/driver/05sequences.phpt - pear/DB/tests/driver/06prepexec.phpt - pear/DB/tests/driver/08affectedrows.phpt - pear/DB/tests/driver/09numrows.phpt - pear/DB/tests/driver/10errormap.phpt - pear/DB/tests/driver/13limit.phpt - pear/DB/tests/driver/14fetchmode_object.phpt - pear/DB/tests/driver/01connect.phpt - pear/DB/tests/db_factory.phpt - pear/DB/tests/db_ismanip.phpt - pear/DB/tests/db_parsedsn.phpt - ext/xml/tests/001.phpt - ext/xml/tests/002.phpt - ext/xml/tests/003.phpt - ext/xml/tests/004.phpt - pear/DB/tests/db_error.phpt - tests/basic/002.phpt: - More test fixes - - * ext/standard/tests/array/array_search.phpt - ext/standard/tests/file/001.phpt - ext/standard/tests/general_functions/004.phpt - ext/standard/tests/math/abs.phpt - ext/standard/tests/math/pow.phpt - ext/standard/tests/math/round.phpt - ext/standard/tests/strings/trim.phpt - ext/standard/tests/strings/wordwrap.phpt - ext/standard/tests/array/001.phpt - ext/standard/tests/aggregation/aggregate.phpt - ext/standard/tests/aggregation/aggregate_methods.phpt - ext/standard/tests/aggregation/aggregate_methods_by_list.phpt - ext/standard/tests/aggregation/aggregate_methods_by_regexp.phpt - ext/standard/tests/aggregation/aggregate_properties.phpt - ext/standard/tests/aggregation/aggregate_properties_by_list.phpt - ext/standard/tests/aggregation/aggregate_properties_by_regexp.phpt - ext/standard/tests/aggregation/aggregation_info.phpt - ext/standard/tests/aggregation/deaggregate.phpt: - - Fix tests to work with CLI - - * ext/mcrypt/tests/001.phpt: - Fix mcrypt tests - -2002-03-05 Yasuo Ohgaki - - * README.TESTING: Fixed wrong description about CLI sapi usage. - Currently "make test" is running test script as - - ./sapi/cli/php -c php.ini-dist run-tests.php - - "make test" does not work... I'm supposing this - will be changed to use CGI sapi for now. - - * README.TESTING: Added README.TESTING - -2002-03-05 Sebastian Bergmann - - * win32/pws-php4cgi.reg - win32/install.txt: s/php.exe/php-cgi.exe/. - -2002-03-05 Dan Kalowsky - - * ext/odbc/birdstep.c: Added a comment for future reference - -2002-03-05 Jason Greene - - * ext/sockets/sockets.c: Style Improvement - -2002-03-05 Stig Bakken - - * pear/PEAR/Config.php - pear/tests/pear_config.phpt: - * fixed a couple of bugs in PEAR_Config revealed by test - -2002-03-05 Frank M. Kromann - - * ext/dbase/dbase.c: Killing compiler warning - - * ext/dbase/dbf_rec.c: Making dbase compule under WIn32 - - * main/php_ini.c: Killing compiler warning on Win32 - -2002-03-04 Dan Kalowsky - - * ext/iconv/config.m4 - ext/iconv/php_iconv.h: - Fix for Bug 14423. Enables FreeBSD to use iconv functionality. - -2002-03-04 Marcus Börger - - * ext/exif/test.txt: - also test TIFF support in GetImageSize - - * ext/exif/exif.c: - Read IsColor for TIFF - -2002-03-04 Sebastian Bergmann - - * win32/php4.dsp - win32/php4ts.dsp: Rename Win32 SAPI/CGI binary to php-cgi.exe. - -2002-03-04 Jon Parise - - * main/php_ticks.c: - Silence a warning under Solaris 8 (WorkShop Compilers 5.0 98/12/15 C 5.0). - -2002-03-04 Derick Rethans - - * NEWS: - - Update NEWS with changes by Shane for "fix force redirect crash under - multithreaded compile". (This is only in the published Windows binaries) - - * php.ini-dist: - MFH for: - add stuff here also. - - * sapi/cgi/cgi_main.c: - MFH for: - add comment for IIS users - - * php.ini-recommended: - MFH for: - document force-redirect in php.ini - - * sapi/cgi/cgi_main.c: - MFH for: - This is much better. With FORCE_CGI_REDIRECT turned on by default for compilation, - we can now define this in the ini file. So it can be turned on for apache, turned - off for IIS which does not have a redirect issue. Alternately, a different 'REDIRECT_STATUS' - environment var can be defined in case some web server out there needs it. - - new ini vars - cgi.force_redirect 0|1 - cgi.redirect_status_env ENV_VAR_NAME - - * sapi/cgi/cgi_main.c: - MFH for: - fix force redirect crash under multithreaded compile - - should be discused: fix redirect detection to only work with apache or netscape, - where we know they set an environment variable regarding redirect. IIS has - no security issue here. Don't know about other windows web servers. - -2002-03-04 Sascha Schumann - - * ext/standard/info.c: Add apparently missing include - -2002-03-04 Derick Rethans - - * main/config.w32.h - main/php.h: - MFH for: turn on force redirect for windows - - * main/main.c: - Some more speed (and more consistency) - -2002-03-04 Sascha Schumann - - * main/php_ini.c - main/php_main.h - main/main.c - ext/standard/info.c: - Supply php_html_puts which escapes a whole string.. now fully works in ZTS - mode, too. - -2002-03-04 Sebastian Bergmann - - * ext/standard/image.c: Silence warning. - -2002-03-04 Sascha Schumann - - * ext/standard/info.c: revert last commit, puts does more through putc. - - * ext/standard/info.c: - Use PHPWRITE to output data. Because this just outputs diagnostic - information, a few spaces won't hurt (and multiple ones are rendered - as one by browsers anyway). Micro-benchmarks which use phpinfo() - as a mean to generate output will yield more through-put now - (35 req/s vs. 83 req/s in tux). - -2002-03-04 Derick Rethans - - * sapi/apache/config.m4: - - Fix for bug #15572 (Patch by Ralf Nyrén ) - -2002-03-04 Marcus Börger - - * EXTENSIONS: - -expose the fact i am working on exif as discussed with Rasmus - - * ext/standard/image.c: - TIFF support for GetImageSize - TIFF support for GetImageSize - - * ext/exif/exif.c: - disabled debug information - - added missing width/height from primary ifd for TIFF - -2002-03-04 James Cox - - * ext/odbc/php_birdstep.h - ext/odbc/php_birstep.h: typos suck. - -2002-03-04 Jason Greene - - * ext/sockets/sockets.c: Style mismatch: Jon's catch - -2002-03-04 Stanislav Malyshev - - * ext/standard/datetime.c: cygwin fix - -2002-03-04 Jon Parise - - * ext/session/session.c - main/output.c: - Silence warning under Solaris 8 (WorkShop Compilers 5.0 98/12/15 C 5.0). - -2002-03-04 Derick Rethans - - * makerpm: - Fix a path and remove --with-imap - -2002-03-04 Stig Bakken - - * pear/PEAR/Config.php: PEAR_Config rewrite: - - * Now supports (in theory) an arbitrary number of - config "layers" (different sets of configuration data with a defined - priority). - * Specify the type of config values so different frontends can make - user-friendly configuration interfaces. Valid types are currently - "string", "integer", "file", "directory", "set" and "password". The - set type lets you specify a limited set of values that the config - values must be selected from. Password values are stored - base64-encoded. - * Added phpdoc comments and some docs for config values. - * Added singleton method. - -2002-03-04 Marcus Börger - - * ext/exif/exif.c: - -addition to last change: php_image.h must be included now - -2002-03-04 James Cox - - * ext/odbc/php_velocis.h - ext/odbc/setup.stub - ext/odbc/velocis.c - main/build-defs.h.in - ext/odbc/birdstep.c - ext/odbc/config.m4 - ext/odbc/php_birstep.h - ext/odbc/php_odbc.c - ext/odbc/php_odbc.h: - Changing the Velocis extension to now be called Birdstep, due to a product/company change. - added aliases for Velocis to the birdstep functions. - -2002-03-04 Sascha Schumann - - * ext/standard/url_scanner_ex.c - ext/standard/url_scanner_ex.re: Restore use of inline - - * build/build2.mk - build/buildcheck.sh: Remove note, suppress warning - - * sapi/tux/php_tux.c: Reduce operations in the ub_write loop. - - * sapi/tux/php_tux.c: - Free status line, initialize number_vec, correctly account for - the number of bytes in the document, avoid strcpy/strlen. - -2002-03-04 Rasmus Lerdorf - - * ext/standard/php_image.h - ext/exif/exif.c: - Let getimagesize() and read_exif_data() share the same constants to - promote a little bit of code reuse here on two very similar problems. - -2002-03-04 Marcus Börger - - * ext/exif/test.php - ext/exif/test.txt: -Updated test.txt and provided test.php - - * ext/exif/exif.c: -Added TIFF support - -Changed parameters after checking bugdatabase and discussion with - Rasmus: 1st=Filename, 2nd=NeededSections - -2002-03-04 Jason Greene - - * ext/sockets/sockets.c: - Patch 1 of 3 (2 in 3 still in progress) of sockets rework - Abstracted string -> ipv4 value conversion which unifies all functions - Standardized Host Lookups - Fixed Broken host error values - Fixed error detection in sendmsg - Added some safety struct zeroing - Modified bind to consitentlyy use sockaddr_storage(not just for AF_UNIX) - -2002-03-03 Zak Greant - - * build/buildcheck.sh: - Added message regarding expected error messages for ./buildconf - -2002-03-03 James E. Flemer - - * main/safe_mode.c: - Added case for root directory when mode is not - CHECKUID_ALLOW_ONLY_DIR. - - * main/safe_mode.c: - Added case for root directory when mode is - CHECKUID_ALLOW_ONLY_DIR. - - * ext/standard/dir.c: Added safe_mode checks on path. - -2002-03-03 Thomas V.V.Cox - - * pear/DB/MAINTAINERS: Updated maintainers - -2002-03-03 Derick Rethans - - * NEWS: - Tidy up NEWS a little bit - -2002-03-03 Alex Waugh - - * sapi/webjames/README - sapi/webjames/config.m4: Updated build instructions - -2002-03-02 Derick Rethans - - * ext/pgsql/pgsql.c: - - Make the 2nd parameter to pgsql_fetch_* support NULL in case 3 parameters - are supplied, but you do not want to provide a row number yourself. - - Make the 2nd parameter to pgsql_fetch_* support NULL in case 3 - parameters are supplied, but you do not want to provide a row number - yourself. - -2002-03-02 Hartmut Holzgraefe - - * ext/standard/math.c: php has no 'double', only 'float' - - * ext/mcve/mcve.c - ext/mcve/php_mcve.h: tab/space mixture cleand up, - editor config comments added, - minor proto fixes - - * ext/standard/aggregation.c - main/output.c: typo fix - -2002-03-02 Zeev Suraski - - * ext/session/session.c: MFH - crash bug fix - - * ext/session/session.c: Fix another crash bug - -2002-03-02 Hartmut Holzgraefe - - * ext/ctype/config.m4: enable ctype functions by default - -2002-03-02 Marcus Börger - - * ext/exif/exif.c: - Wrong brackets by rasmus...but sorry the fault was mine because i missed them... - - i also decided to call the first working version 1.0a - - by the way: currently i am working on tiff files and it looks like it may work - -2002-03-02 Zeev Suraski - - * main/php_version.h - configure.in: Bump those up too in case we ever release - - * configure.in - main/php_version.h: Fix version number - - * ext/session/session.c: MFH - crash bug fix - - * ext/session/session.c: Fix a crash bug in the session module - -2002-03-02 Derick Rethans - - * ext/standard/string.c: - Fix warning message for join(). - - * ext/mcve/CREDITS - ext/tokenizer/CREDITS - ext/dbx/CREDITS: - Fix CREDITS files - - * ext/gd/gd.c: - - Make GD functions only available if they really exist (Patch by - matslin@orakel.ntnu.no) - -2002-03-02 Yasuo Ohgaki - - * ext/mbstring/tests/001.phpt - ext/mbstring/tests/002.inc - ext/mbstring/tests/002.phpt - ext/mbstring/tests/003.inc - ext/mbstring/tests/003.phpt - ext/mbstring/tests/004.inc - ext/mbstring/tests/004.phpt - ext/mbstring/tests/005.inc - ext/mbstring/tests/005.phpt - ext/mbstring/tests/006.inc - ext/mbstring/tests/006.phpt - ext/mbstring/tests/007.inc - ext/mbstring/tests/007.phpt - ext/mbstring/tests/008.inc - ext/mbstring/tests/008.phpt - ext/mbstring/tests/009.inc - ext/mbstring/tests/009.phpt - ext/mbstring/tests/010.inc - ext/mbstring/tests/010.phpt - ext/mbstring/tests/011.inc - ext/mbstring/tests/011.phpt - ext/mbstring/tests/012.inc - ext/mbstring/tests/012.phpt - ext/mbstring/tests/013.inc - ext/mbstring/tests/013.phpt - ext/mbstring/tests/014.inc - ext/mbstring/tests/014.phpt - ext/mbstring/tests/015.inc - ext/mbstring/tests/015.phpt - ext/mbstring/tests/016.inc - ext/mbstring/tests/016.phpt - ext/mbstring/tests/017.inc - ext/mbstring/tests/017.phpt - ext/mbstring/tests/018.inc - ext/mbstring/tests/018.phpt - ext/mbstring/tests/019.inc - ext/mbstring/tests/019.phpt - ext/mbstring/tests/common.php - ext/mbstring/tests/skipif.inc: Add mbstring tests - - * build/rules.mk: Use php.ini-dist as default config file for testing. - -2002-03-02 Rasmus Lerdorf - - * ext/exif/exif.c: Fix a couple of warnings - -2002-03-02 Yasuo Ohgaki - - * ext/iconv/iconv.c: - Improved iconv usage with libc's iconv. No overrun. More efficient memory - allocation. - Hopefully, all bugs reported for iconv will be resolved when users are using - libc iconv. - - * ext/iconv/tests/eucjp2iso2022jp.inc - ext/iconv/tests/eucjp2iso2022jp.phpt - ext/iconv/tests/eucjp2sjis.inc - ext/iconv/tests/eucjp2sjis.phpt - ext/iconv/tests/eucjp2utf8.inc - ext/iconv/tests/eucjp2utf8.phpt - ext/iconv/tests/002.phpt: Add more tests for iconv - -2002-03-02 Stig Bakken - - * pear/tests/pear_autoloader.phpt - pear/tests/pear_config.phpt - pear/tests/pear_error.phpt - pear/tests/pear_error2.phpt - pear/tests/pear_error3.phpt - pear/tests/pear_error4.phpt - pear/tests/pear_registry.phpt: * more cli test fixes - - * pear/DB/tests/db_error.phpt - pear/DB/tests/db_error2.phpt - pear/DB/tests/db_parsedsn.phpt - pear/DB/tests/mysql/02fetch.phpt - pear/DB/tests/mysql/03simplequery.phpt - pear/DB/tests/mysql/04numcols.phpt - pear/DB/tests/mysql/05sequences.phpt - pear/DB/tests/mysql/06prepexec.phpt - pear/DB/tests/mysql/09numrows.phpt - pear/DB/tests/mysql/10errormap.phpt - pear/DB/tests/mysql/12tableinfo.phpt - pear/DB/tests/mysql/13limit.phpt - pear/DB/tests/mysql/14fetchmode_object.phpt - pear/tests/pear_config.phpt - pear/tests/pear_error.phpt: * updated tests to work with cli - - * pear/tests/pear1.phpt: fix test - - * run-tests.php: * work with sapi/cli - -2002-03-01 Rasmus Lerdorf - - * ext/odbc/config.m4: In case we do a 4.1.3, add this trivial fix - -2002-03-01 Edin Kadribasic - - * main/main.c: - Added PHP_SAPI constant which contains the name of running SAPI. - -2002-03-01 Derick Rethans - - * ext/standard/url_scanner_ex.re - ext/standard/url_scanner_ex.c: - - Fix for Sun WorkShop 6 update 2 compiler (Bug #15812) - -2002-03-01 Andrei Zmievski - - * TODO: *** empty log message *** - -2002-03-01 Derick Rethans - - * ext/interbase/interbase.c: - - Add support for returning NULL values from Interbase resultsets (Patch by - Daniela Mariaschi ) - -2002-03-01 Jani Taskinen - - * NEWS: - We haven't got the branch yet.. - - Some typo fixes and correct grammar. - -2002-03-01 Yasuo Ohgaki - - * ext/msession/msession.c: Fix compiler warnings and header file path. - -2002-03-01 Zeev Suraski - - * ext/standard/array.c: Fix php_splice() to work with large values - -2002-03-01 Yasuo Ohgaki - - * ext/pgsql/README: Update doc - - * TODO: Added todo item for Java extention documentation. - - * TODO-4.2.txt - TODO: Merge TODO-4.2.txt into TODO. - -2002-03-01 Stig Bakken - - * pear/PEAR/Command.php - pear/PEAR/Command/Common.php - pear/PEAR/Command/Install.php: - * code for install/uninstall/upgrade complete, not yet tested - -2002-03-01 Yasuo Ohgaki - - * main/output.c: Do explicit test againt to FAILURE. - -2002-03-01 Stig Bakken - - * pear/PEAR/Packager.php: - * output a reminder to set CVS tags after packaging - - * build/rules.mk: * use cli sapi to run tests - -2002-03-01 Shane Caraveo - - * php.ini-dist: add stuff here also. - - * sapi/cgi/cgi_main.c: add comment for IIS users - fix some whitespace - -2002-03-01 Marcus Börger - - * ext/exif/php_exif.h - ext/exif/test.txt - ext/exif/.cvsignore - ext/exif/exif.c: - +Support for Photographer/Editor Copyright as associative array as this is a new feature the change (optionally being an array) has to be mentioned in documentation. - +New function exif_headername can be used to read the internal Tag namelist (was mainly created for debugging purpose but maybe somone writes code to create/update exif headers here). - +An internal version number is present. - +A testpage is supplied test.txt describes how the test works. - +The oldfunction read_exif_data has got an alias exif_read_data - - As the old version of this module is very buggy i decided to implement the testpage (test.txt) and to create the alias. The test script only works with the alias as the old version does not pass tests. By the way it seems a good way to prepend 'exif_' to all functions in the module. - -2002-03-01 Yasuo Ohgaki - - * ext/snmp/snmp.c: Fix compiler warnings - - * ext/standard/var.c - ext/zlib/zlib.c - main/main.c - main/output.c - main/php_output.h - ext/standard/basic_functions.c - ext/session/session.c: - Added ob_get_status() to get array of buffers and it's status. - (DO NOT document this function yet) - - Fixed crash bug with ob_end_*() function. ob_end_*() will not delete - buffers that may not be deleted. - - php_start_ob_buffer() and php_ob_set_internal_handler() takes parameter for - if the buffer created may be deleted or not. - - Added 3rd parameter "bool erase" to ob_start(). If FALSE, buffer may not be - deleted until script finshes. - - Changed ob_*() function that have void return type to bool. All ob_*() - functions return TRUE for success, FALSE for failure. - - -2002-03-01 Shane Caraveo - - * php.ini-recommended: document force-redirect in php.ini - - * sapi/cgi/cgi_main.c: - This is much better. With FORCE_CGI_REDIRECT turned on by default for compilation, - we can now define this in the ini file. So it can be turned on for apache, turned - off for IIS which does not have a redirect issue. Alternately, a different 'REDIRECT_STATUS' - environment var can be defined in case some web server out there needs it. - - new ini vars - cgi.force_redirect 0|1 - cgi.redirect_status_env ENV_VAR_NAME - - * sapi/cgi/cgi_main.c: - fix force redirect crash under multithreaded compile - - should be discused: fix redirect detection to only work with apache or netscape, - where we know they set an environment variable regarding redirect. IIS has - no security issue here. Don't know about other windows web servers. - - * main/config.w32.h - main/php.h: turn on force redirect for windows - -2002-02-28 Jani Taskinen - - * ext/crack/config.m4: - Fixed a typo. (caught by jtate@php.net) - -2002-02-28 Rasmus Lerdorf - - * ext/gd/gd.c: Change fatal errors to warnings - fix bug #15797 - -2002-02-28 Derick Rethans - - * ext/standard/basic_functions.c - ext/standard/var.c: - Make it a boolean - -2002-02-28 Brad House - - * ext/mcve/mcve.c: Fix proto for mcve_initconn - -2002-02-28 Edin Kadribasic - - * NEWS: Inserted a note about CGI binary name change. - -2002-02-28 Marc Boeren - - * ext/dbx/howto_extend_dbx.html: Updating docs (Mc) - -2002-02-28 Marcus Börger - - * ext/exif/exif.c: - Changed file to match CODING_STANDARDS except function names that match jhead.c project. I think it is acceptable using naming conventions of other projects when borrowing code. - -2002-02-28 Edin Kadribasic - - * main/php_ini.c: - Removed CWD from php_ini_search_path when using CLI SAPI. - -2002-02-28 Yasuo Ohgaki - - * ext/sysvshm/sysvshm.c - sapi/aolserver/aolserver.c - sapi/apache2filter/php_functions.c - ext/mcrypt/mcrypt.c - ext/mhash/mhash.c: Use {NULL, NULL, NULL} to terminate function entry. - -2002-02-28 Edin Kadribasic - - * sapi/cgi/config.m4: Default name of CGI binary changed to php-cgi. - -2002-02-28 Marc Boeren - - * NEWS: Added entry that I forgot when comitting the code (Mc) - -2002-02-28 Sebastian Bergmann - - * win32/imap_sendmail.c - scripts/conv_z_macros - sapi/apache2filter/php_apache.h - sapi/apache2filter/php_functions.c - sapi/isapi/php4isapi.c - sapi/apache/mod_php4.h - sapi/apache/php_apache.c - sapi/apache2filter/apache_config.c - pear/XML/Parser.php - pear/PEAR/Command/Install.php - pear/Schedule/At.php - pear/PEAR/Command/Common.php - pear/PEAR/Dependency.php - pear/PEAR/Installer.php - pear/PEAR/Packager.php - pear/PEAR/Registry.php - pear/PEAR/Remote.php - pear/PEAR/Uploader.php - pear/Net/Dig.php - pear/Net/SMTP.php - pear/PEAR/Command.php - pear/PEAR/CommandResponse.php - pear/PEAR/Common.php - pear/PEAR/Config.php - pear/Mail/mail.php - pear/Mail/sendmail.php - pear/Mail/smtp.php - pear/Net/Curl.php - pear/File/SearchReplace.php - pear/HTML/Common.php - pear/HTML/IT.php - pear/HTML/ITX.php - pear/HTML/IT_Error.php - pear/HTML/Menu_Browser.php - pear/HTML/Page.php - pear/HTML/Processor.php - pear/HTML/Select.php - pear/Experimental/Image/gbutton.php - pear/Experimental/Image/gtext.php - pear/File/Find.php - pear/File/Passwd.php - pear/DB/odbc.php - pear/DB/storage.php - pear/DB/sybase.php - pear/Date/Human.php - pear/Experimental/Image/color_helper.php - pear/DB/msql.php - pear/DB/mssql.php - pear/DB/mysql.php - pear/DB/oci8.php - pear/DB/ifx.php - pear/DB/dbase.php - pear/DB/fbsql.php - pear/DB/ibase.php - pear/DB/common.php - pear/Console/Getopt.php - pear/Archive/Tar.php - pear/CMD.php - pear/HTTP.php - pear/Mail.php - pear/PEAR.php - pear/System.php - main/php_open_temporary_file.h - main/php_output.h - main/php_reentrancy.h - main/php_sprintf.c - main/php_streams.h - main/php_ticks.c - main/php_ticks.h - main/reentrancy.c - main/safe_mode.c - main/snprintf.h - main/streams.c - main/build-defs.h.in - main/fopen_wrappers.h - main/network.c - main/php_content_types.c - main/php_globals.h - main/php_logos.c - main/php_network.h - main/php_open_temporary_file.c - ext/zlib/zlib_fopen_wrapper.c - main/SAPI.h - ext/xslt/xslt.c - ext/yaz/php_yaz.c - ext/yaz/php_yaz.h - ext/zip/php_zip.h - ext/zip/zip.c - ext/xslt/php_xslt.h - ext/xslt/sablot.c - ext/xmlrpc/xmlrpc-epi-php.c - ext/xslt/php_sablot.h - ext/xmlrpc/php_xmlrpc.h - ext/wddx/wddx.c - ext/xml/xml.c - ext/w32api/test_dll/test_dll.c - ext/wddx/php_wddx.h - ext/w32api/examples/uptime.php - ext/w32api/test_dll/dll_test.h - ext/w32api/w32api.c - ext/w32api/php_w32api.h - ext/sysvshm/sysvshm.c - ext/tokenizer/php_tokenizer.h - ext/tokenizer/tokenizer.c - ext/vpopmail/php_vpopmail.c - ext/sysvsem/sysvsem.c - ext/sysvshm/php_sysvshm.h - ext/sybase_ct/php_sybase_ct.h - ext/sysvsem/php_sysvsem.h - ext/standard/url_scanner_ex.h - ext/standard/url_scanner_ex.re - ext/standard/versioning.c - ext/sybase/php_sybase_db.h - ext/standard/reg.c - ext/standard/reg.h - ext/standard/scanf.c - ext/standard/scanf.h - ext/standard/syslog.c - ext/standard/type.c - ext/standard/uniqid.c - ext/standard/uniqid.h - ext/standard/url.c - ext/standard/url.h - ext/standard/url_scanner_ex.c - ext/standard/php_metaphone.h - ext/standard/php_parsedate.h - ext/standard/php_rand.h - ext/standard/php_smart_str.h - ext/standard/php_smart_str_public.h - ext/standard/php_standard.h - ext/standard/php_string.h - ext/standard/php_type.h - ext/standard/php_var.h - ext/standard/php_versioning.h - ext/standard/quot_print.c - ext/standard/quot_print.h - ext/standard/rand.c - ext/standard/php_image.h - ext/standard/php_iptc.h - ext/standard/php_lcg.h - ext/standard/php_link.h - ext/standard/php_mail.h - ext/standard/php_math.h - ext/standard/info.h - ext/standard/iptc.c - ext/standard/lcg.c - ext/standard/link.c - ext/standard/mail.c - ext/standard/math.c - ext/standard/md5.c - ext/standard/md5.h - ext/standard/metaphone.c - ext/standard/microtime.c - ext/standard/microtime.h - ext/standard/pack.c - ext/standard/pack.h - ext/standard/pageinfo.c - ext/standard/pageinfo.h - ext/standard/php_assert.h - ext/standard/php_browscap.h - ext/standard/php_crypt.h - ext/standard/php_dir.h - ext/standard/php_ext_syslog.h - ext/standard/php_fopen_wrapper.c - ext/standard/php_fopen_wrappers.h - ext/standard/php_ftok.h - ext/standard/file.h - ext/standard/filestat.c - ext/standard/flock_compat.c - ext/standard/flock_compat.h - ext/standard/formatted_print.c - ext/standard/fsock.h - ext/standard/ftok.c - ext/standard/ftp_fopen_wrapper.c - ext/standard/head.c - ext/standard/head.h - ext/standard/html.c - ext/standard/html.h - ext/standard/http_fopen_wrapper.c - ext/standard/image.c - ext/standard/info.c - ext/standard/aggregation.h - ext/standard/assert.c - ext/standard/base64.c - ext/standard/base64.h - ext/standard/browscap.c - ext/standard/crc32.c - ext/standard/crc32.h - ext/standard/credits.c - ext/standard/credits.h - ext/standard/crypt.c - ext/standard/cyr_convert.c - ext/standard/cyr_convert.h - ext/standard/dir.c - ext/standard/dns.c - ext/standard/dns.h - ext/standard/exec.h - ext/standard/file.c - ext/snmp/snmp.c - ext/standard/aggregation.c - ext/snmp/php_snmp.h - ext/shmop/php_shmop.h - ext/shmop/shmop.c - ext/session/mod_files.h - ext/session/mod_mm.c - ext/session/mod_mm.h - ext/session/mod_user.c - ext/session/mod_user.h - ext/session/php_session.h - ext/readline/readline.c - ext/recode/php_recode.h - ext/recode/recode.c - ext/session/mod_files.c - ext/qtdom/qtdom.h - ext/readline/php_readline.h - ext/posix/posix.c - ext/pspell/php_pspell.h - ext/pspell/pspell.c - ext/qtdom/qtdom.c - ext/posix/php_posix.h - ext/pcntl/php_pcntl.h - ext/pcntl/php_signal.c - ext/pcntl/php_signal.h - ext/pcre/php_pcre.c - ext/pcre/php_pcre.h - ext/pdf/php_pdf.h - ext/pcntl/pcntl.c - ext/overload/overload.c - ext/overload/php_overload.h - ext/ovrimos/ovrimos.c - ext/oracle/oracle.c - ext/odbc/php_odbc.h - ext/odbc/php_velocis.h - ext/odbc/velocis.c - ext/openssl/openssl.c - ext/odbc/php_odbc.c - ext/notes/php_notes.h - ext/oci8/oci8.c - ext/ncurses/ncurses_fe.c - ext/ncurses/ncurses_functions.c - ext/ncurses/php_ncurses.h - ext/ncurses/php_ncurses_fe.h - ext/notes/php_notes.c - ext/mysql/php_mysql.h - ext/ncurses/ncurses.c - ext/mssql/php_mssql.c - ext/mssql/php_mssql.h - ext/mysql/php_mysql.c - ext/msql/php_msql.c - ext/msql/php_msql.h - ext/mnogosearch/php_mnogo.c - ext/mnogosearch/php_mnogo.h - ext/msession/php_msession.h - ext/mhash/mhash.c - ext/mbstring/mbstring.h - ext/mcve/mcve.c - ext/mailparse/php_mailparse.h - ext/mailparse/rfc2045appendurl.c - ext/mbstring/mbstring.c - ext/mailparse/mailparse.c - ext/ircg/ircg_scanner.c - ext/ircg/ircg_scanner.re - ext/ircg/php_ircg.h - ext/ldap/ldap.c - ext/imap/php_imap.h - ext/ircg/ircg.c - ext/imap/php_imap.c - ext/hyperwave/hg_comm.h - ext/hyperwave/hw.c - ext/hyperwave/hw_error.h - ext/hyperwave/php_hyperwave.h - ext/icap/php_icap.c - ext/gmp/php_gmp.h - ext/hyperwave/hg_comm.c - ext/gmp/gmp.c - ext/gd/gdt1.c - ext/gd/gdt1.h - ext/gd/php_gd.h - ext/ftp/ftp.h - ext/ftp/php_ftp.c - ext/ftp/php_ftp.h - ext/gd/gd.c - ext/fribidi/php_fribidi.h - ext/ftp/ftp.c - ext/filepro/php_filepro.h - ext/fribidi/fribidi.c - ext/fbsql/php_fbsql.h - ext/fdf/php_fdf.h - ext/filepro/filepro.c - ext/domxml/php_domxml.h - ext/fbsql/php_fbsql.c - ext/dbplus/php_dbplus.h - ext/dio/dio.c - ext/dio/php_dio.h - ext/domxml/php_domxml.c - ext/dbplus/dbplus.c - ext/dbplus/php_dbplus.c - ext/dbase/dbase.c - ext/dbase/php_dbase.h - ext/dba/php_dba.h - ext/dba/dba_dbm.c - ext/dba/dba_gdbm.c - ext/dba/dba_ndbm.c - ext/dba/dba_cdb.c - ext/dba/dba_db2.c - ext/dba/dba_db3.c - ext/dba/dba.c - ext/db/db.c - ext/db/php_db.h - ext/cyrus/cyrus.c - ext/cyrus/php_cyrus.h - ext/cybermut/cybermut.c - ext/cybermut/php_cybermut.h - ext/cybercash/cybercash.h - ext/ctype/ctype.c - ext/ctype/php_ctype.h - ext/crack/crack.c - ext/crack/php_crack.h - ext/cpdf/php_cpdf.h - ext/cpdf/cpdf.c - ext/ccvs/ccvs.c - ext/ccvs/ccvs.h - ext/bz2/bz2.c - ext/bz2/php_bz2.h - ext/bcmath/php_bcmath.h - ext/bcmath/bcmath.c - ext/aspell/php_aspell.h - ext/aspell/aspell.c - build/rules_pear.mk - build/sysv_makefile - build/rules.mk - build/rules_common.mk - build/mkdep.awk - build/program.mk - build/ltlib.mk - build/fastgen.sh - build/library.mk - build/build2.mk - build/dynlib.mk - build/bsd_makefile - build/build.mk - dynlib.m4 - header - run-tests.php: Maintain headers. - -2002-02-28 Yasuo Ohgaki - - * CODING_STANDARDS: - Recommend ZEND_* macro over PHP_* macro as discussed in php-dev. - -2002-02-28 Sebastian Bergmann - - * ext/exif/exif.c - ext/exif/php_exif.h: Fix headers. - -2002-02-28 Yasuo Ohgaki - - * README.CVS-RULES: Added how to put bug ID in commit message. - -2002-02-28 Rasmus Lerdorf - - * main/rfc1867.c: - That code made no sense - fix it to do what was originally intended - -2002-02-28 Yasuo Ohgaki - - * ext/iconv/iconv.c: Fix iconv. Patch by (itai@siftology.com) - -2002-02-28 Marcus Börger - - * ext/exif/php_exif.h - ext/exif/exif.c - ext/exif/CREDITS: +Added UNICODE support for Comments - +Added Description,Artist - +Added missing memory deallocation - +Corrected error with multiple comments - +Corrected handling of ExifVersion, Tag has 4 ASCII characters *WITHOUT* NUL - +Corrected handling of Thumbnailsize if current source detects size < 0 - +Changed all fields to char* that do not have a maximum length in EXIF standard - +Undocumented second Parameter ReadAll frees memory to early -> moved to third position default changed to false -> faster - +New second Parameter [true|false] to specify whether or not to to read thumbnails -> reading is timeconsumpting suppose default should be false -> done so - -2002-02-27 Rasmus Lerdorf - - * php.ini-dist: - Drop this default to 12 to avoid some of the .000000000000001 questions. - I can't imagine much of a BC issue, and we aren't changing existing php.ini - files anyway. If someone can think of a problem with this, please speak up - -2002-02-27 Brad House - - * ext/mcve/CREDITS - ext/mcve/Makefile.in - ext/mcve/config.m4 - ext/mcve/mcve.c - ext/mcve/mcve.php - ext/mcve/php_mcve.h - ext/mcve/tests/001.phpt - ext/mcve/tests/mcve_simple_test.php - ext/mcve/tests/mcve_test1.php - ext/mcve/tests/mcve_test2.php: - Initial MCVE extension added (Credit Card Processing) - -2002-02-27 Andrei Zmievski - - * ext/overload/EXPERIMENTAL - ext/overload/README: This has been scaring people off. - -2002-02-27 Jani Taskinen - - * NEWS: - Missed this one.. - -2002-02-27 Derick Rethans - - * ext/standard/basic_functions.c: - Fix proto - -2002-02-27 Adam Dickmeiss - - * ext/yaz/php_yaz.c - ext/yaz/php_yaz.h: Implemented yaz_schema. Cleanup. 1.8 YAZ required - -2002-02-27 Jani Taskinen - - * configure.in - main/php_version.h: Fixed minor typo. - -2002-02-27 Derick Rethans - - * main/php_version.h: - Oops... wishful thinking here :) - - * main/php_version.h - configure.in: - Update version number - -2002-02-27 James Cox - - * NEWS: correcting grammar so it's readable - -2002-02-27 Sebastian Bergmann - - * NEWS: Add 4.1.2 NEWS entries to HEAD. - -2002-02-27 Zeev Suraski - - * main/php_version.h - NEWS - configure.in: Go with 4.1.2 - -2002-02-27 Sebastian Bergmann - - * sapi/servlet/servlet.java: - URLEncoder.encode(string) is deprecated in the Java 2 SDK 1.4. - -2002-02-26 Andi Gutmans - - * main/php_main.h - main/main.c: - - Hopefully fix the shutdown_memory_manager() stuff. Part of my previous - - patch seems to have gotten lost - -2002-02-26 Derick Rethans - - * ext/session/session.c: - Bring error message back - -2002-02-26 Sebastian Bergmann - - * main/main.c: TSRM Cleanup. - -2002-02-26 Andi Gutmans - - * main/main.c - main/php_main.h: - Pass shutdown_memory_manager the TSRMLS context. - -2002-02-26 Rasmus Lerdorf - - * NEWS: There are no fdf changes in this branch as far as I can see. Not - sure where this NEWS item came from. - - * NEWS: Remove gd NEWS item - - * ext/gd/config.m4: This line makes no sense to me - -2002-02-26 Zeev Suraski - - * NEWS: Beautify - -2002-02-26 Dan Kalowsky - - * ext/odbc/php_odbc.c: - Bug fix 15719 as submited by Joseph Southwell and allows NULL values in ODBC - -2002-02-26 Edin Kadribasic - - * ext/standard/dl.c: - Allow use of dl() when CLI is compiled with ZTS (bug #15717). - -2002-02-25 Yasuo Ohgaki - - * ext/pspell/pspell.c: Fix pspell function entry - -2002-02-25 jim winstead - - * sapi/apache/config.m4: - make it more clear that --with-apache and --with-apxs only work with apache 1.x. - -2002-02-25 Thomas V.V.Cox - - * pear/DB/ibase.php: - Experimental support for handling all the parameters accepted by - ibase_connect(). - -2002-02-25 Yasuo Ohgaki - - * NEWS: - Add news for mm save handler and multiple SAPI start up problem fix - - * ext/session/mod_mm.c - ext/session/session.c: MFH - - Fixed CGI (or other SAPI) start up failure when mm save handler is used - -2002-02-24 Rui Hirokawa - - * pear/DB/pgsql.php: - fixed error message handling with PostgreSQL 7.2 - -2002-02-24 Derick Rethans - - * ext/standard/var.c: - Fix the fix.. no need to escape " in single quotes - - * ext/standard/var.c: - Add slashes around string output - - * win32/install.txt: - Update with XP (Thanx to Jan for the patch) - -2002-02-24 Stig Bakken - - * pear/package.dtd: * fix broken dtd - -2002-02-24 Sebastian Bergmann - - * ext/wddx/wddx.c: Make phpinfo() look nicer. - -2002-02-23 Markus Fischer - - * ext/xslt/sablot.c: - - Fix info output (Peter Neuman ). - -2002-02-23 Thomas V.V.Cox - - * pear/package.dtd: - DTD corrections (make it require minimal data for installer) - -2002-02-23 Stig Bakken - - * pear/PEAR/Command/Common.php - pear/PEAR/Command/Install.php - pear/PEAR/Command.php - pear/PEAR/CommandResponse.php - pear/PEAR/Packager.php: - * started implementing new "cross-environment" command API - -2002-02-23 Holger Zimmermann - - * sapi/pi3web/pi3web_sapi.h - sapi/pi3web/pi3web_sapi.c: - Fixed functionality to read in server variables. - -2002-02-23 Rui Hirokawa - - * pear/DB/MAINTAINERS - pear/DB/pgsql.php: updated message format for PostgreSQL 7.2. - -2002-02-23 Thomas V.V.Cox - - * pear/README: Point readers to pear web - - * pear/TODO: outdated TODO not needed for the moment - -2002-02-23 Rui Hirokawa - - * NEWS: NEWS updated. - - * ext/mbstring/mbstring.c - ext/gd/config.m4 - ext/fdf/Makefile.in: - - fixed configuration problem as shared extension for fdf. - - fixed configuration problem as shared extension for gd with freetype1. - - default output encoding of mbstring changed to pass to fix initialization problem. - - * ext/gd/config.m4: fixed configure error with freetype1. - - * ext/mbstring/mbstring.c - ext/mbstring/php_mbregex.c: - fixed a comment and default output encoding changed to pass. - - * ext/mbstring/mbfilter.c: php.h included. - -2002-02-22 Christian Stocker - - * pear/HTML/ITX.php: E_ALL fix - -2002-02-22 Vincent Blavet - - * pear/PEAR/Installer.php - pear/PEAR/Packager.php: - * Packager : Changing the order of the files in the package archive file. - The package.xml file is now at the 'root' of the archive, the files tree are under a 'packagename'-'packageversion' folder - * Installer : installing the knew archive format AND supporting the existing format - -2002-02-22 Frank M. Kromann - - * ext/fbsql/php_fbsql.c: Return true on update success. - -2002-02-22 Rasmus Lerdorf - - * NEWS: Keep track of what has gone into 4.1.2 so far - -2002-02-22 Yasuo Ohgaki - - * ext/session/session.c: - Fix crash bug. 4th parameter is not incremental value, but it's assigned. - - * ext/pspell/pspell.c: Fix crash bug 15607 - -2002-02-21 Stefan Esser - - * main/rfc1867.c: fixing boundary check before someone other does it... - -2002-02-21 Yasuo Ohgaki - - * ext/standard/math.c - ext/standard/php_math.h - ext/standard/basic_functions.c: Added fmod() function - -2002-02-21 Mika Tuupola - - * pear/File/Find.php: - * Update PHPDoc. - -2002-02-21 Sebastian Bergmann - - * win32/php4dllts.dsp - win32/php4dll.dsp: Add aggregation to Win32 build. - -2002-02-21 Andrei Zmievski - - * ext/standard/basic_functions.h - ext/standard/php_standard.h - ext/standard/tests/aggregation/.cvsignore - ext/standard/tests/aggregation/aggregate.lib.php - ext/standard/tests/aggregation/aggregate.phpt - ext/standard/tests/aggregation/aggregate_methods.phpt - ext/standard/tests/aggregation/aggregate_methods_by_list.phpt - ext/standard/tests/aggregation/aggregate_methods_by_regexp.phpt - ext/standard/tests/aggregation/aggregate_properties.phpt - ext/standard/tests/aggregation/aggregate_properties_by_list.phpt - ext/standard/tests/aggregation/aggregate_properties_by_regexp.phpt - ext/standard/tests/aggregation/aggregation_info.phpt - ext/standard/tests/aggregation/deaggregate.phpt - ext/standard/aggregation.c - ext/standard/aggregation.h - ext/standard/basic_functions.c - ext/standard/Makefile.in - NEWS: Adding object aggregation capability along with tests. - -2002-02-21 Sean Bright - - * acinclude.m4: Fix for bug #15605 - -2002-02-20 Christian Stocker - - * ext/domxml/php_domxml.c: "o|a|b" is not valid ZE code. changed to "o|ab" - -2002-02-20 Vincent Blavet - - * pear/scripts/pearwin.php: - Config variables must be set between "" while using pear.bat windows script - - * pear/Archive/Tar.php: - * Correct bug while using windows dir separator. It is now supported - -2002-02-20 Rasmus Lerdorf - - * ext/standard/crc32.c - ext/standard/crc32.h: - Split CRC32 table out into a header file so other code can use it - -2002-02-20 Derick Rethans - - * ext/iconv/iconv.c: - Fix for bug #15628 (for real now :) - - * sapi/nsapi/nsapi-readme.txt: - Reformatting - - * ext/iconv/iconv.c: - Fix for bug #15638 - -2002-02-19 David Hedbor - - * sapi/caudium/caudium.c: Fixed environment hashing again. - -2002-02-19 Derick Rethans - - * genfiles: - Fix removal of #line lines - - * EXTENSIONS: - Update to note that I'm the mcrypt extension maintainer - -2002-02-19 Marc Boeren - - * EXTENSIONS: changed comment for dbx module - -2002-02-19 Dan Kalowsky - - * EXTENSIONS: -2002-02-18 Martin Jansen - - * pear/PEAR.php: ='typo' - -2002-02-18 Marc Boeren - - * ext/dbx/dbx.c - ext/dbx/dbx_sybasect.h: - Oops: source copy&paste should be done with care :) (Mc) - - * ext/dbx/CREDITS - ext/dbx/Makefile.in - ext/dbx/dbx.c - ext/dbx/dbx.dsp - ext/dbx/dbx_sybasect.c - ext/dbx/dbx_sybasect.h - ext/dbx/tests/002.phpt - ext/dbx/tests/005.phpt - ext/dbx/tests/006.phpt - ext/dbx/tests/dbx_test.p: - Added support for Sybase-CT to dbx module (Mc). - -2002-02-18 Ludovico Magnocavallo - - * pear/DB/ibase.php: fixed typo - -2002-02-17 Martin Jansen - - * pear/scripts/pearcmd-info.php: * Fix for bug #15500 - -2002-02-17 Stig Bakken - - * pear/package.dtd: * allow in both and - * added element - * added "data" role for files - * allow nested elements - -2002-02-17 Alex Waugh - - * sapi/webjames/webjames.c: Updated to new TSRM macros - -2002-02-17 Mika Tuupola - - * pear/File/Find.php: - * added mapTreeMultiple() method. - -2002-02-17 Jon Parise - - * pear/Makefile.in: - Image/Remote.php and Mail/mime.php have moved to the pear/ repository. - -2002-02-15 Andrei Zmievski - - * NEWS: Fix. - -2002-02-15 Jason Greene - - * ext/sockets/sockets.c: Fix parse string - (Since arg6 is initialized at null this still catches the wrong param condition) - -2002-02-15 Dan Kalowsky - - * ext/odbc/php_odbc.c: - fix for bug 15516, patch submitted by torben@php.net - -2002-02-15 Derick Rethans - - * sapi/cgi/cgi_main.c - sapi/cli/php_cli.c: - Make the errorcode 255. (Doing docs right away) - -2002-02-15 Yasuo Ohgaki - - * ext/pgsql/config.m4: Fix problem with sesssion_pgsql module - -2002-02-15 Sean Bright - - * ext/xslt/config.m4: Fix cosmetic bug. (#15142) - -2002-02-14 Derick Rethans - - * sapi/cgi/cgi_main.c - sapi/cli/php_cli.c - sapi/pi3web/pi3web_sapi.c - main/main.c: - - Let php_execute_script return 0 on failure and 1 on sucess, and change - SAPIs accordingly. (Andrei, Derick) - -2002-02-14 Adam Daniel - - * pear/HTML/Page.php: - changed html tags to lowercase and added Nils-Fredrik G. Kaland's - suggested array support to toHtml - -2002-02-14 Edin Kadribasic - - * sapi/cli/php_cli.c: Turned implicit_flush on. - Cleaned up help text. - - * sapi/cli/README: Added README file for CLI SAPI. - -2002-02-14 Derick Rethans - - * ext/ncurses/ncurses.c: - Remove duplicate constant - -2002-02-13 Frank M. Kromann - - * ext/sockets/sockets.dsp: Fixing release and debug build on Win32 - -2002-02-13 Vincent Blavet - - * pear/scripts/pearwin.php: - * Synchronize pearwin script with pearcmd-xxx.php commands - * Still work to do - - * pear/scripts/pearcmd-list.php: - * user system/user config rather than default value - -2002-02-13 Yavor Shahpasov - - * pear/HTML/Select.php: - Initialize $this->_values to avoid warrnings in case _values property is not set - - * pear/Schedule/At.php: White spaces. - -2002-02-13 Yasuo Ohgaki - - * ext/dbx/dbx_pgsql.c: Fix memory leaks. - -2002-02-13 Marc Boeren - - * ext/dbx/dbx_pgsql.c: - Fixed bug where users with empty passwords could not connect. (Mc) - -2002-02-13 Vincent Blavet - - * pear/scripts/pearwin.php: - - Adding support for remote-list command (with XML-RPC installed) - - Start support of show-config (still work to do ...) - -2002-02-13 Andrei Zmievski - - * NEWS: Ack. - -2002-02-13 Stig Bakken - - * pear/PEAR/Installer.php: * "pear-get install Auth" works now - - * pear/PEAR/Remote.php: * don't use ext/overload yet - - * pear/scripts/pearcmd-remote-list.php: * print package name - -2002-02-12 Jason Greene - - * NEWS: Fix entry - -2002-02-12 Jan Lehnardt - - * pear/DB/mysql.php: - - added default case for mysql_select_db error handling. It throws a - - DB_ERROR (unknown error) in the default case. - - * pear/DB.php - pear/DB/mysql.php: - - added support for different error messages for the following cases: - - - - if a user with unsufficient permissions trys to select a database - - PEAR::DB previously threw a "no database selected" error instead - - of a more proper "insufficient permissions". This is fixed now. - - - - if a user selects a nonexistant database PEAR::DB threw a - - "no database selected" error instead of "no such database". - - This is fixed as well. - - - - I added two new constants to DB.php and a simple case construct to - - DB/mysql.php which can be easily extended to achive the above. I - - hope this is ok. - - Thanks to Till Gerken for mentioning this. - -2002-02-12 Andrei Zmievski - - * NEWS: Fix-up. - -2002-02-12 Sascha Schumann - - * main/network.c: Irix defines AF_INET6, but lacks IPv6 support, including - struct sockaddr_in6. - -2002-02-12 Yasuo Ohgaki - - * ext/pgsql/pgsql.c: Initialize automatic persistent connection reset flag - -2002-02-12 Andrei Zmievski - - * ext/pcre/php_pcre.h - ext/pcre/php_pcre.c: - Fix a long-standing infelicity that resulted in extra regex information - not being passed to PCRE functions. - - * ext/pcre/php_pcre.h - ext/pcre/php_pcre.c: Expose pcre_get_compiled_regex as an API function. - -2002-02-11 Mark L. Woodward - - * ext/msession/msession.c: Added one more tweak for 4.0.x compatibility. - Used "#warning" to inform users of a hard dependency. - (If #warning is unaccptable, let me know!) - -2002-02-11 Sebastian Bergmann - - * sapi/servlet/README: Fugbix typo. - -2002-02-11 Martin Jansen - - * pear/HTTP.php: * Fix bug #15423. - -2002-02-11 Richard Heyes - - * pear/Mail/mime.php - pear/Mail/mimeDecode.php - pear/Mail/mimePart.php - pear/Mail/xmail.dtd - pear/Mail/xmail.xsl: - * Removed these files as they're now in /pear/Mail_Mime - -2002-02-11 Markus Fischer - - * ext/ldap/ldap.c: - Fix protos. - -2002-02-10 Sean Bright - - * ext/gmp/gmp.c: - '0b' could be the beginning of a hex string (without leading '0x') so if - the user specifies base 16, use that instead. - - * ext/gmp/tests/003.phpt: Add a new test for GMP base recognition. - - * ext/gmp/gmp.c: Fix for bugs #10133 and #15454. - - Bug #15454 results from a bug in GMP. If you pass in a string '0xABCD' and - specify a base of 0, GMP figures out that it is hex and skips over the 0x - characters. If you specify base 16, then it doesn't skip those chars. - This was confirmed with the following test program: - - - int main() - { - char *str_one, *str_two; - mpz_t num_one, num_two; - - mpz_init_set_str (num_one, "0x45", 0); - str_one = mpz_get_str(NULL, 10, num_one); - - mpz_init_set_str (num_two, "0x45", 16); - str_two = mpz_get_str(NULL, 10, num_two); - - printf("%s / %s\n", str_one, str_two); - - mpz_clear (num_one); - mpz_clear (num_two); - - return 0; - } - - We now take anything that starts with 0[xX] as hexidecimal and anything - that starts 0[bB] as binary (this is what GMP does internally). We also - no longer force the base to 10 or 16, but instead let GMP decide what the - best base is, be it hex, dec, or octal. - -2002-02-10 Jason Greene - - * ext/standard/basic_functions.c - ext/standard/php_var.h - ext/standard/var.c: Renamed zval_debug_dump() to debug_zval_dump() - -2002-02-10 Thomas V.V.Cox - - * pear/PEAR/Common.php: Now System will return false on fail - - * pear/tests/pear_system.phpt: test suite for the System class - - * pear/System.php: - - Now error will be triggered with trigger_error(). When a command - fails the function will return false - - In-line documentation update - -2002-02-10 Thies C. Arntzen - - * ext/oci8/oci8.c - ext/oci8/php_oci8.h: - only rollback at script end if there is something to rollback. - -2002-02-10 Stig Venaas - - * ext/ftp/ftp.c - main/network.c - main/php_network.h: - Added php_sockaddr_size() in network.c (and the header file). This is used - in ftp.c to make sure connect() and bind() is called with size argument - which is exactly the size of the relevant sockaddr_xx structure - -2002-02-10 Rui Hirokawa - - * pear/Mail/mime.php: Mail/mime/get has wrong parameter name. - -2002-02-10 Sebastian Bergmann - - * ext/tokenizer/tokenizer.c: TSRM fixes. - -2002-02-10 Jason Greene - - * ext/standard/basic_functions.c - ext/standard/php_var.h - ext/standard/var.c: internal information such as refcounts, and the true type names (Jason) - -2002-02-10 Yasuo Ohgaki - - * ext/mbstring/mbstring.c: Fix typo - -2002-02-09 Andrei Zmievski - - * ext/tokenizer/php_tokenizer.h - ext/tokenizer/tokenizer.c: *** empty log message *** - -2002-02-09 Stig Bakken - - * ext/tokenizer/tokenizer.c: * ZTS fix - -2002-02-08 Sebastian Bergmann - - * ext/tokenizer/.cvsignore - ext/tokenizer/tokenizer.dsp - win32/php_modules.dsw - php.ini-dist - php.ini-recommended: - Add MSVC workspace for tokenizer extension. Add php_tokenizer.dll entries to php.ini-*. - -2002-02-08 Thies C. Arntzen - - * ext/oci8/oci8.c - ext/oci8/php_oci8.h: - - got rid of unneded calls to OCIAttrGet when reexecuting the same query - - only invalidate the define list after all rows from a REFCORSOR are read, - "normal" corsors will now remember their column defines. this means that - ocigetcolumn[name|type|..] will from now on work even after the result set - has been read. - -2002-02-08 Stig Bakken - - * ext/tokenizer/.cvsignore - ext/tokenizer/CREDITS - ext/tokenizer/EXPERIMENTAL - ext/tokenizer/Makefile.in - ext/tokenizer/config.m4 - ext/tokenizer/php_tokenizer.h - ext/tokenizer/tokenizer.c - ext/tokenizer/tokenizer.php: Added Andrei's tokenizer extension - -2002-02-08 Mark L. Woodward - - * ext/msession/msession.c: - Backward compatibility to 4.0.6 does not have "HAVE_PHP_SESSION" define - Renamed PHP_4_x_API to PHP_4_x - -2002-02-07 Sterling Hughes - - * ext/session/php_session.h - ext/session/session.c: - move to the ZEND_DECLARE_MODULE_GLOBALS() and ZEND_EXTERN_MODULE_GLOBALS - macros - -2002-02-07 Martin Jansen - - * pear/scripts/pearcmd-remote-list.php: * Better error handling. - - * pear/HTTP.php: * Partially fix bug #15423. - -2002-02-07 Yasuo Ohgaki - - * main/output.c: Legacy code removed. - This line incorrectly removes buffer. - This line was correct only when ouput.c does not support - nested output buffers. Fixed bug #15178 - -2002-02-07 Thomas V.V.Cox - - * pear/DB/common.php - pear/DB/oci8.php: - Moved the array_change_key_case() PHP func definition to common - - * pear/DB/ibase.php: change column case to lower in compatibility mode - - * pear/DB/ibase.php: ws - -2002-02-06 Frank M. Kromann - - * ext/fbsql/php_fbsql.c: - Convert pLists to output character set before parsing the list - - * ext/fbsql/php_fbsql.c: Added order by clause in fbsql_list_tables(). - Table names will now be sorted. - - * ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.h: - Adding fbsql_table_name() aliased fbsql_tablename() for compatibility with MySQL - -2002-02-06 Derick Rethans - - * ext/odbc/config.m4: - Fix for bug 15404 - -2002-02-06 Yasuo Ohgaki - - * ext/mbstring/mbstring.c: Remove unused line - - * ext/mbstring/mbstring.c: Fixed crash with mb_output_handler() - When mb_output_hanlder is applied muiltiple times, PHP does not output. - This should be fixed also. - -2002-02-06 Thomas V.V.Cox - - * pear/System.php: - added 'System::type()' (show the full path of a command) - Copied almost verbatim from Stig's PEAR_Dependency::checkProgram() - -2002-02-06 Yasuo Ohgaki - - * ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: Clean up code. - Removed PHP_PGSQL_API macro. - Define pgsql_globals_id - - * ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: Make module specified functions to static. - Added TSRMLS_D/C, get rid of one TSRMLS_FETCH. - -2002-02-05 Andi Gutmans - - * ext/wddx/wddx.c - ext/standard/array.c: - - Add TSRMLS_FETCH()'s needed for the new object overloading in ZE2. - -2002-02-05 Mark L. Woodward - - * ext/msession/msession.c: - Sorry guys, PHP 4.0.6's ZEND_MODULE_API_NO is whacked, it has an extra - zero, thus ZEND_MODULE_API_NO >= xxxx, will not work for about 18000 years. - Added better checking, and cleaned up some of the #ifdef you seem to love - so much. - -2002-02-05 Hartmut Holzgraefe - - * ext/msession/msession.c: - removed the new-style parameter parser code for bc *and* readability - reasons, changed the remaining #ifdefs to check the api version - directly instead of using the not really related OLD_ZEND_PARAM macro - -2002-02-05 David Eriksson - - * ext/satellite/.cvsignore - ext/satellite/Makefile.in - ext/satellite/README - ext/satellite/class.c - ext/satellite/class.h - ext/satellite/common.c - ext/satellite/common.h - ext/satellite/config.m4 - ext/satellite/corba.c - ext/satellite/corba.h - ext/satellite/enum.c - ext/satellite/enum.h - ext/satellite/findtype.c - ext/satellite/findtype.h - ext/satellite/hashtable.c - ext/satellite/hashtable.h - ext/satellite/multiple_components.patch - ext/satellite/namedvalue_to_zval.c - ext/satellite/namedvalue_to_zval.h - ext/satellite/object.c - ext/satellite/object.h - ext/satellite/php_orbit.c - ext/satellite/php_orbit.h - ext/satellite/struct.c - ext/satellite/struct.h - ext/satellite/typecode.c - ext/satellite/typecode.h - ext/satellite/typemanager.c - ext/satellite/typemanager.h - ext/satellite/zval_to_namedvalue.c - ext/satellite/zval_to_namedvalue.h: - - Removed Satellite. It is now part of PEAR. - -2002-02-05 Yasuo Ohgaki - - * main/output.c: pval -> zval - Check number of parameters - - * main/main.c - php.ini-dist: register_globals=off is defualt for 4.2.0 - -2002-02-05 Jani Taskinen - - * ext/session/session.c: Let's be consistent and use zval instead of pval - - * ext/session/php_session.h - ext/session/session.c: Export php_session_start(). - - * configure.in: - The extensions build as shared were installed into wrong place - even as the layout was PHP. - -2002-02-04 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c: - Fixed compile error - -2002-02-04 Mark L. Woodward - - * ext/msession/msession.c: More 4.0.6 compatibility. - - * ext/msession/msession.c: Restored backward compatibility to PHP 4.0.6 - -2002-02-04 Thomas V.V.Cox - - * pear/DB/TESTERS: Added How To Run Tests - -2002-02-04 Yasuo Ohgaki - - * ext/crack/crack.c - ext/mailparse/mailparse.c: Fix ZTS startup crash - -2002-02-04 Thies C. Arntzen - - * ext/oracle/config.m4: add oracle 9 detection for oracle-module - -2002-02-04 Yasuo Ohgaki - - * ext/mbstring/mbstring.c: Remove TSRMLS_FETCH() does not need - - * ext/msession/msession.c - ext/domxml/php_domxml.c: Fix ZTS build - -2002-02-03 jim winstead - - * makedist: don't include old changelogs in distribution, either - -2002-02-03 Adam Dickmeiss - - * Makefile.in - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-03 Martin Jansen - - * pear/DB/ibase.php: - * nextID() and tableInfo() support by Lutz Brueckner . - -2002-02-03 Yasuo Ohgaki - - * ext/session/mod_files.c - ext/session/session.c: - Revert last commit. Last patch has problem for the 1st request. - - * ext/session/mod_files.c - ext/session/session.c: Fixed crash when save_path is invalid. - Fixed crash when user save handler is incorrectly used. - Fixed crash when session read failed. - - * ext/iconv/tests/001.phpt - ext/iconv/tests/002.inc - ext/iconv/tests/002.phpt - ext/iconv/tests/skipif.inc: Added UCS4 test - - * sapi/roxen/roxen.c: MFH - -2002-02-02 Shane Caraveo - - * sapi/isapi/stresstest/getopt.c - sapi/isapi/stresstest/getopt.h: now needs getopt - - * sapi/isapi/stresstest/stresstest.cpp - sapi/isapi/stresstest/stresstest.dsp: an update to stresstest - -2002-02-02 Sebastian Bergmann - - * sapi/cgi/cgi_main.c - sapi/fastcgi/fastcgi.c - sapi/pi3web/pi3web_sapi.c - sapi/servlet/servlet.c: - Remove obsolete CG(extended_info) = 0 calls, we already do this in zend_set_default_compile_time_values(). - - * ext/calendar/french.c - ext/calendar/julian.c: Consistency. - - * ext/calendar/gregor.c - ext/calendar/jewish.c: Fix a warning. - -2002-02-02 Jon Parise - - * configure.in: Revert revision 1.294. - - This commit broke things in interesting ways under FreeBSD. By adding these - default header files to every header check, a number of subsequent checks - failed (due to unsatisfied header file dependencies). This occured because - , for example, requires . In other words, these - default includes are not autonomous and don't make workable defaults. - -2002-02-02 Sebastian Bergmann - - * main/fopen_wrappers.c: Fix thread-safe build. - -2002-02-02 Stig Bakken - - * pear/DB/odbc.php: * use seqname_format option - - * pear/DB/common.php - pear/DB/fbsql.php - pear/DB/mssql.php - pear/DB/mysql.php - pear/DB/oci8.php - pear/DB/odbc.php - pear/DB/pgsql.php: - * the actual name of the sequences or sequence emulation tables may - now be configured with the "seqname_format" option - - * pear/package.dtd: * add some missing attributes - -2002-02-01 Andrei Zmievski - - * ext/standard/array.c: - Converted extract() to use smart_str for variable name manipulation. This - sped it up a bit. - -2002-02-01 James E. Flemer - - * main/fopen_wrappers.c - main/fopen_wrappers.h: - Changed php.ini directive 'safe_mode_include_dir' to accept a - (semi)colon separated path, rather than a single directory. - Also moved checking of said path into a separate path for code - readability. - -2002-02-01 Andrei Zmievski - - * NEWS: Added is_a() function. - -2002-02-01 Adam Dickmeiss - - * ext/yaz/php_yaz.c: Fixes in MARC decoder (base adress, DANmarc case). - -2002-02-01 Thomas V.V.Cox - - * pear/DB.php: Fix remote security risk, pointed out by Wolfram Kriesing - - * pear/DB/tests/db_parsedsn.phpt - pear/DB.php: - Added support for passing special backend params in DSN. Ex: - ibase://user:pass@localhost/db?role=foo&dialect=bar - -2002-02-01 Thies C. Arntzen - - * ext/readline/readline.c: remove some crap - -2002-02-01 James Cox - - * php.gif - php4.gif - php4.spec.in: - 2 years is ages.... and no way temporary. changed the php4 logo to a versionless one. - -2002-02-01 Derick Rethans - - * ext/gd/gd.c: - - Fix for bug 14899 (patch by Sander Roobol ) - -2002-02-01 Yasuo Ohgaki - - * ext/iconv/iconv.c: - Fixed bug with encodings that has 0 byte in strings. Patch by - Fixed possible problem with encodings that a char can be larger than - 4 bytes. - -2002-01-31 James Cox - - * LICENSE: updating license to 2002 (hasn't been done since 2000) - -2002-01-31 Boian Bonev - - * ext/vpopmail/php_vpopmail.c: fix comment - -2002-01-31 Martin Jansen - - * pear/HTTP.php: * Fix bug #15313 - -2002-01-31 Bertrand Mansion - - * pear/HTML/Table.php: Thanks to Arnaud Limbourg: - - phpDoc and cosmetic fixes - -2002-01-31 Derick Rethans - - * ext/standard/dl.c: - - Fix for bug 15311 (type mismatch of php_dl when #ifndef HAVE_LIBDL) - -2002-01-31 Yasuo Ohgaki - - * sapi/roxen/roxen.c: A fix for the bug number 13231 & 11699. - Makes the roxen support compile. Patch by Lars Wilhelmsen - -2002-01-31 Derick Rethans - - * ext/openssl/openssl.c: - Fix for openssl_pkcs7_sign segfaults - (patch by Christian Stocker ) - -2002-01-31 Stig Bakken - - * pear/scripts/pearize.in: * lowercase tags and attributes - - * pear/Makefile.in: * remove broken rule for rebuilding Makefile - -2002-01-31 Edin Kadribasic - - * main/main.c: Ignore register_globals for $argc and $argv under CLI SAPI. - -2002-01-30 Edin Kadribasic - - * acinclude.m4 - configure.in - sapi/cli/Makefile.in: - Enable extensions to specify that they are not supposed to be - built with the CLI SAPI. This is done by passing "nocli" as the - 3rd parameter to PHP_EXTENSION macro. - -2002-01-30 Dan Kalowsky - - * ext/odbc/php_odbc.c: Fix for bug #14803 - -2002-01-30 Sebastian Bergmann - - * sapi/servlet/README: Fugbix typo. Update path to /lib/optional. - -2002-01-30 Stig Bakken - - * pear/Makefile.in: * don't make command libs executable - - * pear/scripts/pear-get.in - pear/scripts/pear.in - pear/scripts/pearcmd-common.php - pear/scripts/pearcmd-help.php - pear/scripts/pearcmd-info.php - pear/scripts/pearcmd-install.php - pear/scripts/pearcmd-list.php - pear/scripts/pearcmd-package.php - pear/scripts/pearcmd-remote-list.php - pear/scripts/pearcmd-show-config.php - pear/scripts/pearcmd-uninstall.php - pear/Makefile.in: - * modularize "pear" and "pear-get" commands somewhat. checking options - etc. is done for both in pearcmd-common.php. - - * pear/PEAR/Common.php: * silence warning - - * pear/HTML/Form.php: * XHTML fixes by Hans Westerbeek - - * pear/package.dtd: * bring DTD up to date - -2002-01-30 Thies C. Arntzen - - * ext/oci8/oci8.c: enable "user-interrupts" - -2002-01-29 Chuck Hagenbuch - - * pear/DB/mysql.php: - Fix errors caused by not checking for variables before using them. - -2002-01-29 Sebastian Bergmann - - * win32/php_modules.dsw: Overload is built-in. - -2002-01-29 Stig Bakken - - * pear/DB/oci8.php: typo :) - -2002-01-28 Stig Bakken - - * pear/Net/Socket.php: - * doc comments, add setTimeout() and getStatus(), thanks to - Mads Mohr Christensen - -2002-01-28 Sterling Hughes - - * EXTENSIONS: Commit for mr. torben: - Add XSLT to extensions file, mark sablot obsolete - -2002-01-28 Jon Parise - - * ext/standard/math.c: These are now defined in zend_config.w32.h. - -2002-01-28 Thomas V.V.Cox - - * pear/DB/dbase.php: - PEAR dbase driver. Supports, connect, fetch modes, row limit, - numrows and numcols. - -2002-01-28 jim winstead - - * ext/interbase/Makefile.in: testing checkin - -2002-01-27 Jon Parise - - * ext/standard/math.c: - zend_isinf() is already defined in Zend/zend_config.w32.h for Win32. - -2002-01-27 Sterling Hughes - - * ext/bz2/bz2.c: fix proto's for Herr. Holzraefe. int -> resource - -2002-01-27 Chuck Hagenbuch - - * pear/Net/SMTP.php: command spacing - -2002-01-27 fabrice aeschbacher - - * ext/interbase/php_interbase.h - ext/interbase/interbase.c: - add ibase_add_user(), ibase_modify_user(), ibase_delete_use() - -2002-01-27 Jon Parise - - * ext/standard/math.c: - Use the zend_* versions of finite(), isinf(), and isnan(), as defined - in php_config.h. Redefine the zend_* versions in the case of Win32. - - This fixes the build on systems that don't provide a native version of, - say, isinf() (e.g. Solaris). - - * sapi/cgi/getopt.c - sapi/cli/getopt.c - ext/xml/xml.c: Add a note that this statement will never be reached. - - * ext/standard/mail.c: - Add a comment indicating that this return statement will never be reached. - - - * ext/sockets/sockets.c: Use socklen_t (instead of int) where appropriate. - - * ext/sockets/sockets.c: - Because php_network.h includes , it must be included after - _XPG4_2 is defined. - - This fixes the build under Solaris 8. - -2002-01-27 Sterling Hughes - - * ext/standard/pack.c: don't throw fatal errors, throw E_WARNING instead. - - * ext/curl/curl.c: hopefully fix --with-openssl issues - - * ext/bz2/bz2.c: Source code cleanup - - * ext/bz2/bz2.c: - Update code to last working version to avoid recent breaks. - - -2002-01-27 Marko Karppinen - - * acinclude.m4: - Enable developers to use PHP_ARG_ENABLE and PHP_ARG_WITH silently - to maintain legacy configure options without clutter in the - configure help and checking output. - -2002-01-26 Marko Karppinen - - * configure.in: - - Reorganized stuff in configure.in and added a few comments - - Added a check for ApplicationServices/ApplicationServices.h (Mac OS X) - - Added AC_PROG_CPP, AC_PROG_CXX and AC_PROG_CXXCPP - - Improved the IPv6 check to fail on Mac OS X (there's no IPv6 there yet) - -2002-01-26 Vincent Blavet - - * pear/PEAR/Packager.php: * Remove the use of a temp dir - * Tar archive is now doing the same work with less overhead - -2002-01-25 Marko Karppinen - - * configure.in: - Improve detection of resolv.h on versions of Darwin, FreeBSD and Solaris - (this requires post-2.13 autoconf, but 2.13 ignores it gracefully) - - * configure.in: Relying only on host_alias is wrong - -2002-01-25 Yasuo Ohgaki - - * ext/session/mod_mm.c: We need mm file for each user. - -2002-01-25 Derick Rethans - - * ext/xmlrpc/config.m4: - - Fix for bug #15227: Compiling the CGI binary with xmlrpc fails to - build/link expat - - * ext/standard/basic_functions.c: - - Fixed highlight_* (make it more robust) - -2002-01-25 Hartmut Holzgraefe - - * ext/ctype/EXPERIMENTAL: no longer experimental - -2002-01-25 Derick Rethans - - * ext/standard/basic_functions.c: - - Added optional parameter to highlight_string and highlight_file which - makes these functions return a highlighted string instead of dumping - to standard output. (Derick) - - Added optional parameter to highlight_string and highlight_file which - makes these functions return a highlighted string instead of dumping - to standard output. - -2002-01-25 Rasmus Lerdorf - - * ext/standard/array.c: - (extraxt) add EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags - -2002-01-25 Derick Rethans - - * ext/domxml/php_domxml.c: - - Fix for bug #14934: type property not set in comment nodes (domxml) - -2002-01-25 Yasuo Ohgaki - - * ext/session/mod_mm.c: Add sapi postfix for mm save path. - cli/cgi would not complain about mm save handler with this. - -2002-01-25 Doug MacEachern - - * sapi/apache2filter/sapi_apache2.c: adjust to ap_get_brigade() API change - -2002-01-25 Yasuo Ohgaki - - * php.ini-recommended - php.ini-dist: - Added "pgsql.auto_reset_persistent" ini entry to catch broken connection - always with pg_pconnect(). (Default Off in source and php.ini-*) - This option requires a little overhead for pg_pconnect(). - - * ext/pgsql/pgsql.c - ext/pgsql/php_pgsql.h: Added "auto_reset_presistent" ini entry. - -2002-01-24 Marko Karppinen - - * build/buildcheck.sh: - Latest libtools output a multiline version info. Deal with that - - * ext/standard/parsedate.y: - Ignore ordinal suffixes on numbers (bug #15210) - -2002-01-24 Edin Kadribasic - - * sapi/cli/config.m4: Added --disable-cli option. - - * NEWS: Made entry more consistent. - -2002-01-24 Sascha Schumann - - * configure.in: fix typo, found by edin - -2002-01-24 Andrei Zmievski - - * ext/wddx/wddx.c: Revert back to using element for newlines. - -2002-01-24 Thomas V.V.Cox - - * pear/CODING_STANDARDS: correct url - -2002-01-24 Marko Karppinen - - * acinclude.m4: - Added a case for Darwin / Mac OS X to PHP_SHLIB_SUFFIX_NAME - - * php.ini-dist - php.ini-recommended: Corrected a confusing comment (see bug #14972) - -2002-01-24 Sascha Schumann - - * Makefile.in - acinclude.m4 - configure.in - ext/ircg/config.m4: Don't build CLI, if an extension requests that. - - In this case, the ircg extension refers to thttpd-specific symbols - which causes the build of the cli sapi module to fail. - -2002-01-24 Yasuo Ohgaki - - * NEWS: Change NEWS entry according to pgsql source change. - - * ext/pgsql/pgsql.c: - Revert last 2 commit. Instead, make php_pgsql_do_connect() to catch - broken connection always. - -2002-01-24 Vincent Blavet - - * pear/scripts/pearwin.php - pear/PEAR/Installer.php: - * Call the PEAR_Registry constructor with the optional parameter - - * pear/PEAR/Registry.php: - * Adding the ability to set the PEAR_INSTALL_DIR while creating the Registry object (in the same way as Installer.php) - - * pear/Archive/Tar.php: - * Adding support of extraction of remote archive http://www/archive.tgz - * Correct bug while using Windows root path c:\xxx\yyy in extract fct - -2002-01-24 Yasuo Ohgaki - - * NEWS: - Added pgsql connection reset feature. Add my name to --enable-safe-mode fix. - - * ext/pgsql/pgsql.c: - Add a little more fault tolerance for pg_host, pg_tty and more. - - * ext/pgsql/pgsql.c: - No more httpd restart is required when PostgreSQL is rebooted. - -2002-01-24 James Cox - - * INSTALL: - updated INSTALL to be more relevant.. more fixes coming (at some point) - -2002-01-23 Vincent Blavet - - * pear/scripts/pearwin.php: * Add uninstall command - * Add list-installed command - -2002-01-23 Thomas V.V.Cox - - * pear/System.php: - Return false when the directory can not be created in mkDir() - - * pear/DB/tests/driver/.cvsignore: cvsignore - -2002-01-23 Frank M. Kromann - - * ext/fbsql/php_fbsql.c: Fixing spelling error in FrontBase section - Changed som int to unsigned int to remove compiler warnings - - * php.ini-dist - php.ini-recommended: Fixing spelling error in FrontBase section - -2002-01-23 Sebastian Bergmann - - * win32/php4ts.dsw - win32/php4ts_cli.dsp: Add workspace to build CLI SAPI Module on Win32. - - * sapi/cli/php_cli.c: Give Edin Kadribasic his due credits. - -2002-01-23 Edin Kadribasic - - * sapi/cli/php_cli.c: - No need to dupe this string in cli sapi (Bug #15181). - -2002-01-23 Yasuo Ohgaki - - * EXTENSIONS: Added comment for pgsql module. - -2002-01-23 Hartmut Holzgraefe - - * EXTENSIONS: claiming maintainance ownership of ext/calendar - - * apidoc-zend.txt: added info about FETCH macros - (written over a year ago but somehow never commited) - -2002-01-22 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c: - Simplified domxml_substitute_entities_default() function - -2002-01-22 Sterling Hughes - - * ext/curl/curl.c: just init CURL_GLOBAL_SSL - -2002-01-22 Thomas V.V.Cox - - * pear/DB/ibase.php: - - Fix a problem with the cast to array from ibase_fetch_object - (reported by Ludovico Magnocavallo ) - - Removed old, unsupported, unused DB_ibase->fetchRow() - (remember that fetchRow is a method from DB_result not DB_driver) - -2002-01-22 Jan Lehnardt - - * pear/File/Find.php: - whitespace fix - - * pear/File/Find.php: - - initialize $matches to avoid error message on unset variable - if no matches are found. - -2002-01-22 Christian Stocker - - * ext/domxml/php_domxml.c: - Getting rid of some compile warnings (thanks to markus for pointing me in the right direction :) ) - -2002-01-22 Sean Bright - - * ext/standard/string.c: - Fix for bug #15130. Way too much effort for this bug, but cleaned up code - a bit, use zend_parse_parameters(), etc, etc. We only look for extensions - in the basename, not the full path. - -2002-01-21 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.h - ext/domxml/php_domxml.c: - Added domxml_substitute_entities_default() function - -2002-01-21 Chris Jarecki - - * ext/domxml/php_domxml.c: - - fixed bug caused by libxml2 in xpath_register_ns() - - registered namespaces are now persistent - -2002-01-21 Jon Parise - - * pear/Archive/Tar.php - pear/Makefile.in: - Adding Archive/Tar.php to php4/pear/. This is needed in order for the - phptar script (php4/pear/scripts/phptar) to be useful, so it makes sense - to make Archive/Tar.php a standard component. - -2002-01-21 Martin Jansen - - * pear/HTML/IT.php: * Add possibility to load external files in template. - (Patch by Christian Dickmann .) - -2002-01-21 Hartmut Holzgraefe - - * acinclude.m4: removed check macros no longer needed due to CLI work - (plus reverting last commit, was in wrong dir :( ) - - * acinclude.m4: removed check macros no longer needed due to CLI work - -2002-01-21 Dan Kalowsky - - * ext/odbc/php_odbc.c: this closes off a number of ODBC bugs. - -2002-01-21 Derick Rethans - - * main/network.c: - - Fix for bug #15057: getimagesize() crashes when offline (on MacOSX) - -2002-01-21 Yasuo Ohgaki - - * ext/pgsql/pgsql.c: Fixed typo and proto - -2002-01-20 Edin Kadribasic - - * sapi/cgi/cgi_main.c: - Fixed bug #9041 and others in the same class (patch by pete.lee@ubs.com) - -2002-01-20 Markus Fischer - - * ext/standard/datetime.c: - - Fix crash with invalid localtime on Win32 systems. - -2002-01-20 Doug MacEachern - - * sapi/apache2filter/sapi_apache2.c: - adjust to ap_get_brigade and input filter api changes - -2002-01-20 Sebastian Bergmann - - * pear/Cache.php - pear/Cache.xml - pear/Makefile.in: Move Cache to /pear. - - * pear/Makefile.in: Move Payment_Verisign to /pear. - - * pear/Makefile.in - pear/Log.php: - Move Benchmark, Math, Numbers to /pear. Remove Log, it was already in /pear. - -2002-01-20 Hartmut Holzgraefe - - * ext/fbsql/php_fbsql.c: cut&paste errors in protos fixed - - * ext/domxml/php_domxml.c: proto fix - -2002-01-20 Sebastian Bergmann - - * TODO: Fixed by Sean Bright's commit. - -2002-01-20 Sean Bright - - * ext/db/db.c: Forgot to remove the return from a void function - - * ext/db/db.c - ext/db/php_db.h: - These PHP3_* macros aren't defined in the code, so these haven't been doing - anything for some time now (at least since 4.0 was released). So let's go - ahead and remove those. - -2002-01-20 Edin Kadribasic - - * TODO-4.2.txt: Removed entry implemented in cli sapi. - - * main/.cvsignore - main/Makefile.in - sapi/cli/Makefile.in - acinclude.m4 - configure.in - ext/ncurses/config.m4 - ext/pcntl/config.m4 - ext/readline/config.m4: - Modified the build system to make certain extensions (pcntl, ncurses, - pcntl) only with cgi/cli sapi's. This was done by adding 3rd optional - parameter to PHP_EXTENSION macro which should be set to "cli" if - the extension only makes sense for that class of api's. - - * ext/readline/.cvsignore: Added missing entry to .cvsignore - -2002-01-20 Yasuo Ohgaki - - * header: Get rid of needless spaces - - * README.CVS-RULES: Revert my last commit - -2002-01-19 Edin Kadribasic - - * TODO: Removed two issues resolved by the introduction of sapi/cli. - - * sapi/cli/php_cli.c: Merged patch from sapi/cgi. - -2002-01-19 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c: - - Fixed passing parameters to domxml_xslt_process(). Now they can be either strings or XPath expressions. - - Several minor fixes in domxml_xslt_process(). - -2002-01-19 Martin Jansen - - * pear/Crypt/HCEMD5.php: * Fix bug #13189. - -2002-01-19 Wez Furlong - - * ext/mailparse/rfc2045cdecode.c: - Make the decoder less strict to allow for brain-dead mailers that mark - messages as 7bit but then include 8bit chars in the body. - Thanks to Dan Fitzpatrick for bringing this to my attention. - -2002-01-19 Thomas V.V.Cox - - * pear/DB/common.php - pear/DB.php: - Stores limit_from and limit_count as DB_result proporties instead - of DB_common. Fixs bug when doing queries inside limitQuery results. - - * pear/DB/common.php: ws - - * pear/DB/oci8.php: - Removed unecesary check and only change the case of the keys - when data is returned (fetchInto()) - -2002-01-19 Yasuo Ohgaki - - * main/main.c: Make --enable-safe-mode useful - -2002-01-18 Shane Caraveo - - * sapi/cgi/cgi_main.c: reimplement extension listing - -2002-01-18 Thomas V.V.Cox - - * pear/DB/tests/driver/02fetch.phpt - pear/DB/tests/driver/03simplequery.phpt - pear/DB/tests/driver/04numcols.phpt - pear/DB/tests/driver/06prepexec.phpt - pear/DB/tests/driver/08affectedrows.phpt - pear/DB/tests/driver/15quote.phpt: - removed unneeded require_once "DB.php"; - - * pear/DB/odbc.php: - Fix fetch row by number (ODBC starts at 1) - - New "navision" syntax (this driver doesn't support fetchs by - number, so emulate row limit by skipping rows) - -2002-01-18 Markus Fischer - - * ext/domxml/php_domxml.c: - More WS fixes - -2002-01-18 Christian Stocker - - * ext/domxml/php_domxml.c: - shite :) too much WS fixes. leave the licence as it was... - - * ext/domxml/php_domxml.c: - WS fixes (replaced " " by \t) - -2002-01-18 Thomas V.V.Cox - - * pear/DB/STATUS - pear/DB/odbc.php: - added affectedRows() and test in numRows() if the backend - is capable of not to return this info - -2002-01-18 Christian Stocker - - * ext/domxml/php_domxml.c: - - added optional parameters format and level for domxml_dump_node() - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: - added macro DOMXML_PARAM_ONE - - added function domxml_dump_node($doc,$node). Dumps a node plus all - children into a string. (chregu) - - * ext/domxml/php_domxml.h - ext/domxml/php_domxml.c: - - Added function domxml_node_get_content() (chregu) - - * ext/domxml/config.m4 - ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: - added DOMXML_PARAM_THREE macro - - renamed domxml_dumpmem to domxml_dump_mem, added alias for - domxml_dumpmem - - domxml_has_attributes was missing in in zend_function_entry - - added function domxml_dump_file($filename,[$compression]). Dumps XML to - a file and uses compression, if specified (chregu) - - added exslt integration (see http://exslt.org for details). To be - configured with --with-dom-exslt[=DIR] (and --with-dom-xslt) (chregu, jaroslaw) - -2002-01-18 Yasuo Ohgaki - - * README.CVS-RULES: Fix typo - -2002-01-17 Adam Dickmeiss - - * ext/yaz/php_yaz.c - ext/yaz/php_yaz.h: - New function yaz_es_result: Z395.0 Extended Services Result. - -2002-01-17 Ilia Alshanetsky - - * ext/shmop/shmop.c: - Fixed shmop_read to append \0 to returned string in shmop_read to eliminate Zend warnings - -2002-01-17 Thies C. Arntzen - - * ext/session/session.c: - guys, shoot me if i'm wrong, but when we have set register_globals to off we - should _not_ touch any global variables at any time, right? so all session - register/unregister should only work on $HTTP_SESSION_VARS and $_SESSION. this - patch fixes at least one spot where we were touching globals even with - register_globals set to off. - - * ext/oci8/oci8.c: - - Added 3 new optional parameters to OCIFetchStatement(). They control - the number of rows to skip at the beginning of the cursor, the - maximun numer of rows that should be fetched and the format of the - returned array. - -2002-01-17 Sterling Hughes - - * NEWS: Fix attribution, its Petr's patch, not mine :) - - * NEWS: Little cleanup, add information about Sablotron 0.8 - - * ext/xslt/config.m4: Update for Sablotron .8 - -2002-01-17 Thomas V.V.Cox - - * pear/DB/pgsql.php: Test for results in _pgFieldFlags (thanks Brian Abent - ) - -2002-01-17 Yasuo Ohgaki - - * ext/domxml/config.m4: - Use libxml2 header if there are older version. Reported by - -2002-01-17 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: Added XsltStylesheet class with methods: - - domxml_xslt_stylesheet(string), - - domxml_xslt_stylesheet_doc(DomDocument), - - domxml_xslt_stylesheet_file(filename), - - process(DomDocument,parameters array) - previously domxml_xslt_process(). - -2002-01-16 Yasuo Ohgaki - - * ext/session/session.c: Export php_session_register_module/serializer - -2002-01-16 Rasmus Lerdorf - - * ext/snmp/config.m4: Fix typo - -2002-01-16 Marc Boeren - - * ext/dbx/dbx_mysql.c: - mysql_db_query is deprecated, fixed by using mysql_select_db and - mysql_query (Mc). - -2002-01-16 Bertrand Mansion - - * pear/HTML/Table.php: Changes by ReneÌ Jensen : - - Remove duplicate test - - Nicer html output for nested table level comment. - -2002-01-16 Yasuo Ohgaki - - * ext/session/php_session.h: - Export php_session_register_module/serializer. - -2002-01-16 Thomas V.V.Cox - - * pear/DB/tests/driver/15quote.phpt: add quote data test - -2002-01-15 Andrei Zmievski - - * ext/pcre/php_pcre.c - NEWS: - Fixed a bug with matching string containing null bytes. - -2002-01-14 Chris Jarecki - - * ext/domxml/php_domxml.c: - using macro in xpath_register_ns() - - fixed protos in xpath functions - -2002-01-14 Martin Jansen - - * pear/Date/Calc.php: * Fix for bug #15032. - -2002-01-14 Stefan Esser - - * main/SAPI.c: MFH: fix for bug #14776 - - * main/SAPI.c: fix for bug #14776 - -2002-01-14 Rui Hirokawa - - * ext/mbstring/mbregex.c: - fixed an error in mbstring caused by confliction with regex. - -2002-01-13 Edin Kadribasic - - * acinclude.m4 - sapi/cli/Makefile.in: - Fixed build in the directory other than $top_srcdir. - -2002-01-13 Thomas V.V.Cox - - * pear/DB/ibase.php: - Added modifyLimitQuery(). Only avaible for the Firebird syntax - (ibase(firebird)://user:pass@host/db) - (contributed by Ludovico Magnocavallo ) - - * pear/DB/tests/db_parsedsn.phpt: Two tests more - - * pear/DB/mysql.php: - Added support for socket and port options in connect() - - * pear/DB/pgsql.php: better DSN handling - - * pear/DB/tests/db_parsedsn.phpt: Test update - - * pear/DB.php: New DSN "protcocol(protocol_opts)" format support: - phptype://user:pass@protocol(proto_opts)/database - ex: - pgsql://user@unix()/pear - mysql://user@unix(/path/to/socket)/pear - pgsql://user:pass@word@tcp(somehost:7777)/pear - -2002-01-13 Rasmus Lerdorf - - * NEWS: 4.1.1 NEWS entry block was missing from the HEAD tree - -2002-01-13 Rui Hirokawa - - * ext/gd/config.m4: fixed some link error of gd's configure. - -2002-01-13 Edin Kadribasic - - * sapi/cli/Makefile.in - Makefile.in: - This should fix cli build when running 'make install' directly. - -2002-01-13 Chris Jarecki - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: - Added xpath_register_ns() function. - -2002-01-12 Edin Kadribasic - - * sapi/cli/Makefile.in: - Fixed CLI build when the main SAPI is built as a shered library. - - * Makefile.in - acinclude.m4 - configure.in - sapi/cli/.cvsignore - sapi/cli/Makefile.in - sapi/cli/config.m4: Modified the build system to always build CLI SAPI. - -2002-01-12 Gavin Sherry - - * ext/dba/dba_db2.c: - My bad. Left some stray debugging code in previous commit. - - * ext/dba/dba_db2.c: See the update to dba_db3.c - - * ext/dba/dba_db3.c: - This fixes the notorious "mode 'c' fails" bug (see bugs - 10380, 10798, 11732). The bug originates from the fact that mode "c" for db3 sets 'type' to DB_UNKNOWN and mode DB_CREATE when the database already exists. The underlying library raises an error at this logical discrepancy: obviously one cannot create a database of unknown type. - -2002-01-12 Vlad Krupin - - * ext/imap/php_imap.c: - Fixed segfault in imap_bodystruct() when called with an invalid message - number. Now it fails with a warning instead. - -2002-01-11 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: Added domxml_node_replace_node() function. - -2002-01-11 Rui Hirokawa - - * ext/mbstring/Makefile.in - ext/mbstring/config.m4 - ext/mbstring/mbregex.c - ext/mbstring/mbregex.h - ext/mbstring/mbstring.c - ext/mbstring/mbstring.h - ext/mbstring/php_mbregex.c: - Added multi-byte enabled regex functions. - -2002-01-11 Markus Fischer - - * ext/standard/file.c: - - mkdir(): made second (mode) parameter optional, default to 0777 - switched to zend_parse_parameters(). - -2002-01-11 Thomas V.V.Cox - - * pear/HTTP.php: - - Added HTTP::head($url) which sends a "HEAD" HTTP command to a server - and returns the headers as an associative array - - Call-time pass-by-reference fixes - - * pear/tests/pear1.phpt: - submit a test that will fail due to php bug #14744 - -2002-01-10 Frank M. Kromann - - * ext/fbsql/php_fbsql.c - ext/fbsql/php_fbsql.h: - Adding functions to get BLOB/CLOB size from a lob_handle. - Added descriptions on most protos - -2002-01-10 Andrei Zmievski - - * NEWS - ext/standard/array.c: - Fix the recursive counting, it was broken for associative or non-sequential - arrays. Also update NEWS file. - -2002-01-10 Derick Rethans - - * main/main.c: - - Make an E_NOTICE error type show 'Notice' instead of 'Warning'. - -2002-01-10 Yasuo Ohgaki - - * ext/session/mod_mm.c: Fix startup crash - -2002-01-10 Markus Fischer - - * ext/dio/dio.c: - Unified error messages. - - Improved argument handling in dio_fcntl(). - -2002-01-10 Yasuo Ohgaki - - * ext/session/mod_mm.c: Revert last commit - -2002-01-10 Sascha Schumann - - * ext/session/mod_mm.c: Improved code for handling PS(save_path) - - Don't MFH before further testing - - * ext/session/mod_mm.c: Ws fix - - * ext/standard/filestat.c: - (PHP touch) Operate on a stack buffer.. no need for allocating newtime - on the heap. - - * ext/standard/filestat.c: - Add three-parameter touch() which enables users to set - mtime/atime to different values. - -2002-01-10 Yasuo Ohgaki - - * ext/pgsql/tests/dropdb.inc: Fix bug in test script - - * ext/session/mod_mm.c: MFH - - * ext/session/mod_mm.c: Make use of save_path for mm file. - Patch by Henning Schmiedehausen - Closes bug 14808 - -2002-01-10 Sascha Schumann - - * ext/session/tests/003.phpt - ext/session/tests/004.phpt - ext/session/tests/005.phpt - ext/session/tests/006.phpt: - Make these tests succeed with non-standard settings - -2002-01-10 Markus Fischer - - * ext/domxml/php_domxml.h: - Fix compilation. (Christian Stocker) - -2002-01-10 Yasuo Ohgaki - - * header: Year update - - * EXTENSIONS: shmop got a new maintainer - -2002-01-09 jim winstead - - * ext/standard/tests/math/pow.phpt - NEWS - ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h: - Rename finite/isinf/isnan to more standard is_*() names. - - * ext/standard/type.h - ext/standard/php_type.h - ext/standard/type.c - ext/standard/basic_functions.h - ext/standard/php_standard.h - ext/standard/basic_functions.c - main/rfc1867.c: - Move type-handling functions into ext/standard/type.c (which had - a few otherwise unused functions in it). - -2002-01-09 Martin Jansen - - * pear/XML/Parser.php: * Whitespace. - -2002-01-09 Markus Fischer - - * ext/sockets/sockets.c: - Correct some protos. - -2002-01-09 Derick Rethans - - * ext/standard/tests/array/count_recursive.phpt - ext/standard/array.c: - Fix bug introduced in earlier patch - -2002-01-09 Yasuo Ohgaki - - * ext/shmop/README - ext/shmop/php_shmop.h - ext/shmop/shmop.c: MFH. - Bugs 10530,10656,14784 - -2002-01-09 Uwe Steinmann - - * ext/pgsql/pgsql.c: - fixed typo in deprecated functionname - -2002-01-09 Yasuo Ohgaki - - * ext/shmop/README - ext/shmop/config.m4 - ext/shmop/php_shmop.h - ext/shmop/shmop.c: - - shmop_open has a new flag for read/write access, 'w' - - eliminated a segfault when trying to write to a SHM_RDONLY segment - - eliminated a segfault when an invalid flag which starts with 'a' or 'c' is passed - - updated creators' email addresses - - changed error messages to say shmop_* instead of shm* to correspond with new shmop_* function names - Patch by Ilia Alshanetsky (ilia@prohost.org) - -2002-01-09 Jani Taskinen - - * ext/domxml/php_domxml.h: - Fixed compile with older libxml. - - * configure.in: - Fixed the creation of pear-get script. - - * acinclude.m4 - configure.in: - Reverted Hartmut's patch as it caused more trouble than it solved. - - * ext/readline/config.m4: whitespace - -2002-01-08 Jan Lehnardt - - * pear/HTML/Form.php - pear/HTML/Page.php: - fix two warnings, thanks to Erik Hjortsberg - -2002-01-08 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.c - ext/domxml/php_domxml.h: A - Changed names of functions: - - htmldoc() to html_doc(), - - htmldocfile() to html_doc_file(), - - domxml_htmldumpmem() to domxml_html_dump_mem(), - - htmldumpmem() to html_dump_mem(). - -2002-01-08 Jani Taskinen - - * ext/ext_skel: - Some whitespace fixes (naugthy me :) and make use of PHP_CHECK_LIBRARY - macro instead of AC_CHECK_LIB. - - -2002-01-08 Sterling Hughes - - * ext/sockets/sockets.c: Changed proto via Georg Richter's request. - -2002-01-08 Jaroslaw Kolakowski - - * ext/domxml/php_domxml.h - ext/domxml/php_domxml.c - ext/domxml/config.m4: - - Added functions: htmldoc(), htmldocfile(), domxml_htmldumpmem(). - - Added error handling for the libxml library. - - Added preliminary DOM XSLT support: - -- uses the libxslt library, - -- operates on DOM objects, not strings, - -- functions: domxml_xslt_process(), domxml_xslt_version(). - -2002-01-07 James Cox - - * win32/install.txt: - browscap url fix, plus removed ^M references. it should look nice on any os. - - * win32/install.txt: - changed the instructions for php with win32 + apache. Recommending using sapi - over cgi binary, since cgi binary and apache don't mix well security wise. - -2002-01-07 Yasuo Ohgaki - - * ext/session/session.c: MFH - - * NEWS: New PostgreSQL functions - -2002-01-07 Egon Schmid - - * ext/mbstring/mbstring.c: Fixed some protos. - -2002-01-07 Rui Hirokawa - - * ext/mbstring/mbstring.c - ext/mbstring/mbstring.h: - added mb_get_info() to get internal settings of mbstring. - -2002-01-07 Markus Fischer - - * ext/domxml/php_domxml.c: - - Fix domxml_node_unlink_node() proto and return value. - -2002-01-07 Thomas V.V.Cox - - * pear/HTTP.php: ws - -2002-01-06 Stig Venaas - - * ext/ftp/ftp.c - ext/ftp/ftp.h: Added IPv6 support - - * main/network.c - main/php_network.h: - hostconnect now divides the timeout with no. of addresses. If a connection - attempt times out, it goes on to the next. Unless each timeout would be - <5s. Added php_any_addr() that fills out the any address for IPv6 and IPv4. - -2002-01-06 Thomas V.V.Cox - - * pear/scripts/pear-get.in - pear/scripts/pear.in: - use the new Console_Getopt::readPHPArgv() function to read args - - * pear/Console/Getopt.php: - Added readPHPArgv() function that will safely read the $argv PHP array - across different PHP configurations. Will take care on register_globals - and register_argc_argv ini directives and the new $_SERVER vars - -2002-01-06 Edin Kadribasic - - * sapi/cli/.cvsignore - sapi/cli/CREDITS - sapi/cli/Makefile.in - sapi/cli/config.m4 - sapi/cli/getopt.c - sapi/cli/php_cli.c - sapi/cli/php_getopt.h: Added CLI (command line intrerface) sapi. - - * main/SAPI.h - main/main.c: - Added argc and argv in request_info needed for the new cli sapi. - Modified registering $argc and $argv to support cli sapi. - -2002-01-06 Stig Venaas - - * ext/sockets/php_sockets.h - ext/sockets/sockets.c - main/network.c - main/php_network.h - configure.in: - Added some consts for arguments in network.c declarations. Moved - php_sockaddr_storage to php_network.h and added check for struct - sockaddr_storage - -2002-01-06 Thomas V.V.Cox - - * pear/DB/tests/driver/setup.inc: pgsql->mysql - -2002-01-06 Stig Bakken - - * ChangeLog.2001.gz: * archive the 2001 changelog - -2002-01-06 Thomas V.V.Cox - - * pear/DB/tests/pgsql/09numrows.phpt - pear/DB/tests/mysql/09numrows.phpt: this test is no longer here - - * pear/DB/tests/driver/01connect.phpt - pear/DB/tests/driver/02fetch.phpt - pear/DB/tests/driver/03simplequery.phpt - pear/DB/tests/driver/04numcols.phpt - pear/DB/tests/driver/05sequences.phpt - pear/DB/tests/driver/06prepexec.phpt - pear/DB/tests/driver/08affectedrows.phpt - pear/DB/tests/driver/09numrows.phpt - pear/DB/tests/driver/10errormap.phpt - pear/DB/tests/driver/13limit.phpt - pear/DB/tests/driver/14fetchmode_object.phpt - pear/DB/tests/driver/README - pear/DB/tests/driver/connect.inc - pear/DB/tests/driver/mktable.inc - pear/DB/tests/driver/setup.inc - pear/DB/tests/driver/skipif.inc: Multi-Driver portability test - - * pear/DB/tests/errors.inc - pear/DB/tests/limit.inc - pear/DB/tests/numrows.inc - pear/DB/tests/tableinfo.inc: test updates - - * pear/DB/oci8.php: - use count(*) instead of count(a, b) - - preserve the error handler when testing the sequence - - missing E_ALL fixes - - * pear/DB/oci8.php: - change the case of column names to lower case when - "optimize=portability" (use a slow php array_change_key_case() until - PHP get its C native version avaible. Please do it!) - - Improved error reporting in connection - -2002-01-05 Markus Fischer - - * ext/domxml/php_domxml.c: - - Refuse attribute nodes on add_child() and add list destructor for PI - nodes. (Christian Stocker) - - Fix append_child() according to add_child(). - - Fix some protos, minor code and warning message cosmetics. - -2002-01-05 jim winstead - - * ext/standard/tests/strings/wordwrap.phpt - ext/standard/string.c: - More tweaking of wordwrap() with the cut parameter set. It was being a - little too aggressive and cutting words without breaking at spaces - first. (A couple of tests were incorrect.) - - * ext/standard/tests/strings/wordwrap.phpt - ext/standard/string.c: - New memcpy()-based wordwrap() implementation. The simple case - (single-character break, no forced break) appears to be about 60% - faster, and there's simply no comparison for non-simple cases with - non-trivial amounts of text. The old algorithm was O(n^2) (with an - unfortunately large constant factor) because of the use of strncat(), - the new one is O(n). Added some more tests, too. - -2002-01-05 Thomas V.V.Cox - - * pear/scripts/pear-get.in - pear/scripts/pear.in: Added check for $argv avaible - (thanks Michael Härtl ) - -2002-01-05 jim winstead - - * ext/standard/math.c: Fix the Win32 compile. - -2002-01-05 Egon Schmid - - * ext/standard/math.c - ext/standard/basic_functions.c: Fixed some protos. - -2002-01-05 jim winstead - - * ext/standard/math.c: - Apparently multi_convert_to_double_ex() didn't quite do what I - thought. Still need to handle numeric strings. - - * ext/standard/tests/math/pow.phpt - ext/standard/basic_functions.c - ext/standard/math.c - ext/standard/php_math.h: - Fixed pow(), and added finite(), isinf(), and isnan(). Also fixed - pow() tests. - - * ext/standard/tests/math/pow.phpt: - good grief, positive powers of 0 are well-defined. (code fix coming.) - - * ext/standard/reg.c: - Be more aggressive in making sure that substring matches are valid in - ereg_replace before trying to use them. - -2002-01-05 Zak Greant - - * ext/standard/tests/array/array_data.txt: - Surprising how tests can fail when they don't have any supporting data :) Thanks for the catch Jan and Jim - -2002-01-04 Jon Parise - - * main/rfc1867.c: Nuke unused variable warning (end_arr). - -2002-01-04 Stig Venaas - - * ext/ldap/ldap.c - ext/ldap/php_ldap.h: - Made ldap_modify() an alias for ldap_mod_replace(). The two were identical. - -2002-01-04 jim winstead - - * ext/standard/tests/strings/wordwrap.phpt - ext/standard/string.c: - Fixed segfault in wordwrap() when wrapping to zero width and using - multi-character break or trying to force cut (bug #12768, now fails - and issues a warning because forcing a zero-width cut doesn't make - sense). Also converted to new paramater-passing API and avoid making - an extra copy of the return values. - -2002-01-04 Sterling Hughes - - * ext/dio/dio.c: Added the O_NOCTTY option, for terminal i/o. - -2002-01-04 Hartmut Holzgraefe - - * configure.in: first PHP_EXTENSION_LIBS casualty :( - -2002-01-04 Ben Mansell - - * sapi/fastcgi/fastcgi.c: - Added log_message function to the FastCGI sapi, so you can see error - output from scripts - -2002-01-04 Hartmut Holzgraefe - - * ext/ncurses/config.m4: ncurses is useless in webserver modules - - * ext/xmlrpc/config.m4 - ext/xslt/config.m4: more unquoted messages with kommas fixed - - * ext/mcrypt/config.m4: - always quote messages with [...], *especialy* when using kommas in the text - - * ext/domxml/php_domxml.c: proto fixes - - * ext/pcntl/config.m4: use predefined function instead of hardcoded test - - * ext/pcntl/pcntl.c - ext/odbc/velocis.c: proto fix - - * CODING_STANDARDS: small clarification - -2002-01-04 Sascha Schumann - - * genfiles: Remove #line's from var_unserializer.c - -2002-01-04 Hartmut Holzgraefe - - * ext/readline/config.m4: check for library existance before adding them - - * acinclude.m4: two new check functions for use in config.m4 file - -2002-01-04 Sebastian Bergmann - - * ext/mssql/.cvsignore: Update .cvsignore. - -2002-01-03 Frank M. Kromann - - * ext/mssql/php_mssql.c: - Making error handling thread safe. Thanks to Paco Ortiz - -2002-01-03 Hartmut Holzgraefe - - * acinclude.m4 - configure.in: - make configure more robust if extensions add libraries without - checking for their existance first - - old behaviour was to fail on the next library check with misleading - messages, now configure will work but make will fail with a - 'lib not found' message - - * ext/standard/string.c: - fix for bug #14832: basename with 2nd parm corrupts source string - -2002-01-03 Markus Fischer - - * ext/ftp/php_ftp.c: - Now use ZE's builtin zend_zval_type_name(). - - * ext/domxml/php_domxml.c: - - domxml_node_add_child(): Perform deep copy before adding child to prevent - double memory freeing. - - * ext/ftp/php_ftp.c: - FTP_BINARY is more common instead of FTP_IMAGE. - -2002-01-03 Thies C. Arntzen - - * ext/standard/dir.c: protos fixes by Wolfgang Drews - -2002-01-03 Egon Schmid - - * ext/ftp/php_ftp.c: - Please, no punctuation mark at the end of the description. - -2002-01-02 Zak Greant - - * ext/standard/basic_functions.c: - Adding key_exists alias for array_key_exists, at the request of One-Who-Shall-Not-Be-Named-Because-He-Is-On-Vacation - -2002-01-02 Stig Bakken - - * pear/DB/tests/db_error.phpt - pear/DB/tests/db_error2.phpt - pear/tests/pear_error.phpt: * PEAR.php line number changes again - - * pear/tests/pear_registry.phpt: - * registry files renamed from .inf to .reg, update test - - * pear/PEAR/Installer.php: * support "pear-get install XML_RPC" - - * pear/Makefile.in - pear/scripts/.cvsignore - pear/scripts/pear-get.in - pear/scripts/pear.in: - * start splitting "pear" command into "pear" and "pear-get" - - * pear/PEAR/Remote.php: * use new overloading API properly - -2002-01-02 Markus Fischer - - * ext/ftp/php_ftp.c: - - Corrected proto for ftp_connect() (new optional parameter for initial - custom timeout). - - * ext/ftp/ftp.c - ext/ftp/ftp.h - ext/ftp/php_ftp.c - ext/ftp/php_ftp.h: - - Added ftp_set_option(), ftp_get_option() and support for setting a - custom timeout. - -2002-01-02 jim winstead - - * ext/gd/gd.c: - jpeg2wbmp,png2wbmp: fix prototypes; _php_image_convert: simplify argument count checking - -2002-01-02 Markus Fischer - - * ext/ftp/php_ftp.c: - Fixed ftp_fget() and ftp_mkdir() protos. - - * ext/ftp/php_ftp.c: - Corrected proto for ftp_fget(). - -2002-01-01 Markus Fischer - - * ext/ftp/php_ftp.c - ext/ftp/php_ftp.h: - - Switched to zend_parse_parameters(), unified error/warning messages, - use real resources instead of integers, adjusted prototypes (hope I got - them all). - - * NEWS: - Summarize dbase fixes. - -2002-01-01 Adam Dickmeiss - - * ext/yaz/php_yaz.c: - Removal of non-essential parameters for non-piggyback search. diff --git a/ChangeLog.1999.gz b/ChangeLog.1999.gz deleted file mode 100644 index 9d92dda73f6ce8bf6d81faa19d399a774282003b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 78772 zcmV(vK14C$GZf9joZ)YwsIXO81tUUd5+qROw_pdLt2+Vu72Mgx(Mh?-voK-;j9$eqq7G zAAkIDc6c;&>pLfo?JR&jkJ8T;uY{CwWzO;QQ-?5nRB{PzvhypfM3eFEqy{gq_8 zAu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Teq=BbARR9pdKg%Kq)qzp%&{28UxsR&Wztn?bihFB$ITV#CckV z>shQNB6+v{+x#9My{tVjU&1oL)Sy4hRysgNY@uaXKh6B$$xHip{gphPYfsoYOnZ_| z|Eja+nP%g`Oz|{mD$)NW;I%*jHjIJtw zt&-|3s#9&^^-w+4Gb*g5-;2-s6m5Mb>cS~%XWc5h|3r1G_u8r0-O^!{7Nt9$&DEN= zZ|bG^a&o*4NRThId9f8iljE6Q$DtEI8&ddL^@gijhs)cl^|Hk53fGWnX|=By&BpbSOtQbp7MWW(P$||I zbr-pMkSP*nR8z*mX@t=R?xeON?R&BNN2zNuw|`=lQFl2f z70Bp+Uj5m8@cHuUR4#uFtnl;Y&Aa!PH@DVLaX)$ChdHX^^lL5ndsoQnpZAv+Z?0}! zN+gwHeevU`tBc#q>#GTrs$J18uWoM7-@kX{)cS>0!o|louP<+J_^mg8z7_R=&&Auf zpKcrlw0&UbfBpLM>Mf*Ry*~f=+L>eRm0BJj{vzIRe#$BK7w^um-o9}bCR400UVVCd WW5atoK6k$+^ZI{%FQvtlFa-d_5N6Z> diff --git a/ChangeLog.2000.gz b/ChangeLog.2000.gz deleted file mode 100644 index 91cd3b2425c1870248804bc3a8779fd347d5b8ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159518 zcmV(&K;ge1iwFodjMq8>14C$GZf9joZ)YwtFfcFx#9Uc-+c=hfuU~;lJ;YAMlGh~V zsncUeb`no}Ye}xE$%_s}LJ~?O!2(Dt%AEf1^W6)OB4v4zT|M2WB1-^><>D^iUD&(Z z+uK_^yIZ^Oh3Mtd#3~(&FU5Ewtq{MIEiKn_l*u#?vQ{edzy0uo!2jNeOa`WXStLVg zY`d$IAZ=xn?2vnpqe$cvDSY>UyG0lW){2ofBGl=vG&wDqYZ0W87#W=iH!Lj@X@c0c ze)wUxw#lzj-ilsf0y|aM;dlHz`YzL`73!qgl>C;rZH@^86SaqdRpDS%q+zafYFi-> z63sy)70cBBWA!YN6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H2uzbYSD#TZo^tEs%x3HG&i1{e0ZOiy>!6Y1(+fmeKZaLq(Tm- z_c`dN$zz4lvE2cagZ5+=rQnZ^6D#3hj-Mi)m#C>B9BrK7W@nI|P4e6HyzkGh-+efh zFc6t-Y3{gt8j*Hy((*p!jSCD0B@5t4s^G&}moEL`&0o$=uJ`n>N?xM-@-|+2mJ9K4xkigmB}8SZhIS2_jp|xEZZ`A}oLgK4?5T6Y z>5u=JD_Cnu9On5Q80`~gER)U4LY7K_FFPtH ze_LX|_|7S-|DhK}FjW7!`9L$20E8sK_L^DU2ErgpxAY1~w zF_+**<0b2A4sqam6mhU>@gXA|_j3^lr!8tGGf+zO;fWw*&hRhVJz}Iqn(jz$ap;Eazn&rBx`)bOPNM@ z*^y=dVte!MDcf0g=x28@p8!v9GOl~xd}^^knmJzBZ1y*{#hG1%4e?|p;e?_?B-7^Y z&@%3icP$t`JL(Co1+(0(bG`2Jn2GZ#^7e37laceWq8p26GqT*D6hAieY5Bu0NLG2K z{q^9d?Em|b=MJO(sB zK-9X7)1ss%7Oz9EJt_@)&$_d^!wq8ML;23IjjVW}n~k-?QQ}*v(RzbuN&fR8IEyiS z$=5SKm(^oS^knx-KO0r+0o(U0p<5ns7Y&xWXW-xAzZH5snxK~-KRLVXoUMe()Rr2#2aVxp*hYrYESR?LK{5bYo__hq=0<`%tmId2_j50?mVJ3$ z#(Bqe;Xg*J;C!p(*sQ+|si|{P_Mv;GNp3kGC%n(+ lJq17Jz6(sr77r`2{3a0Yp;)kf77x)^{~zh25FsSJ2>^3^lVJb= diff --git a/ChangeLog.2001.gz b/ChangeLog.2001.gz deleted file mode 100644 index 4f0a6f82414da6059ebbab7bdb5752c3967b5431..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198003 zcmV(vK^f=Voh*H3Wvlm;eTu0YuRs?r*=Rdj=#xy)4_cwd*R2ATXFmPxtB5 zJX~b0Gb5A5 zMHKJx<8xWXsi;yVDmluOaMc`t&6sZ){ISC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mo1M>Si)kiRK;N-J;@RjCTZlDUl=h{*0dY^7>_5@{3qHB?xIvHjiPWyl#b#t zw@@zaoo$m%O&iQt@O*P^hhZH0w(S0z6=PlAMJOXojJT0*Y;jzyNB#Tm{{ipue{Qfw F3;=g(PR#%S diff --git a/EXTENSIONS b/EXTENSIONS deleted file mode 100644 index 198c05f9b64..00000000000 --- a/EXTENSIONS +++ /dev/null @@ -1,463 +0,0 @@ - List of PHP maintainers - ======================= - -Maintenance legend ------------------- - Supported: Someone is actually paid to look after this. - Maintained: Someone actually looks after it. - Odd Fixes: It has a maintainer but they don't have time to do - much other than throw the odd patch in. See below. - Orphan: No current maintainer [but maybe you could take the - role as you write your new code]. - Obsolete: Old code. Something tagged obsolete generally means - it has been replaced by a better system and you - should be using that. - Unknown: Not known at this time. - -Status legend -------------- - Working: Working under both Windows and Unix. - Windows: Working only under Windows. - Unix: Working only under Unix. - Experimental: Under development or initial release. - Not Working: Not working. - Unknown: Status unknown. - - -== Server APIs == - -------------------------------------------------------------------------------- -EXTENSION: aolserver -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: apache -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: cgi -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: fhttpd -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: isapi -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: nsapi -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: phttpd -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: pi3web -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: roxen -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: servlet -PRIMARY MAINTAINER: Sam Ruby -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: thttpd -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: webjames -PRIMARY MAINTAINER: Alex Waugh -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- - - -== Database extensions == - -------------------------------------------------------------------------------- -EXTENSION: dba -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: dbase -PRIMARY MAINTAINER: Jim Winstead -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: dbx -PRIMARY MAINTAINER: Marc Boeren -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.6 -COMMENT: DB abstraction for odbc, mysql, pgsql, mssql, fbsql and more, see documentation -------------------------------------------------------------------------------- -EXTENSION: filepro -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: hyperwave -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: informix -PRIMARY MAINTAINER: Danny Heijl -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: ingres_ii -PRIMARY MAINTAINER: David Hénot -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: interbase -PRIMARY MAINTAINER: Jouni Ahto -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: msql -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: msession -PRIMARY MAINTAINER Mark L. Woodward mlwmohawk@mohawksoft.com -MAINTENANCE: Maintained -STATUS: Working/Experimental -COMMENT: Tested on Linux, should work on other UNIX platforms. Backend server code can compile under Windows. -------------------------------------------------------------------------------- -EXTENSION: mssql -PRIMARY MAINTAINER: Frank M. Kromann -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Tested on phpts and isapi versions -------------------------------------------------------------------------------- -EXTENSION: mysql -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: pgsql -PRIMARY MAINTAINER: Yasuo Ohgaki -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug. -------------------------------------------------------------------------------- -EXTENSION: sybase -MAINTENANCE: Unknown -STATUS: Not Working -------------------------------------------------------------------------------- -EXTENSION: sybase_ct -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: oci8 -PRIMARY MAINTAINER: Thies C. Arntzen -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: odbc -PRIMARY MAINTAINER: Daniel R. Kalowsky -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Working except for persistent connections -------------------------------------------------------------------------------- -EXTENSION: oracle -PRIMARY MAINTAINER: Thies C. Arntzen -MAINTENANCE: Maintained -STATUS: Working -COMMENT: Using the new OCI8 driver is encouraged where possible. -------------------------------------------------------------------------------- - - -== Other extensions == - -------------------------------------------------------------------------------- -EXTENSION: aspell -MAINTENANCE: Unknown -STATUS: Working -COMMENT: For aspell .27 and greater, check out the pspell extension -------------------------------------------------------------------------------- -EXTENSION: bcmath -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: bz2 -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: calendar -PRIMARY MAINTAINER: Hartmut Holzgraefe -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: com -PRIMARY MAINTAINER: Harald Radi -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: cpdf -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: crack -MAINTENANCE: Unknown -STATUS: Experimental -SINCE: 4.0.5 -------------------------------------------------------------------------------- -EXTENSION: curl -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: cybercash -PRIMARY MAINTAINER: Evan Klinger -MAINTENANCE: Maintained -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: domxml -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: dotnet -PRIMARY MAINTAINER: Sam Ruby -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: exif -PRIMARY MAINTAINER: Marcus Boerger -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.2 -------------------------------------------------------------------------------- -EXTENSION: fdf -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: ftp -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: gd -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: gettext -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: gmp -MAINTENANCE: Unknown -STATUS: Unknown -SINCE: 4.0.4 -------------------------------------------------------------------------------- -EXTENSION: icap -MAINTENANCE: Unknown -STATUS: Obsolete -------------------------------------------------------------------------------- -EXTENSION: imap -PRIMARY MAINTAINER: Chuck Hagenbuch -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: java -PRIMARY MAINTAINER: Sam Ruby -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: ldap -PRIMARY MAINTAINER: Stig Venaas -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mbstring -PRIMARY MAINTAINER: Rui Hirokawa -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mcal -PRIMARY MAINTAINER: Chuck Hagenbuch -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mcrypt -PRIMARY MAINTAINER: Derick Rethans -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: mhash -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: muscat -PRIMARY MAINTAINER: Sam Liddicott -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.5 -COMMENT: Not tested against windows, only core API completed, rest under development -------------------------------------------------------------------------------- -EXTENSION: openssl -PRIMARY MAINTAINER: Wez Furlong -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.4 -------------------------------------------------------------------------------- -EXTENSION: overload -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Maintained -STATUS: Experimental -------------------------------------------------------------------------------- -EXTENSION: pcre -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: pdf -PRIMARY MAINTAINER: Uwe Steinmann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: pfpro -PRIMARY MAINTAINER: David Croft -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: posix -PRIMARY MAINTAINER: Kristian Köhntopp -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: printer -PRIMARY MAINTAINER: Daniel Beulshausen -MAINTENANCE: Maintained -STATUS: Working -SINCE: 4.0.4 -COMMENT: Only for Win32 -------------------------------------------------------------------------------- -EXTENSION: pspell -PRIMARY MAINTAINER: Vlad Krupin -MAINTENANCE: Unknown -STATUS: Unknown -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: qtdom -MAINTENANCE: Unknown -STATUS: Experimental -SINCE: 4.0.4 -------------------------------------------------------------------------------- -EXTENSION: readline -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: recode -PRIMARY MAINTAINER: Kristian Köhntopp -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: sablot -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Obsolete -STATUS: Experimental -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: satellite -PRIMARY MAINTAINER: David Eriksson -MAINTENANCE: Odd Fixes -STATUS: Experimental -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: session -PRIMARY MAINTAINER: Sascha Schumann -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: shmop -PRIMARY MAINTAINER: Ilia Alshanetsky -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.3 -------------------------------------------------------------------------------- -EXTENSION: snmp -PRIMARY MAINTAINER: Rasmus Lerdorf -MAINTENANCE: Odd Fixes -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: sockets -PRIMARY MAINTAINER: Chris Vandomelen -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.2 -------------------------------------------------------------------------------- -EXTENSION: swf -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Depreciated (Use the ming swf extension instead) -COMMENT: Only for Unix (won't change) -------------------------------------------------------------------------------- -EXTENSION: sysvsem -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: sysvshm -MAINTENANCE: Unknown -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: vpopmail -MAINTENANCE: Unknown -STATUS: Experimental -SINCE: 4.0.5 -------------------------------------------------------------------------------- -EXTENSION: wddx -PRIMARY MAINTAINER: Andrei Zmievski -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: xml -PRIMARY MAINTAINER: Thies C. Arntzen -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: xslt -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANC: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: yaz -PRIMARY MAINTAINER: Adam Dickmeiss -MAINTENANCE: Maintained -STATUS: Unknown -SINCE: 4.0.1 -------------------------------------------------------------------------------- -EXTENSION: yp -MAINTENANCE: Unknown -STATUS: Unknown -------------------------------------------------------------------------------- -EXTENSION: zlib -PRIMARY MAINTAINER: Stefan Roehrich -MAINTENANCE: Maintained -STATUS: Working -------------------------------------------------------------------------------- -EXTENSION: zziplib -PRIMARY MAINTAINER: Sterling Hughes -MAINTENANCE: Maintained -STATUS: Experimental -SINCE: 4.0.5 -------------------------------------------------------------------------------- -# iptc? diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 2d1f8eb68af..00000000000 --- a/INSTALL +++ /dev/null @@ -1,411 +0,0 @@ -Installation Instructions for PHP 4.1 -------------------------------------- - -STOP! - -Before going any further, please remember you are going to find more -up to date instructions in the online manual, located here: - -http://www.php.net/manual/en/install.apache.php - -It is strongly recommended that you read the manual page before going -further. However, for the impatient, here is a quick set of steps that -will build PHP as (first) a dynamic Apache module (DSO) for Apache 1.3.x -with MySQL support and then a static module. A more verbose explanation follows. - -For installing PHP on other web servers, refer to one of the following -files: - - sapi/aolserver/README - sapi/pi3web/README - sapi/servlet/README - sapi/thttpd/README - README.Zeus - -Some notes: - -1: Only install either the static module or the dynamic one. Do not - install both. - -2: If you are recompiling PHP to add new extensions or upgrading - something like GD, remove the config.cache file before you re-run - configure. - -3: If you are on Linux and have installed shared libraries, make - sure the location of these shared libraries are listed in your - /etc/ld.so.conf file. For example, if you have: - - /usr/local/lib/mysql/libmysqlclient.so - - Make sure /etc/ld.so.conf contains: - - /usr/local/lib/mysql - - Then run ldconfig. - -If you want both PHP 3 and 4 modules in the same Apache server, check the -bottom of this file for instructions. - -INSTALLATION WITH THE ZEUS WEB SERVER: ---Please see the 'README.Zeus' file included in this distribution - - -QUICK INSTALL (DSO) - -For this to work your Apache httpd must have mod_so enabled. -Check using httpd -l. You should see something like: - -Compiled-in modules: - http_core.c - mod_so.c - -Chances are you will see a lot more modules than these two. That's ok, -as long as mod_so.c shows up you can proceed with the following steps: - -$ gunzip -c php-4.1.x.tar.gz | tar xf - -$ cd php-4.1.x -$ ./configure --with-mysql --with-apxs -$ make -$ make install - -If you get an error telling you that the apxs script could not be found, -look for it on your system and if you find it, provide the full path to it -as: --with-apxs=/path/to/apxs - -Next you must copy php.ini-dist to the appropriate place (normally -/usr/local/lib/php.ini) and edit it as necessary to set PHP options. - -The only thing left to do is to edit your httpd.conf file and make sure the -PHP 4 mime type is there and uncommented. You need a line that looks like -this: - - AddType application/x-httpd-php .php - -Then restart your server (apachectl restart) and you should be able to -serve up PHP files now. Make a test file called test.php and put some -PHP tags in it. Like , for example. - - -QUICK INSTALL (Static) - -$ gunzip -c apache_1.3.x.tar.gz | tar xf - -$ cd apache_1.3.x -$ ./configure -$ cd .. - -$ gunzip -c php-4.1.x.tar.gz | tar xf - -$ cd php-4.1.x -$ ./configure --with-mysql --with-apache=../apache_1.3.x -$ make -$ make install - -$ cd ../apache_1.3.x -$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a - (The above line is correct! Yes, we know libphp4.a does not exist at this - stage. It isn't supposed to. It will be created.) -$ make - (you should now have an httpd binary which you can copy to your Apache bin dir if - is is your first install then you need to "make install" as well) -$ cd ../php-4.1.x -$ cp php.ini-dist /usr/local/lib/php.ini -You can edit /usr/local/lib/php.ini file to set PHP options. -Edit your httpd.conf or srm.conf file and add: - AddType application/x-httpd-php .php - - -VERBOSE INSTALL - -Chances are you are reading this because the quick install steps above -did not work for you. If this is the case, congratulations, you are -among the elite few that actually reads documentation. It really is -not a difficult install and once you have done it once you will fly -through it. - -Installing PHP can be done in four simple steps: - -1. Unpack your distribution file. - - You will have downloaded a file named something like php-4.1.x.tar.gz. - Unzip this file with a command like: gunzip php-4.1.x.tar.gz - - Next you have to untar it with: tar -xvf php-4.1.x.tar - - This will create a php-4.1.x directory. cd into this new directory. - -2a. Configure PHP (Dynamic Module) - Skip to 2b if you wish to build - a static module - - You now have to choose the options you would like. There are quite - a few of them. To see a list, type: ./configure --help - - The only options that you are likely to want to use are the ones in - the last section entitled, "--enable and --with options recognized:" - - A popular choice is to build the Apache module version. In order to - build PHP as a dynamic module for Apache-1.3.x you have to first have - Apache installed. Assuming Apache is already installed, make sure - the shared object module is enabled. To check this, type: httpd -l - You should see something like: - - Compiled-in modules: - http_core.c - mod_so.c - - You will most likely have a lot more modules than what is shown here. - As long as mod_so.c shows up in the list, PHP should be happy. - - Now, type: ./configure --with-mysql --with-apxs - - If you get an error telling you that the apxs script could not be found, - look for it on your system and if you find it, provide the full path to it - as: --with-apxs=/path/to/apxs - - You might also want other flags on this configure line. --with-mysql - is just an example. - - There are a few things that can go wrong during this configure step. - The most common is that you have asked for an option and that the - configure script can not find the files required to enable this - option in PHP. Chances are you can provide the full path to the - base directory under which the related files were installed. For - example, if you have installed the GD library in /opt/gd which means - that /opt/gd/include has your GD header files and /opt/gd/lib contains - your GD library files, you would use --with-gd=/opt/gd - - Skip to step 3 for compilation and installation instructions. - -2b. Configure PHP (Static Module) - Skip if you performed 2a - - You now have to choose the options you would like. There are quite - a few of them. To see a list, type: ./configure --help - - The only options that you are likely to want to use are the ones in - the last section entitled, "--enable and --with options recognized:" - - A popular choice is to build the Apache module version. You need - to know where the source code directory for your Apache server is - located. Then use an option like: --with-apache=/usr/local/src/apache - if that is your Apache source code directory. If you only specify - --with-apache, then it will default to look for your Apache source - in /usr/local/etc/httpd. - - NOTE: The directory you specify should be the top-level of the - unpacked Apache (or Stronghold) distribution. The configure program - will automatically look for httpd.h in different directories under that - location depending on which version of Apache, including Stronghold, - you are running. - - For MySQL support, since newer versions of MySQL installs its various - components under /usr/local, this is the default. If you have - changed the location you can specify it with: --with-mysql=/opt/local - for example. Otherwise just use: --with-mysql - - *NOTE* If you are using Apache 1.3b6 or later, you should run the - Apache Configure script at least once before compiling PHP. It - doesn't matter how you have Apache configured at this point. - - Skip to step 3b at this point. - -3. Compile and install the files. Simply type: make install - -3a. Dynamic Module Installation - - Nothing else is needed here. Proceed to step 4a. - -3b. Static Module Installation - - For the Apache module version this will copy the appropriate files - to the src/modules/php4 directory in your Apache distribution if - you are using Apache 1.3.x. If you are still running Apache 1.2.x - these files will be copied directly to the main src directory. - - For Apache 1.3b6 and later, you can use the new APACI configuration - mechanism. To automatically build Apache with PHP support, use: - - cd apache_1.3.x - ./configure --prefix=//apache \ - --activate-module=src/modules/php4/libphp4.a - make - make install - - If you do not wish to use this new configuration tool, the old - install procedure (src/Configure) will work fine. - - If you are using the old Apache ./Configure script, you will have to - edit the Apache src/Configuration file manually. If you do not have - this file, copy Configuration.tmpl to Configuration. - - For Apache 1.3.x add: - - AddModule modules/php4/libphp4.a - - For Apache 1.3.x don't do anything else. Just add this line and then - run "./Configure" followed by "make". - - For Apache 1.2.x add: - - Module php4_module mod_php4.o - - For Apache 1.2.x you will also have to look in the libphp4.module file, - which was copied to the src directory. The EXTRA_LIBS line in the Apache - Configuration file needs to be set to use the same libs as specified on - the LIBS line in libphp4.module. You also need to make sure to add - "-L." to the beginning of the EXTRA_LIBS line. - - So, as an example, your EXTRA_LIBS line might look like: - - EXTRA_LIBS=-L. -lphp4 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient - - NOTE: You should not enclose the EXTRA_LIBS line in double-quotes, as it - is in the libphp4.module file. - - Also, look at the RULE_WANTHSREGEX setting in the libphp4.module file - and set the WANTHSREGEX directive accordingly in your Configuration file. - This last step applies to versions of Apache prior to 1.3b3. - - This is a bit of a hassle, but should serve as incentive to move to - Apache 1.3.x where this step has been eliminated. - - Once you are satisfied with your Configuration settings, type: ./Configure - If you get errors, chances are that you forgot a library or made a typo - somewhere. Re-edit Configuration and try again. If it goes well, - type: make - - Assuming it compiles without errors, proceed to step 4b. - -4a. Setting up the server. (Dynamic Module) - - The make install command in step 3 should have done most of your - work for you. It actually edits your httpd.conf file and tries to - enable the dynamic PHP module. To verify this, look for a line that - looks like this: - - LoadModule php4_module libexec/libphp4.so - - The actual path before the libphp4.so part might differ slightly. This - is likely fine. If you are paranoid you can examine the output from the - make install step to see where the libphp4.so file was actually put and - place the full path to this file on this LoadModule line. - - If somewhere in your httpd.conf file you have a ClearModuleList line - then you also need this line: - - AddModule mod_php4.c - - And finally you need to tell Apache which file extension should trigger - PHP. You do this by creating a special mime type and associating it - with an extension. We suggest using: - - AddType application/x-httpd-php .php - - You are however free to use any extension you wish, including .html. - - Note! If a line has a # at the beginning, then it is commented out - and you need to remove the # for that line to take effect. - - Finally you need to copy php.ini-dist to the appropriate place - (normally /usr/local/lib/php.ini) and edit if necessary. - - Once you have made these changes you should be ready to restart your - server and try it out. Type: apachectl restart - -4b. Setting up the server. (Static Module) - - You should now have a new httpd binary. Shut down your existing server, - if you have one, and copy this new binary overtop of it. Perhaps make - a backup of your previous one first. Then edit your conf/httpd.conf file - and add the line: - - AddType application/x-httpd-php .php - - There is also an interesting feature which can be quite instructive and - helpful while debugging. That is the option of having colour syntax - highlighting. To enable this, add the following line: - - AddType application/x-httpd-php-source .phps - - Any file ending in .phps will now be displayed with full colour syntax - highlighting instead of being executed. - - Note that on some older server setups, the AddType lines are in the - conf/srm.conf file instead of conf/httpd.conf. - - Note! If a line has a # at the beginning, then it is commented out - and you need to remove the # for that line to take effect. - - When you are finished making changes to your httpd.conf file, you need - to copy php.ini-dist to the appropriate place (normally - /usr/local/lib/php.ini) and edit if necessary. You can then - start up your server. - -5. Testing it all worked - - Create a test file named test.php in your web tree somewhere and - put some test PHP tags in it. is a good first test. - This tag tells PHP to do a braindump and tells you all sorts of things - about itself. - - -WHY DISABLING -fPIC WORKS ON LINUX - - From: Martin v. Loewis - To: glibc-linux@ricardo.ecn.wfu.edu - Subject: Re: Shared library -shared vs. -fpic - - [In reply to Kaz Kylheku ] - - > PIC stands for Position-Independent Code. - - Correct. - - > Code isn't position-independent (or ``relocatable'') cannot be - > loaded at an arbitrary address; - - Wrong. - - > it requires some references to be patched at load time. - - Correct. - - > Shared libraries need to be relocatable because it's not known - > beforehand what address they will be loaded at - - Correct, depending on the meaning of "relocatable". PIC code typically - does not contain relocations; that's why its position-independent. - - > Just because you don't specify -fPIC doesn't mean that the compiler - > won't emit position-independent code; the option prevents it from - > emitting position-dependent code in situations where it otherwise - > would. - - Correct. However, a non-trivial shared library typically won't be - position-independent unless explicitly compiled with - -fPIC. Linux/glibc indeed does not require a shared library to be - position-independent; instead, it will perform the relocations in the - binary, even if they refer to code pages. As a result, those relocated - pages won't be shared across processes, anymore. - - Regards, - Martin - -USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES - - With some (newer) installations of Apache, it's possible to compile both - PHP 3 and PHP 4, and run them concurrently. - - Note, it's only really wise to do this if you need to use the PHP 3 engine - to maintain backwards compatibility. - - To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the - necessary link extensions (--enable-versioning). Otherwise, all standard - installations instructions apply. For example: - - $ ./configure \ - --with-apxs=/apache/bin/apxs \ - --enable-versioning \ - --with-mysql \ - - - - - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index af5b01c49aa..00000000000 --- a/LICENSE +++ /dev/null @@ -1,75 +0,0 @@ --------------------------------------------------------------------- - The PHP License, version 2.02 -Copyright (c) 1999 - 2002 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior permission from the - PHP Group. This does not apply to add-on libraries or tools - that work in conjunction with PHP. In such a case the PHP - name may be used to indicate that the product supports PHP. - - 4. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP, freely available from - http://www.php.net/". - - 6. The software incorporates the Zend Engine, a product of Zend - Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the - PHP Association (pursuant to a grant from Zend that can be - found at http://www.php.net/license/ZendGrant/) for - distribution to you under this license agreement, only as a - part of PHP. In the event that you separate the Zend Engine - (or any portion thereof) from the rest of the software, or - modify the Zend Engine, or any portion thereof, your use of the - separated or modified Zend Engine software shall not be governed - by this license, and instead shall be governed by the license - set forth at http://www.zend.com/license/ZendLicense/. - - - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . diff --git a/Makefile.frag b/Makefile.frag deleted file mode 100644 index b4a4f40132d..00000000000 --- a/Makefile.frag +++ /dev/null @@ -1,16 +0,0 @@ -$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h -$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h - -$(builddir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -$(builddir)/zend_language_parser.h: $(builddir)/zend_language_parser.c -$(builddir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y - $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@ - -$(builddir)/zend_ini_parser.h: $(builddir)/zend_ini_parser.c -$(builddir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@ - -$(builddir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l diff --git a/Makefile.global b/Makefile.global deleted file mode 100644 index d5a3c4a3df2..00000000000 --- a/Makefile.global +++ /dev/null @@ -1,70 +0,0 @@ -TESTS = $(top_srcdir) -mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p -INSTALL = $(top_srcdir)/build/shtool install -c -INSTALL_DATA = $(INSTALL) -m 644 - -DEFS = -I$(top_builddir)/main -I$(top_srcdir) -COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) - - -all: $(all_targets) - -build-modules: $(PHP_MODULES) - -libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ - -php: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ - -sapi/cli/php: $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) - $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ - -install: $(install_targets) - - -install-cli: - $(INSTALL_CLI) - -install-sapi: - -@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1 - -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) - -@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \ - for i in 0.0.0 0.0 0; do \ - if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \ - $(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \ - break; \ - fi; \ - done; \ - fi - $(INSTALL_IT) - -install-modules: - @test -d modules && \ - $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \ - echo "installing shared modules into $(EXTENSION_DIR)" && \ - rm -f modules/*.la && \ - cp modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true - -install-tester: - @echo "Installing regression tester" - @$(mkinstalldirs) $(PEAR_INSTALLDIR) - @$(INSTALL) -m 755 $(top_srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR) - -install-su: install-pear install-tester - -test: sapi/cli/php - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) \ - $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(TESTS) - -clean: - find . -name \*.lo -o -name \*.o -o -name \*.la -o -name \*.a| xargs rm -f - find . -name .libs -a -type d|xargs rm -rf - rm -f libphp4.la php sapi/cli/php modules/* libs/* - -distclean: clean - rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php4.spec sapi/apache/libphp4.module buildmk.stamp - find . -name Makefile | xargs rm -f - -.PHONY: all clean install distclean test -.NOEXPORT: diff --git a/NEWS b/NEWS deleted file mode 100644 index de6b6571992..00000000000 --- a/NEWS +++ /dev/null @@ -1,1908 +0,0 @@ -PHP 4 NEWS -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2002, Version 4.3.0 -- Fixed memory allocation problem on systems that have iconv() support in libc. - (Yasuo) -- Made var_dump() handle recursive structures better. (Yasuo) -- Added exif_imagetype() function. (Marcus) -- Added domxml functions: - domxml_elem_get_elements_by_tagname() - domxml_doc_get_elements_by_tagname() - domxml_doc_get_element_by_id() - domxml_elem_remove_attribute() - domxml_elem_get_attribute_node() (Chregu) -- Fixed a segfault in domxml_unlink(). (jtate) -- Added -r option to the CLI version of PHP which executes a piece of PHP - code directly from the commmand line. (Edin) -- Added formatting option to domxml_dump_mem(). (Chregu) -- New improved build system. Among other improvements, replaces the slow - recursive make with one global Makefile and eases the integration of proper - dependencies. Automake is only needed for its aclocal tool. The build - process is now more portable and less resource-consuming. (Sascha) - -?? ??? 2002, Version 4.2.0 -- ACHTUNG!! register_globals defaults to 'off' now !!! -- Modified the mysql extension to disable 'LOAD LOCAL' when safe mode is - enabled. (Jason) -- Added CLI (command line interface) sapi which is more suitable for writing - shell scripts. Some of the differences to CGI sapi are: no HTTP headers, - plain text error messages, does not change working directory, etc. - "make install" will install CLI SAPI version of php in {PREFIX}/bin/php while - CGI is renamed and installed as {PREFIX}/bin/php-cgi. (Edin) -- Fixed HTTP file upload support to handle big files better. (Jani) -- Major modifications to the Sockets Extension and its API (Jason): - . Fixed numerous bugs. - . Added automatic host lookup capability to all functions that take addr's. - example: socket_connect($sock, 'www.yahoo.com', 80); - . Corrected and standardized host lookup errors - . Modified socket_recv() behavior. [$r=socket_recv($sock, $buf, $len, $flags)] - . Added socket_set_block() which changes a socket into blocking IO mode - . Modified socket_last_error() to not clear the last error - . Added socket_clear_error() which clears the last error on a socket - . Removed all code pertaining to fd_sets (socket_fd_*) - . Modified/Improved socket_select() to accept array of resources instead of - fd_sets. example: - -- Added optional 3rd parameter "int encoding_mode" to gzencode() and fixed - parameters to conform documentation. (Stefan) -- Changed read_exif_data() to be an alias of exif_read_data(). (Marcus) -- Added exif_tagname() function which returns the names of tags and - exif_thumbnail() function to extract embedded thumbnails. (Marcus) -- Fixed iconv support with FreeBSD. (kalowsky) -- Cleaned up the posix extension: (Markus) - . Removed unwanted warning messages - . Added posix_errno() and posix_strerror() for fetching error messages - . Changed the way posix_getgrnam() and posix_getgrgid() return their values - (breaks BC but makes more sense) - . Does not include functions in symbol table which aren't supported on host - system. -- Added TIFF support for getimagesize() and read_exif_data(). (Marcus) -- Changed the Velocis extension namespace to Birdstep to reflect new product - name. Added aliases for BC. (James) -- Added safe_mode checks for opendir(). (jflemer) -- Changed the 2nd parameter in pgsql_fetch_*() functions to support NULL if - all 3 parameters are supplied, but you do not want to provide a row number. - (Derick) -- Improved iconv() when using libc's iconv. (Yasuo) -- Added PHP_SAPI constant which contains the name of running SAPI. (Edin) -- Added ob_get_status() which returns an array of buffers with their status. - (Yasuo) -- Fixed a crash bug in ob_end_*() functions. ob_end_*() will not delete - buffers that may not be deleted. (Yasuo) -- Added 3rd parameter "bool erase" to ob_start(). If FALSE, the buffer may not - be deleted until script finishes. (Yasuo) -- Changed ob_*() functions to return TRUE for success, FALSE for failure. - (Yasuo) -- Added sybase_ct support to dbx module. (Marc) -- Fixed error message handling with PostgreSQL 7.2. (Rui) -- Added object aggregation capability, see aggregation_*() functions. (Andrei) -- Added debug_zval_dump() which works similarly to var_dump, but displays - extra internal information such as refcounts and true type names. (Jason) -- Added Andrei's tokenizer extension. (Stig) -- Fixed a bug in the COM extension which caused php to crash in - php_COM_get_ids_of_names(). (Paul, Harald) -- Removed ext/satellite. It is now part of PEAR. (eriksson) -- Changed php.ini directive 'safe_mode_include_dir' to accept a (semi)colon - separated path (like 'include_path') rather than a single directory. - (jflemer) -- Added is_a() function that can be used to test whether object is of a certain - class or is derived from it. (Andrei, Zend Engine) -- Added optional parameter to highlight_string() and highlight_file() which - makes these functions to return a highlighted string instead of dumping - it to standard output. (Derick) -- Added EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags to extract(). (Rasmus) -- Fixed a segfault in pg_pconnect(). If PostgreSQL server is restarted, broken - connection is detected and reconnected. (Yasuo) -- Fixed --enable-safe-mode configure option. (Yasuo) -- Added function domxml_dump_node($doc,$node). Dumps a node plus all children - into a string. (chregu) -- Added function domxml_node_get_content(). (chregu) -- Added function domxml_dump_file($filename,[$compression]). Dumps XML to - a file and uses compression, if specified. (chregu) -- Added exslt integration to domxml extension (http://exslt.org for details). - Configure with --with-dom-exslt[=DIR] (and --with-dom-xslt). - (chregu,jaroslaw) -- Fixed session_unset() to not touch any globals if register_globals is off. - (Thies) -- Added 3 new optional parameters to OCIFetchStatement(). They control - the number of rows to skip at the beginning of the cursor, the - maximun numer of rows that should be fetched and the format of the - returned array. (Thies) -- Updated the XSLT extension to support Sablotron 0.8. (Petr Cimprich) -- Fixed a bug in preg_match() and preg_match_all() when matching strings - contain null bytes. (Andrei) -- Added xpath_register_ns() function. This makes it possible to issue XPath - queries with namespaces like for example: "//namespace:sampletag". - (Chris Jarecki) -- Added multi-byte enabled regular expression functions. (Rui) -- Added optional second parameter to count() which can be used to specify - either normal or recursive counting. (patch by Vlad Bosinceanu ) -- Added mb_get_info() to get internal settings of mbstring. (Rui) -- Added async query functions to PostgreSQL module. (Yasuo) -- Added pg_copy_to()/pg_copy_from() for PostgreSQL module. (Youichi, Yasuo) -- Added IPv6 support for FTP extension. (Stig Venaas) -- Improved the speed of wordwrap() significantly. (Jim) -- Fixed pow()'s incorrect behaviour when dealing with powers of 0. (Jim) -- Added is_finite(), is_infinite() and is_nan(). (Jim) -- Fixed segfault in wordwrap() when wrapping to zero width and using - multi-character break or trying to force cut (bug #12768). (Jim) -- Fixed several bugs in dbase extension (dbase_pack() truncate file to right - size, fix 6852 #1 and 6852 #2). (Vlad) -- Fixed bug in krsort() where an extra character was being compared. (Andi) -- Fixed bug that made pspell include pspell.h from a wrong location. (Vlad) -- Added function overload in mbstring to add multibyte support for - string and mail functions. (Rui) -- Added flags parameter to preg_grep(). The only flag currently is - PREG_GREP_INVERT that will make the function return entries that - did not match. (Andrei) -- Fixed several crash bugs in the xslt extension. (Markus, Derick) -- Fixed problem with dbase not returning very large (larger than long) - integers properly. (Vlad) -- Added concepts to IRCG: bailout-on-trivial issue, write output to - files, fetch a resource upon connection end. (Sascha) -- Fixed POST-related bugs in thttpd, added QUERY_STRING, HTTP_HOST, - HTTP_ACCEPT_LANGUAGE to the script environment, improved patch - to send correct MIME types, and added support for /nocache/. (Sascha) -- Fixed several bugs and memleaks in the domxml extension. (Markus) -- Added var_export() which outputs a representation of a variable as reusable - PHP code. (Derick) -- Added -w option to the CGI-version to strip all comments and whitespace - from the script. (Thies) -- Added support for SO_RCVTIMEO and SO_SNDTIMEO to ext/sockets. (Jason) -- Added ob_get_level() which returns the nesting level of the output buffering - mechanism. (Yasuo, Derick) -- Added ob_flush() and ob_clean() functions which flush and clean an output - buffer without destroying the buffer. (Derick) -- Added new optional parameter to mysql_connect() which forces a new database - link to be created. (Markus, Derick) -- Added ldap_sort() function. (Stig Venaas) -- Added md5_file() function which calculates the MD5 sum of a file. - Patch by Alessandro Astarita (Derick) -- Added support for parsing recordsets contained in WDDX packets. (Andrei) -- Renamed key_exists() to array_key_exists(). (Derick) -- Fixed ImageColorsForIndex() and ImageColorAt() to work for TrueColor - images. (Rasmus) -- Added support for bind_textdomain_codeset(). (rudib@email.si) -- Added generic Win 32 API extension. (jmoore) -- Removed warning message about NONEXISTENT character set from mysql_connect() - when the server's default character set != latin1. (Mysql Team) -- Added Direct I/O extension for lowlevel access to the POSIX layer. (Sterling) -- Added SAPI module for the WebJames server on RISC OS. (Alex Waugh) -- Fixed ldap_add() and ldap_modify() functions to throw a warning with illegal - value arrays. Previously segfaulted or added wrong value. (Stig Venaas) -- Added udm_check_charset() function into mnoGoSearch extension. (gluke) -- Fixed mnoGoSearch extension to support mnogosearch-3.2.x. (gluke) -- Made fbsql_num_rows() to return the correct value on all select statements. - (Frank) -- Added array_chunk() function which splits an array into chunks of specified - size. (Andrei) -- Fixed $HTTP_RAW_POST_DATA to be populated on a missing content-type when - always_populate_raw_post_data is on. (Rasmus) -- Added session_cache_expire() function. (patch by anuradha@gnu.org) (Andrei) -- Added array_fill() function. (Rasmus) -- Made Authorization header to be hidden from phpinfo() output in safe_mode. - (Rasmus) -- Re-instated safe-mode realm mangling. (Rasmus) -- Fixed a bug in preg_replace() that would change the type of the replacement - array entries to string. (Andrei) -- Added user-space object overloading extension. (Andrei) -- Added ldap_start_tls() function. (Stig Venaas, patch by kuenne@rentec.com) -- Changed rand() and mt_rand() to be seed automatically if srand() or - mt_srand() has not been called. (Sterling) -- Changed the seed options to srand() and mt_srand() to be optional. If the - seed is not specified the most random seed possible is generated. (Sterling) -- Added array_change_key_case() function which returns an array with all - string keys lowercased or uppercased. (Edin) -- Added parameter to ircg_pconnect to suppress treating non-fatal errors - as fatal, and added conversion of Windows quotes to ". (Sascha) -- Added pcntl_exec() function which behaves similar to the system execve. - (Jason) -- Fixed segfault and check for truecolor image in ImageColorAt(). (Rasmus) -- Fixed nl2br() to handle all styles of line-endings in one string. - (Boian, Derick) -- Added mcrypt_generic_deinit() to replace mcrypt_generic_end(). (Derick) -- Added apache_setenv() function for injecting variables into Apache's - subprocess_env table. (Rasmus) -- Added support for 'int', 'bool', 'float' and 'null' in settype(). (Jeroen) -- Added IPv6 support to gethostbyaddr(). - (Patch by Matthias Wimmer and venaas) -- Fixed LONG_VARCHAR type crashing in ODBC extension. Patch by Walter Franzini. - (kalowsky) -- Changed in_array() and search_array() to allow the needle to be an array - in itself. (Andrei) -- Added ini_get_all() function which returns all registered ini entries - or entries for the specified extension. (Jani) -- Added mailparse_uudecode_all() which extracts all uuencoded attachments. - (Wez) -- Added support for chinese encodings in htmlentities() and htmlspecialchars(). - (Patch by Alan Knowles and Wez) -- Improved support for autoconf-2.50+/libtool 1.4b+. (Jan Kneschke, Sascha) - -27 Feb 2002, Version 4.1.2 -- Fixed start up failure when mm save handler is used and there are multiple - SAPIs working at the same time. (Yasuo) -- Fixed the Roxen SAPI. (Yasuo) -- Fixed a buffer overflow in the RFC-1867 file upload code. (Stefan) -- Fixed a crash bug in the session module. (Yasuo) -- Fixed a crash bug in the pspell module. (Yasuo) -- Changed the default output encoding of mbstring 'pass' to fix - initialization problem. (Rui) - -26 Dec 2001, Version 4.1.1 -- Fixed incompatibility with Windows .NET / IIS 6 - may improve stability - under other versions of IIS. (Zeev) -- Fixed bug that caused crashes or error notices on shutdown on threaded - platforms. (Zeev) -- Fixed several crash bugs in the xslt extension. (Markus, Derick) -- Fixed problem with dbase not returning very large (larger than long) - integers properly. (Vlad) -- Fixed several bugs and memleaks in the domxml extension. (Markus) -- Fixed bug in gmmktime() which was one hour off during standard time - - bug #9878. Patch by bfoddy@mediaone.net. (jmoore) -- Fixed bug in gmdate() timezone handling on Windows - bug #13885. (jmoore) -- Fixed several crash bugs in the mcrypt extension. (Derick) -- Made the mcrypt extension compile with the libmcrypt 2.2 series again. - (Sterling) -- Fixed a bug where the is_file() family of functions would in-correctly give - an error when they were given filenames that didn't exist. (Sterling) -- Fixed a bug in the strtotime() function where it was incorrectly recognizing - GMT +0100 and GMT -0100. (Derick) - -10 Dec 2001, Version 4.1.0 -- Worked around a bug in the MySQL client library that could cause PHP to hang - when using unbuffered queries. (Zeev) -- Fixed a bug which caused set_time_limit() to affect all subsequent requests - to running Apache child process. (Zeev) -- Removed the sablotron extension in favor of the new XSLT extension. - (Sterling) -- Fixed a bug in WDDX deserialization that would sometimes corrupt the root - element if it was a scalar one. (Andrei) -- Make ImageColorAt() and ImageColorsForIndex() work with TrueColor images. - (Rasmus) -- Fixed a bug in preg_match_all() that would return results under improper - indices in certain cases. (Andrei) -- Fixed a crash in str_replace() that would happen if search parameter was an - array and one of the replacements resulted in subject string being empty. - (Andrei) -- Fixed MySQL extension to work with MySQL 4.0. (Jani) -- Fixed a crash bug within Cobalt systems. Patch by tomc@tripac.com. (Jani) -- Bundled Dan Libby's xmlrpc-epi extension. -- Introduced extension version numbers. (Stig) -- Added version_compare() function. (Stig) -- Fixed pg_last_notice() (could cause random crashes in PostgreSQL - applications, even if they didn't use pg_last_notice()). (Zeev) -- Fixed DOM-XML's error reporting, so E_WARNING errors are given instead of - E_ERROR error's, this allows you to trap errors thrown by DOMXML functions. - (Sterling) -- Fixed a bug in the mcrypt extension, where list destructors were not - properly being allocated. (Sterling) -- Better Interbase blob, null and error handling. (Patch by Jeremy Bettis) -- Fixed a crash bug in array_map() if the input arrays had string or - non-sequential keys. Also modified it so that if a single array is passed, - its keys are preserved in the resulting array. (Andrei) -- Fixed a crash in dbase_replace_record. (Patch by robin.marlow@dps-int.com) -- Fixed a crash in msql_result(). (Zeev) -- Added support for single dimensional SafeArrays and Enumerations. - Added an is_enum() function to check if a component implements an - enumeration. (Alan, Harald) -- Fixed a bug in dbase_get_record() and dbase_get_record_with_names(). - boolean fields are now returned correctly. - Patch by Lawrence E. Widman (Jani) -- Added --version option to php-config. (Stig) -- Improved support for thttpd-2.21b by incorporating patches for all known - bugs. (Sascha) -- Added ircg_get_username, a roomkey argument to ircg_join, error fetching - infrastructure, a tokenizer to speed up message processing, and fixed - a lot of bugs in the IRCG extension. (Sascha) -- Improved speed of the serializer/deserializer. (Thies, Sascha) -- Floating point numbers are better detected when converting from strings. - (Zeev, Zend Engine) -- Replaced php.ini-optimized with php.ini-recommended. As the name implies, - it's warmly recommended to use this file as the basis for your PHP - configuration, rather than php.ini-dist. (Zeev) -- Restore xpath_eval() and php_xpathptr_eval() for 4.0.7. There - are still some known leaks. (Joey) -- Added import_request_variables(), to allow users to safely import form - variables to the global scope (Zeev) -- Introduced a new $_REQUEST array, which includes any GET, POST or COOKIE - variables. Like the other new variables, this variable is also available - regardless of the context. (Andi & Zeev) -- Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV variables, which - deprecate the old $HTTP_*_VARS arrays. In addition to be much shorter to - type - these variables are also available regardless of the scope, and - there's no need to import them using the 'global' statement. (Andi & Zeev) -- Added vprintf() and vsprintf() functions that allow passing all arguments - after format as an array. (Andrei) -- Added support for GD2 image type for ImageCreateFromString() (Jani) -- Added ImageCreateFromGD(), ImageCreateFromGD2(), ImageCreateFromGD2part(), - ImageGD() and ImageGD2() functions (Jani) -- addcslashes now warns when charlist is invalid. The returned string - remained the same (Jeroen) -- Added optional extra argument to gmp_init(). The extra argument - indicates which number base gmp should use when converting a - string to the gmp-number. (Troels) -- Added the Cyrus-IMAP extension, which allows a direct interface to Cyrus' - more advanced capabilities. (Sterling) -- Enhanced read_exif_data() to support multiple comment tags. (Rasmus) -- Fixed a crash bug in array_map() when NULL callback was passed in. (Andrei) -- Change from E_ERROR to E_WARNING in the exif extension (Rasmus) -- New pow() implementation, which returns an integer when possible, - and warnings on wrong input (jeroen) -- Added optional second parameter to trim, chop and ltrim. You can - now specify which characters to trim (jeroen) -- Hugely improved the performance of the thread-safe version of PHP, especially - under Windows (Andi & Zeev) -- Improved request-shutdown performance significantly (Andi & Zeev, Zend - Engine) -- Added a few new math functions. (Jesus) -- Bump bundled expat to 1.95.2 (Thies) -- Improved the stability of OCIPlogon() after a database restart. (Thies) -- Fixed __FILE__ in the CGI & Java servlet modes when used in the main script. - It only worked correctly in included files before this fix (Andi) -- Improved the Zend hash table implementation to be much faster (Andi, Zend - Engine) -- Updated PHP's file open function (used by include()) to check in the calling - script's directory in case the file can't be found in the include_path (Andi) -- Fixed a corruption bug that could cause constants to become corrupted, and - possibly prevent resources from properly being cleaned up at the end of - a request (Zeev) -- Added optional use of Boyer-Moore algorithm to str_replace() (Sascha) -- Fixed and improved shared-memory session storage module (Sascha) -- Add config option (always_populate_raw_post_data) which when enabled - will always populate $HTTP_RAW_POST_DATA regardless of the post mime - type (Rasmus) -- Added support for socket and popen file types to ftp_fput (Jason) -- Fixed various memory leaks in the LDAP extension (Stig Venaas) -- Improved interactive mode - it is now available in all builds of PHP, without - any significant slowdown (Zeev, Zend Engine) -- Fixed crash in iptcparse() if the supplied data was bogus. (Thies) -- Fixed return value for a failed snmpset() - now returns false (Rasmus) -- Added hostname:port support to snmp functions (nbougues@axialys.net, Rasmus) -- Added fdf_set_encoding() function (Masaki YATSU, Rasmus) -- Reversed the destruction-order of resources. This fixes the reported OCI8 - "failed to rollback outstanding transactions!" message (Thies, Zend Engine) -- Added option for returning XMLRPC fault packets. (Matt Allen, Sascha - Schumann) -- Improved range() function to support range('a','z') and range(9,0) types of - ranges. (Rasmus) -- Added getmygid() and safe_mode_gid ini directive to allow safe mode to do - a gid check instead of a uid check. (James E. Flemer, Rasmus) -- Made assert() accept the array(&$obj, 'methodname') syntax. (Thies) -- Made sure that OCI8 outbound variables are always zero-terminated. (Thies) -- Fixed a bug that allowed users to spawn processes while using the 5th - parameter to mail(). (Derick) -- Added nl_langinfo() (when OS provides it) that returns locale. -- Fixed a major memory corruption bug in the thread safe version. (Zeev) -- Fixed a crash when using the CURLOPT_WRITEHEADER option. (Sterling) -- Added optional suffix removal parameter to basename(). (Hartmut) -- Added new parameter UDM_PARAM_VARDIR ha in Udm_Set_Agent_Param() function to - support alternative search data directory. This requires mnogoSearch 3.1.13 - or later. -- Fixed references in sessions. This doesn't work when using the WDDX - session-serializer. Also improved speed of sessions. (Thies) -- Added new experimental module pcntl (Process Control). (Jason) -- Fixed a bug when com.allow_dcom is set to false. (phanto) -- Added a further parameter to the constructor to load typelibs from file when - instantiating components (e.g. DCOM Components without local registration). - (phanto) -- Added the possibility to specify typelibs by full name in the typelib file - (Alan Brown) -- Renamed the ZZiplib extension to the Zip extension, function names have also - changed accordingly, functionality, has stayed constant. (Sterling) -- Made the length argument (argument 2) to pg_loread() optional, if not - specified data will be read in 1kb chunks. (Sterling) -- Added a third argument to pg_lowrite() which is the length of the data to - write. (Sterling) -- Added the CONNECTION_ABORTED, CONNECTION_TIMEOUT and CONNECTION_NORMAL - constants. (Zak) -- Assigning to a string offset beyond the end of the string now automatically - increases the string length by padding it with spaces, and performs the - assignment. (Zeev, Zend Engine) -- Added warnings in case an uninitialized string offset is read. (Zeev, Zend - Engine) -- Fixed a couple of overflow bugs in case of very large negative integer - numbers. (Zeev, Zend Engine) -- Fixed a crash bug in the string-offsets implementation (Zeev, Zend Engine) -- Improved the implementation of parent::method_name() for classes which use - run-time inheritance. (Zeev, Zend Engine) -- Added 'W' flag to date() function to return week number of year using ISO - 8601 standard. (Colin) -- Made the PostgreSQL driver do internal row counting when iterating through - result sets. (gvz@2scale.net) -- Updated ext/mysql/libmysql to version 3.23.39; Portability fixes, minor - bug fixes. (tim@mysql.com) -- Added get_defined_constants() function to return an associative array of - constants mapped to their values. (Sean) -- New mailparse extension for parsing and manipulating MIME mail. (Wez) -- Define HAVE_CONFIG_H when building standalone DSO extensions. (Stig) -- Added the 'u' modifier to printf/sprintf which prints unsigned longs. - (Derick) -- Improved IRIX compatibility. (Sascha) -- Fixed crash bug in bzopen() when specifying an invalid file. (Andi) -- Fixed bugs in the mcrypt extension that caused crashes. (Derick) -- Added the IMG_ARC_ROUNDED option for the ImageFilledArc() function, which - specified that the drawn curve should be rounded. (Sterling) -- Updated the sockets extension to use resources instead of longs for the - socket descriptors. The socket functions have been renamed to conform with - the PHP standard instead of their C counterparts. The sockets extension is - now usable under Win32. (Daniel) -- Added disk_total_space() to return the total size of a filesystem. - (Patch from Steven Bower) -- Renamed diskfreespace() to disk_free_space() to conform to established - naming conventions. (Jon) -- Fixed #2181. Now zero is returned instead of an unset value for - 7-bit encoding and plain text body type. (Vlad) -- Fixed a bug in call_user_*() functions that would not allow calling - functions/methods that accepted parameters by reference. (Andrei) -- Added com_release($obj) and com_addref($obj) functions and the related class - members $obj->Release() and $obj->AddRef() to gain more control over the used - COM components. (phanto) -- Added an additional parameter to dotnet_load to specify the codepage (phanto) -- Added peak memory logging. Use --enable-memory-limit to create a new Apache - 1.x logging directive "{mod_php_memory_usage}n" which will log the peak - amount of memory used by the script. (Thies) -- Made fstat() and stat() provide identical output by returning a numerical and - string indexed array. (Jason) -- Fixed memory leak upon re-registering constants. (Sascha, Zend Engine) - -23 Jun 2001, Version 4.0.6 -- Fixed memory fragmention problem which could lead to web server processes - growing much more than they should. (Andi, Zend Engine) -- Made $HTTP_SESSION_VARS['foo'] and $foo be references to the same value - when register_globals is on. (Andrei) -- Fixed disk_free_space() and disk_total_space() under FreeBSD. (Jon) -- Fixed readfile/passthru losing resources during connection abort (Sascha) -- Fixed bug in the mcrypt extension that caused segfaults when using a key - that is too large for the used algorithm, and a bug that caused - mcrypt_generic() to segfault PHP (Derick) -- Fixed getopt so that it accepts command line arguments in the form - - and - . (Jmoore) -- Fixed race in writing session files (Sascha) -- Fixed a possible crash in the PHP CGI when no input file is - specified (Zeev) -- Added is_callable() function that can be used to find out whether - its argument is a valid callable construct. (Andrei) -- Fixed a rare possible crash when generating extended information. (Dmitri - Dmitrienko, Zend Engine) -- Improved virtual() to support PHP-enabled URIs. (Zeev) -- Fixed undefined behavior when using floating point keys in array() - expressions. (Zeev, Zend Engine) -- Fixed a possible crash in case of parse errors in include files or eval - statements. (Zeev, Zend Engine) -- Added --with-layout configure option. (Stig) -- Improved interactive mode - supports function calls, and works in - multithreaded builds. (Zeev, Zend Engine) -- Fixed a crash bug in interactive mode. (Zeev, Zend Engine) -- Added pg_last_notice() function. (Rasmus from suggestion by Dirk@rackspace.com) -- Fixed a bug in preg_split() that would incorrectly limit the number of - results when used along with PREG_SPLIT_NO_EMPTY flag. (Andrei) -- Added connection error support to mysql_error() and mysql_errno(). (Jason) -- Added support to getimagesize to return dimensions of BMP and PSD - files. (Derick) -- Added heuristic to kill stale IRC connections, message scanner caching, and - nickname escaping to IRCG, suppress option to ircg_msg(), and statistics to - IRCG phpinfo() output. (Sascha) -- Added Japanese multibyte string functions support. (Rui) -- Added Mac OS X "\r" line ending support. (Andi, Zend Engine) -- Fixed a bug regarding the $PHP_SELF being incorrectly registered when - force-cgi-redirect was not enabled. (Sterling) -- pfpro extension now supports version 3 of the Verisign SDK. (John Donagher) -- Udm_Cat_List and Udm_Cat_Path functions has been added. -- Added key_exists() to check if a given key or index exists in an - array or object. (David Croft) -- Modify the cURL extension to compile only with the latest cURL release. - Backwards compatibility with regards to the extension api has not been - broken. (Sterling) -- Added the ability to use user-defined callbacks with cURL. (Sterling) -- Added the SSL_VERIFYPEER, CAINFO, MAXREDIRS, FILETIME, RANDOM_FILE, EGDSOCKET - and CONNECTTIMEOUT options to curl_setopt(). (Sterling) -- Added support for persistent connections with cURL. (Sterling) -- Fixed a problem in cURL with file descriptors being allocated, but never - closed. (Sterling) -- Fixed interactive mode (-a). It works again with the same limitations it - has always had. (Andi, Zend Engine) -- Improved memory manager to use less memory and provide better memory overflow - detection abilities in debug mode. (Andi, Zend Engine) -- Fixed resource leaks when resources were being cast to numbers. (Zeev, Zend - Engine) -- Fixed foreach() to not crash when being sent an invalid argument. (Andi, Zend - Engine) -- Fixed a bug in opendir() under Windows when trying to open a non-exisiting - directory. (Andi) -- Fixed popen() and the exec family under Win32 (Unable to fork issue). (Daniel) -- Make the printf family of functions binary clean. (Rasmus) -- Fixed WDDX serialization to HTML-escape key/variable names so as not to - break the XML packet. (Andrei) -- Made WDDX extension enabled by default. (Andrei) -- Added -C command-line option to avoid chdir to the script's directory. (Stig) -- Fixed a bug with /e modifier in preg_replace(), that would not correctly - replace two-digit references if single digit references were present - before them. This fixed bug #10218. (Andrei) -- Added temporary LOB support in OCI8. (Patch by David Benson) -- Fixed crash in pathinfo() -- OCI8 now supports binding of collections. (Patch by Andy Sautins - ) -- Added GD 2.0.1 support for truecolor and alpha channels, plus some other gd - functions, both old and new - see docs for more info. (Wez) -- Added S/MIME sign/verify encrypt/decrypt functions to openssl extension, - along with some other certificate manipulation and interrogation functions. - See docs for more info. (Wez) -- printf argnum (parameter swapping) support. (Morten Poulsen, Rasmus) -- Add DIRECTORY_SEPARATOR constant ('/' on UNIX, '\' on Windows). (Stig) -- Added small change to php_odbc module, to check for failed SQLDisconnects - and to close any outstanding transactions if the call fails, then disconnect - again. (lurcher) -- Modified get_parent_class() and get_class_methods() to accept a class name as - well as a class instance. (Andrei, Zend Engine) -- Added support for UNC style paths. (\\server\share\file, - //server/share/file). (Daniel, TSRM) -- Added dbx module (database abstraction) to the repository. (Marc) -- Using ITypeInfo instead of IDispatch if possible. This makes DCOM calls - and even COM calls much faster. - All ini settings are now prefixed by 'com.'. - Now you need not provide a path to the file containing the typelib, you can - also provide the GUID of the TypeLib - entry or an IID for preloading - type - information. (Harald) -- Rewrite of domxml. It's now mostly DOM Level 2 conform. (Uwe) -- Added array_map() function that applies a callback to the elements - of given arrays and returns the result. It can also be used with a - null callback to transpose arrays. (Andrei) -- Added array_filter(), which allows filtering of array elements via - the specified callback. (Andrei) -- Fixed all relevant array functions to avoid moving the internal array - pointer during operations. (Andrei) -- Added mysql_unbuffered_query(), which is useful for very large result sets. - (Zeev) - -30 Apr 2001, Version 4.0.5 -- Added new php.ini directive: arg_separator.input which is used to tell - PHP which characters are considered as argument separators in URLs. - Renamed php.ini directive: arg_separator -> arg_separator.output (Jani) -- Added FastCGI SAPI module. (Ben Mansell) -- Added array_reduce(), which allows iterative reduction of an array - to a single value via a callback function. (Andrei) -- The imageloadfont function of the gd extension should be not platform - dependent after this fix. (alex@zend.com) -- Fixed a compatibility problem in some file functions (fgets, fputs, fread, - fwrite). The ANSI standard says that if a file is opened in read/write - mode, fseek() should be called before switching from reading to writing - and vice versa. (alex@zend.com) -- Fixed argument checking for call_user_func* functions and allowed - specifying array($obj, 'method') syntax for call_user_func_array. (Andrei) -- Fixed parent::method() to also work with runtime bindings. - (Zeev, Zend Engine) -- Implemented high-performance zlib-based output compression - see - zlib.output_compression INI directive. (Zeev) -- Improved ob_gzhandler() to support chunked output buffering - it's - recommended to use it with 4KB chunks. (Zeev) -- Fixed chunked output buffering. (Zeev) -- Forced call_user_method() and call_user_method_array() to take the - object argument by reference. (Andrei) -- Fixed binding of ROWIDs in OCI8. (Thies) -- Added PEAR/Cache as a generic Caching System. (Sebastian, PEAR/Cache) -- Added IMAP quota support (imap_set_quota, imap_get_quota), enabled/added via - c-client2000. (kalowsky) -- Upgraded PCRE to version 3.4. (Andrei) -- Added array_search which works similar to in_array but returns - the key instead of a boolean. (jason@php.net) -- Fixed pgsql transaction support. (Stig, PEAR/DB) -- Added new object VARIANT() to encapsulate values for use with - the COM and DOTNET module. Therefore it is now possible to pass - values by reference, convert php values to extended variant types (currency, - date, idispatch, iunknown, ...) and define the codepage that should - be used for unicode - conversion. -- Improved overall speed of IRCG, added URL handling to message scanner. - (Sascha) -- Fixed some modules to allow using output-buffering. (Thies) -- Added the chroot() function. (Derick) -- PostgreSQL now does a rollback at the end of a request on every - persistent connection. This is done by doing an "empty" transaction - on the connection. This was advised by someone from the PostgreSQL - core-team. (Thies) -- Fixed PostgeSQL pg_connect() bug. We would sometimes close the default - link by accident. (Patch by: aja@nlgroup.ca) -- Improved OCI8 dead-session detection. (Patch by: George Schlossnagle) -- Fixed get_meta_tags() multiline bug #4556. (Sean) -- Prefer random() over *rand48(). (JimJag) -- Sped up WDDX serialization 2x. (Andrei) -- Added a new parameter to mail() which appends aditional command line - parameters to the mail program. (Derick) -- Added Udm_Clear_Search_Limits mnoGoSearch extension function. (gluke) -- Fixed mnogosearch protos. Fixed mnogosearch functions return values. - A bug with capital letters break search has been fixed. (gluke) -- Static methods can now be called via call_user_method_* functions, e.g. - call_user_method('method', 'class'), and also array('class', 'method') - constructs (for array_walk(), for example). (Andrei, Zend Engine) -- microtime() under Windows now returns accurate values. (James) -- Added PREG_SPLIT_DELIM_CAPTURE flag to preg_split() that allows for Perl-like - functionality of capturing parenthesized delimiter expression. (Andrei) -- Fixed strip_tags() to not strip a lone > character. (Rasmus) -- When using the ob_gzhandler() PHP now automagically also sets the - Content-Lengh correctly which enables browsers to use the HTTP - Keep-Alive feature. (Thies) -- Improved handling of preg_replace() /F modifier so that it's possible to - specify array($obj, 'method') construct as a replacement function. (Andrei) -- Added mysql_get_client_info(), mysql_get_server_info(), - mysql_get_proto_info(), and mysql_get_host_info() functions. (Sean) -- Major change of the php pdf api. It could break some functions though - backwards compatibility was tried to maintain. Adding some still - missing functions as well. (Uwe) -- Added mnoGoSearch extension - http://search.mnogo.ru. (Sergey K) -- Allow URL encoding in DB usernames and passwords. (Stig, PEAR) -- Added raiseError and setErrorHandling methods to PEAR class. (Stig, PEAR) -- Added support for converting images from JPG/PNG on the fly with the GD - extension, which is usefull for creating dynamic WAP-sites. (Derick) -- Updated ext/mysql/libmysql to version 3.23.32; bug fixes. (tim@mysql.com) -- Fixed possible crash in all (non-pcre) regex functions. (Thies) -- Improved str_replace() to accept an array for any parameter - similar - to preg_replace(). (Andrei) -- Fixed extract() to properly prefix numeric keys when EXTR_PREFIX_ALL is - used. (Andrei) -- Added EXTR_PREFIX_INVALID flag to extract() to automatically prefix - string keys that do not constitute valid variable names. (Andrei) -- BeOS patch from svanegmond@bang.dhs.org, modified somewhat by Rasmus. -- Fixed the Apache module to overwrite PATH_TRANSLATED with SCRIPT_FILENAME, - only if PATH_TRANSLATED is not previously set. (Zeev) -- Fixed crash bug in highlight_string(). (Rasmus) -- Added URL support for getimagesize() function. (Jani) -- Added xslt_set_scheme_handler() function. (carmelo@akooe.com) -- Added the pg_lolseek and pg_lotell functions. (Derick) -- Fixed wrong breaking with the wordwrap function. (Derick) -- Fixed 'O' and 'r' flags of date() to have correct sign for timezone - offset. (Andrei) -- Changed 'Z' flag to date() to always return timezone offset with - negative sign if it's west of UTC. (Andrei) -- Added the HTML_Processor class which provides common functions for - processing HTML. (Sterling) -- Added localeconv() and strcoll() functions for localization. (Sean) -- Added the xslt_set_base function. (Sterling) -- Added support for Zeus 3.3.8. -- Added odbc_error() and odbc_errormsg() functions. (Stig) -- New extension for vpopmail - http://www.inter7.com/vpopmail, - give it a try, but keep in mind that it is not ready for production - environments. (David Croft, Boian Bonev) -- Added sybase_get_last_message() to the Sybase CT module. (Jan Fedak) -- Made ldap_list(), ldap_read() and ldap_search() do parallel search when - first parameter is an array of link identifiers. (Stig Venaas) -- Made fopen() of HTTP URL follow redirects, $http_response_header will - contain all headers with empty string as delimiter. (Stig Venaas) -- Added Console_Getopt class for parsing command-line args. (Andrei, PEAR) -- Added an experimental version of the ZZipLib extension which provides the - ability to read zip files. (Sterling) -- Allow access to uploaded files in safe_mode. Beware that you can only - read the file. If you copy it to new location the copy will not have the - right UID and you script won't be able to access that copy. (Thies) -- Changed extract() to check that prefixed name is a valid one. (Andrei) -- Changed extract() to return the number of variables extracted. (Andrei) -- Added ldap_rename() function. (Stig Venaas) -- Made ldap_set_option() support controls. (Stig Venaas) -- Changed ldap_search() and added functions ldap_parse_result(), - ldap_first_reference(), ldap_next_reference() and ldap_parse_reference() - to cope with LDAPv3 stuff like referrals and references. (Stig Venaas) -- Fixed date('r') overflow. -- Made the php.ini path reported in phpinfo() always point to the absolute - path that was opened. (Zeev) -- Made the INI mechanism thread safe. (Zeev, Zend Engine) -- Changed setlocale() to use LC_* constants. (Jani) -- ctype functions now follow the extension naming conventions. (Hartmut) -- Added iconv() function (using libc or libiconv). (Stig) -- Added ODBC_TYPE constant. (Stig) -- Added the call_user_method_array function which allows you to call a method - with an arbitrary number of parameters. (Sterling) -- ext/odbc: IBM DB2 patch by Walter Franzini. -- Added extension for the cracklib library. (Alexander Feldman) - -19 Dec. 2000, Version 4.0.4 -- Allow assigning a newly created object by reference. This is needed only if - your constructor makes other data structures reference the $this object (for - example, $GLOBALS["foobar"] =& $this;) - The new syntax is $obj =& new MyClass(); (Andi, Zend Engine) -- Allow for three expression types to be sent to functions which are requesting - the function argument to be passed by reference (only c. was previously - supported): - a. func(new myclass()); - b. func(func2()); where func2() returns a reference, i.e. is defined as - function &func2(...) - { - ... - } - c. func($var); where func() is defined as function func(&$var) {...} - You CAN'T count on any other expressions to be passable by reference. - (Andi, Zend Engine) -- Made ldap_get_entries() return an array even if there are no entries - in search result. (Jani) -- Fixed bad mod_perl interaction which caused segfaults when using LFS (Sascha) -- const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME - description was recognized. -- Added the is_null() function that will return true if a variable is of - type null. (Sterling) -- Fixed a bug which made readdir() unusable in some systems. (Jani) -- Added the get_defined_functions() function which returns a list of all - currently defined functions. (Sterling) -- Added the get_defined_vars() function which returns an associative array - of all variables defined in the current scope and their subsequent values. - (Sterling) -- Added the call_user_func_array() function which gives you the ability to - call a user function by passing an array of parameters as the second - argument. (Sterling) -- Added the constant() function which returns the value of a constant given - the constant's name. (Sterling) -- Implemented support for Perl-style matching regexp delimiters in PCRE. - You can use <{[( and )]}> to delimit your expressions now. (Andrei) -- Introduced new 'F' modifier in PCRE that lets you specify a function - name in the replacement argument to preg_replace() that will be called - at run-time to provide the replacement string. It is passed an array of - matched pattern and subpatterns. (Andrei) -- Put an end to BUG#4615 (kalowsky & Eric Veldhuyzen) -- Added the IRCG extension (Sascha) -- Fixed realpath() in Virtual Directory mode (Daniel) -- Integrated the Phil Nelson's bc math library routines into PHP, now that - the license allows it (Phil Nelson ) -- Added the xslt_set_error_handler() function to the Sablotron extension. - (Sterling) -- Improved Sablotron's error handling system allowing you to catch all - errors before they are outputted to the screen. (Sterling) -- Added OpenSSL extension (Stig Venaas) -- Fixed/created support for Solid 3.0 databases (kalowsky) -- Fixed support for Solid 2.3 databases (kalowsky) -- quoted_printable_decode() function is made RFC-2045 compliant. (Kir) -- Modified preg_grep() to always return the results with keys from the original - array. (Andrei) -- Modified preg_replace() to accept Perl-style $n backreferences in addition - to \\n ones. (Andrei) -- Modified preg_replace() to ignore backreferences that refer to - non-existing subpatterns. (Andrei) -- Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies) -- Added 'output_handler' INI directive (Zeev) -- Fixed some buglets in the output buffering mechanism (Zeev) -- Added transparent gzip compression support (Jade Nicoletti, Zeev) -- Major overhaul of domxml. Added basic XPath support as well (Uwe) -- Added 'r' flag to date() which generates an RFC822 formatted date, e.g. - "Thu, 9 Nov 2000 16:33:01 -0500" (Colin) -- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables - as well (Zeev) -- Allow user to use mysql_use_result in mysql queries (Stas) -- Fixed a memory leak that would occur when restarting Apache often - (mookid@sigent.ru) -- Fixed a bug that prevented $argv and $argc from being defined in the command - line version of PHP (Stas) -- Fixed a bug that prevented a changed compile-time extension_dir from - affecting modules that were loaded via php.ini (Zeev) -- Fixed a bug in ftp_mkdir() when used on ftp server which doesn't return - the full path (Jani) -- Added ImageCreateFromString() which creates an image stream out of - e.g. a MySQL blob. (Mathieu) -- Fixed a crash bug in imagewbmp() (Jani) -- Changed the sablot configuration file so that if you use any version of - Sablotron below 0.44 you must use Sablotron's built-in Expat libraries. - (Sterling) -- Added basic authentication support to thttpd (Sascha) -- Added support for the Caudium webserver (http://caudium.net/). It's based - on the Roxen SAPI module. Many bugs have been identified and fixed. (David) -- Fixed mysql_close(), pg_close(), msql_close() and sybase_close() - they - weren't properly closing the SQL connections (Zeev) -- Fixed crypt() to supply random seed if none is given (Andi) -- Made print_r() support recursive data structures, e.g. $GLOBALS. (Zeev) -- Fixed a bug that caused PHP not to properly flush its output buffer, if more - than one output buffer was used. (Zeev) -- Fixed a bug that could draw the shutdown sequence of the PHP Apache module - into an endless loop, under certain circumstances. It could cause Apache - processes under Solaris to get stuck, especially when using output - buffering. (Zeev) -- Added support for serializing references (Stas) -- Fixed conflict with OpenLDAP and Oracle 8.1.x (Jani) -- parse_ini_file() supports a new optional 2nd argument that instructs it - to divide the directives to arrays according to the sections in which they - reside (Zeev) -- parse_ini_file() is now thread-safe, and supported under Windows (Zeev) -- Unified aborted-connection semantics of all SAPI modules (Sascha) -- URL-opened files now store the HTTP response header in $http_response_header - (Zeev) -- Fixed array_rand() to shuffle results when the number of requested - elements is the same as the number of elements in the array. (Andrei) -- Added replace parameter to header() (Sascha) -- Fixed handling of single quotes in transparent session-id mode (Sascha) -- Fixed "php://*" fopen handler (Sascha) -- Made rename work in threadsafe enviroments (Daniel) -- Made session_destroy() close files before unlinking (Daniel) -- Added array_sum() function. (Andrei) -- Fixed a bug in session.c. The php_session_save_current_state did not check - if mod_data is NULL and such situation is possible if the user calls - session_module_name with a parameter. (alex@zend.com) -- Added IIS Admin extension. (Frank) -- OCIBindByName() now does better parameter-checking. (Thies) -- Made read() binary-safe in sockets.c (Chris Vandomelen) -- Made array_intersect() and array_diff() not alter order (Stig Venaas) -- Made ldap_connect() accept URL in host parameter when using OpenLDAP - 2.x. To use SSL, use ldaps://host/ as URL. (Stig Venaas) -- Made resource type names visible, e.g. var_dump() and - get_resource_type() display "file" for file resources. (Andrei) -- Added the curl_getinfo() function to find out information about a CURL - transfer. This function requires cURL 7.4.0 or above. (Sterling) -- Added the CURLOPT_KRB4, CURLOPT_INTERFACE, CURLOPT_QUOTE, CURLOPT_POSTQUOTE, - CURLOPT_QUOTE and CURLOPT_HTTPPROXYTUNNELL options. (Sterling) -- Renamed the shm_* functions to shmop_* (Derick) -- Updated ext/mysql/libmysql to version 3.23 (tim@mysql.com) -- Added ldap_get_option() and ldap_set_option() functions (Stig Venaas) -- Fixed a crash in CGI mode, in case no file was provided - (Daniel Beulshausen& Zeev) -- Fixed possible crash bug in imap_fetchstructure() (Jani) -- Fixed possible crash bug in imap_open() (Jani & Mark Musone) -- Added url_rewriter.tags configuration directive (Sascha) -- Added CORBA client extension, ready for use (eriksson@php.net) -- Fixed memory leak in x-httpd-source mode (Jason Greene) -- Changed ext/gd not to be enabled by default (Jani) -- Make increment of empty string ("") behave like in PHP 3 and result in "1" - (Andi, Zend Engine) -- Added POST handler for Adobe FDF format (Hartmut) -- Added transparent read and write .gz-files on glibc based systems - using the 'zlib:' fopen wrapper (Hartmut) -- Fixed a problem in the configuration parser (two null bytes were added - to each ENCAPSULATED TC_STRING) (alex@zend.com) -- Added HMAC support in the mhash module (nmav@altera.gr) -- Added module for Ovrimos sql server (nmav@altera.gr) - -11 Oct 2000, Version 4.0.3 -- Fixed a possible crash in -a interactive mode (Zeev, Zend Engine) -- Added mysql_escape_string() (Peter A. Savitch and & Brian Wang) -- Fixed many possible crash bugs with improper use of the printf() family of - functions (Andi) -- Fixed a problem that allowed users to override admin_value's and admin_flag's - (Zeev) -- Fixed PostgreSQL module to work when the link handle is omitted (Zeev) -- Fixed returning of empty LOB fields in OCI8. (Thies) -- Added Calendar module to default Win32 build (Andi) -- Added FTP module to default Win32 build (Andi) -- Fixed crash in the POSIX getrlimit() function (alex@zend.com) -- Fixed dirname() under certain conditions (Andi) -- Added --with-imap-ssl to support SSL'ized imap library in RH7 and others - (Rasmus) -- Fixed possible crash bug in parse_url() (Andi) -- Added support for trans sid under Win32 (Daniel) -- Added IPv6 support in fopen (Stig Venaas) -- Added the shmop extension. It allows more general ways of shared memory - access. (thanks to Ilia Alshanestky and Slava Poliakov - (Derick) -- Added the ability for CURLOPT_POSTFIELDS to accept an associative array of - HTTP POST variables and values. (Sterling) -- Added the CURLOPT_HTTPHEADER option to curl_setopt(). (Sterling) -- Added the curl_error() and curl_errno() functions. (Sterling) -- Changed ext/db not to be enabled by default (Jani) -- Fixed building Apache SAPI module on SCO UnixWare (Sascha) -- Fixed writing empty session sets to shared memory (tcarroll@chc-chimes.com) -- Added support for BSD/OS make (Sascha) -- Added improved URL rewriter (Sascha) -- Fixed readdir_r() use on Solaris (Sascha) -- Improved HTTP headers for private-caching (jon@csh.rit.edu, Sascha) -- Added new function session_cache_limiter (jon@csh.rit.edu, Sascha) -- Added ftp_exec to the ftp functions (thanks to ) - (Derick) -- PEAR: add last executed query as debug info in DB errors (Stig) -- PEAR: allow multiple modes in PEAR_Error (Stig) -- Made the Sybase CT module thread safe (Zeev) -- Added second argument to array_reverse() that indicatese whether - the original array keys should be preserved. (Andrei) -- Clean up htmlspecialchars/htmlentities inconsistencies. (Rasmus) -- PEAR: renamed DB_GETMODE_* to DB_FETCHMODE_*, added setFetchMode() - in DB_common to set the default mode, added some MySQL tests (Stig) -- Made eval() and several other runtime-evaluated code portions report the - nature and location of errors more accurately (Stas) -- Added an optional parameter to wordwrap that cuts a string if the length of a - word is longer than the maximum allowed. (Derick) -- Added functions pg_put_line and pg_end_copy (Dirk Elmendorf) -- Added second parameter for parse_str to save result (John Bafford) -- Fixed bug with curl places extra data in the output. (medvitz@medvitz.net) -- Added the pathinfo() function. (Sterling) -- Updated sybase_ct module and its sybase_query to use high performance API. - (Joey) -- Added a more configurable error reporting interface to DB. (Stig) -- Added is_uploaded_file() and move_uploaded_file() (Zeev) -- Added several directives to php.ini - post_max_size, file_uploads, - display_startup_errors - see php.ini-dist for further information (Zeev) -- Worked around a bug in the libc5 implementation of readdir() (Stas) -- Fixed some potential OpenBSD and NetBSD crash bugs when opening files. (Andi) -- Added EscapeShellArg() function (Rasmus) -- Added a php.ini option session.use_trans_sid to enable/disable trans-sid. - (Sterling) -- Added the Sablotron extension for XSL parsing. (Sterling) -- Fixed a bug in checkdate() which caused < 1 years to be valid (Jani) -- Added support for an optional output handler function for output - buffering. This enables transparent rendering of XML through XSL, - transparent compression, etc. (Zeev) -- Added support for user defined 'tick' callback functions. This helps - emulate background processing. (Andrei) -- Fixed problem with having $this as the XML parser object. (Andrei) -- Internal opened_path variable now uses the Zend memory manager so that full - paths of files won't leak on unclean shutdown (Andi) -- Removed support of print $obj automatically calling the __string_value() - method. Instead define yourself a method such as toString() and use - print $obj->toString() (Andi, Zend Engine) - -29 Aug 2000, Version 4.0.2 -- Added PHP API for Zend's ticks. (Stig) -- PHP 3 regression testing framework re-born (Stig) -- Added php_uname() function (Stig) -- Made a minor change to allow building with OpenLDAP 2.0 (Stig Venaas) -- Fixed a bug in preg_replace() that would truncate subject string if the - first argument was en empty array. (Andrei) -- Added ob_get_length function (Stig) -- Fixed a bug that did not respect limit parameter in preg_replace() when - using /e modifier. (Andrei) -- Added ability for each xml_set_*_handler() function to take the - array($obj, 'method') syntax for the handler argument as well - as the normal function name. (Andrei) -- Updated array_walk() to be able to accept array($obj, 'method') - syntax for the walk function. (Andrei) -- Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when - called with negative length argument. (Torben) -- Fixed by-reference parameters passing for xml_ functions and for scanf - functions (Stas) -- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure - with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas) -- Fixed memory leaks in eval(); A script that used eval() extensively, could - end up consuming very large amounts of memory during execution (Zeev, Zend - Engine) -- Fixed memory_limit feature, which did not work properly in previous versions - (Zeev, Zend Engine) -- Fixed stdout support with the swf extension. (Sterling) -- Fixed byte order for ip2long and long2ip (Stas) -- Fixed dbase_add_record. (Sterling) -- Added support for libmcrypt 2.4.4 (Derick) -- Added strncasecmp function (Andi, Zend Engine) -- Fixed FTP module to accept multiline server replies (Jani) -- Fixed switch which only has a single default rule. (Andi, Zend Engine) -- Fixed problem with nested foreach()'s. (Andi, Zend Engine) -- The CCVS module is now stable and compiling. It compiles as a CGI and into - Apache cleanly without warnings. (Brendan W. McAdams) -- Fixed mSQL_close(). (nick@loman.net) -- Made return() in a require()'d file work like return() in an include()'d - file (Andi & Zeev, Zend Engine) -- Changed require_once() to work using the same table as include_once() - (Andi & Zeev, Zend Engine) -- Fixed PostgreSQL module to work when the link handle is omitted (Zeev) -- Fixed the Sybase modules to work properly with PHP 4.0 (Zeev) -- Fixed CLOB handling in OCI8 driver when using variable-width - character sets. (Thies) -- Added 4th optional parameter to sybase_[p]connect to specify the charset - for the connection (alf@alpha.ulatina.ac.cr) -- Fixed support for current thttpd releases. (Sascha) -- Added support for kerberized IMAP library using --with-kerberos - (Rasmus, Sascha) -- Virtualize realpath, chmod, chown and utime (Stas) -- Support content-encoding headers in file upload MIME parts - (Ragnar Kjørstad) -- Fixed warning when shutting down OCINLogon() connections. (Thies) -- Fixed \n in session variables bug on Win32 (Stas) -- OCIError() would sometimes not report failed connections. (Thies) -- Fixed HEAD request bug on an Apache ErrorDocument redirect and preserve - the status code across the redirect as well. (Rasmus) -- Added Olympus-specific tags to read_exif_data() (Rasmus) -- Fixed bug in imap_fetchheader() where using FT_PREFETCHTEXT didn't return - the body. Bug #4447. (Jani) -- Fixed exec() returning "\0" when output is empty -- Added XML_Parser class in PEAR (Stig) -- Added "make test" target in pear/ and added some regression tests (Stig) -- Fixed bug in strip_tags function as per bug #5857 (Rasmus) -- Fixed reading of IPTC via GetImageInfo() for certain JPEG files. (Thies) -- Improved the output-buffering functions to be re-entrant (Zeev) -- Made ldap_add(), ldap_modify(), ldap_mod_add(), ldap_mod_replace() - binary-safe. Original patch: Terrence Miao (Jani) -- CGI aka. command line version has now an option '-l' for syntax check - without execution (Hartmut) -- Fixed bug in ldap_get_values_len() which makes it NULL-safe. (Jani) -- Bug-report and fix submitted by Michel Alexeline -- Make ext_skel create a Makefile.in set up to handle shared extension - support automatically (Rasmus) -- Fixed php_realpath not to die on non-existing files (needed for touch()) - (Stas and china@thewrittenword.com) -- Fixed get_browser() function (Stas) -- Fixed symbol clash which caused a DSO problem on OpenBSD (Rob Black and - anil@recoil.org) -- Added new function: ldap_compare(). (Jani) -- Fixed a bug in ldap_get_entries() and ldap_get_attributes(). (Jani) -- Ported DB to new error reporting scheme in PEAR. (Stig) -- Added sybase and ibase DB backends in PEAR. (Sterling) -- New PEAR package Payment_Verisign for use with the Payflow Pro - (pfpro) extension. (David Croft) -- Added CURL support. (Sterling) -- Catch users trying to set "compatibility" parameter in PDF, which is not - supported from user-land. (Joey) -- Fixed dbase_add_record. (Sterling) -- Added new function wordwrap() to wordwrap long strings from Chris - Russel (David Croft) -- Added four additional arguments: attrsonly, sizelimit, timelimit, deref which - were missing in ldap_search(), ldap_list() and ldap_read() functions (Jani) -- Fixed a bug in ldap_search/list/read() which prevented returning the partial - results when 'Sizelimit exceeded' error occurred. (Jani Taskinen) -- Fixed preg_replace() to automatically escape quotes in matched - strings when using /e modifier. (Andrei) -- Itanium patch (Steve Robb) -- Set default include_path so PEAR files can be reached (Stig) -- Added "pear" executable, requires CGI version installed (Stig) -- Added extension ii for Ingres II native support. See README in ext/ingres_ii - directory. (David H) -- Added Win32 project for the Interbase module (Zeev) -- Added ability to perform calls to the parent class without explicitly - specifying its name, using parent::func_name(...) (Zeev, Zend Engine) -- You can now call Ora_Error() without prameters to get the reason - for a failed connection attempt. (Kirill Maximov) -- New extension "pfpro" for interface with Verisign Payflow Pro (David Croft) -- Added IMG_GIF, IMG_JPG, IMG_JPEG, IMG_PNG and IMG_WBMP constants for - imagetypes() function (Rasmus) -- Added ImageTypes() function which returns a bitfield with the supported - image formats. 1=gif, 2=jpeg, 4=png and 8=wbmp (Rasmus) -- Make it possible to specify an empty string as a thousands-seperator - in number_format() (Rasmus) -- Shared module support for LDAP extension (Troels Arvin) -- Fixed a bug with imap_mail where apache would segfault if the rpath - parameter was specified. -- Use dashes and short day name in cookies since some browsers seem picky - about this (Rasmus) -- Added pspell module. (Vlad) -- Added 3 additional arguments to the user-defined error handler - the file - name and line number in which the error occured, and the context (local - variables) of the code in which the error occured (Zeev, Zend Engine) -- Improved the error handling code to handle an error in a user-defined error - handling function (Zeev, Zend Engine) -- Fixed leak when using string offsets in the array() construct. - (Andi, Zend Engine) -- Fixed corruption problem when changing deeply nested values in objects. - (Andi & Zeev, Zend Engine) -- Improved array_multisort() to be able to specify sort type as well sort - order. Incidentally, it can be used to sort multi-dimensional arrays - as well. (Andrei) -- Fixed a possible data corruption in case of a huge amount of aborted requests - (Zeev) -- Apache module would sometimes close a wrong file-descriptor. (Sascha) -- Fixed use of alternative storage handlers in the session module. (Sascha) -- Updated str_pad() to be able to pad on left/right/both sides. (Andrei) -- Fixed crash in gzopen(). (Thies) -- Multiple character set support in gdttf.c (Rob Goodwin) -- When using HTTP auth from PHP, fill in the %u custom log field so the - authenticated used id will get logged in the Apache access_log (Rasmus) -- Support for pdflib 3.01. (Uwe) -- FDF Data is handled properly and can be accessed by reading - HTTP_RAW_POST_DATA. (Uwe) -- Added new 'O' format modifier that will output the GMT offset as "[+-]HHMM" - (eg: Pacific time is -0700). This is useful for things such as Date: mail - headers. (Mike W) -- Fixed crash on OCI?Logon() failure. (Thies) -- Make the special Header("http/...") response be case insensitive like 3.0 - (Rasmus) -- Allow cybercash to compile as a DL module. (Sterling) -- Fixed the dbase_create function. (Sterling) -- Fixed a problem under some versions of Windows that could cause PHP to hang - on startup if errors occured, e.g. in the php.ini file (Zeev) -- Fixed opendir() again. It should actually work well continuously now (Zeev) -- Added three additional arguments to be sent to a user-defined error handler - - the filename and line number in which the error occured, and the context - (the local variables) of the error (Zeev, Zend Engine) -- Improved the error handling code to handle an error in a user-defined error - handling function (Zeev, Zend Engine) -- Added an optional parameter to preg_replace() that can be used to - specify how many replacements to make. (Andrei) - -28 Jun 2000, Version 4.0.1 -- Fixed a possible crash in the LDAP modify code. (Eric Kilfoil) -- Fixed a bug in opendir(), which prevented readdir() from working properly if - the $dir argument wasn't explicitly specified (Zeev) -- Made --enable-discard-path work again. (Andi) -- Removed 8KB limit on line length of the file() function (Zeev) -- Disabled dl() when PHP is being used as a module inside a multithreaded web - server - it didn't work before, and caused weird results (Zeev) -- Added the ImageColorClosestHWB(), ImageCopyMerge() and ImagePaletteCopy() - functions. (Sterling) -- Added ImageCreateFromWBMP() function. (Jouni) -- Fixed problems with POST requests under the NSAPI module. (Roberto Biancardi) -- Added spliti() function. (Thies) -- Fixed serializer behaviour with regards to serializing objects whose class - definition was not available in the deserializing context. (Sascha) -- Improve memory cache performance and increase cache size. (Stas, Zend Engine) -- Added a crc32 checksum function - used by the UdmSearch search engine - and currently run through a system call. This will speed up the UdmSearch - php frontend significantly. (Rasmus) -- Modified in_array() to not touch array pointer. (Andrei) -- Added restore_error_handler(). (Zeev, Zend Engine) -- Fixed erroneous file names and line numbers in error situations under the - multithreaded version of PHP - most noticeably Win32 (Zeev, Zend Engine) -- Fixed problem with CGI crashing on certain servers especially Windows Apache - & O'Reilly website (Andi) -- Added Pi3Web SAPI module; run ./configure --with-pi3web to enable this. - (Holger; zimpel@t-online.de) -- Enhanced WDDX functions to call __sleep() and __wakeup() when working on - objects. (Andrei) -- Changed WDDX to serialize arrays as structs only if needed. (Thies) -- Implemented max_execution_time under Win32 (Zeev) -- Updated strtotime() to handle many more formats. It now has complete - feature parity with GNU date command. (Andrei) -- Added support for multiple arguments in unset(). (Faisal, Zend Engine) -- Functions that expect a resource but are passed something else now return - NULL instead of FALSE. (Thies, Zend Engine) -- Fixed gmmktime(), on certain systems it incorrectly adjusted for the timezone - offset and daylight savings time. (Andrei) -- Moved VC++ Win32 project and workspace files to the win32 directory - (Zeev) -- Fixed checkdate() to not return true on non-numeric arguments (Rasmus) -- Added --enable-c9x-inline option for compilers which support the new C9x - standard. If you encounter undefined references to i_zend_is_true and - other symbols, you should enable this. (Sascha, Zend Library) -- Fixed a problem in ldap_add() and ldap_modify(), sometimes added trailing - garbage to the values (Stig Venaas) -- Fixed a problem with dbmopen() not handing 'c' correctly with dbm/db/ndbm - databases. (JimJag) -- Fixed a crash in number_format() when used with locales. (Andrei) -- Fixed an initialization problem in the MS-SQL problem that could cause - a crash in mssql_query() (Zeev) -- Upgraded PCRE to version 3.2 and fixed a bug when anchored pattern - matched an empty string. (Andrei) -- Fixed a bug that prevented PHP from paying attention to the extension_dir - directive with extensions that were loaded from the php.ini file (Zeev) -- Changed set_error_handler() to return the name of the previously defined - error handler, if any (Zeev, Zend Engine) -- Declared officially dead. It didn't work in PHP 4.0.0 - either, but now it's gone for good (Zeev) -- Make convert_cyr_string() binary safe and stop it from corrupting other - PHP variables. (Andi) -- Added functions array_unique, array_intersect and array_diff (Stig Venaas) -- Fixed problem when using uninitialized values in comparisons with strings. - They behave as empty strings again just like in PHP 3. - (Andi & Zeev, Zend Engine) -- Fixed 'Z' flag in date() to adjust for daylight savings time. (Andrei) -- Fixed var_dump() not to modify the internal order of array elements (Zeev) -- Fixed stripcslashes() to remove to strip \ in unknown escapes instead of - leaving it. (Andrei) -- Changed WDDX to always serialize arrays as structs. (Andrei) -- Fixed include_once() to issue a warning in case the supplied file name is - not found (Zeev, Zend Engine) -- Fixed a bug in get_declared_classes() which could return the same class - multiple times under certain circumstances (Zeev, Zend Engine) -- Fixed a bug in rawurldecode() that would cause in rawurldecode() corrupting - its argument (Zeev) -- Parse errors (or other errors) in the php.ini files under Windows will no - longer mess up the HTTP headers in CGI mode and are now displayed in a - message box (Zeev) -- Fixed a crash in OCIFetchStatement() when trying to read after all data - has already been read. (Thies) -- fopen_wrappers() are now extensible via modules (Hartmut Holzgraefe) -- Make trim strip \0 to match php 3 (Rasmus) -- Added function imagecreatefromxbm(). (Jouni) -- Added function imagewbmp(). (Jouni, based on patch from Rune Nordbøe - Skillingstad) -- Added str_pad() for padding a string with an arbitrary string on left or - right. (Andrei) -- Made the short_tags, asp_tags and allow_call_time_pass_reference INI - directives work on a per-directory basis as well, e.g. from .htaccess - files. (Zeev) -- Added fflush() function. (Eric Huss) -- Fixed a problem with static variables, default function arguments and class - member variables, that contained array values. (Andi & Zeev, Zend Engine) -- Fixed virtual() when used with output buffering (Marc Pohl) -- Clean up constants in flock() function and add optional 3rd arg which - is set to true on EWOULDBLOCK (Rasmus) -- Added functions pg_loimport(), pg_loexport(). (Jouni) -- Added SWF support to getimagesize() function (Derick Rethans) -- Added support for both indexed and non-indexed arrays of file uploads - eg. name="file[]" type="file" (Rasmus) -- Added create_function(), which gives the ability to create functions - on-the-fly (Zeev, Zend Engine) -- Added support for comparisons of arrays (with arrays) and objects (with - objects); The equality operator (==) performs an unordered comparison, - whereas the identity operator (===) performs an ordered comparison (Zeev, - Zend Engine) -- Allow all functions that receive user-defined function callbacks to accept - an array that contains an object and a method name, in place of a function - name, e.g. usort($array, array($obj, "ObjSort")) (Zeev, Zend Engine) -- Added set_error_handler() to allow custom error handling functions, - instead of the built-in error handling code (Zeev, Zend Engine) -- Renamed user_error() to trigger_error(); user_error() remains - defined for compatibility (Zeev, Zend Engine) -- Fixed the global/static statements to require a trailing terminating - semi-colon ';'. (Andi, Zend Engine) -- Cleaned up PCRE extension and made it binary-safe. (Andrei) -- Added third argument to in_array(). If it's true, then in_array() - will use strict comparison instead of the default one. (Andrei) -- Added pg_trace() and pg_untrace (Dominic J. Eidson & Zeev) -- ignore_user_abort=Off is now default. (Thies) -- Added array_merge_recursive() that will recursively merge values - under the same keys. (Andrei) -- fixed crash in OCIParse when parsing invalid SQL. (Thies) -- Fixed a bug in mysql_connect() that made it ignore the socket argument, in - case of non-persistent connects (Zeev) -- Added disable_functions php.ini directive, to allow administrators to disable - certain functions for security reasons (Zeev) -- Fixed sessions on Win32. When setting the directory depth parameter in - save_path you need to now delimit it with a ';' instead of ':', e.g - "5;/tmp" instead of "5:/tmp" (Andi) -- Changed the Apache handler's return status to 'Declined' when a requested - PHP file could not be found. Returning 'Not Found' caused problems - in the ErrorDocument handler stage in that $REDIRECT_REDIRECT_ERROR_NOTES - was not getting set at all. Moving to 'Declined' should fix this and I - can't see any other side effects. (Rasmus) -- Fixed scanning decimal numbers in internationalized environments. They should - always be in standard US format e.g. 23.3. (Andi, Zend Engine) -- Added second argument to preg_quote() which allows quoting of - one additional character, usually the regex delimiter. (Andrei) -- Uncommitted outstanding OCI8 transactions are now rolled back - before the connection is closed. (Thies) -- ignore_user_abort() & friends should now work in CGI mode as well. - (Patch by daniel.braun@ercom.fr) -- Added extension YAZ (dickmeiss). -- Fixed a crash bug triggered by certain cases of class redeclarations - (Stas & Zeev, Zend Engine) -- Fixed min()/max() segfault. (Andrei) -- New module for reading EXIF header data from JPEG files. Most digital - cameras will embed all sorts of information about a picture inside the - jpeg images it generates. (Rasmus) -- Fixed basename() bug where "file.ext///" would not return the same - as "/path/file.ext///" (Rasmus) -- Added the swf_ortho function. (Sterling) -- Moved to virtual current working directory support. This highly improves the - functionality and stability of multi-threaded versions of PHP (Andi, Sascha) - -22 May 2000, Version 4.0.0 Release -- Allow the writing of flash files to stdout. -- Fixed a crash bug in .phps syntax-highlighted files (Andi) -- Improved round() to allow specification of rounding precision. - (Andrei, Todd Kirby ) -- Added SORT_REGULAR, SORT_NUMERIC, SORT_STRING flags that can be used with - non-user sort functions for precise sorting behavior. (Andrei) -- Fixed two 64-bit issues (startup crash, gethostbyaddr). (Sascha) -- NULL values are now preserved in the return value of mysql_fetch_array() - and mysql_fetch_object(). (Andrei) -- Ported InterBase module finally from PHP 3 to PHP 4. Full support for - InterBase 6. (Jouni) -- Added swf_definepoly for drawing polygons to the SWF functions. (Sterling) -- Ported imagegammacorrect from PHP3 to PHP4. (Sterling) -- Added array_rand() function. (Andrei) - -8 May 2000, Version 4.0 Release Candidate 2 -- NSAPI WIN32 Module compilable, untested (Shane) -- Apache WIN32 Module compilable and lightly tested. (Shane) -- Enabled assert() by default in php.ini-dist. (Andrei) -- Put in safeguards in case dynamic code evaluation in assert() and - preg_replace() with /e modifier fails. (Andrei) -- Fixed infinite recursion when serializing $GLOBALS[] in WDDX. (Andrei) -- Made WDDX serialization properly escape <, >, and &. Also speeded up - the serialization in general. (Andrei) -- Moved install-local to install-sapi for clarity. (Joey) -- Improved extension build framework. Refer to README.SELF-CONTAINED-EXTENSIONS - for an introduction. (Sascha) -- ImagePolygon() is no longer limited by a maximum number of polygons. - (Marc Pohl) -- Added configure time checking for bcmath package. (Joey, Sascha) -- Added get_declared_classes(). (Andrei, Zend Engine) -- Added initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus) -- Added the SWF module which allows you to create Macromedia Flash files via - libswf. (Sterling) -- Improved UNIX build system to support more vendor make tools (Sascha) -- Updated natural comparison/sorting algorithm by Martin Pool - . (Andrei) -- Fixed a crash in array_multisort() that happened when empty arrays - were passed to it. (Andrei) -- Added substr_count() from Peter Kovacs. (Andrei) -- Added an optional third argument to fseek to indicate where to seek from. - (Andrei) -- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies) -- Converted the IMAP module to the high performance API (Zeev) -- The fgetcsv() function now handles embedded end-of-line in a quoted field - (Nick Talbott) -- Added user_error(), to allow explicitly generate error messages from scripts - (Zeev, Zend Engine) -- Fixed a problem in long2ip() that occasionally returned incorrect IP address. - (Evan, Andrei) -- Fixed many memory leaks in the IMAP module (Stas, Andi, Zeev) -- Fixed bug in number_format (Jon Forsberg) -- Make error_prepend_string and error_append_string work (Rasmus) -- array_walk() now automatically resets the array. (Andrei) -- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(), - natsort(), and natcasesort(). These are useful for comparing and sorting - strings that contain numbers. Based on the code from Martin Pool - . See http://www.linuxcare.com.au/projects/natsort/ - for more info on natural sorting. (Andrei) -- Zeus Webserver support (version 3.3.6+) for ISAPI (Ben Mansell) -- Fixed several problems with the PATH_TRANSLATED and PHP_SELF under Apache - (Paul Gregg & Zeev) -- Ported ldap_get_values_len() function from PHP3 to PHP4. (Sterling) -- Fixed a problem in include_once() with non constant arguments (Andi & Zeev, - Zend Engine) -- Added php.ini-optimized (Zeev) -- Ported ldap_errno(), ldap_err2str() and ldap_error() from PHP3 to PHP4. - (Sterling) -- WDDX now defaults to ISO-8859-1. (Thies) -- Fixed crash resulting from IMAP's error handling (Stas) -- Added $HTTP_POST_FILES[filename][tmp_name] - it was previously impossible to - retrieve the temporary name of an uploaded file using $HTTP_POST_FILES[] - (Zeev) -- Made the IMAP and LDAP modules compilable under Windows and thread-safe - (Zeev) -- Fixed a problem when dealing with large POST blocks in CGI mode (Zeev) -- Added session_get_cookie_params() function. (Sterling) -- Fixed return of stristr() to no longer always be lowercased. (Andrei) -- Changed the Windows version of PHP so that a php.ini file is no - longer mandatory (Zeev) -- session_start() is now more verbose if headers cannot be send. (Thies) -- Fixed a memory leak when using assign-op bitwise operators on strings (Zeev, - Zend Engine) -- Added support for reading properties that require arguments in the COM - module - writing to them will only be supported in PHP 4.1 (Zeev) -- Fixed a very old legacy memory leak in the COM module (Zeev) -- Fixed problems with object-overloading support - noteably, COM and Java - (Zeev, Zend Engine) -- Fixed an overrun in WDDX. (Thies) -- Fixed a crash bug with modules loaded through dl() not properly freeing their - resources (Zeev, Zend Engine) -- Added localtime() function. (Sterling) -- Added the 'I' format option for the date function, this option will return - true or false depending on whether or not daylight savings time is in effect. -(Sterling) -- Added gmstrftime() function. (Sterling) -- snmp_walkoid is now an alias for snmp_realwalk. (Sterling) -- Fixed a bug that could cause a crash when using 'global' inside large include - files (Stas, Zend Engine) -- Added --enable-libgcc switch to force linking against libgcc (Sascha) -- Fixed dynamic loading where extension_dir had no trailing slash (Sascha) -- Fixed dynamic loading on OpenBSD (Sascha) -- Improved POSIX threads check. ZTS works now on at least Linux, Solaris, - FreeBSD and OpenBSD (Sascha, TSRM) -- Added !== operator support. (Torben, Zend Engine) - -27 March 2000, Version 4.0 Release Candidate 1 -- Added support for UCD-SNMP 4.1.x (Sascha) -- Fixed a data corruption bug in mysql_result(), if used in table.fieldname - mode (Zeev) -- Fixed a crash problem in func_num_args(), func_get_arg() and func_get_args() - when used as function arguments (Andi, Zend Engine) -- Added get_class_methods(string classname) function. (Andrei) -- Added 'I' switch to test whether or not DST is active. (Sterling) -- Fixed a data corruption bug in mysql_result(), if used in table.fieldname - mode (Zeev) -- Modified the registry INI entry reader (Win32) to work with drive letters. - For example, if you wish to wish to specify INI entries for C:\foo\bar, you - should create HKLM\PHP\Per Directory Values\C\foo\bar in the registry, and add - string values for each directive you want to override in this directory (Zeev) -- Fixed extract() for EXTR_PREFIX_SAME and EXTR_SKIP cases. (Andrei) -- stristr() no longer modifies it's arguments. (Thies) -- Don't default to iso-8859-1 since this confuses some browsers. (Rasmus) -- Make it possible to specify both a port and a socket - in mysql_[p]connect. (Rasmus) -- Added --disable-pic for disabling generating PIC for shared objects - on platforms which support it (i.e. Linux) (Sascha) -- serialize()/unserialize() now call __sleep() and __wakeup() when - working on objects. (Thies) -- renamed to_string() method to __string_value() for consistency. - (Thies, Zend Engine) -- Fixed a bug in the third argument to define() -- Added is_numeric() that returns true if the argument is a number - or a numeric string. (Andrei) -- domxml now supports libxml 2.0 Beta and drops support for older versions, - due to massive changes in libxml -- fixed possible crash in unserialize() if serialized data was - corrupted. (Thies) -- Changed $HTTP_STATE_VARS to $HTTP_SESSION_VARS. Use only the latter - version now! (Andrei) -- Added GD-JPEG Support (Rasmus) -- Prevent from loading dynamic PHP modules which were compiled with different - debug and thread safety modes than PHP, which resulted in a crash (Andi) -- connection_aborted() and friends work again (Thies) -- Upgraded to libtool 1.3.4 (Sascha) -- UNIX configure creates config.nice in the build directory now which allows - easy reuse of configuration options (Sascha) -- Added support for embedded MySQL client library. Unless you specify a path - to --with-mysql, the bundled MySQL client library will be used (Sascha) -- Added include_once() and require_once() functionality (Andi, Zend Engine) -- Removed support for pdflib < 3.0 (Uwe) -- Added auto-registration of everything in $HTTP_SESSION_VARS[] if - register_globals is turned off. (Andrei) -- Cleaned up extension namespace (Stig) -- OCINLogon() sessions are now closed again. (Thies) -- Added ip2long() and long2ip(), - courtesy of Faisal Nasim (Andrei) -- Added ftruncate() and fstat(), - courtesy of Faisal Nasim (Andrei) -- Added parse_ini_file(). Currently implemented in non thread safe version - of PHP, and currently lacks section support (Zeev) -- "none" is now equivalent with "" in Apache config directives (Stig) -- OCINLogon no longer crashes. (Thies) -- Fixed comparisons of (string) "nan" with (string) "nan". (Thies, Zend Engine) -- Switched back to the old $HTTP_*_VARS[] behavior - $HTTP_GET_VARS["foo"] - and $foo are no longer references to each other, but separate variables - like they were prior to PHP 4.0 Beta 4 (Zeev) -- Fixed Sybase-DB compilation (Zeev) -- Fixed a (fairly common) situation where error_reporting values would not be - properly restored after a call to error_reporting(), in between requests - (Zeev) -- The various $HTTP_*_VARS[] are now protected, and cannot be manipulated by - user input (Zeev) -- Added ini_set() as an alias to ini_alter() (Zeev) -- The string None is now recognized as a keyword by the php.ini processor, and - can be used to denote an empty string (Zeev) -- Added get_class_vars(string class_name) and get_object_vars(object obj) - functions. (Andrei, Zend Engine) -- Added pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe) -- Fixed comparison of (string) "inf" with (string) "inf", which was erroneously - returning false (Zeev) -- Implemented default_charset and default_mimetype config directives (Stig) -- Ported T1lib support from PHP3. (Jouni) -- Fixed -DEAPI inheritance from APXS. (Sascha) -- Fixed possible crash in module-shutdown. (Thies) -- Fixed safe_mode_protected_env_vars INI directive (Zeev) -- Fixed getrusage() (Sascha) -- Fixed OCI8 crash when returning cursors from stored-procedures. (Thies) - -21 February 2000 Version 4.0 Beta 4 patch level 1 -- Fixed crash when magic_quotes were switched off. (Thies) -- Support for pdflib 2.30 (Uwe) - -20 February 2000, Version 4.0 Beta 4 -- Introduced $HTTP_POST_FILES[], that contains information about files uploaded - through HTTP upload (Zeev) -- Made PHP work under Microsoft Personal Web Server, under both Windows NT - workstation and Windows 95 (Zeev) -- Made multipart/form-data content obey to the variables_order directive (Zeev) -- Updated the browscap module to work with PHP 4.0 (Zeev) -- Recover gracefully in ISAPI after the client prematurely presses STOP (Andi) -- Fixed bug in unset() on array offsets which are referenced more than once - (Andi, Zend Engine) -- Improved ISAPI module - it should no longer be necessary to set PHP as - an ISAPI filter, only as an ISAPI extension, unless you wish to perform - authentication using PHP. This didn't yet get enough testing, but it - should work (Zeev) -- Fixed RFC1867 file upload under Windows (Zeev) -- Initital support for pdflib 2.20 (Uwe) -- Added PostgreSQL support for DB (Rui Hirokawa ) -- Re-introduced "none" for disabling auto_prepend/append_file (Stig) -- Added DB/storage (Stig, PEAR) -- Introduced DB warnings (Stig, PEAR) -- Fixed overrun in strip_tags (Stas) -- Fixed crash in strip_tags() and related functions. (Thies) -- Workaround for bogus POST-Data from IE/Mac. (Thies) - Patch by Alain Malek -- Finished the server abstraction layer; All of the PHP code is now shared - across different servers (Apache, CGI, IIS, etc.), except for thin - interface modules (Zeev) -- Added NULL-support in gettype(). (Thies) -- base64_decode() will decode POST data correct. (Thies) - Patch submitted by: Turadg Aleahmad -- Much more work on domxml. Build xml tree, create xml doc works (Uwe) -- Made foreach() work on objects. (Thies, Zend Engine) -- Added domxml extension based on libxml, still little functionality (Uwe) -- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev) -- Updated calendar dynamic library to work with PHP 4. (Evan) -- Added strncmp() function, courtesy of Walter. (Andrei) -- Made the output of var_dump() more informative. (Thies) -- Fixed some OCIBindByName() problems. (Thies) -- Protect the ISAPI module against exceptions. Stack overflows in scripts are - now nicely detected and handled (Zeev) -- Fixed possible buffer-overflow in base64_decode. (Thies) -- Fixed possible buffer-overflow in setcookie(). (Thies) -- Fixed signal() bug that could cause the Apache master process to - die. (Thies) -- Added session_set_cookie_params() function. (Andrei) -- If header information is sent after output has already been sent, the warning - message will now state the filename and line number at which the first output - was made (Zeev) -- Added the XML Expat library to the standard PHP source distribution thanks - to its author James Clark (Andi & Zeev) -- Added XML support to the default Win32 build (Andi & Zeev) -- Added socket_get_status() function. Renamed: - set_socket_timeout() -> socket_set_timeout() - set_socket_blocking() -> socket_set_blocking(). (Andrei) -- Added realpath() function. (Andrei) -- mktime interprets years in the range 0-70 now as 2000-2070. You can - continue to specify the complete year (i.e. 1920) (Sascha) -- Added the ability to control the environment variables the user is allowed - to change in Safe Mode, using INI directives (Zeev) -- Fixed a crash bug in strtr() working on large input strings (Zeev) -- Ora_GetColumn()/Ora_FetchInto() now return NULL for NULL-Columns. (Thies) -- OCI8 now supports binding of NULL-values. Module cleanups. (Thies) -- Added ability to set timeout on socket read operations through - set_socket_timeout() function. (Andrei) -- Added implicit_flush INI directive (Zeev) -- Added implicit_flush() to control whether flush() should be called - implicitly after any output (Zeev) -- Fixed a crash in pfsockopen() (Zeev) -- Fixed a possible crash in phpinfo() (Zeev) -- Added register_argc_argv INI directive, to allow to selectively disable - the declaration of the $argv and $argc variables for increased - performance (Zeev) -- Added $HTTP_ENV_VARS[] and $HTTP_SERVER_VARS[] support, which similarly - to $HTTP_GET_VARS[], contain environment and server variables. Setting - register_globals to Off will now also prevent registration of the - environment and server variables into the global scope (Zeev) -- Renamed gpc_globals INI directive to register_globals (Zeev) -- Introduced variables_order that deprecates gpc_order, and allows control - over the server and environment variables, in addition to GET/POST/Cookies - (Zeev) -- new function cpdf_set_document_limits() (Uwe) -- Applied safe-mode patch to popen(). (Patch by Kristian Köhntopp) -- str_repeat() now returns correct length. (Thies) -- Don't assume libz and libpng are installed for the GD checks (Rasmus) -- Implemented support for and types according - to WDDX version 1.0 (Andrei) -- Made var_dump()/serialize()/unserialize() NULL aware. (Thies) -- Added new NULL constant (Zeev, Zend Engine) -- Fixed -c support in the standalone CGI binary (Zeev) -- Increased PHP's performance by 5-15% using a new memory cache (Andi & Zeev, - Zend Engine) -- Improved the php.ini reader to support constants and bitwise operators (Zeev) -- Fixed strrev() to no longer modify arg1. (Thies) -- Fixed buffer overruns in iptcembed(). (Thies) -- Fixed a bug in ODBC error reporting (Zeev) -- Added PHP_Logo_GUID() and Zend_Logo_GUID() functions, that return the GUIDs - of the PHP and Zend logos used in phpinfo() (Zeev) -- Added GNU Pth support (Sascha, TSRM library) -- Removed select(), fd_set() and fd_isset() - will be reimplemented soon! (Thies) -- Improved Win32 performance significantly by using different mutexes (Zeev, - TSRM library) -- Made quotemeta() and preg_quote() binary-safe. (Andrei) -- Added UDP support in fsockopen(). (Evan) -- Added --disable-pear option (Andrei) -- Renamed libzend repository to Zend (Zeev) -- Added support for thttpd (Sascha) -- Added session.cache_limiter and cache_expire options (Sascha) -- Restored the PHP_VERSION and PHP_OS constants (Zeev) -- Added get_loaded_extensions(), extension_loaded(), and - get_extension_funcs() functions. (Andrei) -- Added date/time stamping to PHP error log file. (Andrei, Joey) -- Added is_subclass_of() function (Andrei, Zend Engine) -- Implemented count_chars(). (Thies) -- Added class_exists() function (Andrei, Zend Engine) -- Made strspn() and strcspn() binary-safe. (Andrei) -- Added array_multisort() function. (Andrei) -- Made pageinfo.c thread-safe (Sascha) -- Made implode() binary-safe (Andrei) -- Made strstr(), stristr(), and ucwords() binary-safe() (Andrei) -- Made strtoupper(), strtolower(), substr_replace() binary-safe. (Andrei) -- Fixed a crash in the Apache syntax highlighting mode (Zeev) -- Report all ODBC error's not just the one on the top of the stack (lurcher) -- OCI8 now returns NULL values in LONG columns correct. (Thies) -- Added support for a C-like assert() function. (Thies) -- Added CyberCash support. (Evan) -- Made explode() binary-safe. (Thies) -- Made strpos() binary-safe. (Thies) -- Added XML_Set_Object() function, now you can use the XML-Parser from - within an object. (Thies) -- Session vars are now decoded into $HTTP_STATE_VARS[] array and the - globals, depending on track_vars and gpc_globals settings (Andrei) -- Added get_used_files() function - returns a hash mapping the use()'d files - to their full path (Zeev) -- PHP 4 scripts will now obey the max_execution_time setting and actually - time out (Rasmus) -- Added configure command to phpinfo() output (Stig) -- Added optional socket path to the mysql_?connect() functions (Rasmus) -- Made mysql and gd work as shared extensions again (Stig) -- Make the global GET/POST/Cookie variables and their $HTTP_*_VARS[] counterparts - be references to each other (Zeev) -- Added support for the 'use' keyword - behaves like 'require', but will not - use the same file more than once (Andi & Zeev, Zend Engine) -- Added check to see if a persistent connection is still valid with the - ODBC interface before reusing (nick@easysoft.com) -- Added DBMaker support (patch by Pax Tsai ) -- Renamed "PECL" to "PEAR" (PHP Extension and Add-on Repository) (Stig) -- buildconf now uses build.mk (Stig) -- Disable symlinks to urls (Rasmus) -- Informix driver now reflects version of ESQL/C used (Danny) -- Modified session_register() to take variable number of arguments (Andrei) -- Fixed file descriptor leak in thread safe mode (Zeev, Zend Engine) -- Added select(), fd_set() and fd_isset() (Evan) -- cpdf support has been ported from php3, needs ClibPDF 2.x (Uwe) -- Fixed a leak when using automatic output buffering (Zeev) -- Introduced PECL - PHP Extension and Code Library - (prounounced "pickle") (Stig) -- Fixed inconsistencies in the implementation of here-docs (Andi & Zeev, Zend - library) -- Fixed a problem with constant class-member initializations (Andi & Zeev, - Zend Engine) -- Fixed float-compare in min(),max(),a[r]sort(),[r]sort() (Thies) -- Implemented get_html_translation_table() function (Thies) -- Implemented array_flip() function. Returns input-array with key, value - flipped (Thies) -- Added Berkeley DB3 support in DBA (Sascha) -- Implemented 2-Arg version of strtr($str,$translation_array). This can be used - to revert what htmlspecialchars() did (Thies) -- Fixed mem-overwrite in XML_Parse_Into_Struct (Thies) -- Added substr_replace() function (Andrei) - -November 16 1999, Version 4.0 Beta 3 -- ucfirst()/ucwords() no longer modify arg1 (Thies) -- Fixed strtr() not to modify arg1 (Thies) -- Added Win32 build files for Informix driver and make it - compile with ZTS (danny) -- Added tmpfile() function (Stig) -- Upgraded regex library to alpha3.8 (Sascha) -- Fixed selecting nested-tables in OCI8. (Thies) -- RFC-854 fix for internal FTP-Code. Commands have to end in "\r\n" (Thies) -- Fixed OpenLink ODBC support (Stig) -- min(),max(),a[r]sort(),[r]sort(),k[r]sort() now work consistent with the - language-core. (Thies) -- tempnam() now uses mkstemp() if available (Stig) -- serialize() and var_dump() now honor the precision as set in php.ini - for doubles. (Thies) -- Improved the Win32 COM module to support [out] parameters (Boris Wedl) -- Fixed garbage returned at the end of certain Sybase-Columns (Thies) - Patch submitted by: neal@wanlink.com -- Added Microsoft SQL Server module for Win32 (Frank) -- Added support for forcing a variable number of internal function arguments - by reference. (Andi & Zeev, Zend Engine) -- Implemented getprotoby{name,number} (Evan) -- Added array_pad() function. (Andrei) -- Added new getservby{name,port} functions. (Evan) -- Added session.cookie_path and session.cookie_domain (Sascha) -- Continue processing PHP_INI_SYSTEM knownDirectives after extension= - (Sam Ruby) -- Enable IBM DB2 support - Tested against DB2 6.1 UDB on Linux (Rasmus) -- Added new str_repeat() function. (Andrei) -- Output-Buffering system is now Thread-Safe. (Thies) -- implemented OCI8 $lob->WriteToFile() function - very useful for streaming - large amounts of LOB-Data without to need of a huge buffer. (Thies) -- Added session.use_cookies option (Sascha) -- Added getcwd() function. (Thies) -- XML_Parse_Into_Struct no longer eats data. (Thies) -- Fixed parse_url('-') crash. (Thies) -- added === operator support. (Andi & Thies, Zend Engine) -- unserialize() now gives a notice when passed invalid data. (Thies) -- Fixed shuffle() so that it no longer breaks on Solaris. (Andrei) -- Added is_resource(), is_bool() functions. (Thies) -- Cleaned up File-Module (Thies) -- Upgraded math-funtions to use new Zend function API (Thies) -- Fixed zombie problem in shell_exec() and $a = `some_command` - constructs. (Thies) -- Thies introduced ZEND_FETCH_RESOURCE2 (Danny). -- Added Informix driver to list of maintained extensions. (Danny). -- Informix driver : Changed ifx.ec to use the new high-performance - ZEND API. (Danny) -- IXF_LIBDIR environment variable specifies alternate Informix library - path for configure (Danny). -- Fixed gmmktime() so that the following should always be true: - gmmktime([args]) == mktime([args]) + date('Z', mktime([args])) (Jouni) -- setlocale doesn't anymore screw up things if you forgot to change it back - to the original settings. (Jouni) -- Switched to new system where ChangeLog is automagically updated from commit - messages. NEWS file is now the place for public announcements. (Andrei) -- Fixed refcount problem in XML module. (Thies) -- Fixed crash in HTTP_RAW_POST_DATA handling (Thies) -- You can use resources as array-indices again (Thies, Zend Engine) -- Fixed pg_fetch_array() with three arguments (Sascha) - Patch submitted by: brian@soda.berkeley.edu -- Upgraded a lot internal functions to use new Zend function API (Thies) -- fdf support ported; not completely tested with latest version 4.0 for - glibc (Uwe) -- OCI8 connections are now kept open as long as they are referenced (Thies) -- Cleaned up Directory-Module (Thies) -- Small fix in Ora_Close (Thies) -- Ported range() and shuffle() from PHP 3 to PHP 4 (Andrei) -- Fixed header("HTTP/..."); behaviour (Sascha) -- Improved UNIX build system. Now utilizes libtool (Sascha) -- Upgrade some more internal functions to use new Zend function API. (Thies, - Zend Engine) -- Fixed backwards incompatibility with ereg() (Thies) -- Updated Zend garbage collection with a much more thorough method. - (Andi, Zend Engine) -- Added the ability to use variable references in the array() construct. - For example, array("foo" => &$foo). (Andi, Zend Engine) -- Added array_reverse() function (Andrei) -- Some more XML fixes/cleanups (Thies) -- Updated preg_replace() so that if any argument passed in is an array - it will make a copy of each entry before converting it to string so that - the original is intact. If the subject is an array then it will preserve - the keys in the output as well (Andrei) -- Updated OCI8 to use the new high-performance Zend function API. (Thies) -- Configure speedup (Stig) -- Fixed LOB/Persistent-Connection related OCI8-Crash (Thies) -- Generalized server-API build procedure on UNIX (Stig) -- Added '--disable-rpath' option (Sascha) -- Added AOLserver SAPI module (Sascha) -- Fixed XML Callbacks. (Thies) -- Updated ODBC to use the new high-performance Zend function API (kara) -- Updated zlib to use the new high-performance Zend function API. (Stefan) -- Updated preg_split() to allow returning only non-empty pieces (Andrei) -- Updated PCRE to use the new high-performance Zend function API (Andrei) -- Updated session, dba, mhash, mcrypt, sysvshm, sysvsem, gettext modules to use - the new high-performance Zend function API (Sascha) -- Extended var_dump to handle resource type somewhat (Andrei) -- Updated WDDX to use the new high-performance Zend function API (Andrei) -- Updated XML to use the new high-performance Zend function API. (Thies) -- Updated Oracle to use the new high-performance Zend function API. (Thies) -- Improved the performance of the MySQL module significantly by using the new - high-performance Zend function API. (Zeev) -- Added support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com) -- Fixed bug in odbc_setoption, getParameter call incorrect (martin@easysoft.com) -- Ora_Fetch_Into now resets the returned array in all cases (Thies) -- Fixed NULL-Column problem in Oracle-Driver (Thies) -- Added extra metadata functions to ODBC, SQLTables etc (nick@easysoft.com) -- Fixed SEGV in mcal make_event_object() and - typo in mcal_list_alarms() (Andrew Skalski) -- Fixed Ora_PLogon (Thies) -- Resourcified Oracle (Thies) -- Implemented object serialization/deserialization in WDDX (Andrei) -- Added krsort() function (Thies) -- Added func_num_args(), func_get_arg() and func_get_args() for standard - access to variable number of arguments functions (Zeev) -- Added FTP support (Andrew Skalski) -- Added optional allowable_tags arguments to strip_tags(), gzgetss() and - fgetss() to allow you to specify a string of tags that are not to be - stripped (Rasmus) -- Upgraded var_dump() to take multiple arguments (Andrei) -- Resourcified XML (Thies) -- Fixed a memory leak in the Apache per-directory directives handler (Zeev) -- Added array_count_values() function. (Thies) -- snmp, pgsql, mysql and gd modules can be built as dynamically loaded - modules (Greg) -- OCI8 fix for fetching empty LOBs (Thies) -- Added user-level callbacks for session module (Sascha) -- Added support for unknown POST content types (Zeev) -- Added "wddx" serialization handler for session module (Sascha) - (automatically enabled, if you compile with --with-wddx) -- Fixed unserializing objects (Thies) -- PHP 4.0 now serializes Objects as 'O' (not understood by PHP 3.0), but - unserializes PHP 3.0 serialized objects as expected. (Thies) -- Made serialize/unserialize work on classes. If the class is known at - unserialize() time, you'll get back a fully working object! (Thies) -- Reworked preg_* functions according to the new PCRE API, which also made - them behave much more like Perl ones (Andrei) -- Made it possible to specify external location of PCRE library (Andrei) -- Updated bundled PCRE library to version 2.08 (Andrei) -- count()/is_array/is_object... speedups. (Thies) -- OCI8 supports appending and positioning when saving LOBs (Thies) -- Added metaphone support (Thies) -- OCI8 doesn't use define callbacks any longer. (Thies) -- OCI8 Driver now supports LOBs like PHP 3.0. (Thies) -- var_dump now dumps the properties of an object (Thies) -- Rewrote the GET/POST/Cookie data reader to support multi-dimensional - arrays! (Zeev) -- Renamed allow_builtin_links to expose_php (defaults to On). This directive - tells PHP whether it may expose its existence to the outside world, e.g. - by adding itself to the Web server header (Zeev) -- Added support for transparent session id propagation (Sascha) -- Made WDDX serialize object properties properly (Andrei) -- Fixed WDDX mem leak when undefined variable is passed in - for serialization (Andrei) -- Added session_unset() function (Andrei) -- Fixed double session globals shutdown crash (Andrei) -- Fixed crash related to ignore_user_abort ini entry (Andrei) -- Added support for external entropy sources for session id creation - (on Unices /dev/random and /dev/urandom) (Sascha) -- Added gpc_globals variable directive to php.ini. By default it is On, but - if it is set to Off, GET, POST and Cookie variables will not be inserted - to the global scope. Mostly makes sense when coupled with track_vars (Zeev) -- Added versioning support for shared library (Sascha) - This allows concurrent use of PHP 3.0 and PHP 4.0 as Apache modules. See - the end of the INSTALL file for more information. -- Added second parameter to array_keys which specifies search value - for which the key should be returned (Andrei) -- Resourcified Informix driver (Danny) -- New resource handling for odbc, renamed to php_odbc.[ch] -- Make set_time_limit() work on Unix (Rasmus) -- Added connection handling support (Rasmus) -- Improved the Sybase-CT module to make use of resources (Zeev) -- Improved the mSQL module to make use of resources (Zeev) -- Changed mysql_query() and mysql_db_query() to return false in case of saving - the result set data fails (Zeev) -- Improved the resource mechanism - resources were not getting freed as soon - as they could (Zeev) -- Added shared memory module for session data storage (Sascha) -- Fixed session.auto_start (Sascha) -- Fixed several problems with output buffering and HEAD requests (Zeev) -- Fixed HTTP Status code issue with ISAPI module (Zeev) -- Fixed a problem that prevented $GLOBALS from working properly (Zeev, Zend - library) -- Ported newest GetImageSize (Thies) -- Added session compile support in Win32 (Andi) -- Added -d switch to the CGI binary that allows overriding php.ini values - from the command line (Zeev) -- Fixed a crash that would occur if wddx_deserialize did not receive - a valid packet (Andrei) -- Fixed a bugglet when redefining a class at run-time (Andi, Zend Engine) -- Fixed sem_get() on AIX (Sascha) -- Fixed fopen() to work with URL's in Win32 (Andi & Zeev) -- Fixed include_path for Win32 (Andi, Zend Engine) -- Fixed bug in ISAPI header sending function (Charles) -- Fixed memory leak when using undefined values (Andi & Zeev, Zend Engine) -- Added output_buffering directive to php.ini, to enable output buffering - for all PHP scripts - default is off (Zeev). -- Fixed some more class inheritance issues (Zeev, Zend Engine) -- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha) -- Added session.extern_referer_chk which checks whether session ids were - referred to by an external site and eliminates them (Sascha) -- Improved session id generation (Sascha) -- Improved speed of uniqid() by using the combined LCG and removing - the extra usleep() (Sascha) -- Introduced general combined linear congruential generator (Sascha) -- Made ldap_close back into an alias for ldap_unbind (Andrei) -- OciFetchInto now resets the returned array in all cases (Thies) -- Fixed mysql_errno() to work with recent versions of MySQL (Zeev) -- Fixed a problem with define() and boolean values (Zeev) -- Fixed inclusion of gd/freetype functions (Sascha) -- Fixed persistency of MHASH_* constants (Sascha) -- Oracle is now ZTS-Safe (Thies) -- Fixed flushing of cached information to disk in DBA's DB2 module (Sascha) -- OCI8 is now ZTS-Safe (Thies) -- Fixed is_writeable/is_writable problem; they are both defined now (Andrei) -- Imported PHP 3.0 diskfreespace() function (Thies) -- Fixed thread-safety issues in the MySQL module (Zeev) -- Fixed thread-safe support for dynamic modules (Zeev) -- Fixed Sybase CT build process (Zeev) - -August 9 1999, Version 4.0 Beta 2 -- Fixed a problem when sending HTTP/1.x header lines using header() (Zeev) -- Win32 builds now include the ODBC module built-in (Zeev) -- Fixed SYSV-SHM interface (Thies). -- Updated hyperwave module, made it thread safe -- Updated pdflib module, version 0.6 of pdflib no longer supported -- Updated fdf module -- Built-in phpinfo() links are now turned off by default. They can be turned - on using the allow_builtin_links INI directive (Zeev) -- Changed phpinfo() to list modules that have no info function (Zeev) -- Modified array_walk() function so that the userland callback is passed - a key and possible user data in addition to the value (Andrei) -- Fixed ldap_search(), ldap_read() and ldap_list() (Zeev) -- Fixed Apache information in phpinfo() (sam@breakfree.com) -- Improved register_shutdown_function() - you may now supply arguments that - will be passed to the shutdown function (Zeev) -- Improved call_user_func() and call_user_method() - they now support passing - arguments by reference (Zeev) -- Fixed usort() and uksort() (Zeev) -- Fixed md5() in the Apache module (Thies) -- Introduced build process for dynamic modules (Stig) -- Improved ISAPI module to supprt large server variables (Zeev) -- Imported PHP 3.0 fixes for problem with PHP as a dynamic module and Redhat - libc2.1 in zlib module (Stefan) -- Fixed sybase_fetch_object() (Zeev) -- Made the IMAP module work with PHP 4.0 (Zeev) -- Fixed a problem with include()/require() of URLs (Sascha, Zeev) -- Fixed a bug in implode() that caused it to corrupt its arguments (Zeev) -- Added get_class($obj), get_parent_class($obj) and method_exists($obj,"name") - (Andi & Zeev) -- Fixed various inheritance problems (Andi & Zeev, Zend Engine) -- Children now inherit their parent's constructor, if they do not supply a - constructor of their own. -- Fixed runtime inheritance of classes (parent methods/properties were - overriding their children) (Zeev, Zend Engine) -- Fixed backwards incompatibility with the "new" operator (Andi, Zend Engine) -- Fixed bugs in uksort() and ksort() sort ordering (Andrei) -- Fixed a memory leak when using assignment-op operators with lvalue of type - string (Zeev, Zend Engine) -- Fixed a problem in inheritance from classes that are defined in include()d - files (Zeev, Zend Engine) -- Fixed a problem with the PHP error handler that could result in a crash - on certain operating systems (Zeev) -- Apache php_flag values only recognized 'On' (case sensitive) - changed - to case insensitive (Zeev) -- Fixed a memory leak with switch statement containing return statements - (Andi & Zeev, Zend Engine) -- Fixed a crash problem in switch statements that had a string offset - as a conditional (Andi & Zeev, Zend Engine) -- Imported PHP 3.0 fixes for rand() and mt_rand() (Rasmus) -- Added function entries for strip_tags() and similar_text() (Andrei) -- Fixed a bug in WDDX that would cause a crash if a number was passed in - instead of a variable name (Andrei) -- Ported strtotime() function from PHP 3.0 (Andrei) -- Merged in gdttf stuff from PHP 3.0 (Sascha) -- buildconf now checks your installation (Stig) -- XML module now built dynamically with --with-xml=shared (Stig) -- Added a check for freetype.h - fixed build on RedHat 6.0 (Zeev) -- Fixed array_walk() to work in PHP 4.0 (Andrei) -- Ported all remaining date() format options from PHP 3.0 (Andrei) -- $php_errormsg now works (Andrei) -- Added locale support for Perl Compatible Regexp functions (Andrei) -- Informix module ported (Danny) -- Removed --with-shared-apache (Sascha) -- Added patch for reverse lookup table in base64_decode (Sascha) - Submitted by bfranklin@dct.com -- Merged in PHP 3.0 version of str_replace (Sascha) -- Added DBA module (Sascha) -- Added session id detection within REQUEST_URI (Sascha) -- Merged in HP-UX/ANSI compatibility switch from PHP 3.0 (Sascha) -- Fixed rpath handling for utilitites built during Apache build (Sascha) -- Added missing E_ error level constants (Zeev, Zend Engine) -- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev) -- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase - modules (Zeev) -- Gave PHP 4.0's SNMP extension all the functionality of PHP 3.0.12 (SteveL) - -July 19 1999, Version 4.0 Beta 1 -- First public beta of PHP 4.0 diff --git a/README.CVS-RULES b/README.CVS-RULES deleted file mode 100644 index 3de9b5e2625..00000000000 --- a/README.CVS-RULES +++ /dev/null @@ -1,114 +0,0 @@ -This is the first file you should be reading after you get your CVS account. -We'll assume you're basically familiar with CVS, but feel free to post -your questions on the mailing list. - -PHP is developed through the efforts of a large number of people. -Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following -some basic rules with regards to CVS usage will: - - a. Make everybody happier, especially those responsible for maintaining - the CVS itself. - b. Keep the changes consistently well documented and easily trackable. - c. Prevent some of those 'Oops' moments. - d. Increase the general level of good will on planet Earth. - - -Having said that, here are the organizational rules: - - 1. Respect other people working on the project. - - 2. Discuss any significant changes on the list before committing. - - 3. Look at EXTENSIONS file to see who is the primary maintainer of - the code you want to contribute to. - - 4. If you "strongly disagree" about something another person did, don't - start fighting publicly - take it up in private email. - - 5. If you don't know how to do something, ask first! - - 6. Test your changes before committing them. We mean it. Really. - - -The next few rules are more of a technical nature. - - 1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit - messages every day. Woe be to those who attempt to mess with it. - - 2. All news updates intended for public viewing, such as new features, - bug fixes, improvements, etc., should go into the NEWS file. Also see - the note below about automatically updating NEWS in your commit message. - - 3. Do not commit multiple file and dump all messages in one commit. If you - modified several unrelated files, commit each group separately and - provide a nice commit message for each one. See example below. - - 4. Do write your commit message in such a way that it makes sense even - without the corresponding diff. One should be able to look at it, and - immediately know what was modified. Definitely include the function name - in the message as shown below. - - 5. In your commit messages, keep each line shorter than 80 characters. And - try to align your lines vertically, if they wrap. It looks bad otherwise. - - 6. If you modified a function that is callable from PHP, prepend PHP to - the function name as shown below. - - -The format of the commit messages is pretty simple. - -If a line begins with #, it is taken to be a comment and will not appear -in the ChangeLog. If the line begins with @, it will be redirected to the -NEWS file. Everything else goes into the ChangeLog. - -It is important to note that if your comment or news logline spans multiple -lines, you have to put # or @ at the beginning of _every_ such line. Every -entry in NEWS has to have a name after it, so if you did it with someone's -help, put both your names there. Your name WILL NOT be automatically put -at the end of the NEWS entry - so, please provide it yourself. - -Example. Say you modified two files, datetime.c and string.c. In datetime.c -you added a new format option for date() function, and in string.c you fixed -a memory leak in php_trim(). Don't commit both of these at once. Commit them -separately and try to make sure your commit messages look something like the -following. - -For datetime.c: - -(PHP date) Added new 'K' format modifier for printing out number of - days until New Year's Eve. -@- Added new 'K' format modifier that will output the number of days -@ until New Year's Eve. (Bob) - -For string.c: -(php_trim) Fixed a memory leak resulting from improper use of zval_dtor(). -# Man, that thing was leaking all over the place! -@- Memory leak in trim() function has finally been fixed. (Bob) - -The lines above marked with @ will go into NEWS file automagically, and the -# lines will be omitted from the ChangeLog. Alternatively, you might want -to modify NEWS file directly and not use the @ lines. - -If you fix some bugs, you should note the bug ID numbers in your -commit message. Bug ID should be prefixed by "#" for easier access to -bug report when developers are browsing CVS via. LXR or Bonsai. - -Example: - -Fixed pgsql notice handler double free crash bug. Bug #14016 -@ Fixed pgsql notice handler double free crash bug. Bug #14016 - -If you don't see your messages in ChangeLog and NEWS right away, don't worry! -These files are updated once a day, so your stuff will not show up until -somewhat later. Don't go adding stuff to NEWS by hand if you already put @ -lines in the commit message. - -You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/) -to look at PHP CVS repository in various ways. - -To receive daily updates to ChangeLog and NEWS, send an empty message to -php-cvs-daily-subscribe@lists.php.net. - -Happy hacking, - -PHP Team diff --git a/README.EXTENSIONS b/README.EXTENSIONS deleted file mode 100644 index 51e3b730e7d..00000000000 --- a/README.EXTENSIONS +++ /dev/null @@ -1,39 +0,0 @@ -Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way -that broke both source and binary compatibility. If you are -maintaining a third party extension, here's how to update it: - -If this was your old module entry: - -zend_module_entry foo_module_entry = { - "foo", /* extension name */ - foo_functions, /* extension function list */ - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - PHP_RINIT(foo), /* per-request startup function */ - PHP_RSHUTDOWN(foo), /* per-request shutdown function */ - PHP_MINFO(foo), /* information function */ - STANDARD_MODULE_PROPERTIES -}; - -Here's how it should look if you want your code to build with PHP -4.1.0 and up: - -zend_module_entry foo_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "foo", /* extension name */ - foo_functions, /* extension function list */ - NULL, /* extension-wide startup function */ - NULL, /* extension-wide shutdown function */ - PHP_RINIT(foo), /* per-request startup function */ - PHP_RSHUTDOWN(foo), /* per-request shutdown function */ - PHP_MINFO(foo), /* information function */ -#if ZEND_MODULE_API_NO >= 20010901 - FOO_VERSION, /* extension version number (string) */ -#endif - STANDARD_MODULE_PROPERTIES -}; - -If you don't care about source compatibility with earlier PHP releases -than 4.1.0, you can drop the #if/#endif lines. diff --git a/README.EXT_SKEL b/README.EXT_SKEL deleted file mode 100644 index dae5b400983..00000000000 --- a/README.EXT_SKEL +++ /dev/null @@ -1,184 +0,0 @@ - -WHAT IT IS - - It's a tool for automatically creating the basic framework for a PHP module - and writing C code handling arguments passed to your functions from a simple - configuration file. See an example at the end of this file. - -HOW TO USE IT - - Very simple. First, cd do directory ext/ in PHP 4 sources. If you just need - the basic framework and will be writing all the code in your functions - yourself, you can now do - - ./ext_skel --extname=module_name - - and everything you need is placed in directory module_name. In fact, if you - don't need to test the existence of any external header files, libraries or - functions in them, the module is already almost ready to be compiled in PHP. - Just remove 3 comments in your_module_name/config.m4, cd back up to PHP - sources top directory, and do - - ./buildconf; ./configure --enable-module_name; make - - But if you already have planned the overall scheme of your module, what - functions it will contain, their return types and the arguments they take - (a very good idea) and don't want to bother yourself with creating function - definitions and handling arguments passed yourself, it's time to create a - function definitions file, which you will give as an argument to ext_skel - with option - - --proto=filename. - -FORMAT OF FUNCTION DEFINITIONS FILE - - All the definitions must be on one line. In it's simplest form, it's just - the function name, ie. - - my_function - - but then you'll be left with an almost empty function body without any - argument handling. - - Arguments are given in parenthesis after the function name, and are of - the form 'argument_type argument_name'. Arguments are separated from each - other with a comma and optional space. Argument_type can be one of int, - bool, double, float, string, array, object or mixed. - - An optional argument is separated from the previous by an optional space, - then '[' and of course comma and optional space, like all the other - arguments. You should close a row of optional arguments with same amount of - ']'s as there where '['s. Currently, it does not harm if you forget to do it - or there is a wrong amount of ']'s, but this may change in the future. - - An additional short description may be added after the parameters. - If present it will be filled into the 'proto' header comments in the stubs - code and the tag in the XML documentation. - - An example: - - my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st - - Arguments arg3 and arg4 are optional. - - If possible, the function definition should also contain it's return type - in front of the definition. It's not actually used for any C code generating - purposes but PHP in-source documentation instead, and as such, very useful. - It can be any of int, double, string, bool, array, object, resource, mixed - or void. - - The file must contain nothing else but function definitions, no comments or - empty lines. - -OTHER OPTIONS - - --no-help - - By default, ext_skel creates both comments in the source code and a test - function to help first time module writers to get started and testing - configuring and compiling their module. This option turns off all such things - which may just annoy experienced PHP module coders. Especially useful with - - --stubs=file - - which will leave out also all module specific stuff and write just function - stubs with function value declarations and passed argument handling, and - function entries and definitions at the end of the file, for copying and - pasting into an already existing module. - - --assign-params - --string-lens - - By default, function proto 'void foo(string bar)' creates the following: - ... - zval **bar; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar); - - Specifying both of these options changes the generated code to: - ... - zval **bar_arg; - int bar_len; - char *bar = NULL; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar_arg); - bar = Z_STRVAL_PP(bar_arg); - bar_len = Z_STRLEN_PP(bar_arg); - - You shouldn't have to ask what happens if you leave --string-lens out. If you - have to, it's questionable whether you should be reading this document. - - --with-xml[=file] - - Creates the basics for phpdoc .xml file. - - --full-xml - - Not implemented yet. When or if there will ever be created a framework for - self-contained extensions to use phpdoc system for their documentation, this - option enables it on the created xml file. - -CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES - - Only arguments of types int, bool, double, float, string and array are - handled. For other types you must write the code yourself. And for type - mixed, it wouldn't even be possible to write anything, because only you - know what to expect. - - It can't handle correctly, and probably never will, variable list of - of arguments. (void foo(int bar [, ...]) - - Don't trust the generated code too much. It tries to be useful in most of - the situations you might encounter, but automatic code generation will never - beat a programmer who knows the real situation at hand. ext_skel is generally - best suited for quickly generating a wrapper for c-library functions you - might want to have available in PHP too. - - This program doesn't have a --help option. It has --no-help instead. - -EXAMPLE - - The following _one_ line - - bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) - - will create this function definition for you (note that there are a few - question marks to be replaced by you, and you must of course add your own - value definitions too): - -/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) - */ -PHP_FUNCTION(my_drawtext) -{ - zval **image, **text, **font, **x, **y, **color; - int argc; - int image_id = -1; - int font_id = -1; - - argc = ZEND_NUM_ARGS(); - if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???_rsrc_id); - ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); - - switch (argc) { - case 6: - convert_to_long_ex(color); - /* Fall-through. */ - case 5: - convert_to_long_ex(y); - convert_to_long_ex(x); - /* font: fetching resources already handled. */ - convert_to_string_ex(text); - /* image: fetching resources already handled. */ - break; - default: - WRONG_PARAM_COUNT; - } - - php_error(E_WARNING, "my_drawtext: not yet implemented"); -} -/* }}} */ - diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API deleted file mode 100644 index 1c6eea52008..00000000000 --- a/README.PARAMETER_PARSING_API +++ /dev/null @@ -1,118 +0,0 @@ -New parameter parsing functions -=============================== - -It should be easier to parse input parameters to an extension function. -Hence, borrowing from Python's example, there are now a set of functions -that given the string of type specifiers, can parse the input parameters -and store the results in the user specified variables. This avoids most -of the IS_* checks and convert_to_* conversions. The functions also -check for the appropriate number of parameters, and try to output -meaningful error messages. - - -Prototypes ----------- -/* Implemented. */ -int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...); -int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...); - -The zend_parse_parameters() function takes the number of parameters -passed to the extension function, the type specifier string, and the -list of pointers to variables to store the results in. The _ex() version -also takes 'flags' argument -- current only ZEND_PARSE_PARAMS_QUIET can -be used as 'flags' to specify that the function should operate quietly -and not output any error messages. - -Both functions return SUCCESS or FAILURE depending on the result. - -The auto-conversions are performed as necessary. Arrays, objects, and -resources cannot be autoconverted. - - -Type specifiers ---------------- - l - long - d - double - s - string (with possible null bytes) and its length - b - boolean, stored in zend_bool - r - resource (stored in zval) - a - array - o - object (of any type) - O - object (of specific type, specified by class entry) - z - the actual zval - - The following characters also have a meaning in the specifier string: - | - indicates that the remaining parameters are optional, they - should be initialized to default values by the extension since they - will not be touched by the parsing function if they are not - passed to it. - / - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows - ! - the parameter it follows can be of specified type or NULL (only applies - to 'a', 'o', 'O', 'r', and 'z'). If NULL is passed, the results - pointer is set to NULL as well. - -Examples --------- -/* Gets a long, a string and its length, and a zval */ -long l; -char *s; -int s_len; -zval *param; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz", - &l, &s, &s_len, ¶m) == FAILURE) { - return; -} - - -/* Gets an object of class specified by my_ce, and an optional double. */ -zval *obj; -double d = 0.5; -zend_class_entry my_ce; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d", - &obj, my_ce, &d) == FAILURE) { - return; -} - - -/* Gets an object or null, and an array. - If null is passed for object, obj will be set to NULL. */ -zval *obj; -zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", - &obj, &arr) == FAILURE) { - return; -} - - -/* Gets a separated array which can also be null. */ -zval *arr; -if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!", - &arr) == FAILURE) { - return; -} - - -/* Get only the first three parameters (useful for varargs functions). */ -zval *z; -zend_bool b; -zval *r; -if (zend_parse_parameters(3 TSRMLS_CC, "zbr!", - &z, &b, &r) == FAILURE) { - return; -} - - -/* Get either a set of 3 longs or a string. */ -long l1, l2, l3; -char *s; -if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "lll", &l1, &l2, &l3) == SUCCESS) { - /* manipulate longs */ -} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "s", &s) == SUCCESS) { - /* manipulate string */ -} else { - /* output error */ - - return; -} diff --git a/README.QNX b/README.QNX deleted file mode 100644 index d70d2e5d8b6..00000000000 --- a/README.QNX +++ /dev/null @@ -1,57 +0,0 @@ -QNX4 Installation Notes ------------------------ - -NOTE: General installation instructions are in the INSTALL file - - -1. To compile and test PHP3 you have to grab, compile and install: - - GNU dbm library or another db library; - - GNU bison (1.25 or later; 1.25 tested); - - GNU flex (any version supporting -o and -P options; 2.5.4 tested); - - GNU diffutils (any version supporting -w option; 2.7 tested); - -2. To use CVS version you may need also: - - GNU CVS (1.9 tested); - - GNU autoconf (2.12 tested); - - GNU m4 (1.3 or later preferable; 1.4 tested); - -3. To run configure define -lunix in command line: - LDFLAGS=-lunix ./configure - -4. To use Sybase SQL Anywhere define ODBC_QNX and CUSTOM_ODBC_LIBS in - command line and run configure with --with-custom-odbc: - CFLAGS=-DODBC_QNX LDFLAGS=-lunix CUSTOM_ODBC_LIBS="-ldblib -lodbc" ./configure --with-custom-odbc=/usr/lib/sqlany50 - If you have SQL Anywhere version 5.5.00, then you have to add - CFLAGS=-DSQLANY_BUG - to workaround its SQLFreeEnv() bug. Other versions has not been tested, - so try without this flag first. - -5. To build the Apache module, you may have to hardcode an include path for - alloc.h in your Apache base directory: - - APACHE_DIRECTORY/src/httpd.h: - change #include "alloc.h" - to #include "APACHE_DIRECTORY/src/alloc.h" - Unless you want to use system regex library, you have to hardcode also - a path to regex.h: - - APACHE_DIRECTORY/src/conf.h: - change #include - to #include "APACHE_DIRECTORY/src/regex/regex.h" - I don't know so far why this required for QNX, may be it is Watcom - compiler problem. - - If you building Apache module with SQL Anywhere support, you'll get - symbol conflict with BOOL. It is defined in Apache (httpd.h) and in - SQL Anywhere (odbc.h). This has nothing to do with PHP, so you have to - fix it yourself someway. - -6. With above precautions, it should compile as is and pass regression - tests completely: - make - make check - make install - - Don't bother me unless you really sure you made that all but it - still doesn't work. - -June 28, 1998 -Igor Kovalenko -- owl@infomarket.ru diff --git a/README.SELF-CONTAINED-EXTENSIONS b/README.SELF-CONTAINED-EXTENSIONS deleted file mode 100644 index bff6c80726b..00000000000 --- a/README.SELF-CONTAINED-EXTENSIONS +++ /dev/null @@ -1,154 +0,0 @@ -$Id$ -============================================================================= - -HOW TO CREATE A SELF-CONTAINED PHP EXTENSION - - A self-contained extension can be distributed independently of - the PHP source. To create such an extension, three things are - required: - - - Configuration file (config.m4) - - Source code for your module - - We will describe now how to create these and how to put things - together. - -PREPARING YOUR SYSTEM - - While the result will run on any system, a developer's setup needs these - tools: - - GNU autoconf - GNU automake - GNU libtool - GNU m4 - - All of these are available from - - ftp://ftp.gnu.org/pub/gnu/ - -CONVERTING AN EXISTING EXTENSION - - Just to show you how easy it is to create a self-contained - extension, we will convert an embedded extension into a - self-contained one. Install PHP and execute the following - commands. - - $ mkdir /tmp/newext - $ cd /tmp/newext - - You now have an empty directory. We will copy the files from - the mysql extension: - - $ cp -rp php-4.0.X/ext/mysql/* . - - It is time to finish the module. Run: - - $ phpize - - You can now ship the contents of the directory - the extension - can live completely on its own. - - The user instructions boil down to - - $ ./configure \ - [--with-php-config=/path/to/php-config] \ - [--with-mysql=MYSQL-DIR] - $ make install - - The MySQL module will either use the embedded MySQL client - library or the MySQL installation in MYSQL-DIR. - - -DEFINING THE NEW EXTENSION - - Our demo extension is called "foobar". - - It consists of two source files "foo.c" and "bar.c" - (and any arbitrary amount of header files, but that is not - important here). - - The demo extension does not reference any external - libraries (that is important, because the user does not - need to specify anything). - - - LTLIBRARY_SOURCES specifies the names of the sources files. You can - name an arbitrary number of source files here. - -CREATING THE M4 CONFIGURATION FILE - - The m4 configuration can perform additional checks. For a - self-contained extension, you do not need more than a few - macro calls. - ------------------------------------------------------------------------------- -PHP_ARG_ENABLE(foobar,whether to enable foobar, -[ --enable-foobar Enable foobar]) - -if test "$PHP_FOOBAR" != "no"; then - PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared) -fi ------------------------------------------------------------------------------- - - PHP_ARG_ENABLE will automatically set the correct variables, so - that the extension will be enabled by PHP_NEW_EXTENSION in shared mode. - - The first argument of PHP_NEW_EXTENSION describes the name of the - extension. The second names the source-code files. The third passes - $ext_shared which is set by PHP_ARG_ENABLE/WITH to PHP_NEW_EXTENSION. - - Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not - plan to distribute your module with PHP, these facilities allow you - to integrate your module easily into the main PHP module framework. - -CREATING SOURCE FILES - - ext_skel can be of great help when creating the common code for all modules - in PHP for you and also writing basic function definitions and C code for - handling arguments passed to your functions. See README.EXT_SKEL for further - information. - - As for the rest, you are currently alone here. There are a lot of existing - modules, use a simple module as a starting point and add your own code. - - -CREATING THE SELF-CONTAINED EXTENSION - - Put config.m4 and the source files into one directory. Afterwards, - run phpize (this is installed during make install by PHP 4.0). - For example, if you configured PHP with --prefix=/php, you would run - - $ /php/bin/phpize - - This will automatically copy the necessary build files and create - configure from your config.m4. - - And that's it. You now have a self-contained extension. - -INSTALLING A SELF-CONTAINED EXTENSION - - An extension can be installed by running: - - $ ./configure \ - [--with-php-config=/path/to/php-config] - $ make install - -ADDING SHARED MODULE SUPPORT TO A MODULE - - In order to be useful, a self-contained extension must be loadable - as a shared module. I will explain now how you can add shared module - support to an existing module called foo. - - 1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will - automatically be able to use --with-foo=shared[,..] or - --enable-foo=shared[,..]. - - 2. In config.m4, use PHP_NEW_EXTENSION(foo,.., $ext_shared) to enable - building the extension. - - 3. Add the following lines to your C source file: - - #ifdef COMPILE_DL_FOO - ZEND_GET_MODULE(foo) - #endif diff --git a/README.STREAMS b/README.STREAMS deleted file mode 100644 index 2ae89b7a51d..00000000000 --- a/README.STREAMS +++ /dev/null @@ -1,243 +0,0 @@ -An Overview of the PHP Streams abstraction -========================================== -$Id$ - -Please send comments to: Wez Furlong - -Note: this doc is preliminary and is intended to give the reader an idea of -how streams work and should be used. - -Why Streams? -============ -You may have noticed a shed-load of issock parameters flying around the PHP -code; we don't want them - they are ugly and cumbersome and force you to -special case sockets and files everytime you need to work with a "user-level" -PHP file pointer. -Streams take care of that and present the PHP extension coder with an ANSI -stdio-alike API that looks much nicer and can be extended to support non file -based data sources. - -Using Streams -============= -Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a -FILE* parameter. - -The main functions are: - -PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count); -PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t - count); -PHPAPI int php_stream_eof(php_stream * stream); -PHPAPI int php_stream_getc(php_stream * stream); -PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen); -PHPAPI int php_stream_close(php_stream * stream); -PHPAPI int php_stream_flush(php_stream * stream); -PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence); -PHPAPI off_t php_stream_tell(php_stream * stream); - -These (should) behave in the same way as the ANSI stdio functions with similar -names: fread, fwrite, feof, fgetc, fgets, fclose, fflush, fseek, ftell. - -Opening Streams -=============== -Ultimately, I aim to implement an fopen_wrapper-like call to do this with -minimum fuss. -Currently, mostly for testing purposes, you can use php_stream_fopen to open a -stream on a regular file. - -PHPAPI php_stream * php_stream_fopen(const char * filename, const char * - mode); - -This call behaves just like fopen(), except it returns a stream instead of a -FILE * - -Casting Streams -=============== -What if your extension needs to access the FILE* of a user level file pointer? -You need to "cast" the stream into a FILE*, and this is how you do it: - -FILE * fp; -php_stream * stream; /* already opened */ - -if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, &fp, 1) == FAILURE) { - RETURN_FALSE; -} - -The prototype is: - -PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int - show_err); - -The show_err parameter, if non-zero, will cause the function to display an -appropriate error message of type E_WARNING if the cast fails. - -castas can be one of the following values: -PHP_STREAM_AS_STDIO - a stdio FILE* -PHP_STREAM_AS_FD - a generic file descriptor -PHP_STREAM_AS_SOCKETD - a socket descriptor - -If you ask a socket stream for a FILE*, the abstraction will use fdopen to -create it for you. Be warned that doing so may cause buffered data to be lost -if you mix ANSI stdio calls on the FILE* with php stream calls on the stream. - -If your system has the fopencookie function, php streams can synthesize a -FILE* on top of any stream, which is useful for SSL sockets, memory based -streams, data base streams etc. etc. -NOTE: There might be situations where this is not desireable, and we need to -provide a flag to inform the casting routine of this. - -You can use: - -PHPAPI int php_stream_can_cast(php_stream * stream, int castas) - -to find out if a stream can be cast, without actually performing the cast, so -to check if a stream is a socket you might use: - -if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) { - /* it's a socket */ -} - - -Stream Internals -================ - -There are two main structures associated with a stream - the php_stream -itself, which holds some state information (and possibly a buffer) and a -php_stream_ops structure, which holds the "virtual method table" for the -underlying implementation. - -The php_streams ops struct consists of pointers to methods that implement -read, write, close, flush, seek, gets and cast operations. Of these, an -implementation need only implement write, read, close and flush. The gets -method is intended to be used for non-buffered streams if there is an -underlying method that can efficiently behave as fgets. The ops struct also -contains a label for the implementation that will be used when printing error -messages - the stdio implementation has a label of "STDIO" for example. - -The idea is that a stream implementation defines a php_stream_ops struct, and -associates it with a php_stream using php_stream_alloc. - -As an example, the php_stream_fopen() function looks like this: - -PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode) -{ - FILE * fp = fopen(filename, mode); - php_stream * ret; - - if (fp) { - ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode); - if (ret) - return ret; - - fclose(fp); - } - return NULL; -} - -php_stream_stdio_ops is a php_stream_ops structure that can be used to handle -FILE* based streams. - -A socket based stream would use code similar to that above to create a stream -to be passed back to fopen_wrapper (or it's yet to be implemented successor). - -The prototype for php_stream_alloc is this: - -PHPAPI php_stream * php_stream_alloc(php_stream_ops * ops, void * abstract, - size_t bufsize, int persistent, const char * mode) - -ops is a pointer to the implementation, -abstract holds implementation specific data that is relevant to this instance -of the stream, -bufsize is the size of the buffer to use - if 0, then buffering at the stream -level will be disabled (recommended for underlying sources that implement -their own buffering - such a FILE*), -persistent controls how the memory is to be allocated - persistently so that -it lasts across requests, or non-persistently so that it is freed at the end -of a request (it uses pemalloc), -mode is the stdio-like mode of operation - php streams places no real meaning -in the mode parameter, except that it checks for a 'w' in the string when -attempting to write (this may change). - -The mode parameter is passed on to fdopen/fopencookie when the stream is cast -into a FILE*, so it should be compatible with the mode parameter of fopen(). - -Writing your own stream implementation -====================================== - -First, you need to figure out what data you need to associate with the -php_stream. For example, you might need a pointer to some memory for memory -based streams, or if you were making a stream to read data from an RDBMS like -mysql, you might want to store the connection and rowset handles. - -The stream has a field called abstract that you can use to hold this data. -If you need to store more than a single field of data, define a structure to -hold it, allocate it (use pemalloc with the persistent flag set -appropriately), and use the abstract pointer to refer to it. - -For structured state you might have this: - -struct my_state { - MYSQL conn; - MYSQL_RES * result; -}; - -struct my_state * state = pemalloc(sizeof(struct my_state), persistent); - -/* initialize the connection, and run a query, using the fields in state to - * hold the results */ - -state->result = mysql_use_result(&state->conn); - -/* now allocate the stream itself */ -stream = php_stream_alloc(&my_ops, state, 0, persistent, "r"); - -/* now stream->abstract == state */ - -Once you have that part figured out, you can write your implementation and -define the your own php_stream_ops struct (we called it my_ops in the above -example). - -For example, for reading from this wierd mysql stream: - -static size_t php_mysqlop_read(php_stream * stream, char * buf, size_t count) -{ - struct my_state * state = (struct my_state*)stream->abstract; - - if (buf == NULL && count == 0) { - /* in this special case, php_streams is asking if we have reached the - * end of file */ - if (... at end of file ...) - return EOF; - else - return 0; - } - - /* pull out some data from the stream and put it in buf */ - ... mysql_fetch_row(state->result) ... - /* we could do something strange, like format the data as XML here, - and place that in the buf, but that brings in some complexities, - such as coping with a buffer size too small to hold the data, - so I won't even go in to how to do that here */ -} - -Implement the other operations - remember that write, read, close and flush -are all mandatory. The rest are optional. Declare your stream ops struct: - -php_stream_ops my_ops = { - php_mysqlop_write, php_mysqlop_read, php_mysqlop_close, - php_mysqlop_flush, NULL, NULL, NULL, - "Strange mySQL example" -} - -Thats it! - -Take a look at the STDIO implementation in streams.c for more information -about how these operations work. -The main thing to remember is that in your close operation you need to release -and free the resources you allocated for the abstract field. In the case of -the example above, you need to use mysql_free_result on the rowset, close the -connection and then use pefree to dispose of the struct you allocated. -You may read the stream->persistent field to determine if your struct was -allocated in persistent mode or not. - -vim:tw=78 diff --git a/README.TESTING b/README.TESTING deleted file mode 100644 index 7f28e55ef1f..00000000000 --- a/README.TESTING +++ /dev/null @@ -1,175 +0,0 @@ -[IMPORTANT NOTICE] ------------------- - Do _not_ ask to developers why some or all tests are failed under -your environment! Let us know if you find why it fails. Thank you. - - -[Testing Basics] ----------------- - To execute test scripts, you must build PHP with some SAPI, then you -type "make test" to execute all or some test scripts saved under -"tests" directory under source root directory. - -Usage: -make test - - "make test" basically executes "run-tests.php" script -under source root. Therefore you can execute the script -as follows - -./sapi/cli/php -c php.ini-dist run-tests.php [ext/some_extension_name] - - - -[Which "php" executable "make test" look for] ---------------------------------------------- - "make test" executes "run-tests.php" script with "php" binary. Some -test scripts such as session must be executed by CGI SAPI. Therefore, -you must build PHP with CGI SAPI to perform all tests. - - If PHP is not build with CGI SAPI, "run-tests.php" script uses CLI -SAPI. Tests that may not executed by CLI SAPI will be skipped. - -NOTE: PHP binary executing "run-tests.php" and php binary used for -executing test scripts may differ. If you use different PHP binary for -executing "run-tests.php" script, you may get errors. - - -[Which php.ini is used] ------------------------ - "make test" force to use php.ini-dist as default config file. If -you would like to test with other configuration file, user -"run-tests.php" script. - -Example: -./sapi/cli/php -c ./your_php.ini ext/standard - -If you use php.ini other than php.ini-dist, you may see more failed -tests. - - -[Which test scripts are executed] ---------------------------------- - "run-tests.php" ("make test") executes all test scripts by default -by looking all directory named "tests". If there are files have "phpt" -extension, "run-tests.php" takes test php code from the file and -executes it. - - Tester can easily executes tests selectively with as follows. - -Example: -./sapi/cli/php -c php.ini-dist run-tests.php ext/mbstring - - -[Test results] --------------- - Test results are printed to standard output. If there is a failed test, -"run-tests.php" script saves the result, expected result and code -executed to the test script directory. For example, if -ext/myext/tests/myext.phpt is failed to pass, following files are -created: - -ext/myext/tests/myext.out - output from test script -ext/myext/tests/myext.exp - expected output -ext/myext/tests/myext.php - test script executed - - Tester can verify these files, if failed test is actually a bug -or not. - - -[Creating new test files] -------------------------- - Writing test file is very easy if you are used to PHP. Test file -has following format. Here is a actual test file from iconv module. - -===== ext/iconv/002.phpt ======= ---TEST-- -UCS4BE to ASCII ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abcd -abcd -===== end of ext/iconv/002.phpt ======= - -"--TEST--" is title of the test. -"--SKIPIF--" is condition when to skip this test. -"--POST--" is POST variable passed to test script. -"--GET--" is GET variable passed to test script. -"--FILE--" is the test script. -"--EXPECT--" is the expected output from the test script. - -ext/iconv/002.phpt uses 2 files. "skipif.inc" is used to skip -test when test cannot be performed such as iconv module is not -compiled or loaded. - -==== ext/iconv/skipif.inc ==== - -==== end of ext/iconv/skipif.inc ==== - -ext/inconv/002.inc is the test script. "run-tests.php" script -executes test script with CGI executable. - -==== ext/iconv/002.inc === - -=== end of ext/iconv/002.inc === - -Test script and skipif code may be directly write into *.phpt. -However, it is recommended to use other files for ease of writing -test script. For instance, you can execute test script under -ext/iconv as follows: - -./sapi/cli/php -c /etc/php.ini-dist ext/iconv - - -[How to help us] ----------------- - If you find bug in PHP, you can submit bug report AND test script -for us. You don't have to write complete script, just give us test -script with following format. Please test the script and make sure -you write the correct ACTUAL OUTPUT and EXPECTED OUTPUT before you -submit. - - diff --git a/README.Zeus b/README.Zeus deleted file mode 100644 index 0a2803c8422..00000000000 --- a/README.Zeus +++ /dev/null @@ -1,126 +0,0 @@ -Using PHP4 with the Zeus Web Server ------------------------------------ - -Zeus fully supports running PHP in combination with our -webserver. There are three different interfaces that can be used to -enable PHP: - -* CGI -* ISAPI -* FastCGI - -Of the three, we recommend using FastCGI, which has been tested and -benchmarked as providing the best performance and reliability. - -Full details of how to install PHP are available from our -website, at: - -http://support.zeus.com/products/php.html - -If you have any problems, please check the support site for more -up-to-date information and advice. - - -Quick guide to installing FastCGI with Zeus -------------------------------------------- - -Step 1 - obtain and install FastCGI development kit. - -Grab the package from: -http://www.fastcgi.com/dist/devkit_2.2.0.tar.gz - -Extract the package and follow the instructions: - ./configure - make - make export -(run the last as root) - -This will install to /usr/local/lib/libfcgi.a - and /usr/local/include/*fcgi* - - - -Step 2 - Compile PHP as FastCGI. - -Compile as follows: - ./configure --with-fastcgi - make - -Note that PHP has many options to the configure script - -e.g. --with-mysql. You will probably want to select your usual options -before compiling; the above is just a bare minimum, for illustration. - -After compilation finishes, you will be left with an executable -program called 'php'. Copy this into your document root, under a -dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php) - - -Step 3 - configure Zeus - -Four stages: - - enable FastCGI - - configure FastCGI - - setup alias for FastCGI - - setup alias for PHP - -1) Using the admin server, go to the 'module configuration' page for -your virtual server, and ensure that 'fastcgi' is enabled (select the -tickbox to the left). - -2) While we can run FastCGI's locally, there are known problems with -some OS's (specifically, the communication between web server and -FastCGI happens over a unix domain socket, and some OS's have trouble -sustaining high connection rates over these sockets). So instead, we -are going to set up the PHP FastCGI to run 'remotely' over localhost -(this uses TCP sockets, which do not suffer this problem). Go to the -'fastcgi configuration' page, and under 'add remote fastcgi': - Add Remote FastCGI - Docroot path /fcgi-bin/php - Remote machine localhost:8002 -The first entry is where you saved PHP, above. -The second entry is localhost: -We will start the FastCGI listening on this port shortly. -Click 'update' to commit these changes. - -3) Go to the path mapping module and add an alias for FastCGI: - Add Alias - Docroot path /fcgi-bin - Filesystem directory /path/to/docroot/fcgi-bin - Alias type fastcgi -Click 'update' to commit these changes - -4) Also on the path mapping module, add a handler for PHP: - Add handler - File extension php - Handler /fcgi-bin/php -Click 'update' to commit these changes - -Finally restart your virtual server for these changes to take effect. - - -Step 4 - start PHP as a FastCGI runner - -When you start PHP, it will pre-fork a given number of child processes -to handle incoming PHP requests. Each process will handle a given -number of requests before exiting (and being replaced by a newly -forked process). You can control these two parameters by setting the -following environment variables BEFORE starting the FastCGI runner: - -PHP_FCGI_CHILDREN - the number of child processes to pre-fork. If not -set, defaults to 8. - -PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process -handles before exiting. If not set, defaults to 500. - -To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner -8002 $DOCROOT/fcgi-bin/php'. Substitute the appropriate values for -$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose, -above. - -To stop the runner (e.g. to experiment with the above environment -variables) you will need to manually stop and running PHP -processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots -of children and not the runner, Zeus unfortunately cannot keep track -of what processes are running, sorry. A typical command line may look -like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk -'{print $4}' | xargs kill' diff --git a/RELEASE_PROCESS b/RELEASE_PROCESS deleted file mode 100644 index 4e4d7f19367..00000000000 --- a/RELEASE_PROCESS +++ /dev/null @@ -1,186 +0,0 @@ - Advisory on the PHP Release Cycle - - -Copyright & Liciencing - - This Document is (c) Copyright 2000,2001 by The PHP Group - - This Document is distributed 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. - - -Table of Contents - - 1. Introduction - 2. Dealing with bugs - 2.1 As a QA Team Member - 2.2 As a Developer - 3. Releaseing another RC - 4. CVS During the Release Process - 4.1 Useful CVS Commands - 5 The Final Release - 6 Summary - - -1. Introduction - - This cycle should take place over roughly 10 days. When it is - decided it is time for an Release to occur Andi/Zeev (Or - Whoever) will tarball RC1, Tag & Branch CVS (see section 4) - and then announce the RC on PHP-QA and PHP-DEV. At this - point the build tracker and QA Bug System come into play. - If you successfully build PHP then report it in the build - tracker, If you then run and complete all the tests you - should report this too in the build tracker when - these features become avalible. - -2. Dealing with Bugs - -2.1 As a QA Team member - - If you find a bug in an RC that you think is a showstopper - then, even if it is a known bug, you should report it in the - QA Bug system. This marks the bug for discussion at least, - and preferably fixing before the actual release. This system - is separate from the main bugs system so that important bugs - dont get lost in the midst if lots of feature/change request - in the approach to a release. It is imperitive where - appropraite that as a QA'er a test script, Configure options - and PHP.ini files are provided to enable the developer to - reproduce the bug, this is an important part of our job. If - you have a serious bug then you should also create a test - script to be added to the tests dir of the php source so - that at the end of the process to enable us to make sure bug - does not return. It is not difficult to create these test - scripts and a readme on it can be found in - php4/tests/README. - - -2.2 As a Developer - - What should happen is that when a bug is reported it - is send to php-dev and php-qa as with other bugs. We should - have far stricter assignment system in this bug cycle rather - than just leaving them. Once again bugs should be able to be - marked as To Be Fixed Before release or moved to other bug - system. (This is currently the Release Masters responsibility) - - Then before the actual release the qa bugs system can be - checked and if there are outstanding To Be Fixed Before - release bugs the Developers can see this easyly rather than - show stoppers being dismissed and not worried about. - - When a bug is fixed the QAer who reported the bug is emailed - and asked to test again and see if the bug is fixed. - -3 Releasing another RC - - If it is felt necessary that a 2nd RC is needed then it - should be packaged as before and announced to both lists - again. The testing process then starts again, the RC2 is - added to the build tracker and QA'ers are asked to build and - retest the scripts as appropriate, espectially if you - reported a bug, you should test thourghly for your - bug and make sure it no longer occurs. This will normally - add anouther 3 days to the cycle, giving QA'ers time to - build test and report back, then for developers to - fix any problems. - -4 CVS during the release process - - At the point where the first RC is create a branch is - formed. This branch is not altered form that point onward - other than major bug fixes. Minor non important bug - fixes should not be applied to this branch but to the main - tree instead. Any major bug fixes should be applied to both - trees. The developer should test and check the RC tree then - also test and check the MAIN tree. This is their - responsibility to make sure (as far as possible) that the - bug fix works on both trees. - -4.1 Useful CVS Commands - - To create a Branch : - - $ cvs tag -b php_4_0_RC - IE: - $ cvs tag -b php_4_0_1RC1 - - This should be executed in the PHP directory of an up to - date checkout. Remember to also tag the Zend and TSRM repositories. - - You can retrieve a branch in one of two ways: by checking it - out fresh from the repository, or by switching an existing - working copy over to the branch, I would suggest you - checkout a new copy. - - To check out a new copy: - $ cvs checkout -r php_4_0_RC php4 - IE: - $ cvs checkout -r php_4_0_1RC1 php4 - - - To switch a working copy (Not recomended due to possible - commiting to wrong branch) - $ cvs update -r php_4_0_RC php4 - IE: - $ cvs update -r php_4_0_1RC1 php4 - - This should be done in the PHP4 directory itself. - - To revert back to normal branch you should use the - following: - $ cvs update -A - - To Commit to the branch you follow exactly the same - procedure as normal - $ cvs commit file.c - - MAKE SURE YOU DO NOT COMMIT TO THE WRONG BRANCH. - -5 The Final Release - - When it is time to make the final release the following - proceedure should be followed. The person who is tarballing - the final release should check the QA bugs system and make - sure there are no showstoppers left unfixed. If there are - then bug the person the bug is assigned to until they fix - it. If there are no more qa bugs then they should tag the - branch as php_4_0_ and tarball as usual. An email - should be sent to PHP-GEN, PHP_DEV and PHP-QA about the new - release and it should be added to php.net. The windows - binaries and servelets should be built as soon as possible - and added too, as should the windows installer. - -6 Summary - - Here is a summary of what a release cycle might look like: - - Thurs: RC is agreed on and packaged, an email is sent to - PHP_QA and PHP-DEV, the CVS is Branched and the - Release Cycle Begins. - - Mon: After a weekends testing most show stoppers should - have been found (Hopefully) and the developers get to - work on fixing them. - - Thurs: A second RC is released if needed with the new bug - fixes in and the QAers test again. - - Sun: A review is made of all outstanding bugs and any show - stoppers should be fixed. if there are no show - stoppers then the final release is packaged and - released on the monday morning on php.net - - Mon: Release is made. - - -James --- -James Moore -PHP QA Team -jmoore@php.net - diff --git a/TODO b/TODO deleted file mode 100644 index 6d7c1a35767..00000000000 --- a/TODO +++ /dev/null @@ -1,170 +0,0 @@ -Things to do or at least think about doing in the future. Name in -parenthesis means that person has taken on this project. - -Zend ----- - For PHP 4.3.0: - * Allow foreach ($array as $k => &$val) syntax. right now we cannot - traverse an array without copying each element. - * Allow foreach ($array as $k => list($a, $b)) syntax for multi - dimensional arrays. - * Look at replacing c-lib call tolower(). - * Make hash API functions work with HASH_OF() to save time. - * Allow to set a default value for call-by-reference-parameters. - eg: function hello (&$pallo = NULL) {} - * Disallow function(method) redefinition in class. - * Add configure test to determine if dlsym() requires underscore and set - DLSYM_NEEDS_UNDERSCORE accordingly. Perl and zsh have it in configure, - for example. (DONE?) - - For PHP 5.0.0: - * Native large number support (probably with GNU GMP) - * Const'ify APIs. Right now, many functions leave parameters untouched, - but don't declare those as const. This makes interaction with other - interfaces difficult which pass const parameters to us. - * Add try..catch/throw exception handling. - * Fix Zend shallow copy issues with objects and arrays. - - -global ------- - For PHP 4.3.0: - * Add aliases to functions to conform to new naming conventions, e.g. - str_to_upper(). - * Make all extensions thread-safe. - * Make everything on the language-level independent of your locale - settings. - * Change PHP error messages, so that they point to pages or sections - in the PHP Manual. - * Make sure that all ZTS globals get destructed. Most ts_allocate_id() - calls should have a dtor entry. - * Activate all extensions by default that don't rely on external - dependencies. (eg ftp) (DONE?) - * on some platforms unimplemented function will just do nothing - (e.g. symlink) they should print a warning or not even be defined! - (DONE ?) - * Finish PHP streams abstraction, nuke all that issock stuff, implement SSL - socket support. (wez) - - ext/ftp/ -> all FILEs to streams - - ext/bz2/ -> convert to stream impl. - * Use arg_separator.input to implode args in the CGI sapi extension - and arg_separator.input to explode in php_build_argv(). (DONE?) - * Change the odbc_fetch_into() function to require ALWAYS the first two - parameters ($conn_id and $array), and make the third (row) be optional. - * Remove --with-openlink configure option (--with-iodbc replaces it). - * Implement flush feature suitable for nested output buffers. - - For PHP 5.0.0 - * bundle and use curl lib for fopen wrapper. - * --enable-all in configure. (--enable-shared=max ...) - * make configure print out a summary when it's done (like XEmacs) - * replace standard functions which work on static data with - reentrancy-safe functions (DONE?). - * make SAPI conform to CGI/1.1. Currently, all SAPI modules - define REMOTE_ADDR etc. themselves and reach only various level - of compliance. - * see what functions might need to be changed to use HashPosition, so - that the internal array pointer is not affected. - * Move most extensions and PEAR packages out of the PHP CVS tree, - include them again during release packaging. - - - Other - * use thread-safe resolver functions (either require BIND 8 or adns). - * implement javadoc based function docs template system. - * provide optional IPv6 support. - * find a better way to implement script timeouts. SIGVTALRM is used - by some POSIX threads implementations (i.e. OpenBSD) and is not - available in ZTS mode. - - -documentation -------------- - * Add remarks in the documentation which functions are not implemented - on win32. - * Add remarks in the documentation which functions are not binary-safe. - * Update curl documentation (DONE?) - * Add developer documentation. - * Add detailed documentation for Java extension. - -ext/curl --------- - * Use the cURL write handler to save data for use when returning data or - outputting data. - * Have a warning scheme for when people use unsupported features. - -ext/oci8 --------- - * All OCIFetch*() functions should return 0 for no more data and false on - error. - * Have a flag that trims trailing spaces from CHAR fields on retrieval. - * Make allow_call_time_pass_reference=Off working. - * For additional todo information, see oci8.c, in ext/oci8 - -ext/pcre --------- - * Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe - -ext/pgsql ---------- - For PHP 4.3.0: - * Add pg_metadata() with metadata cache feature. - * Add pg_convert() to check and convert array value for query. - * Add pg_insert/pg_update/pg_delete/pg_select for simple query. - -ext/session ------------ - For PHP 4.3.0: - * session_abort() to abort session. ie: Do not save session data. - * Allow unset($_SESSION) or unset($HTTP_SESSION_VARS) to unset - session vars regardless of register_globals setting. - - Other: - * Maybe implement finer-grained session variables that could be - locked individually. - * Write a network-transparent storage back-end with fallover - facilities - * Provide a callback facility which is executed upon encountering - an unknown class name during deserialization - -ext/sockets ------------ - * Make the extension work on windows (Daniel Beulshausen) - * Make the extension work with Solaris and the Sun GCC - -ext/standard ------------- - * Add a version number to data serialized via serialize(). - * Possibly modify parsing of GPC data to automatically create arrays if - variable name is seen more than once. - * Implement regex-cache for url-functions. - * stri_replace(). (Andrei) - * Move socket related functions to fsock.c. - * NOT binary safe: - strtok() - basename() - dirname() - strrpos() - strrchr() - strip_tags() - * Rewrite win32 SMTP code to be usable for *ix to, maybe as a (default) - module of its own (Hartmut) - -ext/zziplib ------------- - * More fully support the zziplib API - -ext/wddx --------- - * See if we can support the remaining data types: - dateTime - binary - - http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm - (Andrei) - - * implement wddx_packet_as_javascript(). (Andrei) - -other cool stuff ----------------- - * PVM extension diff --git a/TODO.BUILDv5 b/TODO.BUILDv5 deleted file mode 100644 index 28237ea4d1e..00000000000 --- a/TODO.BUILDv5 +++ /dev/null @@ -1,3 +0,0 @@ -- clean up .cvsignores -- purge Makefile.ins and replace PHP_EXTENSION in config.m4s - with appropiate calls to PHP_NEW_EXTENSION diff --git a/TSRM/LICENSE b/TSRM/LICENSE deleted file mode 100644 index 8d208476e41..00000000000 --- a/TSRM/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -- Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -- Neither name of the copyright holders nor the names of their contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS -IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/TSRM/Makefile.am b/TSRM/Makefile.am deleted file mode 100644 index 91e585b65c8..00000000000 --- a/TSRM/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## process this file with automake to produce Makefile.am -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libtsrm.la -libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c - -depend: diff --git a/TSRM/TODO b/TSRM/TODO deleted file mode 100644 index 82b4fedfde1..00000000000 --- a/TSRM/TODO +++ /dev/null @@ -1,2 +0,0 @@ -- Improve the lock in ts_resource_ex() in order to cover less code. - This can probably be done by more careful hash table access diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c deleted file mode 100644 index 65447c6df05..00000000000 --- a/TSRM/TSRM.c +++ /dev/null @@ -1,588 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski| - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#include "TSRM.h" - -#ifdef ZTS - -#include -#include - -#if HAVE_STDARG_H -#include -#endif - -typedef struct _tsrm_tls_entry tsrm_tls_entry; - -struct _tsrm_tls_entry { - void **storage; - int count; - THREAD_T thread_id; - tsrm_tls_entry *next; -}; - - -typedef struct { - size_t size; - ts_allocate_ctor ctor; - ts_allocate_dtor dtor; -} tsrm_resource_type; - - -/* The memory manager table */ -static tsrm_tls_entry **tsrm_tls_table=NULL; -static int tsrm_tls_table_size; -static ts_rsrc_id id_count; - -/* The resource sizes table */ -static tsrm_resource_type *resource_types_table=NULL; -static int resource_types_table_size; - - -static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */ - -/* New thread handlers */ -static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler; -static tsrm_thread_end_func_t tsrm_new_thread_end_handler; - -/* Debug support */ -int tsrm_error(int level, const char *format, ...); - -/* Read a resource from a thread's resource storage */ -static int tsrm_error_level; -static FILE *tsrm_error_file; - -#if TSRM_DEBUG -#define TSRM_ERROR(args) tsrm_error args -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - { \ - int unshuffled_offset = TSRM_UNSHUFFLE_RSRC_ID(offset); \ - \ - if (offset==0) { \ - return &array; \ - } else if ((unshuffled_offset)>=0 && (unshuffled_offset)<(range)) { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - 0x%0.8X", \ - unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset])); \ - return array[unshuffled_offset]; \ - } else { \ - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", \ - unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \ - return NULL; \ - } \ - } -#else -#define TSRM_ERROR -#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \ - if (offset==0) { \ - return &array; \ - } else { \ - return array[TSRM_UNSHUFFLE_RSRC_ID(offset)]; \ - } -#endif - -#if defined(PTHREADS) -/* Thread local storage */ -static pthread_key_t tls_key; -#elif defined(TSRM_ST) -static int tls_key; -#elif defined(TSRM_WIN32) -static DWORD tls_key; -#endif - - -/* Startup TSRM (call once for the entire process) */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename) -{ -#if defined(GNUPTH) - pth_init(); -#elif defined(PTHREADS) - pthread_key_create( &tls_key, 0 ); -#elif defined(TSRM_ST) - st_init(); - st_key_create(&tls_key, 0); -#elif defined(TSRM_WIN32) - tls_key = TlsAlloc(); -#endif - - tsrm_error_file = stderr; - tsrm_error_set(debug_level, debug_filename); - tsrm_tls_table_size = expected_threads; - - tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *)); - if (!tsrm_tls_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table")); - return 0; - } - id_count=0; - - resource_types_table_size = expected_resources; - resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type)); - if (!resource_types_table) { - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table")); - free(tsrm_tls_table); - tsrm_tls_table = NULL; - return 0; - } - - tsmm_mutex = tsrm_mutex_alloc(); - - tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources)); - return 1; -} - - -/* Shutdown TSRM (call once for the entire process) */ -TSRM_API void tsrm_shutdown(void) -{ - int i; - - if (tsrm_tls_table) { - for (i=0; inext; - for (j=0; jstorage[j]); - } - free(p->storage); - free(p); - p = next_p; - } - } - free(tsrm_tls_table); - tsrm_tls_table = NULL; - } - if (resource_types_table) { - free(resource_types_table); - resource_types_table=NULL; - } - tsrm_mutex_free(tsmm_mutex); - tsmm_mutex = NULL; - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM")); - if (tsrm_error_file!=stderr) { - fclose(tsrm_error_file); - } -#if defined(GNUPTH) - pth_kill(); -#elif defined(PTHREADS) - pthread_key_delete(tls_key); -#elif defined(TSRM_WIN32) - TlsFree(tls_key); -#endif -} - - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size)); - - tsrm_mutex_lock(tsmm_mutex); - - /* obtain a resource id */ - *rsrc_id = TSRM_SHUFFLE_RSRC_ID(id_count++); - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", *rsrc_id)); - - /* store the new resource type in the resource sizes table */ - if (resource_types_table_size < id_count) { - resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count); - if (!resource_types_table) { - tsrm_mutex_unlock(tsmm_mutex); - TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource")); - *rsrc_id = 0; - return 0; - } - resource_types_table_size = id_count; - } - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor; - resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor; - - /* enlarge the arrays for the already active threads */ - for (i=0; icount < id_count) { - int j; - - p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count); - for (j=p->count; jstorage[j] = (void *) malloc(resource_types_table[j].size); - if (resource_types_table[j].ctor) { - resource_types_table[j].ctor(p->storage[j], &p->storage); - } - } - p->count = id_count; - } - p = p->next; - } - } - tsrm_mutex_unlock(tsmm_mutex); - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id)); - return *rsrc_id; -} - - -static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id) -{ - int i; - - TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id)); - (*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry)); - (*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count); - (*thread_resources_ptr)->count = id_count; - (*thread_resources_ptr)->thread_id = thread_id; - (*thread_resources_ptr)->next = NULL; - -#if defined(PTHREADS) - /* Set thread local storage to this new thread resources structure */ - pthread_setspecific(tls_key, (void *) *thread_resources_ptr); -#elif defined(TSRM_ST) - st_thread_setspecific(tls_key, (void *) *thread_resources_ptr); -#elif defined(TSRM_WIN32) - TlsSetValue(tls_key, (void *) *thread_resources_ptr); -#endif - - if (tsrm_new_thread_begin_handler) { - tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage)); - } - for (i=0; istorage[i] = (void *) malloc(resource_types_table[i].size); - if (resource_types_table[i].ctor) { - resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage); - } - } - - tsrm_mutex_unlock(tsmm_mutex); - - if (tsrm_new_thread_end_handler) { - tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage)); - } -} - - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) -{ - THREAD_T thread_id; - int hash_value; - tsrm_tls_entry *thread_resources; - - if (!th_id) { -#if defined(PTHREADS) - /* Fast path for looking up the resources for the current - * thread. Its used by just about every call to - * ts_resource_ex(). This avoids the need for a mutex lock - * and our hashtable lookup. - */ - thread_resources = pthread_getspecific(tls_key); -#elif defined(TSRM_ST) - thread_resources = st_thread_getspecific(tls_key); -#elif defined(TSRM_WIN32) - thread_resources = TlsGetValue(tls_key); -#else - thread_resources = NULL; -#endif - if (thread_resources) { - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id)); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); - } - thread_id = tsrm_thread_id(); - } else { - thread_id = *th_id; - } - - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id)); - tsrm_mutex_lock(tsmm_mutex); - - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - if (!thread_resources) { - allocate_new_resource(&tsrm_tls_table[hash_value], thread_id); - return ts_resource_ex(id, &thread_id); - } else { - do { - if (thread_resources->thread_id == thread_id) { - break; - } - if (thread_resources->next) { - thread_resources = thread_resources->next; - } else { - allocate_new_resource(&thread_resources->next, thread_id); - return ts_resource_ex(id, &thread_id); - /* - * thread_resources = thread_resources->next; - * break; - */ - } - } while (thread_resources); - } - tsrm_mutex_unlock(tsmm_mutex); - /* Read a specific resource from the thread's resources. - * This is called outside of a mutex, so have to be aware about external - * changes to the structure as we read it. - */ - TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); -} - - -/* frees all resources allocated for the current thread */ -void ts_free_thread(void) -{ - tsrm_tls_entry *thread_resources; - int i; - THREAD_T thread_id = tsrm_thread_id(); - int hash_value; - tsrm_tls_entry *last=NULL; - - tsrm_mutex_lock(tsmm_mutex); - hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); - thread_resources = tsrm_tls_table[hash_value]; - - while (thread_resources) { - if (thread_resources->thread_id == thread_id) { - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage); - } - } - for (i=0; icount; i++) { - free(thread_resources->storage[i]); - } - free(thread_resources->storage); - if (last) { - last->next = thread_resources->next; - } else { - tsrm_tls_table[hash_value] = thread_resources->next; - } -#if defined(PTHREADS) - pthread_setspecific(tls_key, 0); -#elif defined(TSRM_WIN32) - TlsSetValue(tls_key, 0); -#endif - free(thread_resources); - break; - } - if (thread_resources->next) { - last = thread_resources; - } - thread_resources = thread_resources->next; - } - tsrm_mutex_unlock(tsmm_mutex); -} - - -/* deallocates all occurrences of a given id */ -void ts_free_id(ts_rsrc_id id) -{ -} - - - - -/* - * Utility Functions - */ - -/* Obtain the current thread id */ -TSRM_API THREAD_T tsrm_thread_id(void) -{ -#ifdef TSRM_WIN32 - return GetCurrentThreadId(); -#elif defined(GNUPTH) - return pth_self(); -#elif defined(PTHREADS) - return pthread_self(); -#elif defined(NSAPI) - return systhread_current(); -#elif defined(PI3WEB) - return PIThread_getCurrent(); -#elif defined(TSRM_ST) - return st_thread_self(); -#endif -} - - -/* Allocate a mutex */ -TSRM_API MUTEX_T tsrm_mutex_alloc(void) -{ - MUTEX_T mutexp; - -#ifdef TSRM_WIN32 - mutexp = malloc(sizeof(CRITICAL_SECTION)); - InitializeCriticalSection(mutexp); -#elif defined(GNUPTH) - mutexp = (MUTEX_T) malloc(sizeof(*mutexp)); - pth_mutex_init(mutexp); -#elif defined(PTHREADS) - mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t)); - pthread_mutex_init(mutexp,NULL); -#elif defined(NSAPI) - mutexp = crit_init(); -#elif defined(PI3WEB) - mutexp = PIPlatform_allocLocalMutex(); -#elif defined(TSRM_ST) - mutexp = st_mutex_new(); -#endif -#ifdef THR_DEBUG - printf("Mutex created thread: %d\n",mythreadid()); -#endif - return( mutexp ); -} - - -/* Free a mutex */ -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp) -{ - if (mutexp) { -#ifdef TSRM_WIN32 - DeleteCriticalSection(mutexp); -#elif defined(GNUPTH) - free(mutexp); -#elif defined(PTHREADS) - pthread_mutex_destroy(mutexp); - free(mutexp); -#elif defined(NSAPI) - crit_terminate(mutexp); -#elif defined(PI3WEB) - PISync_delete(mutexp); -#elif defined(TSRM_ST) - st_mutex_destroy(mutexp); -#endif - } -#ifdef THR_DEBUG - printf("Mutex freed thread: %d\n",mythreadid()); -#endif -} - - -/* Lock a mutex */ -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - EnterCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_acquire(mutexp, 0, NULL); -#elif defined(PTHREADS) - return pthread_mutex_lock(mutexp); -#elif defined(NSAPI) - return crit_enter(mutexp); -#elif defined(PI3WEB) - return PISync_lock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_lock(mutexp); -#endif -} - - -/* Unlock a mutex */ -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp) -{ - TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id())); -#ifdef TSRM_WIN32 - LeaveCriticalSection(mutexp); - return 1; -#elif defined(GNUPTH) - return pth_mutex_release(mutexp); -#elif defined(PTHREADS) - return pthread_mutex_unlock(mutexp); -#elif defined(NSAPI) - return crit_exit(mutexp); -#elif defined(PI3WEB) - return PISync_unlock(mutexp); -#elif defined(TSRM_ST) - return st_mutex_unlock(mutexp); -#endif -} - - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler) -{ - void *retval = (void *) tsrm_new_thread_begin_handler; - - tsrm_new_thread_begin_handler = new_thread_begin_handler; - return retval; -} - - -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler) -{ - void *retval = (void *) tsrm_new_thread_end_handler; - - tsrm_new_thread_end_handler = new_thread_end_handler; - return retval; -} - - - -/* - * Debug support - */ - -#if TSRM_DEBUG -int tsrm_error(int level, const char *format, ...) -{ - if (level<=tsrm_error_level) { - va_list args; - int size; - - fprintf(tsrm_error_file, "TSRM: "); - va_start(args, format); - size = vfprintf(tsrm_error_file, format, args); - va_end(args); - fprintf(tsrm_error_file, "\n"); - fflush(tsrm_error_file); - return size; - } else { - return 0; - } -} -#endif - - -void tsrm_error_set(int level, char *debug_filename) -{ - tsrm_error_level = level; - -#if TSRM_DEBUG - if (tsrm_error_file!=stderr) { /* close files opened earlier */ - fclose(tsrm_error_file); - } - - if (debug_filename) { - tsrm_error_file = fopen(debug_filename, "w"); - if (!tsrm_error_file) { - tsrm_error_file = stderr; - } - } else { - tsrm_error_file = stderr; - } -#endif -} - -#endif /* ZTS */ diff --git a/TSRM/TSRM.dsp b/TSRM/TSRM.dsp deleted file mode 100644 index 1a5693f5a23..00000000000 --- a/TSRM/TSRM.dsp +++ /dev/null @@ -1,186 +0,0 @@ -# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=TSRM - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library") -!MESSAGE "TSRM - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "TSRM - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "TSRM - Win32 Debug_TS" -# Name "TSRM - Win32 Release_TS" -# Name "TSRM - Win32 Release_TS_inline" -# Name "TSRM - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\TSRM.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.c -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\TSRM.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_config_common.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_strtok_r.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_virtual_cwd.h -# End Source File -# Begin Source File - -SOURCE=.\tsrm_win32.h -# End Source File -# End Group -# End Target -# End Project diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h deleted file mode 100644 index eed6986a6a8..00000000000 --- a/TSRM/TSRM.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Thread Safe Resource Manager | - +----------------------------------------------------------------------+ - | Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski| - | This source file is subject to the TSRM license, that is bundled | - | with this package in the file LICENSE | - +----------------------------------------------------------------------+ - | Authors: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#ifndef TSRM_H -#define TSRM_H - -#ifndef WIN32 -# include "tsrm_config.h" -#endif - -#ifdef WIN32 -# define TSRM_WIN32 -#endif - -#ifdef TSRM_WIN32 -# ifdef TSRM_EXPORTS -# define TSRM_API __declspec(dllexport) -# else -# define TSRM_API __declspec(dllimport) -# endif -#else -# define TSRM_API -#endif - -/* Only compile multi-threading functions if we're in ZTS mode */ -#ifdef ZTS - -#ifdef TSRM_WIN32 -# include -#elif defined(GNUPTH) -# include -#elif defined(PTHREADS) -# include -#elif defined(TSRM_ST) -# include -#endif - -typedef int ts_rsrc_id; - -/* Define THREAD_T and MUTEX_T */ -#ifdef TSRM_WIN32 -# define THREAD_T DWORD -# define MUTEX_T CRITICAL_SECTION * -#elif defined(GNUPTH) -# define THREAD_T pth_t -# define MUTEX_T pth_mutex_t * -#elif defined(PTHREADS) -# define THREAD_T pthread_t -# define MUTEX_T pthread_mutex_t * -#elif defined(NSAPI) -# define THREAD_T SYS_THREAD -# define MUTEX_T CRITICAL -#elif defined(PI3WEB) -# define THREAD_T PIThread * -# define MUTEX_T PISync * -#elif defined(TSRM_ST) -# define THREAD_T st_thread_t -# define MUTEX_T st_mutex_t -#endif - -typedef void (*ts_allocate_ctor)(void *, void ***); -typedef void (*ts_allocate_dtor)(void *, void ***); - -#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts - -#ifdef __cplusplus -extern "C" { -#endif - -/* startup/shutdown */ -TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename); -TSRM_API void tsrm_shutdown(void); - -/* allocates a new thread-safe-resource id */ -TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor); - -/* fetches the requested resource for the current thread */ -TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id); -#define ts_resource(id) ts_resource_ex(id, NULL) - -/* frees all resources allocated for the current thread */ -TSRM_API void ts_free_thread(void); - -/* deallocates all occurrences of a given id */ -TSRM_API void ts_free_id(ts_rsrc_id id); - - -/* Debug support */ -#define TSRM_ERROR_LEVEL_ERROR 1 -#define TSRM_ERROR_LEVEL_CORE 2 -#define TSRM_ERROR_LEVEL_INFO 3 - -typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls); -typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls); - - -TSRM_API int tsrm_error(int level, const char *format, ...); -TSRM_API void tsrm_error_set(int level, char *debug_filename); - -/* utility functions */ -TSRM_API THREAD_T tsrm_thread_id(void); -TSRM_API MUTEX_T tsrm_mutex_alloc(void); -TSRM_API void tsrm_mutex_free(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp); -TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp); - -TSRM_API void *tsrm_set_new_thread_begin_handler(tsrm_thread_begin_func_t new_thread_begin_handler); -TSRM_API void *tsrm_set_new_thread_end_handler(tsrm_thread_end_func_t new_thread_end_handler); - -#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) -#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1) - -#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL) -#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element) -#define TSRMLS_D void ***tsrm_ls -#define TSRMLS_DC , TSRMLS_D -#define TSRMLS_C tsrm_ls -#define TSRMLS_CC , TSRMLS_C - -#ifdef __cplusplus -} -#endif - -#else /* non ZTS */ - -#define TSRMLS_FETCH() -#define TSRMLS_D void -#define TSRMLS_DC -#define TSRMLS_C -#define TSRMLS_CC - -#endif /* ZTS */ - -#endif /* TSRM_H */ diff --git a/TSRM/acconfig.h b/TSRM/acconfig.h deleted file mode 100644 index 2b94cf35e71..00000000000 --- a/TSRM/acconfig.h +++ /dev/null @@ -1 +0,0 @@ -#undef PTHREADS diff --git a/TSRM/acinclude.m4 b/TSRM/acinclude.m4 deleted file mode 100644 index 1953172aef4..00000000000 --- a/TSRM/acinclude.m4 +++ /dev/null @@ -1,5 +0,0 @@ - -AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[ - LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' -]) - diff --git a/TSRM/build.mk b/TSRM/build.mk deleted file mode 100644 index aac1a8b982a..00000000000 --- a/TSRM/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile to generate build tools -# -# Standard usage: -# make -f build.mk -# -# Written by Sascha Schumann -# -# $Id$ - - -LT_TARGETS = ltmain.sh ltconfig - -config_h_in = tsrm_config.h.in - -makefile_am_files = Makefile.am -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in) - -all: $(targets) - -clean: - rm -f $(targets) - -$(LT_TARGETS): - rm -f $(LT_TARGETS) - libtoolize --automake $(AMFLAGS) -f - -$(makefile_in_files): $(makefile_am_files) - automake -a -i $(AMFLAGS) $(makefile_files) - -aclocal.m4: configure.in acinclude.m4 - aclocal - -$(config_h_in): configure.in acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @rm -f $@ - autoheader - -configure: aclocal.m4 configure.in - autoconf diff --git a/TSRM/buildconf b/TSRM/buildconf deleted file mode 100755 index fe8dee6f767..00000000000 --- a/TSRM/buildconf +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -case "$1" in ---copy) - automake_flags=--copy - shift -;; -esac - -libtoolize --force --automake $automake_flags - -mv aclocal.m4 aclocal.m4.old 2>/dev/null -aclocal -if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then - echo "buildconf: keeping ${1}aclocal.m4" - mv aclocal.m4.old aclocal.m4 -else - echo "buildconf: created or modified ${1}aclocal.m4" -fi - -autoheader - -automake --add-missing --include-deps $automake_flags - -mv configure configure.old 2>/dev/null -autoconf -if cmp configure.old configure > /dev/null 2>&1; then - echo "buildconf: keeping ${1}configure" - mv configure.old configure -else - echo "buildconf: created or modified ${1}configure" -fi - diff --git a/TSRM/configure.in b/TSRM/configure.in deleted file mode 100644 index acfdd00b353..00000000000 --- a/TSRM/configure.in +++ /dev/null @@ -1,31 +0,0 @@ -dnl $Id$ -dnl -dnl Minimalistic configure.in for TSRM. -dnl - -AC_INIT(TSRM.c) -AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine) -AM_CONFIG_HEADER(tsrm_config.h) - -sinclude(tsrm.m4) - -TSRM_BASIC_CHECKS -TSRM_THREADS_CHECKS - -AM_PROG_LIBTOOL -if test "$enable_debug" != "yes"; then - AM_SET_LIBTOOL_VARIABLE([--silent]) -fi - -dnl TSRM_PTHREAD - -AC_CHECK_HEADERS( -utime.h \ -dirent.h \ -stdarg.h \ -alloca.h \ -unistd.h \ -limits.h -) - -AC_OUTPUT(Makefile) diff --git a/TSRM/readdir.h b/TSRM/readdir.h deleted file mode 100644 index b0f1ad9e6f9..00000000000 --- a/TSRM/readdir.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef READDIR_H -#define READDIR_H - - -/* - * Structures and types used to implement opendir/readdir/closedir - * on Windows 95/NT. - */ - -#include -#include -#include -#include - - -/* struct dirent - same as Unix */ - -struct dirent { - long d_ino; /* inode (always 1 in WIN32) */ - off_t d_off; /* offset to this dirent */ - unsigned short d_reclen; /* length of d_name */ - char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */ -}; - - -/* typedef DIR - not the same as Unix */ -typedef struct { - long handle; /* _findfirst/_findnext handle */ - short offset; /* offset into directory */ - short finished; /* 1 if there are not more files */ - struct _finddata_t fileinfo; /* from _findfirst/_findnext */ - char *dir; /* the dir we are reading */ - struct dirent dent; /* the dirent to return */ -} DIR; - -/* Function prototypes */ -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -int readdir_r(DIR *, struct dirent *, struct dirent **); -int closedir(DIR *); -void rewinddir(DIR *); - - -#endif /* READDIR_H */ diff --git a/TSRM/threads.m4 b/TSRM/threads.m4 deleted file mode 100644 index e0f934e5567..00000000000 --- a/TSRM/threads.m4 +++ /dev/null @@ -1,160 +0,0 @@ -dnl Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl -dnl 1. Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl -dnl 2. Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in -dnl the documentation and/or other materials provided with the -dnl distribution. -dnl -dnl THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY -dnl EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SASCHA SCHUMANN OR -dnl HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -dnl NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -dnl OF THE POSSIBILITY OF SUCH DAMAGE. - -dnl -dnl PTHREADS_FLAGS -dnl -dnl Set some magic defines to achieve POSIX threads conformance -dnl -AC_DEFUN(PTHREADS_FLAGS,[ - if test -z "$host_alias" && test -n "$host"; then - host_alias=$host - fi - if test -z "$host_alias"; then - AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess) - fi - case $host_alias in - *solaris*) - PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";; - *freebsd*) - PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";; - *linux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *aix*) - PTHREAD_FLAGS=-D_THREAD_SAFE;; - *irix*) - PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;; - *hpux*) - PTHREAD_FLAGS=-D_REENTRANT;; - *sco*) - PTHREAD_FLAGS=-D_REENTRANT;; -dnl Solves sigwait() problem, creates problems with u_long etc. -dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";; - esac - - if test -n "$PTHREAD_FLAGS"; then - CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS" - fi -])dnl -dnl -dnl PTHREADS_CHECK_COMPILE -dnl -dnl Check whether the current setup can use POSIX threads calls -dnl -AC_DEFUN(PTHREADS_CHECK_COMPILE, [ -AC_TRY_RUN( [ -#include -#include - -void *thread_routine(void *data) { - return data; -} - -int main() { - pthread_t thd; - pthread_mutexattr_t mattr; - int data = 1; - pthread_mutexattr_init(&mattr); - return pthread_create(&thd, NULL, thread_routine, &data); -} ], [ - pthreads_working=yes - ], [ - pthreads_working=no - ], pthreads_working=no ) ] )dnl -dnl -dnl PTHREADS_CHECK() -dnl -dnl Try to find a way to enable POSIX threads -dnl -dnl Magic flags -dnl -kthread gcc (FreeBSD) -dnl -Kthread UDK cc (UnixWare) -dnl -mt WorkShop cc (Solaris) -dnl -mthreads gcc (AIX) -dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD) -dnl -pthreads gcc (Solaris) -dnl -qthreaded AIX cc V5 -dnl -threads gcc (HP-UX) -dnl -AC_DEFUN(PTHREADS_CHECK,[ - -save_CFLAGS=$CFLAGS -save_LIBS=$LIBS -PTHREADS_ASSIGN_VARS -PTHREADS_CHECK_COMPILE -LIBS=$save_LIBS -CFLAGS=$save_CFLAGS - -AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[ -ac_cv_pthreads_cflags= -if test "$pthreads_working" != "yes"; then - for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do - ac_save=$CFLAGS - CFLAGS="$CFLAGS $flag" - PTHREADS_CHECK_COMPILE - CFLAGS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_cflags=$flag - break - fi - done -fi -]) - -AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[ -ac_cv_pthreads_lib= -if test "$pthreads_working" != "yes"; then - for lib in pthread pthreads c_r; do - ac_save=$LIBS - LIBS="$LIBS -l$lib" - PTHREADS_CHECK_COMPILE - LIBS=$ac_save - if test "$pthreads_working" = "yes"; then - ac_cv_pthreads_lib=$lib - break - fi - done -fi -]) - -if test "$pthreads_working" = "yes"; then - threads_result="POSIX-Threads found" -else - threads_result="POSIX-Threads not found" -fi -])dnl -dnl -dnl -AC_DEFUN(PTHREADS_ASSIGN_VARS,[ -if test -n "$ac_cv_pthreads_lib"; then - LIBS="$LIBS -l$ac_cv_pthreads_lib" -fi - -if test -n "$ac_cv_pthreads_cflags"; then - CFLAGS="$CFLAGS $ac_cv_pthreads_cflags" -fi -])dnl diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4 deleted file mode 100644 index 61462f1f96c..00000000000 --- a/TSRM/tsrm.m4 +++ /dev/null @@ -1,124 +0,0 @@ - -dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND) -AC_DEFUN(TSRM_CHECK_GCC_ARG,[ - gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_) - AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [ - echo 'void somefunc() { };' > conftest.c - cmd='$CC $1 -c conftest.c' - if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then - ac_result=no - else - ac_result=yes - fi - eval $gcc_arg_name=$ac_result - rm -f conftest.* - ]) - if eval test "\$$gcc_arg_name" = "yes"; then - $2 - else - : - $3 - fi -]) - -AC_DEFUN(TSRM_BASIC_CHECKS,[ - -AC_REQUIRE([AC_PROG_CC])dnl -dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl -AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl - -AC_CHECK_HEADERS(stdarg.h) - -]) - - -AC_DEFUN(TSRM_CHECK_PTH,[ - -AC_MSG_CHECKING(for GNU Pth) -PTH_PREFIX="`$1 --prefix`" -if test -z "$PTH_PREFIX"; then - AC_MSG_RESULT(Please check your Pth installation) -fi - -CPPFLAGS="$CPPFLAGS `$1 --cflags`" -LDFLAGS="$LDFLAGS `$1 --ldflags`" -LIBS="$LIBS `$1 --libs`" - -AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth]) -AC_MSG_RESULT(yes - installed in $PTH_PREFIX) - -]) - -AC_DEFUN(TSRM_CHECK_ST,[ - if test -r "$1/include/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1/include" - LDFLAGS="$LDFLAGS -L$1/lib" - elif test -r "$1/st.h"; then - CPPFLAGS="$CPPFLAGS -I$1" - LDFLAGS="$LDFLAGS -L$1" - fi - AC_CHECK_HEADERS(st.h,[],[ - AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix]) - ]) - LIBS="$LIBS -lst" - AC_MSG_CHECKING(for SGI's State Threads) - AC_MSG_RESULT(yes) - AC_DEFINE(TSRM_ST, 1, [ ]) -]) - -sinclude(threads.m4) -sinclude(TSRM/threads.m4) - -AC_DEFUN(TSRM_CHECK_PTHREADS,[ - -PTHREADS_CHECK - -if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR(Your system seems to lack POSIX threads.) -fi - -AC_DEFINE(PTHREADS, 1, Whether to use Pthreads) - -AC_MSG_CHECKING(for POSIX threads) -AC_MSG_RESULT(yes) -]) - - -AC_DEFUN(TSRM_THREADS_CHECKS,[ - -dnl For the thread implementations, we always use --with-* -dnl to maintain consistency - -AC_ARG_WITH(tsrm-pth, -[ --with-tsrm-pth[=pth-config] Use GNU Pth.],[ - TSRM_PTH=$withval -],[ - TSRM_PTH=no -]) - -AC_ARG_WITH(tsrm-st, -[ --with-tsrm-st],[ - TSRM_ST=$withval -],[ - TSRM_ST=no -]) - -AC_ARG_WITH(tsrm-pthreads, -[ --with-tsrm-pthreads Use POSIX threads (default)],[ - TSRM_PTHREADS=$withval -],[ - TSRM_PTHREADS=yes -]) - -test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config - -if test "$TSRM_PTH" != "no"; then - TSRM_CHECK_PTH($TSRM_PTH) -elif test "$TSRM_ST" != "no"; then - TSRM_CHECK_ST($TSRM_ST) -elif test "$TSRM_PTHREADS" != "no"; then - TSRM_CHECK_PTHREADS -fi - -]) diff --git a/TSRM/tsrm_config.w32.h b/TSRM/tsrm_config.w32.h deleted file mode 100644 index 405d8c7c8f3..00000000000 --- a/TSRM/tsrm_config.w32.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef TSRM_CONFIG_W32_H -#define TSRM_CONFIG_W32_H - -#define HAVE_UTIME 1 -#define HAVE_ALLOCA 1 - -#undef inline -#ifdef ZEND_WIN32_FORCE_INLINE -# define inline __forceinline -#else -# define inline -#endif - - -#endif diff --git a/TSRM/tsrm_config_common.h b/TSRM/tsrm_config_common.h deleted file mode 100644 index add5a50fa53..00000000000 --- a/TSRM/tsrm_config_common.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef TSRM_CONFIG_COMMON_H -#define TSRM_CONFIG_COMMON_H - -#if WINNT|WIN32 -# define TSRM_WIN32 -#endif - -#ifndef TSRM_WIN32 -# include "tsrm_config.h" -# include -#else -# include "tsrm_config.w32.h" -#endif - -#ifdef TSRM_WIN32 -#include -#endif - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_LIMITS_H -#include -#endif - -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 256 -# endif -#endif - -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) -# define tsrm_do_alloca(p) alloca(p) -# define tsrm_free_alloca(p) -#else -# define tsrm_do_alloca(p) malloc(p) -# define tsrm_free_alloca(p) free(p) -#endif - -#endif /* TSRM_CONFIG_COMMON_H */ diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c deleted file mode 100644 index e9ad26a7ac2..00000000000 --- a/TSRM/tsrm_strtok_r.c +++ /dev/null @@ -1,63 +0,0 @@ -#include - -#include "tsrm_config_common.h" -#include "tsrm_strtok_r.h" - -static inline int in_character_class(char ch, const char *delim) -{ - while (*delim) { - if (*delim == ch) { - return 1; - } - delim++; - } - return 0; -} - -char *tsrm_strtok_r(char *s, const char *delim, char **last) -{ - char *token; - - if (s == NULL) { - s = *last; - } - - while (*s && in_character_class(*s, delim)) { - s++; - } - if (!*s) { - return NULL; - } - - token = s; - - while (*s && !in_character_class(*s, delim)) { - s++; - } - if (!*s) { - *last = s; - } else { - *s = '\0'; - *last = s + 1; - } - return token; -} - -#if 0 - -main() -{ - char foo[] = "/foo/bar//\\barbara"; - char *last; - char *token; - - token = tsrm_strtok_r(foo, "/\\", &last); - while (token) { - printf ("Token = '%s'\n", token); - token = tsrm_strtok_r(NULL, "/\\", &last); - } - - return 0; -} - -#endif diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h deleted file mode 100644 index 8c9e8198e78..00000000000 --- a/TSRM/tsrm_strtok_r.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TSRM_STRTOK_R -#define TSRM_STRTOK_R - -char *tsrm_strtok_r(char *s, const char *delim, char **last); - -#endif diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c deleted file mode 100644 index ae8efd93e46..00000000000 --- a/TSRM/tsrm_virtual_cwd.c +++ /dev/null @@ -1,773 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tsrm_virtual_cwd.h" -#include "tsrm_strtok_r.h" - -#ifdef TSRM_WIN32 -#include -#include "tsrm_win32.h" -#endif - -#define VIRTUAL_CWD_DEBUG 0 - -#include "TSRM.h" - -/* Only need mutex for popen() in Windows because it doesn't chdir() on UNIX */ -#if defined(TSRM_WIN32) && defined(ZTS) -MUTEX_T cwd_mutex; -#endif - -#ifdef ZTS -static ts_rsrc_id cwd_globals_id; -#else -static virtual_cwd_globals cwd_globals; -#endif - -cwd_state main_cwd_state; /* True global */ - -#ifndef TSRM_WIN32 -#include -#else -#include -#endif - -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - -#ifdef TSRM_WIN32 -#define tsrm_strtok_r(a,b,c) strtok((a),(b)) -#define TOKENIZER_STRING "/\\" - -static int php_check_dots(const char *element, int n) -{ - while (n-- > 0) if (element[n] != '.') break; - - return (n != -1); -} - -#define IS_DIRECTORY_UP(element, len) \ - (len >= 2 && !php_check_dots(element, len)) - -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && ptr[0] == '.') - - -#else -#define TOKENIZER_STRING "/" -#endif - - -/* default macros */ - -#ifndef IS_DIRECTORY_UP -#define IS_DIRECTORY_UP(element, len) \ - (len == 2 && memcmp(element, "..", 2) == 0) -#endif - -#ifndef IS_DIRECTORY_CURRENT -#define IS_DIRECTORY_CURRENT(element, len) \ - (len == 1 && ptr[0] == '.') -#endif - -/* define this to check semantics */ -#define IS_DIR_OK(s) (1) - -#ifndef IS_DIR_OK -#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0) -#endif - - -#define CWD_STATE_COPY(d, s) \ - (d)->cwd_length = (s)->cwd_length; \ - (d)->cwd = (char *) malloc((s)->cwd_length+1); \ - memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1); - -#define CWD_STATE_FREE(s) \ - free((s)->cwd); - -static int php_is_dir_ok(const cwd_state *state) -{ - struct stat buf; - - if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) - return (0); - - return (1); -} - -static int php_is_file_ok(const cwd_state *state) -{ - struct stat buf; - - if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) - return (0); - - return (1); -} - -static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) -{ - CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state); -} - -static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) -{ - CWD_STATE_FREE(&cwd_globals->cwd); -} - -static char *tsrm_strndup(const char *s, size_t length) -{ - char *p; - - p = (char *) malloc(length+1); - if (!p) { - return (char *)NULL; - } - if (length) { - memcpy(p,s,length); - } - p[length]=0; - return p; -} - -CWD_API void virtual_cwd_startup(void) -{ - char cwd[MAXPATHLEN]; - char *result; - - result = getcwd(cwd, sizeof(cwd)); - if (!result) { - cwd[0] = '\0'; - } - main_cwd_state.cwd = strdup(cwd); - main_cwd_state.cwd_length = strlen(cwd); - -#ifdef ZTS - ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor); -#else - cwd_globals_ctor(&cwd_globals TSRMLS_CC); -#endif - -#if defined(TSRM_WIN32) && defined(ZTS) - cwd_mutex = tsrm_mutex_alloc(); -#endif -} - -CWD_API void virtual_cwd_shutdown(void) -{ -#ifndef ZTS - cwd_globals_dtor(&cwd_globals TSRMLS_CC); -#endif -#if defined(TSRM_WIN32) && defined(ZTS) - tsrm_mutex_free(cwd_mutex); -#endif - - free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */ -} - -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) -{ - cwd_state *state; - - state = &CWDG(cwd); - - if (state->cwd_length == 0) { - char *retval; - - *length = 1; - retval = (char *) malloc(2); - retval[0] = DEFAULT_SLASH; - retval[1] = '\0'; - return retval; - } - -#ifdef TSRM_WIN32 - /* If we have something like C: */ - if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') { - char *retval; - - *length = state->cwd_length+1; - retval = (char *) malloc(*length+1); - memcpy(retval, state->cwd, *length); - retval[*length-1] = DEFAULT_SLASH; - retval[*length] = '\0'; - return retval; - } -#endif - *length = state->cwd_length; - return strdup(state->cwd); -} - - -/* Same semantics as UNIX getcwd() */ -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) -{ - size_t length; - char *cwd; - - cwd = virtual_getcwd_ex(&length TSRMLS_CC); - - if (buf == NULL) { - return cwd; - } - if (length > size-1) { - free(cwd); - errno = ERANGE; /* Is this OK? */ - return NULL; - } - memcpy(buf, cwd, length+1); - free(cwd); - return buf; -} - -/* Resolve path relatively to state and put the real path into state */ -/* returns 0 for ok, 1 for error */ -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path) -{ - int path_length = strlen(path); - char *ptr, *path_copy; - char *tok = NULL; - int ptr_length; - cwd_state *old_state; - int ret = 0; - int copy_amount = -1; - char *free_path; - unsigned char is_absolute = 0; -#ifndef TSRM_WIN32 - char resolved_path[MAXPATHLEN]; -#endif - - if (path_length == 0) - return (0); - -#if !defined(TSRM_WIN32) && !defined(__BEOS__) - if (IS_ABSOLUTE_PATH(path, path_length)) { - if (realpath(path, resolved_path)) { - path = resolved_path; - path_length = strlen(path); - } - } else { /* Concat current directory with relative path and then run realpath() on it */ - char *tmp; - char *ptr; - - ptr = tmp = (char *) malloc(state->cwd_length+path_length+sizeof("/")); - if (!tmp) { - return 1; - } - memcpy(ptr, state->cwd, state->cwd_length); - ptr += state->cwd_length; - *ptr++ = DEFAULT_SLASH; - memcpy(ptr, path, path_length); - ptr += path_length; - *ptr = '\0'; - if (realpath(tmp, resolved_path)) { - path = resolved_path; - path_length = strlen(path); - } - free(tmp); - } -#endif - free_path = path_copy = tsrm_strndup(path, path_length); - - old_state = (cwd_state *) malloc(sizeof(cwd_state)); - CWD_STATE_COPY(old_state, state); -#if VIRTUAL_CWD_DEBUG - fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path); -#endif - if (IS_ABSOLUTE_PATH(path_copy, path_length)) { - copy_amount = COPY_WHEN_ABSOLUTE; - is_absolute = 1; -#ifdef TSRM_WIN32 - } else if (IS_UNC_PATH(path_copy, path_length)) { - copy_amount = 2; - is_absolute = 1; - } else if (IS_SLASH(path_copy[0])) { - copy_amount = 2; -#endif - } - - if (copy_amount != -1) { - state->cwd = (char *) realloc(state->cwd, copy_amount + 1); - if (copy_amount) { - if (is_absolute) { - memcpy(state->cwd, path_copy, copy_amount); - path_copy += copy_amount; - } else { - memcpy(state->cwd, old_state->cwd, copy_amount); - } - } - state->cwd[copy_amount] = '\0'; - state->cwd_length = copy_amount; - } - - - ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok); - while (ptr) { - ptr_length = strlen(ptr); - - if (IS_DIRECTORY_UP(ptr, ptr_length)) { - char save; - - save = DEFAULT_SLASH; - -#define PREVIOUS state->cwd[state->cwd_length - 1] - - while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) && - !IS_SLASH(PREVIOUS)) { - save = PREVIOUS; - PREVIOUS = '\0'; - state->cwd_length--; - } - - if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) { - state->cwd[state->cwd_length++] = save; - state->cwd[state->cwd_length] = '\0'; - } else { - PREVIOUS = '\0'; - state->cwd_length--; - } - } else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1); -#ifdef TSRM_WIN32 - /* Windows 9x will consider C:\\Foo as a network path. Avoid it. */ - if (state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') { - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - } -#else - state->cwd[state->cwd_length++] = DEFAULT_SLASH; -#endif - memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1); - state->cwd_length += ptr_length; - } - ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok); - } - - if (state->cwd_length == COPY_WHEN_ABSOLUTE) { - state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1); - state->cwd[state->cwd_length] = DEFAULT_SLASH; - state->cwd[state->cwd_length+1] = '\0'; - state->cwd_length++; - } - - if (verify_path && verify_path(state)) { - CWD_STATE_FREE(state); - - *state = *old_state; - - ret = 1; - } else { - CWD_STATE_FREE(old_state); - ret = 0; - } - - free(old_state); - - free(free_path); -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd); -#endif - return (ret); -} - -CWD_API int virtual_chdir(const char *path TSRMLS_DC) -{ - return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok)?-1:0; -} - -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) -{ - int length = strlen(path); - char *temp; - int retval; - - if (length == 0) { - return 1; /* Can't cd to empty string */ - } - while(--length >= 0 && !IS_SLASH(path[length])) { - } - - if (length == -1) { - /* No directory only file name */ - errno = ENOENT; - return -1; - } - - if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */ - length++; - } - temp = (char *) tsrm_do_alloca(length+1); - memcpy(temp, path, length); - temp[length] = 0; -#if VIRTUAL_CWD_DEBUG - fprintf (stderr, "Changing directory to %s\n", temp); -#endif - retval = p_chdir(temp TSRMLS_CC); - tsrm_free_alloca(temp); - return retval; -} - -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, NULL); - - if (!retval) { - int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; - memcpy(real_path, new_state.cwd, len); - real_path[len] = '\0'; - return real_path; - } - - return NULL; -} - -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - retval = virtual_file_ex(&new_state, path, verify_path); - - *filepath = new_state.cwd; - - return retval; - -} - -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) -{ - return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC); -} - -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) -{ - cwd_state new_state; - FILE *f; - - if (path[0] == '\0') { /* Fail to open empty path */ - return NULL; - } - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - f = fopen(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} - -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL); - - ret = utime(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return ret; -} -#endif - -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL); - - ret = chmod(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return ret; -} - -#ifndef TSRM_WIN32 -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC) -{ - cwd_state new_state; - int ret; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, filename, NULL); - - ret = chown(new_state.cwd, owner, group); - - CWD_STATE_FREE(&new_state); - return ret; -} -#endif - -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - if (flags & O_CREAT) { - mode_t mode; - va_list arg; - - va_start(arg, flags); - mode = (mode_t) va_arg(arg, int); - va_end(arg); - - f = open(new_state.cwd, flags, mode); - } else { - f = open(new_state.cwd, flags); - } - CWD_STATE_FREE(&new_state); - return f; -} - -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int f; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - f = creat(new_state.cwd, mode); - - CWD_STATE_FREE(&new_state); - return f; -} - -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) -{ - cwd_state old_state; - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&old_state, &CWDG(cwd)); - virtual_file_ex(&old_state, oldname, NULL); - oldname = old_state.cwd; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, newname, NULL); - newname = new_state.cwd; - - retval = rename(oldname, newname); - - CWD_STATE_FREE(&old_state); - CWD_STATE_FREE(&new_state); - - return retval; -} - -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - retval = stat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#ifndef TSRM_WIN32 - -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - retval = lstat(new_state.cwd, buf); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#endif - -CWD_API int virtual_unlink(const char *path TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL); - - retval = unlink(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL); - -#ifdef TSRM_WIN32 - retval = mkdir(new_state.cwd); -#else - retval = mkdir(new_state.cwd, mode); -#endif - CWD_STATE_FREE(&new_state); - return retval; -} - -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) -{ - cwd_state new_state; - int retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL); - - retval = rmdir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#ifdef TSRM_WIN32 -DIR *opendir(const char *name); -#endif - -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) -{ - cwd_state new_state; - DIR *retval; - - CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, pathname, NULL); - - retval = opendir(new_state.cwd); - - CWD_STATE_FREE(&new_state); - return retval; -} - -#ifndef TSRM_WIN32 - -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) -{ - int command_length; - char *command_line; - char *ptr; - FILE *retval; - - command_length = strlen(command); - - ptr = command_line = (char *) malloc(command_length + sizeof("cd ; ") + CWDG(cwd).cwd_length+1); - if (!command_line) { - return NULL; - } - memcpy(ptr, "cd ", sizeof("cd ")-1); - ptr += sizeof("cd ")-1; - - if (CWDG(cwd).cwd_length == 0) { - *ptr++ = DEFAULT_SLASH; - } else { - memcpy(ptr, CWDG(cwd).cwd, CWDG(cwd).cwd_length); - ptr += CWDG(cwd).cwd_length; - } - - *ptr++ = ' '; - *ptr++ = ';'; - *ptr++ = ' '; - - memcpy(ptr, command, command_length+1); - retval = popen(command_line, type); - - free(command_line); - return retval; -} - -#else - -/* On Windows the trick of prepending "cd cwd; " doesn't work so we need to perform - a real chdir() and mutex it - */ -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) -{ - char prev_cwd[MAXPATHLEN]; - char *getcwd_result; - FILE *retval; - - getcwd_result = getcwd(prev_cwd, MAXPATHLEN); - if (!getcwd_result) { - return NULL; - } - -#ifdef ZTS - tsrm_mutex_lock(cwd_mutex); -#endif - - chdir(CWDG(cwd).cwd); - retval = popen(command, type); - chdir(prev_cwd); - -#ifdef ZTS - tsrm_mutex_unlock(cwd_mutex); -#endif - - return retval; -} - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h deleted file mode 100644 index 52afebe0dac..00000000000 --- a/TSRM/tsrm_virtual_cwd.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Sascha Schumann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef VIRTUAL_CWD_H -#define VIRTUAL_CWD_H - -#include "TSRM.h" -#include "tsrm_config_common.h" - -#include -#include -#include - -#ifdef HAVE_UTIME_H -#include -#endif - -#ifdef HAVE_STDARG_H -#include -#endif - -#ifndef TSRM_WIN32 -#include -#endif - -#ifdef TSRM_WIN32 -#include "readdir.h" -#include -/* mode_t isn't defined on Windows */ -typedef unsigned short mode_t; - -#define DEFAULT_SLASH '\\' -#define DEFAULT_DIR_SEPARATOR ';' -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') -#define COPY_WHEN_ABSOLUTE 2 -#define IS_ABSOLUTE_PATH(path, len) \ - (len >= 2 && isalpha(path[0]) && path[1] == ':') -#define IS_UNC_PATH(path, len) \ - (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) - -#else -#ifdef HAVE_DIRENT_H -#include -#endif - -#define DEFAULT_SLASH '/' - -#ifdef __riscos__ -#define DEFAULT_DIR_SEPARATOR ';' -#else -#define DEFAULT_DIR_SEPARATOR ':' -#endif - -#define IS_SLASH(c) ((c) == '/') - -#endif - - -#ifndef COPY_WHEN_ABSOLUTE -#define COPY_WHEN_ABSOLUTE 0 -#endif - -#ifndef IS_ABSOLUTE_PATH -#define IS_ABSOLUTE_PATH(path, len) \ - (IS_SLASH(path[0])) -#endif - -#ifdef TSRM_EXPORTS -#define CWD_EXPORTS -#endif - -#ifdef TSRM_WIN32 -# ifdef CWD_EXPORTS -# define CWD_API __declspec(dllexport) -# else -# define CWD_API __declspec(dllimport) -# endif -#else -#define CWD_API -#endif - -typedef struct _cwd_state { - char *cwd; - int cwd_length; -} cwd_state; - -typedef int (*verify_path_func)(const cwd_state *); - -CWD_API void virtual_cwd_startup(void); -CWD_API void virtual_cwd_shutdown(void); -CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC); -CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC); -CWD_API int virtual_chdir(const char *path TSRMLS_DC); -CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC); -CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC); -CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC); -CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC); -CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC); -CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); -CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); -CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC); -CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); -#ifndef TSRM_WIN32 -CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); -#endif -CWD_API int virtual_unlink(const char *path TSRMLS_DC); -CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC); -CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC); -CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); -CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); -#if HAVE_UTIME -CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC); -#endif -CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC); -#ifndef TSRM_WIN32 -CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group TSRMLS_DC); -#endif - -CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path); - -typedef struct _virtual_cwd_globals { - cwd_state cwd; -} virtual_cwd_globals; - -#ifdef ZTS -# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v) -#else -# define CWDG(v) (cwd_globals.v) -#endif - -/* The actual macros to be used in programs using TSRM - * If the program defines VIRTUAL_DIR it will use the - * virtual_* functions - */ - -#ifdef VIRTUAL_DIR - -#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC) -#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC) -/* Because open() has two modes, we have to macros to replace it */ -#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags) -#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode) -#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC) -#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC) -#define VCWD_GETWD(buf) -#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC) -#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC) -#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC) -#ifdef TSRM_WIN32 -#define VCWD_LSTAT(path, buff) virtual_stat(path, buff TSRMLS_CC) -#else -#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC) -#endif -#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC) -#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC) -#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC) -#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC) -#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC) -#if HAVE_UTIME -#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC) -#endif -#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC) -#ifndef TSRM_WIN32 -#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group TSRMLS_CC) -#endif - -#else - -#define VCWD_GETCWD(buff, size) getcwd(buff, size) -#define VCWD_FOPEN(path, mode) fopen(path, mode) -#define VCWD_OPEN(path, flags) open(path, flags) -#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode) -#define VCWD_CREAT(path, mode) creat(path, mode) -#define VCWD_RENAME(oldname, newname) rename(oldname, newname) -#define VCWD_CHDIR(path) chdir(path) -#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) -#define VCWD_GETWD(buf) getwd(buf) -#define VCWD_STAT(path, buff) stat(path, buff) -#define VCWD_LSTAT(path, buff) lstat(path, buff) -#define VCWD_UNLINK(path) unlink(path) -#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) -#define VCWD_RMDIR(pathname) rmdir(pathname) -#define VCWD_OPENDIR(pathname) opendir(pathname) -#define VCWD_POPEN(command, type) popen(command, type) - -#ifndef TSRM_WIN32 -#define VCWD_REALPATH(path, real_path) realpath(path, real_path) -#else -#define VCWD_REALPATH(path, real_path) strcpy(real_path, path) -#endif - -#if HAVE_UTIME -#define VCWD_UTIME(path, time) utime(path, time) -#endif -#define VCWD_CHMOD(path, mode) chmod(path, mode) -#ifndef TSRM_WIN32 -#define VCWD_CHOWN(path, owner, group) chown(path, owner, group) -#endif - -#endif - -#endif /* VIRTUAL_CWD_H */ diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c deleted file mode 100644 index 09999af69e5..00000000000 --- a/TSRM/tsrm_win32.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include - -#include "TSRM.h" - -#ifdef TSRM_WIN32 -#include -#include "tsrm_win32.h" - -#ifdef ZTS -static ts_rsrc_id win32_globals_id; -#else -static tsrm_win32_globals win32_globals; -#endif - -static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC) -{ - globals->process = NULL; - globals->shm = NULL; - globals->process_size = 0; - globals->shm_size = 0; - globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com"); -} - -static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC) -{ - shm_pair *ptr; - - if (globals->process) { - free(globals->process); - } - - if (globals->shm) { - for (ptr = globals->shm; ptr < (globals->shm + globals->shm_size); ptr++) { - UnmapViewOfFile(ptr->addr); - CloseHandle(ptr->segment); - UnmapViewOfFile(ptr->descriptor); - CloseHandle(ptr->info); - } - free(globals->shm); - } - - free(globals->comspec); -} - -TSRM_API void tsrm_win32_startup(void) -{ -#ifdef ZTS - ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor); -#else - tsrm_win32_ctor(&win32_globals TSRMLS_CC); -#endif -} - -TSRM_API void tsrm_win32_shutdown(void) -{ -#ifndef ZTS - tsrm_win32_dtor(&win32_globals TSRMLS_CC); -#endif -} - -static process_pair *process_get(FILE *stream TSRMLS_DC) -{ - process_pair *ptr; - process_pair *newptr; - - for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) { - if (ptr->stream == stream) { - break; - } - } - - if (ptr < (TWG(process) + TWG(process_size))) { - return ptr; - } - - newptr = (process_pair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(process_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(process) = newptr; - ptr = newptr + TWG(process_size); - TWG(process_size)++; - return ptr; -} - -static shm_pair *shm_get(int key, void *addr) -{ - shm_pair *ptr; - shm_pair *newptr; - TSRMLS_FETCH(); - - for (ptr = TWG(shm); ptr < (TWG(shm) + TWG(shm_size)); ptr++) { - if (!ptr->descriptor) { - continue; - } - if (!addr && ptr->descriptor->shm_perm.key == key) { - break; - } else if (ptr->addr == addr) { - break; - } - } - - if (ptr < (TWG(shm) + TWG(shm_size))) { - return ptr; - } - - newptr = (shm_pair*)realloc((void*)TWG(shm), (TWG(shm_size)+1)*sizeof(shm_pair)); - if (newptr == NULL) { - return NULL; - } - - TWG(shm) = newptr; - ptr = newptr + TWG(shm_size); - TWG(shm_size)++; - return ptr; -} - -static HANDLE dupHandle(HANDLE fh, BOOL inherit) { - HANDLE copy, self = GetCurrentProcess(); - if (!DuplicateHandle(self, fh, self, ©, 0, inherit, DUPLICATE_SAME_ACCESS|DUPLICATE_CLOSE_SOURCE)) { - return NULL; - } - return copy; -} - -TSRM_API FILE *popen(const char *command, const char *type) -{ - FILE *stream = NULL; - int fno, str_len = strlen(type), read, mode; - STARTUPINFO startup; - PROCESS_INFORMATION process; - SECURITY_ATTRIBUTES security; - HANDLE in, out; - char *cmd; - process_pair *proc; - TSRMLS_FETCH(); - - security.nLength = sizeof(SECURITY_ATTRIBUTES); - security.bInheritHandle = TRUE; - security.lpSecurityDescriptor = NULL; - - if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) { - return NULL; - } - - memset(&startup, 0, sizeof(STARTUPINFO)); - memset(&process, 0, sizeof(PROCESS_INFORMATION)); - - startup.cb = sizeof(STARTUPINFO); - startup.dwFlags = STARTF_USESTDHANDLES; - startup.hStdError = GetStdHandle(STD_ERROR_HANDLE); - - read = (type[0] == 'r') ? TRUE : FALSE; - mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT; - - - if (read) { - in = dupHandle(in, FALSE); - startup.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - startup.hStdOutput = out; - } else { - out = dupHandle(out, FALSE); - startup.hStdInput = in; - startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - } - - cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")); - sprintf(cmd, "%s /c %s", TWG(comspec), command); - if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &process)) { - return NULL; - } - free(cmd); - - CloseHandle(process.hThread); - proc = process_get(NULL TSRMLS_CC); - - if (read) { - fno = _open_osfhandle((long)in, _O_RDONLY | mode); - CloseHandle(out); - } else { - fno = _open_osfhandle((long)out, _O_WRONLY | mode); - CloseHandle(in); - } - - stream = _fdopen(fno, type); - proc->prochnd = process.hProcess; - proc->stream = stream; - return stream; -} - -TSRM_API int pclose(FILE *stream) -{ - DWORD termstat = 0; - process_pair *process; - TSRMLS_FETCH(); - - if ((process = process_get(stream TSRMLS_CC)) == NULL) { - return 0; - } - - fflush(process->stream); - fclose(process->stream); - - WaitForSingleObject(process->prochnd, INFINITE); - GetExitCodeProcess(process->prochnd, &termstat); - process->stream = NULL; - CloseHandle(process->prochnd); - - return termstat; -} - -TSRM_API int shmget(int key, int size, int flags) -{ - shm_pair *shm; - char shm_segment[26], shm_info[29]; - HANDLE shm_handle, info_handle; - BOOL created = FALSE; - - if (size < 0) { - return -1; - } - - sprintf(shm_segment, "TSRM_SHM_SEGMENT:%d", key); - sprintf(shm_info, "TSRM_SHM_DESCRIPTOR:%d", key); - - shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); - info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); - - if ((!shm_handle && !info_handle)) { - if (flags & IPC_EXCL) { - return -1; - } - if (flags & IPC_CREAT) { - shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, shm_segment); - info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info); - created = TRUE; - } - if ((!shm_handle || !info_handle)) { - return -1; - } - } - - shm = shm_get(key, NULL); - shm->segment = shm_handle; - shm->info = info_handle; - shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - if (created) { - shm->descriptor->shm_perm.key = key; - shm->descriptor->shm_segsz = size; - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_cpid = getpid(); - shm->descriptor->shm_perm.mode = flags; - - shm->descriptor->shm_perm.cuid = shm->descriptor->shm_perm.cgid= 0; - shm->descriptor->shm_perm.gid = shm->descriptor->shm_perm.uid = 0; - shm->descriptor->shm_atime = shm->descriptor->shm_dtime = 0; - shm->descriptor->shm_lpid = shm->descriptor->shm_nattch = 0; - shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; - } - - if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { - CloseHandle(shm->segment); - UnmapViewOfFile(shm->descriptor); - CloseHandle(shm->info); - return -1; - } - - return key; -} - -TSRM_API void *shmat(int key, const void *shmaddr, int flags) -{ - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return (void*)-1; - } - - shm->descriptor->shm_atime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch++; - - shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - - return shm->addr; -} - -TSRM_API int shmdt(const void *shmaddr) -{ - shm_pair *shm = shm_get(0, (void*)shmaddr); - - if (!shm->segment) { - return -1; - } - - shm->descriptor->shm_dtime = time(NULL); - shm->descriptor->shm_lpid = getpid(); - shm->descriptor->shm_nattch--; - - return UnmapViewOfFile(shm->addr) ? 0 : -1; -} - -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) { - shm_pair *shm = shm_get(key, NULL); - - if (!shm->segment) { - return -1; - } - - switch (cmd) { - case IPC_STAT: - memcpy(buf, shm->descriptor, sizeof(struct shmid_ds)); - return 0; - - case IPC_SET: - shm->descriptor->shm_ctime = time(NULL); - shm->descriptor->shm_perm.uid = buf->shm_perm.uid; - shm->descriptor->shm_perm.gid = buf->shm_perm.gid; - shm->descriptor->shm_perm.mode = buf->shm_perm.mode; - return 0; - - case IPC_RMID: - if (shm->descriptor->shm_nattch < 1) { - shm->descriptor->shm_perm.key = -1; - } - return 0; - - default: - return -1; - } -} -#endif \ No newline at end of file diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h deleted file mode 100644 index 7931beafc49..00000000000 --- a/TSRM/tsrm_win32.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Daniel Beulshausen | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef TSRM_WIN32_H -#define TSRM_WIN32_H - -#include "TSRM.h" - -#ifdef TSRM_WIN32 -#include - -struct ipc_perm { - int key; - unsigned short uid; - unsigned short gid; - unsigned short cuid; - unsigned short cgid; - unsigned short mode; - unsigned short seq; -}; - -struct shmid_ds { - struct ipc_perm shm_perm; - int shm_segsz; - time_t shm_atime; - time_t shm_dtime; - time_t shm_ctime; - unsigned short shm_cpid; - unsigned short shm_lpid; - short shm_nattch; -}; - -typedef struct { - FILE *stream; - HANDLE prochnd; -} process_pair; - -typedef struct { - void *addr; - HANDLE info; - HANDLE segment; - struct shmid_ds *descriptor; -} shm_pair; - -typedef struct { - process_pair *process; - shm_pair *shm; - int process_size; - int shm_size; - char *comspec; -} tsrm_win32_globals; - -#ifdef ZTS -# define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v) -#else -# define TWG(v) (win32_globals.v) -#endif - -#endif - -#define IPC_PRIVATE 0 -#define IPC_CREAT 00001000 -#define IPC_EXCL 00002000 -#define IPC_NOWAIT 00004000 - -#define IPC_RMID 0 -#define IPC_SET 1 -#define IPC_STAT 2 -#define IPC_INFO 3 - -#define SHM_R PAGE_READONLY -#define SHM_W PAGE_READWRITE - -#define SHM_RDONLY FILE_MAP_READ -#define SHM_RND FILE_MAP_WRITE -#define SHM_REMAP FILE_MAP_COPY - - -TSRM_API void tsrm_win32_startup(void); -TSRM_API void tsrm_win32_shutdown(void); - -TSRM_API FILE *popen(const char *command, const char *type); -TSRM_API int pclose(FILE *stream); - -TSRM_API int shmget(int key, int size, int flags); -TSRM_API void *shmat(int key, const void *shmaddr, int flags); -TSRM_API int shmdt(const void *shmaddr); -TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf); - -#endif \ No newline at end of file diff --git a/Zend/ChangeLog b/Zend/ChangeLog deleted file mode 100644 index 1af3dff9f65..00000000000 --- a/Zend/ChangeLog +++ /dev/null @@ -1,8817 +0,0 @@ -2002-03-15 Andi Gutmans - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans - - * zend_execute.c: - Support importing constants. e.g.: - - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - - -2002-03-02 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise ) - -2002-01-25 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - - -2002-01-14 Sebastian Bergmann - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans - - * zend_execute.c: - Support constants. The following works now: - - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - - -2001-11-24 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-11-05 stig - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha - - * zend.h: Fix build - -2001-07-27 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor - -2000-11-02 Zeev Suraski - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans - - * zend.h: version update - -2000-06-26 Zeev Suraski - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of - -2000-06-11 Andi Gutmans - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy ) - -2000-05-22 Zeev Suraski - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans - - * zend_opcode.c: Fix order - -2000-05-17 sascha - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen - - * zend.h - zend_execute.c: - needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen - - * zend_operators.c: now - -2000-02-27 Egon Schmid - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski - - * zend_highlight.c: - Since we're highlighting code, put and around the code. - -2000-01-13 Zeev Suraski - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby - - * zend-scanner.l: build error - windows - -1999-12-04 stig - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski - - * zend.c: Make this class instanciatable - -1999-09-12 sascha - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski - - * zend_constants.c: New constants - -1999-07-22 stig - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski - - * zend.h: *** empty log message *** - -1999-05-12 stig - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff --git a/Zend/FlexLexer.h b/Zend/FlexLexer.h deleted file mode 100644 index fd652585702..00000000000 --- a/Zend/FlexLexer.h +++ /dev/null @@ -1,186 +0,0 @@ -// $Header$ - -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms with or without -// modification are permitted provided that: (1) source distributions retain -// this entire copyright notice and comment, and (2) distributions including -// binaries display the following acknowledgement: ``This product includes -// software developed by the University of California, Berkeley and its -// contributors'' in the documentation or other materials provided with the -// distribution and in all advertising materials mentioning features or use -// of this software. Neither the name of the University nor the names of -// its contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef FLEXLEXER_H -// Never included before - need to define base class. -#define FLEXLEXER_H -#include - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); - - virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -#endif diff --git a/Zend/LICENSE b/Zend/LICENSE deleted file mode 100644 index 5837d7cf3c3..00000000000 --- a/Zend/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ --------------------------------------------------------------------- - The Zend Engine License, version 2.00 -Copyright (c) 1999-2002 Zend Technologies Ltd. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. The names "Zend" and "Zend Engine" must not be used to endorse - or promote products derived from this software without prior - permission from Zend Technologies Ltd. For written permission, - please contact license@zend.com. - - 4. Zend Technologies Ltd. may publish revised and/or new versions - of the license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by Zend Technologies Ltd. No one other than Zend - Technologies Ltd. has the right to modify the terms applicable - to covered code created under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes the Zend Engine, freely available at - http://www.zend.com" - - 6. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "The Zend Engine is freely available at http://www.zend.com" - -THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND -TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - --------------------------------------------------------------------- diff --git a/Zend/Makefile.am b/Zend/Makefile.am deleted file mode 100644 index 4f73a2ac92c..00000000000 --- a/Zend/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## Process this file with automake to produce Makefile.in -*- makefile -*- - -#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output - -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libZend.la - -libZend_la_SOURCES=\ - zend_language_parser.y zend_language_scanner.l \ - zend_ini_parser.y zend_ini_scanner.l \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ - zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ - zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ - zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ - zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c - -libZend_la_LDFLAGS = -libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ - -# automake isn't too clever about "non-standard" use of lex and yacc - -$(libZend_la_OBJECTS): zend_language_parser.h - -zend_ini_scanner.lo: zend_ini_parser.h - -# Language parser/scanner rules - -zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -zend_language_parser.h: zend_language_parser.c -zend_language_parser.c: $(srcdir)/zend_language_parser.y - $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c - -# INI parser/scanner rules - -zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c - -zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l - -zend_ini_parser.h: zend_ini_parser.c - -depend: - -zend_execute.lo: $(srcdir)/zend_execute.c - $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c - diff --git a/Zend/OBJECTS2_HOWTO b/Zend/OBJECTS2_HOWTO deleted file mode 100644 index 3d942c2ed00..00000000000 --- a/Zend/OBJECTS2_HOWTO +++ /dev/null @@ -1,190 +0,0 @@ -Creating an object ------------------- - -Object can be created in the following ways: - -1. As a result of a function call. E.g.: - -$foo = create_new_foo("parameter"); -$foo->run(); - -The function should create a new zval, create new object and get the -handle for it, set handle and handler table as needed. Note that the -handle is the only ID of the object, so it should be enough to -identify it. - -2. Overriding create_object handler for class. E.g.: - -$foo = new Java("some.Class.here", "parameter"); -$foo->run(); - -The create_object handler function should create a new zval, create -new object and get the handle for it, set handle and handler table as -needed, and also provide constructor method that would handle -constructor call. The get_constructor handler table entry should be -used for that. Do not rely class entry's constructor, unless you refer -to it from get_constructor handler. - -Object maintenance ------------------- - -The handlers add_ref and del_ref are called when a new zval referring -to the object is created. This does not create a new object - both -zvals still refer to the same object. - -clone_obj handler should create a new object, identical to an old one, -but being a separate entity. - -delete_obj should destroy an object, all references to it become -invalid. - -Object access - read --------------------- - -read_property is used to read object's property. This value is not -meant to be changed. The handler returns zval * with the value. - -Object access - write ---------------------- - -write_property is used to directly write object's property by -name. This handler is used to assign property variables or to change them -in operations like += or ++ (unless get_property_zval_ptr is also set). - -get_property_zval_ptr is used to obtain pointer to modifyable zval for -operations like += or ++. This should be used only if your object model -stores properties as real zval's that can be modified from outside. -Otherwise this handler should be NULL and the engine will use -read_property and write_property instead. - -get_property_ptr is used to obtain zval ** for future writing to -it. If your object properties are stored as zval*, return real place -where the property is stored. If the aren't, the best way is to create -proxy object and handle it via get and set methods (see below). -This method is meant to be used for send-by-reference and assign-by-reference -use of object properties. If you don;t want to implement property -referencing for your objects, you can set this handler to NULL. - -get and set handlers are used when engine needs to access the object -as a value. E.g., in the following situation: - -$foo =& $obj->bar; -$foo = 1; - -if $foo is an object (e.g., proxy object from get_property_ptr) it -would be accessed using write handler. - -Object access - method call ---------------------------- - -get_method handler is used to find method description by name. It -should set right type, function name and parameter mask for the -method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be -called via call_method handler, otherwise it would be called with -standard Zend means. - -get_constructor performs the same function as get_method, but for the -object constructor. - -call_method handler is used to perform method call. Parameters are -passed like to any other Zend internal function. - -Object - comparison -------------------- - -Objects can be compared via compare_objects handler. This is used with -== operation, === compares objects by handles, i.e., return true if -and only if it's really the same object. Note that objects from -different object types (i.e., having different handlers) can not be -compared. - -Objects - reflection --------------------- - -get_class_name is used to retrieve class name of the object. No other -reflection functions are currently implemented. - -Objects - data structures and handlers ---------------------------------------- - -The object is represented by the following structure: - -struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -}; - -handle is an ID of the object among the objects of the same type (not -class!). The type of the object and how it behaves is determined by -the handler table. - -typedef struct _zend_object_handlers { - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_delete_obj_t delete_obj; - zend_object_clone_obj_t clone_obj; - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_get_property_ptr_t get_property_ptr; - zend_object_get_property_zval_ptr_t get_property_zval_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; -} zend_object_handlers; - -See zend_object_handlers.h for prototypes. All objects are passed as zval's. - -Handlers explained: - -add_ref - called when a copy of the object handle is created. - -del_ref - called when a copy of the object handle is destroyed. - -delete_obj - called when an object needs to be destroyed. - -clone_obj - called when a new object identical to an old one should be -created (unlike Zend Engine 1, this never happens unless explicitly -asked for). - -read_property - returns zval *, containing the value of the -property. Is used when value of the property should be retrieved for -reading. - -write_property - assigns value to certain property of the object. - -get_property_zval_ptr - retrieves zval** for being directly modified by -the engine. If your properties are not zval's, don't define it. - -get_property_ptr - retrieves zval** for the property of the value, to -be used for read and write. If object properties are not zval's -natively, this method should create and return proxy object for use -with get and set methods. - -get - retrieves zval* for object contents. To be used mainly with -proxy objects from get_property_ptr, but also may be used for -convert_to_* functions. - -set - sets value for object contents. To be used mainly with -proxy objects from get_property_ptr. - -has_property - checks if the object has certain property set. - -unset_property - removes value for the property of the object - -get_method - retrieves description of the method - -call_method - calls the method (parameters should be put on stack like -for any other PHP internal function). - -get_constructor - get description for the object constructor method - -get_class_name - get the name of the class the object belongs to - -compare_objects - compares if two objects are equal diff --git a/Zend/RFCs/001.txt b/Zend/RFCs/001.txt deleted file mode 100644 index bf1d847b97a..00000000000 --- a/Zend/RFCs/001.txt +++ /dev/null @@ -1,136 +0,0 @@ -Revamped object model using object handles -=========================================== - -Background ----------- - -In the Zend Engine 1.0 (and its predecessor the PHP 3 scripting -engine) the object model's design is that instantiated objects are -language values. This means that when programmers are performing -operations, such variable assignment and passing parameters to -functions, objects are handled very similarly to the way other -primitive types are handled such as integers and strings. -Semantically this means that the whole object is being copied. The -approach Java takes is different where one refers to objects by handle -and not by value (one can think of a handle as an objects' ID). - -Need ----- - -Unfortunately, the approach taken up to now has severely limited the -Zend Engine's object oriented model, both feature and simplicity -wise. One of the main problems with the former approach is that object -instantiation and duplication is very hard to control, a problem which -can not only lead to inefficient development but also often to strange -run-time behavior. Changing the object model to a handle oriented -model will allow the addressing of many needs such as destructors, -de-referencing method return values, tight control of object -duplication and more. - -Overview --------- - -The proposed object model is very much influenced by the Java -model. In general, when you create a new object you will be getting a -handle to the object instead of the object itself. When this handle is -sent to functions, assigned and copied it is only the handle which is -copied/sent/assigned. The object itself is never copied nor -duplicated. This results in all handles of this object to always point -at the same object making it a very consistent solution and saving -unnecessary duplication and confusing behavior. - -Functionality -------------- - -After this change the basic use of objects will be almost identical to -previous versions of the scripting engine. However, you won't bump -into awkward and confusing copying & destructing of objects. In order -to create and use a new object instance you will do the following: -$object = new MyClass(); $object->method(); - -The previous code will assign $object the handle of a new instance of -the class MyClass and call one of its methods. - - -Consider the following code: - -1 class MyClass -2 { -3 function setMember($value) -4 { -5 $this->member = $value; -6 } -7 -8 function getMember() -9 { -10 return $this->member; -11 } -12 } -13 -14 function foo($obj) -15 { -16 $obj->setMember("foo"); -17 } -18 -19 $object = new MyClass(); -20 $object->setMember("bar"); -21 foo($object); -22 print $object->getMember(); - -Without the new Java-like handles, at line 20 the objects' data member -member is set to the string value of "bar". Because of the internal -representation of objects in the Zend Engine 1.0, the object is marked -as a reference, and when it is sent by value to the function foo, it -is duplicated (!). Therefore, the call to foo() on line 21 will -result in the $obj->setMember("foo") call being called on a duplicate -of $object. Line 22 will then result in "bar" being printed. - -This is how the scripting engine has worked until today. Most -developers are probably unaware of the fact that they aren't always -talking to the same object but often duplicates; others may have -realized this can usually be solved by always passing objects by -reference (unless a replica is actually desired, which is uncommon). - -The new object model will allow for a much more intuitive -implementation of the code. On line 21, the object's handle (ID) is -passed to foo() by value. Inside foo(), the object is fetched -according to this handle and, therefore, the setMember() method is -called on the originally instantiated object and not a copy. Line 22 -will therefore result in "foo" being printed. This approach gives -developers tighter control of when objects are created and duplicated. -An additional not-as-important benefit is that the object handle will -be passed to foo() by value, which most probably will also save -unnecessary duplication of the value containing the ID itself and thus -additionally improving run-time performance. - -This was just a simple description of why the new object model solves -awkward behavior and makes object handling much easier, intuitive and -efficient. The importance of this change goes far beyond what is -mentioned in this section as you will see in further sections which -describe new features with a majority of them being based on this -change. - -Compatibility Notes --------------------- - -Many PHP programmers aren't even aware of the copying quirks of the -current object model and, therefore, there is a relatively good chance -that the amount of PHP applications that will work out of the box or -after a very small amount of modifications would be high. - -To simplify migration, version 2.0 will support an optional -'auto-clone' feature, which will perform a cloning of the object -whenever it would have been copied in version 1.0. Optionally, it -will also be possible to request that the engine will emit an E_NOTICE -message whenever such an automatic clone occurs, in order to allow -developers to gradually migrate to the version 2.0-style behavior -(without automatic clones). - -Dependencies ------------- - -The new object model is not dependent on other features. Many of the -other Zend Engine 2.0 features, such as the $foo->bar()->barbara() -syntax, destructors and others completely rely on this new object -model. - diff --git a/Zend/RFCs/002.txt b/Zend/RFCs/002.txt deleted file mode 100644 index 263c4116c92..00000000000 --- a/Zend/RFCs/002.txt +++ /dev/null @@ -1,169 +0,0 @@ -Title: Zend 2.0 Namespaces -Version: $Revision$ -Status: draft -Maintainer: Stig S. Bakken -Created: 2001-09-08 -Modified: 2001-09-08 - - -1. Background/Need -================== - -PHP and Zend 1.0 have come to a point where a lot of reusable code is -being written; from simple functions and classes to entire application -frameworks. It is becoming increasingly difficult to avoid symbol -name collisions with the current scoping methods. - -The symbol scopes available in Zend 1.0 are the global scope, the -class scope and the function scope. All scopes but classes may -contain variables, only the class and global scopes may contain -functions, while only the global scope may contain constants and -classes. This means that all of Zend 1.0's scoping methods are -inherently limited for solving symbol name collision problems. - - -2. Overview -=========== - -Namespaces in Zend 2.0 provide a way to manage the symbol collision -problem by making it possible to define multiple symbol tables able to -contain all types of symbols. Zend will get the notion of a current -namespace, defaulting to the current global one. The current name -space may be changed on a file-by-file basis. Symbols in other name -spaces than the current one may be referenced using a new namespace -operator. It will be possible to "import" symbols from one namespace -into another. - - -3. Functionality -================ - -3.1. Namespace Syntax -===================== - -The namespace operator ":" is used to refer to symbols in other -namespaces than the current one: - -Class: Namespace:class -Function: Namespace:function -Static method: Namespace:class::method -Variable: $Namespace:variable -Constant: Namespace:CONSTANT -Class variable: $Namespace:class::variable - -To refer to symbols in the global namespace, symbols are prefixed with -only the namespace operator: - -Class: :class -Function: :function -Static method: :class::method -Variable: $:variable -Constant: :CONSTANT -Class variable: $:class::variable - -Note: $:variable will effectively be just another syntax for -$GLOBALS['variable']. - -A namespace may have a name containing a ":", it is always the last -":" character in the symbol qualifier that is the actual namespace -operator: - -Class: Name:Space:class -Function: Name:Space:function -Static method: Name:Space:class::method -Variable: $Name:Space:variable -Constant: Name:Space:CONSTANT -Class variable: $Name:Space:class::variable - -(Here, the ":" between "Name" and "Space" is part of the name, it is -the one after "Space" that is the namespace operator.) - - -3.2. Defining Namespaces -======================== - -Individual files may define a namespace that will apply to the entire -file. If no "namespace" operator occurs in the file, it will be in -the global namespace: - - 1 namespace HTML; - 2 - 3 class Form { - 4 function Form() { - 5 // constructor - 6 } - 7 // ... - 8 } - -Or with the "nested" name syntax: - - 1 namespace HTML:Form; - 2 - 3 class Image { - 4 var $src; - 5 function Image($src) { - 6 $this->src = $src; - 7 } - 8 // ... - 9 } - -Code executed within the "HTML" namespace may refer to the Form class -as just "Form". Code executed from within other namespaces has to -refer to it as "HTML:Form". The "namespace" statement must occur -before any other statements in the file. - -# [ssb 2001-09-08]: -# Should it be possible to "add" symbols to a namespace by including a -# second file with the same namespace statement? - - -3.3. Importing Symbols -====================== - -It is possible to import symbols from another namespace into the -current one with the "import" statement: - - import * from HTML; // all symbols - - import Form from HTML; // single symbols - - import Form,Table from HTML; // multiple symbols - -There is a potential for name clashes between symols of different -types that have the same qualifier syntax. These are resolved in this -order: class, function, constant. - -Optionally, the symbol type may be explicitly given to import (as -"class", "function", "variable" or "constant"): - - import class Form from HTML; - -And finally, you may import all symbols of a given type: - - import constant * from HTML:Table; - -The namespace with its symbols must already be defined before using -"import". - - -4. Compatibility Notes -====================== - -Old code that does not take advantage of namespaces will run without -modifications. - - -5. Dependencies -=============== - -The class variable syntax depends on this class variables being -implemented in the new ZE2 object model. - - -6. Acknowledgements -=================== - -Andi Gutmans and Zeev Suraski for -initial ZE2 namespaces proposal - -Dean Hall for the initial symbol qualification syntax diff --git a/Zend/RFCs/003.txt b/Zend/RFCs/003.txt deleted file mode 100644 index aa90691b196..00000000000 --- a/Zend/RFCs/003.txt +++ /dev/null @@ -1,72 +0,0 @@ -Title: Loose type requirements for functions -Version: $Revision$ -Status: draft -Maintainer: Brian Moon -Created: 2001-09-17 -Modified: 2001-09-17 - - -1. Background/Need -================== - -Many internal function of PHP will reject parameters because of their -type (the array and variable function come to mind). For userland -this is not an easy task as there is no uniform way to do it. An -addition to the engine for requiring loose types would allow -delevopers to know that the data passed to their functions is of the -correct type and reduce the need for duplicating the same code in -every function to check for the type of data. - - -2. Overview -=========== - -Loose typing mostly means evaluating the contents of the variable and -not the type of the variable itself. The requirements for this would -and should work much like several of the is_* functions do now. - -The typing of parameters would be optional and those not typed would -simply continue to be treated as they are now. - -3. Functionality -================ - -3.1. Allowed Types -================== - -Only loose types should be needed to ensure the data is usable by the -function. Duplicating the functionallity of is_scalar, is_resource, -is_array and is_object should give developers all the information they -need to use a variable correctly. - -3.2. Syntax -=========== - -The current function syntax should be expanded to allow typing of -variables inline in a C style. - -function foo ($var){ -} - -could be changed to require an array such as: - -function foo (array $var){ -} - -3.3. Errors -=========== - -Mis-matches in type should be reported as fatal errors and should halt -the execution of a script as that function can not be run and code -following could not reliably run. - - -4. Compatibility Notes -====================== - -Old code that does not take advantage of this will run without -modifications. - - - - diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES deleted file mode 100644 index ffc4149f34f..00000000000 --- a/Zend/ZEND_CHANGES +++ /dev/null @@ -1,641 +0,0 @@ -Changes in the Zend Engine 2.0 - - * New Object Model. - - The Zend Engine's handling of objects has been completely - changed in order to allow for new features, but also to increase - its performance. - - Objects were handled in previous versions like primitive types - (for instance integers and strings). The drawback of this method - is, that semantically the whole object was copied when a - variable was assigned or parameters were passed to a method. The - new approach refers to objects by handle and not by value (one - can think of a handle as an object's ID). - - Many PHP programmers aren't even aware of the copying quirks of - the old object model and, therefore, there is a relatively good - chance that the amount of PHP applications that will work out of - the box or after a very small amount of modifications would be - high. - - [Not sure if the following will be implemented after all] - To simplify migration, the Zend Engine 2.0 supports an optional - 'auto-clone' feature, which performs a cloning of the object - whenever it would have been copied in the Zend Engine 1.0. - Optionally, it emits an E_NOTICE message whenever such an - automatic clone occurs, in order to allow developers to - gradually migrate to the behavior of the Zend Engine 2 (without - automatic clones). - - * Private Members. - - The Zend Engine 2.0 introduces private member variables. Note - that for performance reasons no error message is emitted in - case of an illegal access to a private member variable. - - Example: - - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - - * Object Cloning. - - The Zend Engine 1.0 offered no way a user could decide what copy - constructor to run when an object is duplicated. During - duplication, the Zend Engine 1.0 did a bitwise copy making an - identical replica of all the object's properties. - - Creating a copy of an object with fully replicated properties is - not always the wanted behavior. A good example of the need for - copy constructors, is if you have an object which represents a - GTK window and the object holds the resource of this GTK window, - when you create a duplicate you might want to create a new - window with the same properties and have the new object hold the - resource of the new window. Another example is if your object - holds a reference to another object which it uses and when you - replicate the parent object you want to create a new instance of - this other object so that the replica has its own separate copy. - - An object copy is created by calling the object's __clone() - method. - - Example: - - __clone(); - ?> - - When the developer asks to create a new copy of an object, the - Zend Engine will check if a __clone() method has been defined or - not. If not, it will call a default __clone() which will copy - all of the object's properties. If a __clone() method is - defined, then it will be responsible to set the necessary - properties in the created object. For convenience, the engine - will supply a function that imports all of the properties from - the source object, so that they can start with a by-value - replica of the source object, and only override properties that - need to be changed. [The function hasn't been implemented yet] - - Example: - - id = self::$id++; - } - - function __clone() { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - $obj = new MyCloneable(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id . "\n"; - - $obj = $obj->__clone(); - - print $obj->id . "\n"; - print $obj->name . "\n"; - print $obj->address . "\n"; - ?> - - * Forced deletion of objects. - - The Zend Engine 1.0 had no means to force deletion of an object - if there are still references to it. The newly introduced delete - statement calls the object's destructor and frees it even if the - object is referenced by some other places in the engine. Other - references to the deleted object become stale and trying to - access them results in a fatal error. - - Note that if you have a user-defined function delete() in an old - script, this script will yield a parser error with the Zend - Engine 2.0, since 'delete' is now a reserved word. - - * Namespaces. - - The Zend Engine 1.0 provided only three scopes: the global - scope, the class scope and the function scope. All scopes but - classes could contain variables, only the class and global - scopes could contain functions, while only the global scope - could contain constants and classes. This means that all of the - Zend Engine 1.0's scoping methods were inherently limited for - solving symbol name collision problems. - - The Zend Engine 2.0 introduces the concept of namespaces to - manage the symbol collision problem by making it possible to - define multiple symbol tables able to contain all types of - symbols. The Zend Engine is aware of a current namespace, - defaulting to the current global one. The current namespace may - be changed on a file-by-file basis. Symbols in other namespaces - than the current one may be referenced using a new namespace - operator. - - Namespaces and classes are the same with the Zend Engine 2.0, - except that you can't instantiate a namespace with "new". This - essentially also makes a class a namespace, so the scoping rules - for namespaces apply for classes. Some of the consequences of - this are: [Not finalized. Right now we basically have nested - classes so you can instantiate any nested class] - - * Classes may contain classes. - - Example: - - host' as $user\n"; - } - } - - class DB::Oracle { - var $host = "localhost"; - - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } - } - - $MySQL_obj = new DB::MySQL(); - $MySQL_obj->db_connect("Susan"); - - $Oracle_obj = new DB::Oracle(); - $Oracle_obj->db_connect("Barbara"); - ?> - - * Classes may contain constants. - - Example: - - - - * Current namespace's symbol tables are searched first for - constants and functions. - - Example: - - The following code prints "foobar", not "foo", because - the class constant overrides the "global" constant of - the same name. - - - - * In the scope of a function, the current namespace is that - of the containing class/namespace. - - Example: - - bar(); - bar(); - } - - function bar() { - print "foobar\n"; - } - } - - $obj = new FooClass; - $obj->foo(); - $obj->foo(); - ?> - - This prints "foobar" two times, since a bar() method exists - in the current namespace. - - * It is possible to "import" symbols from one namespace into - another. - - Example: - - - - Example: - - - - Example: - - - - Old code that does not take advantage of namespaces will run - without modifications. - - * Unified Constructors. - - The Zend Engine allows developers to declare constructor methods - for classes. Classes which have a constructor method call this - method on each newly-created object, so it is suitable for any - initialization that the object may need before it can be used. - - With the Zend Engine 1.0, constructor methods were class methods - that had the same name as the class itself. Since it is very - common to call parent constructors from derived classes, the way - the Zend Engine 1.0 worked made it a bit cumbersome to move - classes around in a large class hierarchy. If a class is moved - to reside under a different parent, the constructor name of that - parent changes as well, and the code in the derived class that - calls the parent constructor has to be modified. - - The Zend Engine 2.0 introduces a standard way of declaring - constructor methods by calling them by the name __construct(). - - Example: - - - - For backwards compatibility, if the Zend Engine 2.0 cannot find - a __construct() function for a given class, it will search for - the old-style constructor function, by the name of the class. - Effectively, it means that the only case that would have - compatibility issues is if the class had a method named - __construct() which was used for different semantics. - - * Destructors. - - Having the ability to define destructors for objects can be very - useful. Destructors can log messages for debugging, close - database connections and do other clean-up work. - - No mechanism for object destructors existed in the Zend Engine - 1.0, although PHP had already support for registering functions - which should be run on request shutdown. - - The Zend Engine 2.0 introduces a destructor concept similar to - that of other object-oriented languages, such as Java: When the - last reference to an object is destroyed the object's - destructor, which is a class method name __destruct() that - recieves no parameters, is called before the object is freed - from memory. - - Example: - - name = "MyDestructableClass"; - } - - function __destruct() { - print "Destroying " . $this->name . "\n"; - } - } - - $obj = new MyDestructableClass(); - ?> - - Like constructors, parent destructors will not be called - implicitly by the engine. In order to run a parent destructor, - one would have to explicitly call parent::__destruct() in the - destructor body. - - * Exceptions. - - The Zend Engine 1.0 had no exception handling. The Zend Engine 2.0 - introduces a exception model similar to that of other programming - languages. - - Example: - - exception = $exception; - } - - function Display() { - print "MyException: $this->exception\n"; - } - } - - class MyExceptionFoo extends MyException { - function __construct($exception) { - $this->exception = $exception; - } - - function Display() { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } - - catch (MyException $exception) { - $exception->Display(); - } - ?> - - Old code that has no user-defined functions 'catch', 'throw' and - 'try' will run without modifications. - - * Derefencing objects returned from functions. - - Example: - - draw(); - ShapeFactoryMethod("Square")->draw(); - ?> - - * Static member variables of static classes can now be - initialized. - - Example: - - - - * Supporting default values for by-reference function parameters. - - Example: - - - - -Changes in the Zend Engine 1.0 - - The Zend Engine was designed from the ground up for increased speed, - reduced memory consumption and more reliable execution. We dare say - it meets all of these goals and does so pretty well. Beyond that, - there are several improvements in the language engine features: - - * References support. - - $foo = &$a; would make $foo and $a be two names to the same - variable. This works with arrays as well, on either side; e.g., - $foo = &$a[7]; would make $foo and $a[7] be two names to the - same variable. Changing one would change the other and vice - versa. - - * Object overloading support. - - This feature allows various OO libraries to use the OO notation - of PHP to access their functionality. Right now, no use is made - of that feature, but we'd have a COM module ready by the time - PHP 4.0 is released. A CORBA module would probably follow. - - * include() and eval() are now functions, and not statements. - - That means they return a value. The default return value from - include() and eval() is 1, so that you can do if (include()) - without further coding. The return value may be changed by - returning a value from the global scope of the included file or - the evaluated string. For example, if 'return 7;' is executed in - the global scope of foo.inc, include("foo.inc") would evaluate - to 7. - - * Automatic resource deallocation. - - Several people have been bitten by the fact that PHP 3.0 had no - concept of reference counting. The Zend Engine adds full - reference counting for every value in the system, including - resources. As soon as a resource is no longer referenced from - any variable, it is automatically destroyed to save memory and - resources. The most obvious example for the advantage in this is - a loop that has an SQL query inside it, something like '$result - = sql_query(...);'. In PHP 3.0, every iteration resulted in - another SQL result-set allocated in the memory, and all of the - result sets weren't destroyed until the end of the script's - execution. With the Zend Engine, as soon as we overwrite an old - result set with a new one, the old result set which is no longer - referenced, is destroyed. - - * Full support for nesting arrays and objects within each other, - in as many levels as you want. - - * true and false are now constants of type boolean. - - Comparing any other value to them would convert that value to a - boolean first, and conduct the comparison later. That means, for - example, that 5==true would evaluate to true (in PHP 3.0, true - was nothing but a constant for the integer value of 1, so - 5==true was identical to 5==1, which was false). - - * Runtime binding of function names. - - This complex name has a simple explanation - you can now call - functions before they're declared! - - * Added here-docs support. - - * Added foreach. - - Two syntaxes supported: - - foreach(array_expr as $val) statement - foreach(array_expr as $key => $val) statement - - * A true unset() implementation. - - A variable or element that is unset(), is now sent to oblivion - in its entirely, no trace remains from it. - - * Output buffering support. - - Use ob_start() to begin output buffering, ob_end_flush() to end - buffering and send out the buffered contents, ob_end_clean() to - end buffering without sending the buffered contents, and - ob_get_contents() to retreive the current contents of the output - buffer. Header information (header(), content type, cookies) are - not buffered. By turning on output buffering, you can - effectively send header information all throughout your file, - regardless of whether you've emitted body output or not. - - * Full variable reference within quoted strings: - - ${expr} - full indirect reference support for scalar - variables - {variable} - full variable support - - For example: - - $foo[5]["bar"] = "foobar"; - print "{$foo[5]["bar"]}"; // would print "foobar" - - * Ability to call member functions of other classes from within - member functions or from the global scope. - - You can now, for example, override a parent function with a - child function, and call the parent function from it. - - * Runtime information for classes (class name, parent, available - functions, etc.). - - * Much more efficient syntax highlighter - runs much quicker, - performs more reliably, and generates much tighter HTML. - - * A full-featured debugger has been integrated with the language - (supports breakpoints, expression evaluation, step-in/over, - function call backtrace, and more). - - The Zend Engine claims 100% compatability with the engine of PHP - 3.0, and is shamelessly lying about it. Here's why: - - * Static variable initializers only accept scalar values - (in PHP 3.0 they accepted any valid expression). The impact - should be somewhere in between void and non existent, since - initializing a static variable with anything but a simple - static value makes no sense at all. - - * The scope of break and continue is local to that of an - include()'d file or an eval()'d string. The impact should - be somewhat smaller of the one above. - - * The return statement no longer works from a require()'d file. It - hardly worked in PHP 3.0, so the impact should be fairly small. If - you want this functionality - use include() instead. - - * unset() is no longer a function, but a statement. - - * The following letter combination is not supported within - encapsulated strings: "{$". If you have a string that includes - this letter combination, for example, print "{$somevar"; (which - printed the letter { and the contents of the variable $somevar in - PHP 3.0), it will result in a parse error with the Zend Engine. - In this case, you would have to change the code to print - "\{$somevar"; This incompatability is due to the full variable - reference within quoted strings feature added in the Zend - Engine. diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp deleted file mode 100644 index 03a7bd73e25..00000000000 --- a/Zend/Zend.dsp +++ /dev/null @@ -1,506 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Zend" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=Zend - Win32 Release_inline -!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 "Zend.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 "Zend.mak" CFG="Zend - Win32 Release_inline" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Zend - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "Zend - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "Zend - Win32 Release_inline" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Zend - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDebug" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x40d /d "NDebug" -# ADD RSC /l 0x40d /d "NDebug" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "Zend - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug" /D "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_Debug" -# ADD RSC /l 0x40d /d "_Debug" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Zend___Win32_Release_inline" -# PROP BASE Intermediate_Dir "Zend___Win32_Release_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release_inline" -# PROP Intermediate_Dir "Release_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x40d /d "NDebug" -# ADD RSC /l 0x40d /d "NDebug" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "Zend - Win32 Release" -# Name "Zend - Win32 Debug" -# Name "Zend - Win32 Release_inline" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zend.c -# End Source File -# Begin Source File - -SOURCE=.\zend_alloc.c -# End Source File -# Begin Source File - -SOURCE=.\zend_API.c -# End Source File -# Begin Source File - -SOURCE=.\zend_builtin_functions.c -# End Source File -# Begin Source File - -SOURCE=.\zend_compile.c -# End Source File -# Begin Source File - -SOURCE=.\zend_constants.c -# End Source File -# Begin Source File - -SOURCE=.\zend_execute.c -# End Source File -# Begin Source File - -SOURCE=.\zend_execute_API.c -# End Source File -# Begin Source File - -SOURCE=.\zend_extensions.c -# End Source File -# Begin Source File - -SOURCE=.\zend_hash.c -# End Source File -# Begin Source File - -SOURCE=.\zend_highlight.c -# End Source File -# Begin Source File - -SOURCE=.\zend_indent.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_parser.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_scanner.c -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.c" -# End Source File -# Begin Source File - -SOURCE=".\zend_language_scanner.c" -# End Source File -# Begin Source File - -SOURCE=.\zend_list.c -# End Source File -# Begin Source File - -SOURCE=.\zend_llist.c -# End Source File -# Begin Source File - -SOURCE=.\zend_objects.c -# End Source File -# Begin Source File - -SOURCE=.\zend_opcode.c -# End Source File -# Begin Source File - -SOURCE=.\zend_operators.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ptr_stack.c -# End Source File -# Begin Source File - -SOURCE=.\zend_qsort.c -# End Source File -# Begin Source File - -SOURCE=.\zend_sprintf.c -# End Source File -# Begin Source File - -SOURCE=.\zend_stack.c -# End Source File -# Begin Source File - -SOURCE=.\zend_variables.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\FlexLexer.h -# End Source File -# Begin Source File - -SOURCE=.\zend.h -# End Source File -# Begin Source File - -SOURCE=.\zend_alloc.h -# End Source File -# Begin Source File - -SOURCE=.\zend_API.h -# End Source File -# Begin Source File - -SOURCE=.\zend_builtin_functions.h -# End Source File -# Begin Source File - -SOURCE=.\zend_compile.h -# End Source File -# Begin Source File - -SOURCE=.\zend_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\zend_constants.h -# End Source File -# Begin Source File - -SOURCE=.\zend_errors.h -# End Source File -# Begin Source File - -SOURCE=.\zend_execute.h -# End Source File -# Begin Source File - -SOURCE=.\zend_extensions.h -# End Source File -# Begin Source File - -SOURCE=.\zend_fast_cache.h -# End Source File -# Begin Source File - -SOURCE=.\zend_globals.h -# End Source File -# Begin Source File - -SOURCE=.\zend_hash.h -# End Source File -# Begin Source File - -SOURCE=.\zend_highlight.h -# End Source File -# Begin Source File - -SOURCE=.\zend_indent.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ini.h -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.h" -# End Source File -# Begin Source File - -SOURCE=".\zend_language_scanner.h" -# End Source File -# Begin Source File - -SOURCE=.\zend_list.h -# End Source File -# Begin Source File - -SOURCE=.\zend_llist.h -# End Source File -# Begin Source File - -SOURCE=.\zend_modules.h -# End Source File -# Begin Source File - -SOURCE=.\zend_operators.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ptr_stack.h -# End Source File -# Begin Source File - -SOURCE=.\zend_qsort.h -# End Source File -# Begin Source File - -SOURCE=.\zend_stack.h -# End Source File -# Begin Source File - -SOURCE=.\zend_variables.h -# End Source File -# End Group -# Begin Group "Parsers" - -# PROP Default_Filter "y" -# Begin Source File - -SOURCE=.\zend_ini_parser.y - -!IF "$(CFG)" == "Zend - Win32 Release" - -!ELSEIF "$(CFG)" == "Zend - Win32 Debug" - -# Begin Custom Build -InputDir=. -InputPath=.\zend_ini_parser.y - -BuildCmds= \ - bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y - -"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.y" - -!IF "$(CFG)" == "Zend - Win32 Release" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Debug" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_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=.\flex.skl -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_scanner.l - -!IF "$(CFG)" == "Zend - Win32 Release" - -!ELSEIF "$(CFG)" == "Zend - Win32 Debug" - -# Begin Custom Build -InputPath=.\zend_ini_scanner.l - -"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=".\zend_language_scanner.l" - -!IF "$(CFG)" == "Zend - Win32 Release" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Debug" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ZEND_BUGS -# End Source File -# Begin Source File - -SOURCE=.\ZEND_CHANGES -# End Source File -# Begin Source File - -SOURCE=.\ZEND_TODO -# End Source File -# End Group -# Begin Group "Resources" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\zend.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 deleted file mode 100644 index 409c0408338..00000000000 --- a/Zend/Zend.m4 +++ /dev/null @@ -1,202 +0,0 @@ -dnl -dnl $Id$ -dnl -dnl This file contains Zend specific autoconf functions. -dnl - -AC_DEFUN(LIBZEND_BISON_CHECK,[ - -if test "$YACC" != "bison -y"; then - AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.) -else - AC_MSG_CHECKING(bison version) - set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'` - if test "${1}" = "1" -a "${2}" -lt "28"; then - AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).) - fi - AC_MSG_RESULT(${1}.${2} (ok)) -fi - -]) - -AC_DEFUN(LIBZEND_BASIC_CHECKS,[ - -AC_REQUIRE([AC_PROG_YACC]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_CC_C_O]) -AC_REQUIRE([AC_PROG_LEX]) -AC_REQUIRE([AC_HEADER_STDC]) -AC_REQUIRE([AC_PROG_LIBTOOL]) - -LIBZEND_BISON_CHECK - -dnl Ugly hack to get around a problem with gcc on AIX. -if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \ - "`uname -sv`" = "AIX 4"; then - CFLAGS=`echo $CFLAGS | sed -e 's/-g//'` -fi - -dnl Hack to work around a Mac OS X cpp problem -dnl Known versions needing this workaround are 5.3 and 5.4 -if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then - CPPFLAGS="$CPPFLAGS -traditional-cpp" -fi - -AC_CHECK_HEADERS( -limits.h \ -malloc.h \ -string.h \ -unistd.h \ -stdarg.h \ -sys/types.h \ -sys/time.h \ -signal.h \ -unix.h \ -dlfcn.h) - -AC_TYPE_SIZE_T -AC_TYPE_SIGNAL - -AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"]) -AC_CHECK_FUNC(dlopen,[AC_DEFINE(HAVE_LIBDL, 1,[ ])]) - -dnl -dnl Ugly hack to check if dlsym() requires a leading underscore in symbol name. -dnl -AC_MSG_CHECKING([whether dlsym() requires a leading underscore in symbol names]) -_LT_AC_TRY_DLOPEN_SELF([ - AC_MSG_RESULT(no) -], [ - AC_MSG_RESULT(yes) - AC_DEFINE(DLSYM_NEEDS_UNDERSCORE, 1, [Define if dlsym() requires a leading underscore in symbol names. ]) -], [ - AC_MSG_RESULT(no) -], []) - -dnl This is required for QNX and may be some BSD derived systems -AC_CHECK_TYPE( uint, unsigned int ) -AC_CHECK_TYPE( ulong, unsigned long ) - - -dnl Checks for library functions. -AC_FUNC_VPRINTF -AC_FUNC_MEMCMP -AC_FUNC_ALLOCA -AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass) -AC_ZEND_BROKEN_SPRINTF - -AC_CHECK_FUNCS(finite isfinite isinf isnan) - -ZEND_FP_EXCEPT - -]) - - - - - -AC_DEFUN(LIBZEND_ENABLE_DEBUG,[ - -AC_ARG_ENABLE(debug, -[ --enable-debug Compile with debugging symbols],[ - ZEND_DEBUG=$enableval -],[ - ZEND_DEBUG=no -]) - -]) - - - - - - - - - - - - -AC_DEFUN(LIBZEND_OTHER_CHECKS,[ - -AC_ARG_ENABLE(experimental-zts, -[ --enable-experimental-zts This will most likely break your build],[ - ZEND_EXPERIMENTAL_ZTS=$enableval -],[ - ZEND_EXPERIMENTAL_ZTS=no -]) - -AC_ARG_ENABLE(inline-optimization, -[ --enable-inline-optimization If you have much memory and are using - gcc, you might try this.],[ - ZEND_INLINE_OPTIMIZATION=$enableval -],[ - ZEND_INLINE_OPTIMIZATION=no -]) - -AC_ARG_ENABLE(memory-limit, -[ --enable-memory-limit Compile with memory limit support. ], [ - ZEND_MEMORY_LIMIT=$enableval -],[ - ZEND_MEMORY_LIMIT=no -]) - -AC_MSG_CHECKING(whether to enable experimental ZTS) -AC_MSG_RESULT($ZEND_EXPERIMENTAL_ZTS) - -AC_MSG_CHECKING(whether to enable inline optimization for GCC) -AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION) - -AC_MSG_CHECKING(whether to enable a memory limit) -AC_MSG_RESULT($ZEND_MEMORY_LIMIT) - -AC_MSG_CHECKING(whether to enable Zend debugging) -AC_MSG_RESULT($ZEND_DEBUG) - -if test "$ZEND_DEBUG" = "yes"; then - AC_DEFINE(ZEND_DEBUG,1,[ ]) - echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g" - if test "$CFLAGS" = "-g -O2"; then - CFLAGS=-g - fi - test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall" - test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \ - DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations" -else - AC_DEFINE(ZEND_DEBUG,0,[ ]) -fi - -test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" - -if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then - AC_DEFINE(ZTS,1,[ ]) - CFLAGS="$CFLAGS -DZTS" - LIBZEND_CPLUSPLUS_CHECKS -fi - -if test "$ZEND_MEMORY_LIMIT" = "yes"; then - AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit]) -else - AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit]) -fi - - -changequote({,}) -if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then - INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//` -else - INLINE_CFLAGS="$CFLAGS" -fi -changequote([,]) - -AC_C_INLINE - -AC_SUBST(INLINE_CFLAGS) - -]) - - -AC_DEFUN(LIBZEND_CPLUSPLUS_CHECKS,[ - -]) - diff --git a/Zend/ZendCore.dep b/Zend/ZendCore.dep deleted file mode 100644 index 39a5c0fb0b4..00000000000 --- a/Zend/ZendCore.dep +++ /dev/null @@ -1,258 +0,0 @@ -# Microsoft Developer Studio Generated Dependency File, included by ZendCore.mak - -.\zend_alloc.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - - -.\alloca.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_config.w32.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_compile.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_modules.h"\ - ".\zend_operators.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_API.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - - -.\zend_constants.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend_constants.h"\ - ".\zend_operators.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_execute.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_constants.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_modules.h"\ - ".\zend_operators.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_API.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - - -.\zend_highlight.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_execute.h"\ - ".\zend_highlight.h"\ - ".\zend_llist.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_language_parser.tab.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - - -.\zend_llist.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend_llist.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_opcode.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_modules.h"\ - ".\zend_operators.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_API.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - - -.\zend_operators.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_operators.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - - -.\zend_ptr_stack.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend_ptr_stack.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_stack.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend_stack.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_variables.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_constants.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_modules.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_API.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - ".\zend_list.h"\ - - -.\zend.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend_operators.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_API.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_compile.h"\ - ".\zend_config.w32.h"\ - ".\zend_constants.h"\ - ".\zend_execute.h"\ - ".\zend_llist.h"\ - ".\zend_modules.h"\ - ".\zend_operators.h"\ - ".\zend_ptr_stack.h"\ - ".\zend_stack.h"\ - ".\zend_variables.h"\ - ".\zend.h"\ - ".\zend_API.h"\ - ".\zend_errors.h"\ - ".\zend_globals.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - ".\zend_list.h"\ - - -.\zend_hash.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_config.w32.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - - -.\zend_ini.c : \ - "..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\ - ".\zend_alloc.h"\ - ".\zend_config.w32.h"\ - ".\zend.h"\ - ".\zend_errors.h"\ - ".\zend_hash.h"\ - ".\zend_ini.h"\ - - -!IF "$(CFG)" == "ZendCore - Win32 Release" - -!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug" - -!ENDIF - -!IF "$(CFG)" == "ZendCore - Win32 Release" - -!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug" - -!ENDIF - -!IF "$(CFG)" == "ZendCore - Win32 Release" - -!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug" - -!ENDIF - -!IF "$(CFG)" == "ZendCore - Win32 Release" - -!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug" - -!ENDIF - diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp deleted file mode 100644 index d69cfa3e6b8..00000000000 --- a/Zend/ZendTS.dsp +++ /dev/null @@ -1,667 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ZendTS" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=ZendTS - Win32 Release_TSDbg -!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 "ZendTS.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 "ZendTS.mak" CFG="ZendTS - Win32 Release_TSDbg" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ZendTS - Win32 Release_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "ZendTS - Win32 Debug_TS" (based on "Win32 (x86) Static Library") -!MESSAGE "ZendTS - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library") -!MESSAGE "ZendTS - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ZendTS - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDebug_TS" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x40d /d "NDebug_TS" -# ADD RSC /l 0x40d /d "NDebug_TS" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug_TS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_Debug_TS" -# ADD RSC /l 0x40d /d "_Debug_TS" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "ZendTS___Win32_Release_TS_inline" -# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TS_inline" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release_TS_inline" -# PROP Intermediate_Dir "Release_TS_inline" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x40d /d "NDebug_TS" -# ADD RSC /l 0x40d /d "NDebug_TS" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "ZendTS___Win32_Release_TSDbg" -# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TSDbg" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release_TSDbg" -# PROP Intermediate_Dir "Release_TSDbg" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x40d /d "NDebug_TS" -# ADD RSC /l 0x40d /d "NDebug_TS" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "ZendTS - Win32 Release_TS" -# Name "ZendTS - Win32 Debug_TS" -# Name "ZendTS - Win32 Release_TS_inline" -# Name "ZendTS - Win32 Release_TSDbg" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zend.c -# End Source File -# Begin Source File - -SOURCE=.\zend_alloc.c -# End Source File -# Begin Source File - -SOURCE=.\zend_API.c -# End Source File -# Begin Source File - -SOURCE=.\zend_builtin_functions.c -# End Source File -# Begin Source File - -SOURCE=.\zend_compile.c -# End Source File -# Begin Source File - -SOURCE=.\zend_constants.c -# End Source File -# Begin Source File - -SOURCE=.\zend_dynamic_array.c -# End Source File -# Begin Source File - -SOURCE=.\zend_execute.c -# End Source File -# Begin Source File - -SOURCE=.\zend_execute_API.c -# End Source File -# Begin Source File - -SOURCE=.\zend_extensions.c -# End Source File -# Begin Source File - -SOURCE=.\zend_hash.c -# End Source File -# Begin Source File - -SOURCE=.\zend_highlight.c -# End Source File -# Begin Source File - -SOURCE=.\zend_indent.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_parser.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_scanner.c -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.c" -# End Source File -# Begin Source File - -SOURCE=.\zend_language_scanner.c -# End Source File -# Begin Source File - -SOURCE=.\zend_list.c -# End Source File -# Begin Source File - -SOURCE=.\zend_llist.c -# End Source File -# Begin Source File - -SOURCE=.\zend_object_handlers.c -# End Source File -# Begin Source File - -SOURCE=.\zend_objects.c -# End Source File -# Begin Source File - -SOURCE=.\zend_opcode.c -# End Source File -# Begin Source File - -SOURCE=.\zend_operators.c -# End Source File -# Begin Source File - -SOURCE=.\zend_ptr_stack.c -# End Source File -# Begin Source File - -SOURCE=.\zend_qsort.c -# End Source File -# Begin Source File - -SOURCE=.\zend_sprintf.c -# End Source File -# Begin Source File - -SOURCE=.\zend_stack.c -# End Source File -# Begin Source File - -SOURCE=.\zend_variables.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\FlexLexer.h -# End Source File -# Begin Source File - -SOURCE=.\zend.h -# End Source File -# Begin Source File - -SOURCE=.\zend_alloc.h -# End Source File -# Begin Source File - -SOURCE=.\zend_API.h -# End Source File -# Begin Source File - -SOURCE=.\zend_builtin_functions.h -# End Source File -# Begin Source File - -SOURCE=.\zend_compile.h -# End Source File -# Begin Source File - -SOURCE=.\zend_config.w32.h -# End Source File -# Begin Source File - -SOURCE=.\zend_constants.h -# End Source File -# Begin Source File - -SOURCE=.\zend_dynamic_array.h -# End Source File -# Begin Source File - -SOURCE=.\zend_errors.h -# End Source File -# Begin Source File - -SOURCE=.\zend_execute.h -# End Source File -# Begin Source File - -SOURCE=.\zend_execute_locks.h -# End Source File -# Begin Source File - -SOURCE=.\zend_extensions.h -# End Source File -# Begin Source File - -SOURCE=.\zend_fast_cache.h -# End Source File -# Begin Source File - -SOURCE=.\zend_globals.h -# End Source File -# Begin Source File - -SOURCE=.\zend_globals_macros.h -# End Source File -# Begin Source File - -SOURCE=.\zend_hash.h -# End Source File -# Begin Source File - -SOURCE=.\zend_highlight.h -# End Source File -# Begin Source File - -SOURCE=.\zend_indent.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ini.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_parser.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_scanner.h -# End Source File -# Begin Source File - -SOURCE=.\zend_istdiostream.h -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.h" -# End Source File -# Begin Source File - -SOURCE=".\zend_language_scanner.h" -# End Source File -# Begin Source File - -SOURCE=.\zend_list.h -# End Source File -# Begin Source File - -SOURCE=.\zend_llist.h -# End Source File -# Begin Source File - -SOURCE=.\zend_modules.h -# End Source File -# Begin Source File - -SOURCE=.\zend_object_handlers.h -# End Source File -# Begin Source File - -SOURCE=.\zend_objects.h -# End Source File -# Begin Source File - -SOURCE=.\zend_operators.h -# End Source File -# Begin Source File - -SOURCE=.\zend_ptr_stack.h -# End Source File -# Begin Source File - -SOURCE=.\zend_qsort.h -# End Source File -# Begin Source File - -SOURCE=.\zend_stack.h -# End Source File -# Begin Source File - -SOURCE=.\zend_variables.h -# End Source File -# End Group -# Begin Group "Parsers" - -# PROP Default_Filter "y" -# Begin Source File - -SOURCE=.\zend_ini_parser.y - -!IF "$(CFG)" == "ZendTS - Win32 Release_TS" - -# Begin Custom Build -InputDir=. -InputPath=.\zend_ini_parser.y - -BuildCmds= \ - bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y - -"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS" - -# Begin Custom Build -InputDir=. -InputPath=.\zend_ini_parser.y - -BuildCmds= \ - bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y - -"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline" - -# Begin Custom Build -InputDir=. -InputPath=.\zend_ini_parser.y - -BuildCmds= \ - bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y - -"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=. -InputPath=.\zend_ini_parser.y - -BuildCmds= \ - bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y - -"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=".\zend_language_parser.y" - -!IF "$(CFG)" == "ZendTS - Win32 Release_TS" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg" - -# Begin Custom Build -InputDir=. -InputPath=".\zend_language_parser.y" - -BuildCmds= \ - bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y - -"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\zend_language_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=.\flex.skl -# End Source File -# Begin Source File - -SOURCE=.\zend_ini_scanner.l - -!IF "$(CFG)" == "ZendTS - Win32 Release_TS" - -# Begin Custom Build -InputPath=.\zend_ini_scanner.l - -"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS" - -# Begin Custom Build -InputPath=.\zend_ini_scanner.l - -"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline" - -# Begin Custom Build -InputPath=.\zend_ini_scanner.l - -"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg" - -# Begin Custom Build -InputPath=.\zend_ini_scanner.l - -"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=".\zend_language_scanner.l" - -!IF "$(CFG)" == "ZendTS - Win32 Release_TS" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg" - -# Begin Custom Build -InputPath=".\zend_language_scanner.l" - -"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -B -i -Sflex.skl -Pzend -ozend_language_scanner.c zend_language_scanner.l - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Text Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\LICENSE -# End Source File -# Begin Source File - -SOURCE=.\ZEND_BUGS -# End Source File -# Begin Source File - -SOURCE=.\ZEND_CHANGES -# End Source File -# End Group -# Begin Group "Resources" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\zend.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/Zend/acconfig.h b/Zend/acconfig.h deleted file mode 100644 index d5cfefee44c..00000000000 --- a/Zend/acconfig.h +++ /dev/null @@ -1,76 +0,0 @@ -#define ZEND_API -#define ZEND_DLEXPORT - -@TOP@ - -#undef uint -#undef ulong - -/* Define if you want to enable memory limit support */ -#define MEMORY_LIMIT 0 - -@BOTTOM@ - -#ifdef HAVE_STDLIB_H -# include -#endif - -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#ifdef HAVE_IEEEFP_H -# include -#endif - -#ifdef HAVE_STRING_H -# include -#else -# include -#endif - -#if ZEND_BROKEN_SPRINTF -int zend_sprintf(char *buffer, const char *format, ...); -#else -# define zend_sprintf sprintf -#endif - -#include - -#ifdef HAVE_ISNAN -#define zend_isnan(a) isnan(a) -#elif defined(NAN) -#define zend_isnan(a) (((a)==NAN)?1:0) -#elif defined(HAVE_FPCLASS) -#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) -#else -#define zend_isnan(a) 0 -#endif - -#ifdef HAVE_ISINF -#define zend_isinf(a) isinf(a) -#elif defined(INFINITY) -/* Might not work, but is required by ISO C99 */ -#define zend_isinf(a) (((a)==INFINITY)?1:0) -#elif defined(HAVE_FPCLASS) -#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) -#else -#define zend_isinf(a) 0 -#endif - -#ifdef HAVE_FINITE -#define zend_finite(a) finite(a) -#elif defined(HAVE_ISFINITE) || defined(isfinite) -#define zend_finite(a) isfinite(a) -#elif defined(fpclassify) -#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0) -#else -#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1) -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 deleted file mode 100644 index 395f7220db4..00000000000 --- a/Zend/acinclude.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl $Id$ -dnl -dnl This file contains local autoconf functions. - -AC_DEFUN(ZEND_FP_EXCEPT,[ - AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[ - AC_TRY_COMPILE([ -#include -],[ -fp_except x = (fp_except) 0; -],[ - ac_cv_type_fp_except=yes -],[ - ac_cv_type_fp_except=no -],[ - ac_cv_type_fp_except=no -])]) - if test "$ac_cv_type_fp_except" = "yes"; then - AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except]) - fi -]) - -dnl -dnl Check for broken sprintf() -dnl -AC_DEFUN(AC_ZEND_BROKEN_SPRINTF,[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ - AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes - ],[ - ac_cv_broken_sprintf=no - ]) - ]) - if test "$ac_cv_broken_sprintf" = "yes"; then - ac_result=1 - else - ac_result=0 - fi - AC_DEFINE_UNQUOTED(ZEND_BROKEN_SPRINTF, $ac_result, [Whether sprintf is broken]) -]) - -AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[ - LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' -]) - diff --git a/Zend/build.mk b/Zend/build.mk deleted file mode 100644 index 6105ff12c47..00000000000 --- a/Zend/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -# Makefile to generate build tools -# -# Standard usage: -# make -f build.mk -# -# Written by Sascha Schumann -# -# $Id$ - - -LT_TARGETS = ltmain.sh ltconfig - -config_h_in = zend_config.h.in - -makefile_am_files = Makefile.am -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in) - -all: $(targets) - -clean: - rm -f $(targets) - -$(LT_TARGETS): - rm -f $(LT_TARGETS) - libtoolize --automake $(AMFLAGS) -f - -$(makefile_in_files): $(makefile_am_files) - automake -a -i $(AMFLAGS) $(makefile_files) - -aclocal.m4: configure.in acinclude.m4 - aclocal - -$(config_h_in): configure.in acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @rm -f $@ - autoheader - -configure: aclocal.m4 configure.in - autoconf diff --git a/Zend/buildconf b/Zend/buildconf deleted file mode 100755 index fe8dee6f767..00000000000 --- a/Zend/buildconf +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -case "$1" in ---copy) - automake_flags=--copy - shift -;; -esac - -libtoolize --force --automake $automake_flags - -mv aclocal.m4 aclocal.m4.old 2>/dev/null -aclocal -if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then - echo "buildconf: keeping ${1}aclocal.m4" - mv aclocal.m4.old aclocal.m4 -else - echo "buildconf: created or modified ${1}aclocal.m4" -fi - -autoheader - -automake --add-missing --include-deps $automake_flags - -mv configure configure.old 2>/dev/null -autoconf -if cmp configure.old configure > /dev/null 2>&1; then - echo "buildconf: keeping ${1}configure" - mv configure.old configure -else - echo "buildconf: created or modified ${1}configure" -fi - diff --git a/Zend/configure.in b/Zend/configure.in deleted file mode 100644 index a999c3a3eb5..00000000000 --- a/Zend/configure.in +++ /dev/null @@ -1,45 +0,0 @@ -dnl $Id$ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(zend.c) -AM_INIT_AUTOMAKE(zend, 0.80A, nodefine) -AM_CONFIG_HEADER(zend_config.h) -AM_SANITY_CHECK -AM_MAINTAINER_MODE -AC_PROG_CC -AM_PROG_LEX -AM_PROG_CC_STDC -ZEND_VERSION=$VERSION - -dnl We want this one before the checks, so the checks can modify CFLAGS. -test -z "$CFLAGS" && auto_cflags=1 - -sinclude(Zend.m4) - -LIBZEND_BASIC_CHECKS - -AM_PROG_LIBTOOL -if test "$enable_debug" != "yes"; then - AM_SET_LIBTOOL_VARIABLE([--silent]) -fi - -dnl -dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary -dnl and source packages. This should be harmless on other OSs. -dnl -if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then - CFLAGS="$CFLAGS -I/usr/pkg/include" - LDFLAGS="$LDFLAGS -L/usr/pkg/lib" -fi - -LIBZEND_ENABLE_DEBUG -LIBZEND_OTHER_CHECKS - -ZEND_EXTRA_LIBS="$LIBS" -LIBS="" -AC_SUBST(ZEND_EXTRA_LIBS) -AC_OUTPUT(Makefile) - -# Local Variables: -# tab-width: 4 -# End: diff --git a/Zend/flex.skl b/Zend/flex.skl deleted file mode 100644 index 30b944e23a1..00000000000 --- a/Zend/flex.skl +++ /dev/null @@ -1,1628 +0,0 @@ -/* A Lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header$ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -%- -#include -%* - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -%+ -class istream; -%* -#if HAVE_UNISTD_H -#include -#endif - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -#undef YY_USE_PROTOS -#define YY_USE_PROTOS - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( SCNG(yy_in) TSRMLS_CC ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -%- -%* - - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr TSRMLS_CC ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { -%- - FILE *yy_input_file; -%+ - istream* yy_input_file; -%* - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -%- Standard (non-C++) definition -#define yy_current_buffer SCNG(current_buffer) -#define yy_hold_char SCNG(_yy_hold_char) -%* - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -%- Standard (non-C++) definition -/* yy_hold_char holds the character lost when yytext is formed. */ - -#if 0 -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -#endif - -/* Points to current character in buffer. */ -#define yy_c_buf_p SCNG(c_buf_p) -#define yy_init SCNG(init) -#define yy_start SCNG(start) - -#ifdef ZTS -#define TSRMLS_D void ***tsrm_ls -#define TSRMLS_DC , TSRMLS_D -#define TSRMLS_C tsrm_ls -#define TSRMLS_CC , TSRMLS_C -#else -#define TSRMLS_D -#define TSRMLS_DC -#define TSRMLS_C -#define TSRMLS_CC -#endif - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -/* static int yy_did_buffer_switch_on_eof; */ -#define yy_did_buffer_switch_on_eof SCNG(_yy_did_buffer_switch_on_eof) - -void yyrestart YY_PROTO(( FILE *input_file TSRMLS_DC )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer TSRMLS_DC )); -void yy_load_buffer_state YY_PROTO(( TSRMLS_D )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size TSRMLS_DC )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b TSRMLS_DC )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file TSRMLS_DC )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b TSRMLS_DC )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer TSRMLS_CC ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size TSRMLS_DC )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str TSRMLS_DC )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len TSRMLS_DC )); - -%* - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here -#undef yyleng -#define yyleng SCNG(yy_leng) -#undef yytext -#define yytext SCNG(yy_text) -#undef yytext_ptr -#define yytext_ptr SCNG(yy_text) -#undef yyin -#define yyin SCNG(yy_in) -#undef yyout -#define yyout SCNG(yy_out) -#undef yy_last_accepting_state -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#undef yy_last_accepting_cpos -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#undef yy_more_flag -#define yy_more_flag SCNG(_yy_more_flag) -#undef yy_more_len -#define yy_more_len SCNG(_yy_more_len) - - -%- Standard (non-C++) definition -static yy_state_type yy_get_previous_state YY_PROTO(( TSRMLS_D )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state TSRMLS_DC )); -static int yy_get_next_buffer YY_PROTO(( TSRMLS_D )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); -%* - -#undef TSRMLS_D -#undef TSRMLS_DC -#undef TSRMLS_C -#undef TSRMLS_CC - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ -%% code to fiddle yytext and yyleng for yymore() goes here - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ -%% code to copy yytext_ptr to yytext[] goes here, if %array - yy_c_buf_p = yy_cp; - -#undef yyleng -#undef yytext -#undef yytext_ptr -#undef yyin -#undef yyout -#undef yy_last_accepting_state -#undef yy_last_accepting_cpos -#undef yy_more_flag -#undef yy_more_len - - -%% data tables for the DFA and the user's section 1 definitions go here - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -%- -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr TSRMLS_DC )); -#endif -%* - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -%- Standard (non-C++) definition -#ifdef __cplusplus -static int 3 YY_PROTO(( TSRMLS_D )); -#else -static int input YY_PROTO(( TSRMLS_D )); -#endif -%* -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state TSRMLS_DC )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( TSRMLS_D )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -%- Standard (non-C++) definition -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, SCNG(yy_out) ) -%+ C++ definition -#define ECHO LexerOutput( yytext, yyleng ) -%* -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -%% fread()/read() definition of YY_INPUT goes here unless we're doing C++ -%+ C++ definition - if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -%* -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -%- -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -%+ -#define YY_FATAL_ERROR(msg) LexerError( msg ) -%* -#endif - - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -%- Standard (non-C++) definition -#define YY_DECL int yylex YY_PROTO(( void )) -%+ C++ definition -#define YY_DECL int yyFlexLexer::yylex() -%* -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -%% YY_RULE_SETUP definition goes here - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -%% user's declarations go here - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! SCNG(yy_in) ) -%- - SCNG(yy_in) = stdin; -%+ - SCNG(yy_in) = &cin; -%* - - if ( ! SCNG(yy_out) ) -%- - SCNG(yy_out) = stdout; -%+ - SCNG(yy_out) = &cout; -%* - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC ); - - yy_load_buffer_state(TSRMLS_C); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { -%% yymore()-related code goes here - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - -%% code to set up and find next match goes here - -yy_find_action: -%% code to find the action number goes here - - YY_DO_BEFORE_ACTION; - -%% code for yylineno update goes here - -do_action: /* This label is used only to access EOF actions. */ - -%% debug code goes here - - switch ( yy_act ) - { /* beginning of action switch */ -%% actions go here - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - SCNG(yy_n_chars) = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = SCNG(yy_in); - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(TSRMLS_C); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state TSRMLS_CC ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { -%% code to do back-up for compressed tables and set up yy_cp goes here - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer(TSRMLS_C) ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(TSRMLS_C); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars)]; - - yy_current_state = yy_get_previous_state(TSRMLS_C); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - -%+ -yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout ) - { - SCNG(yy_in) = arg_yyin; - SCNG(yy_out) = arg_yyout; - yy_c_buf_p = 0; - yy_init = 1; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno - - yy_did_buffer_switch_on_eof = 0; - - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; - - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = 0; - - yy_current_buffer = 0; - -#ifdef YY_USES_REJECT - yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2]; -#else - yy_state_buf = 0; -#endif - } - -yyFlexLexer::~yyFlexLexer() - { - delete yy_state_buf; - yy_delete_buffer( yy_current_buffer TSRMLS_CC ); - } - -void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out ) - { - if ( new_in ) - { - yy_delete_buffer( SCNG(yy_current_buffer TSRMLS_CC ) ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE TSRMLS_CC ) TSRMLS_CC ); - } - - if ( new_out ) - SCNG(yy_out) = new_out; - } - -int yyFlexLexer::LexerInput( char* buf, int max_size ) - { - if ( SCNG(yy_in)->eof() || SCNG(yy_in)->fail() ) - return 0; - - if (yy_current_buffer->yy_is_interactive) { - SCNG(yy_in)->get( buf[0] ); - - if ( SCNG(yy_in)->eof() ) - return 0; - - if ( SCNG(yy_in)->bad() ) - return -1; - - return 1; - } else { - (void) SCNG(yy_in)->read( buf, max_size ); - - if ( SCNG(yy_in)->bad() ) - return -1; - else - return SCNG(yy_in)->gcount(); - } - } - -void yyFlexLexer::LexerOutput( const char* buf, int size ) - { - (void) SCNG(yy_out)->write( buf, size ); - } -%* - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -%- -static int yy_get_next_buffer(TSRMLS_D) -%+ -int yyFlexLexer::yy_get_next_buffer(TSRMLS_D) -%* - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = SCNG(yy_n_chars) = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - SCNG(yy_n_chars), num_to_read ); - - yy_current_buffer->yy_n_chars = SCNG(yy_n_chars); - } - - if ( SCNG(yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( SCNG(yy_in) TSRMLS_CC ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - SCNG(yy_n_chars) += number_to_move; - yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -%- -static yy_state_type yy_get_previous_state(TSRMLS_D) -%+ -yy_state_type yyFlexLexer::yy_get_previous_state(TSRMLS_D) -%* - { - register yy_state_type yy_current_state; - register char *yy_cp; - -%% code to get the start state into yy_current_state goes here - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { -%% code to find the next state goes here - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -%- -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state TSRMLS_DC ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state TSRMLS_CC ) -yy_state_type yy_current_state; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state TSRMLS_DC ) -%* - { - register int yy_is_jam; -%% code to find the next state, and perhaps do backing up, goes here - - return yy_is_jam ? 0 : yy_current_state; - } - - -%- -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp TSRMLS_DC ) -#else -static void yyunput( c, yy_bp TSRMLS_CC ) -int c; -register char *yy_bp; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -void yyFlexLexer::yyunput( int c, register char* yy_bp TSRMLS_DC ) -%* - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = SCNG(yy_n_chars) + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - SCNG(yy_n_chars) = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - -%% update yylineno here - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -%- -#endif /* ifndef YY_NO_UNPUT */ -%* - - -%- -#ifdef __cplusplus -static int yyinput(TSRMLS_D) -#else -static int input(TSRMLS_C) -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -int yyFlexLexer::yyinput(TSRMLS_D) -%* - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[SCNG(yy_n_chars)] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer(TSRMLS_C) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( SCNG(yy_in) TSRMLS_CC ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(TSRMLS_C); -#else - return input(TSRMLS_C); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - -%% update BOL and yylineno - - return c; - } - - -%- -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file TSRMLS_DC ) -#else -void yyrestart( input_file TSRMLS_CC ) -FILE *input_file; -#endif -%+ -void yyFlexLexer::yyrestart( istream* input_file TSRMLS_DC ) -%* - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC ); - - yy_init_buffer( yy_current_buffer, input_file TSRMLS_CC ); - yy_load_buffer_state(TSRMLS_C); - } - - -%- -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer TSRMLS_DC) -#else -void yy_switch_to_buffer( new_buffer TSRMLS_CC) -YY_BUFFER_STATE new_buffer; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer TSRMLS_DC ) -%* - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = SCNG(yy_n_chars); - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(TSRMLS_C); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( TSRMLS_D ) -#else -void yy_load_buffer_state(TSRMLS_C) -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -void yyFlexLexer::yy_load_buffer_state() -%* - { - SCNG(yy_n_chars) = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - SCNG(yy_in) = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size TSRMLS_DC ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size TSRMLS_CC ) -FILE *file; -int size; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size TSRMLS_DC ) -%* - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file TSRMLS_CC ); - - return b; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b TSRMLS_DC ) -#else -void yy_delete_buffer( b TSRMLS_CC ) -YY_BUFFER_STATE b; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b TSRMLS_DC ) -%* - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -%- -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file TSRMLS_DC ) -#else -void yy_init_buffer( b, file TSRMLS_CC ) -YY_BUFFER_STATE b; -FILE *file; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif - -%+ -extern "C" int isatty YY_PROTO(( int )); -void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file TSRMLS_DC ) -%* - - { - yy_flush_buffer( b TSRMLS_CC ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -%- -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif -%+ - b->yy_is_interactive = (file == (istream *) &cin) ? 1 : 0; -%* - } - - -%- -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b TSRMLS_DC ) -#else -void yy_flush_buffer( b TSRMLS_CC ) -YY_BUFFER_STATE b; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif - -%+ -void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b TSRMLS_DC ) -%* - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(TSRMLS_C); - } -%* - - -#ifndef YY_NO_SCAN_BUFFER -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size TSRMLS_DC ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size TSRMLS_CC ) -char *base; -yy_size_t size; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b TSRMLS_CC ); - - return b; - } -%* -#endif - - -#ifndef YY_NO_SCAN_STRING -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str TSRMLS_DC ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str TSRMLS_CC ) -yyconst char *yy_str; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len TSRMLS_CC ); - } -%* -#endif - - -#ifndef YY_NO_SCAN_BYTES -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len TSRMLS_DC ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len TSRMLS_CC ) -yyconst char *bytes; -int len; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n TSRMLS_CC); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -%* -#endif - - -#ifndef YY_NO_PUSH_STATE -%- -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state TSRMLS_DC ) -#else -static void yy_push_state( new_state TSRMLS_CC ) -int new_state; -#ifdef ZTS -void ***tsrm_ls; -#endif -#endif -%+ -void yyFlexLexer::yy_push_state( int new_state TSRMLS_DC ) -%* - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -%- -static void yy_pop_state(TSRMLS_D) -%+ -void yyFlexLexer::yy_pop_state(TSRMLS_D) -%* - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -%- -static int yy_top_state() -%+ -int yyFlexLexer::yy_top_state() -%* - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -%- -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - -%+ - -void yyFlexLexer::LexerError( yyconst char msg[] ) - { - cerr << msg << '\n'; - exit( YY_EXIT_FAILURE ); - } -%* - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif diff --git a/Zend/tests/zend2.php b/Zend/tests/zend2.php deleted file mode 100644 index f4466b73e2c..00000000000 --- a/Zend/tests/zend2.php +++ /dev/null @@ -1,339 +0,0 @@ -Example 1: A singleton (static members) -======================================= - -counter; - print "\n"; - } - } - - - class SingletonCounter { - static $m_instance = NULL; - - function Instance() - { - if (self::$m_instance == NULL) { - self::$m_instance = new Counter(); - } - return self::$m_instance; - } - } - - SingletonCounter::Instance()->increment_and_print(); - SingletonCounter::Instance()->increment_and_print(); - SingletonCounter::Instance()->increment_and_print(); - -?> - -Example 2: Factory method (derefencing objects returned from functions) -======================================================================= - -draw(); - ShapeFactoryMethod("Square")->draw(); - - -?> - -Example 3: Nested class -======================= - -host' as $user\n"; - } - } - - class Oracle { - var $host = "localhost"; - - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } - - } - } - - $MySQL_obj = new Database::MySQL(); - $MySQL_obj->db_connect("John"); - - $Oracle_obj = new Database::Oracle(); - $Oracle_obj->db_connect("Mark"); - - unset($MySQL_obj); - unset($Oracle_obj); -?> - -Example 3: Nested class suitable for a PEAR like hierarchy -========================================================== - -host' as $user\n"; - } - } - - class DB::Oracle { - var $host = "localhost"; - - function db_connect($user) { - print "Connecting to Oracle database '$this->host' as $user\n"; - } - - } - - $MySQL_obj = new DB::MySQL(); - $MySQL_obj->db_connect("Susan"); - - $Oracle_obj = new DB::Oracle(); - $Oracle_obj->db_connect("Barbara"); - -?> - -Example 4: Class constants and class scope -========================================== - - - -Example 5: Regular object method using both local and global functions -====================================================================== - -length_of_hello_world(); - print "\n"; -?> - -Example 6: Multiple derefencing of objects returned from methods -================================================================ - -name = $_name; - } - - function display() - { - print $this->name; - print "\n"; - } - } - - class Person { - function Person($_name, $_address) - { - $this->name = new Name($_name); - } - - function getName() - { - return $this->name; - } - } - - $person = new Person("John", "New York"); - print $person->getName()->display(); - -?> - -Example 7: Exception handling -============================= - -error = $_error; - } - - function getException() - { - return $this->error; - } - } - - function ThrowException() - { - throw new MyException("'This is an exception!'"); - } - - - try { - } catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; - } - - try { - ThrowException(); - } catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; - } - -?> - -Example 8: __clone() -=================== - -id = self::$id++; - } - - function __clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyCloneable(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->__clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; -?> - -Example 9: Unified constructors -=============================== - - - -Example 10: Destructors -======================= - -name = "MyDestructableClass"; - } - - function __destruct() - { - print "Destroying " . $this->name . "\n"; - } -} - -$obj = new MyDestructableClass(); - -?> diff --git a/Zend/zend.c b/Zend/zend.c deleted file mode 100644 index 6c6815bd3f3..00000000000 --- a/Zend/zend.c +++ /dev/null @@ -1,876 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_extensions.h" -#include "zend_modules.h" -#include "zend_constants.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_builtin_functions.h" -#include "zend_ini.h" - -#ifdef ZTS -# define GLOBAL_FUNCTION_TABLE &global_main_class.function_table -# define GLOBAL_CLASS_TABLE &global_main_class.class_table -# define GLOBAL_CONSTANTS_TABLE &global_main_class.constants_table -# define GLOBAL_AUTO_GLOBALS_TABLE global_auto_globals_table -#else -# define GLOBAL_FUNCTION_TABLE CG(function_table) -# define GLOBAL_CLASS_TABLE CG(class_table) -# define GLOBAL_CONSTANTS_TABLE CG(zend_constants) -# define GLOBAL_AUTO_GLOBALS_TABLE CG(auto_globals) -#endif - -#if defined(ZEND_WIN32) && ZEND_DEBUG -BOOL WINAPI IsDebuggerPresent(VOID); -#endif - -/* true multithread-shared globals */ -ZEND_API zend_class_entry *zend_standard_class_def = NULL; -ZEND_API int (*zend_printf)(const char *format, ...); -ZEND_API zend_write_func_t zend_write; -ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); -ZEND_API void (*zend_block_interruptions)(void); -ZEND_API void (*zend_unblock_interruptions)(void); -ZEND_API void (*zend_ticks_function)(int ticks); -ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); - -static void (*zend_message_dispatcher_p)(long message, void *data); -static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents); - - -#ifdef ZTS -ZEND_API int compiler_globals_id; -ZEND_API int executor_globals_id; -ZEND_API int alloc_globals_id; -zend_class_entry global_main_class; -HashTable *global_auto_globals_table; -#endif - -zend_utility_values zend_uv; - -ZEND_API zval zval_used_for_init; /* True global variable */ - -/* version information */ -static char *zend_version_info; -static uint zend_version_info_length; -#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2002 Zend Technologies\n" - - -#define PRINT_ZVAL_INDENT 4 - -static void print_hash(HashTable *ht, int indent) -{ - zval **tmp; - char *string_key; - HashPosition iterator; - ulong num_key; - uint str_len; - int i; - - for (i=0; i "); - zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT); - ZEND_PUTS("\n"); - zend_hash_move_forward_ex(ht, &iterator); - } - indent -= PRINT_ZVAL_INDENT; - for (i=0; itype==IS_STRING) { - *use_copy = 0; - return; - } - switch (expr->type) { - case IS_NULL: - expr_copy->value.str.len = 0; - expr_copy->value.str.val = empty_string; - break; - case IS_BOOL: - if (expr->value.lval) { - expr_copy->value.str.len = 1; - expr_copy->value.str.val = estrndup("1", 1); - } else { - expr_copy->value.str.len = 0; - expr_copy->value.str.val = empty_string; - } - break; - case IS_RESOURCE: - expr_copy->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG); - expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Resource id #%ld", expr->value.lval); - break; - case IS_ARRAY: - expr_copy->value.str.len = sizeof("Array")-1; - expr_copy->value.str.val = estrndup("Array", expr_copy->value.str.len); - break; - case IS_OBJECT: - expr_copy->value.str.val = (char *) emalloc(sizeof("Object id #")-1 + MAX_LENGTH_OF_LONG); - expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Object id #%ld", (long)expr->value.obj.handle); -#if 0 - /* FIXME: This might break BC for some people */ - expr_copy->value.str.len = sizeof("Object")-1; - expr_copy->value.str.val = estrndup("Object", expr_copy->value.str.len); -#endif - break; - default: - *expr_copy = *expr; - zval_copy_ctor(expr_copy); - convert_to_string(expr_copy); - break; - } - expr_copy->type = IS_STRING; - *use_copy = 1; -} - - -ZEND_API int zend_print_zval(zval *expr, int indent) -{ - return zend_print_zval_ex(zend_write, expr, indent); -} - - -ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) -{ - zval expr_copy; - int use_copy; - - zend_make_printable_zval(expr, &expr_copy, &use_copy); - if (use_copy) { - expr = &expr_copy; - } - if (expr->value.str.len==0) { /* optimize away empty strings */ - if (use_copy) { - zval_dtor(expr); - } - return 0; - } - write_func(expr->value.str.val, expr->value.str.len); - if (use_copy) { - zval_dtor(expr); - } - return expr->value.str.len; -} - - -ZEND_API void zend_print_zval_r(zval *expr, int indent) -{ - zend_print_zval_r_ex(zend_write, expr, indent); -} - - -ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent) -{ - switch(expr->type) { - case IS_ARRAY: - ZEND_PUTS("Array\n"); - if (++expr->value.ht->nApplyCount>1) { - ZEND_PUTS(" *RECURSION*"); - expr->value.ht->nApplyCount=0; - return; - } - print_hash(expr->value.ht, indent); - expr->value.ht->nApplyCount--; - break; - case IS_OBJECT: - { - zend_object *object = Z_OBJ_P(expr); - - if (++object->properties->nApplyCount>1) { - ZEND_PUTS(" *RECURSION*"); - object->properties->nApplyCount=0; - return; - } - zend_printf("%s Object\n", object->ce->name); - print_hash(object->properties, indent); - object->properties->nApplyCount--; - break; - } - default: - zend_print_variable(expr); - break; - } -} - - -static FILE *zend_fopen_wrapper(const char *filename, char **opened_path) -{ - if (opened_path) { - *opened_path = estrdup(filename); - } - return fopen(filename, "rb"); -} - - -static void register_standard_class(void) -{ - zend_standard_class_def = malloc(sizeof(zend_class_entry)); - - zend_standard_class_def->type = ZEND_INTERNAL_CLASS; - zend_standard_class_def->name_length = sizeof("stdClass") - 1; - zend_standard_class_def->name = zend_strndup("stdClass", zend_standard_class_def->name_length); - zend_standard_class_def->parent = NULL; - zend_hash_init_ex(&zend_standard_class_def->default_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0); - zend_hash_init_ex(&zend_standard_class_def->private_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0); - zend_standard_class_def->static_members = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(zend_standard_class_def->static_members, 0, NULL, ZVAL_PTR_DTOR, 1, 0); - zend_hash_init_ex(&zend_standard_class_def->constants_table, 0, NULL, ZVAL_PTR_DTOR, 1, 0); - zend_hash_init_ex(&zend_standard_class_def->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); - zend_hash_init_ex(&zend_standard_class_def->function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1, 0); - zend_standard_class_def->constructor = NULL; - zend_standard_class_def->destructor = NULL; - zend_standard_class_def->clone = NULL; - zend_standard_class_def->handle_function_call = NULL; - zend_standard_class_def->handle_property_get = NULL; - zend_standard_class_def->handle_property_set = NULL; - zend_standard_class_def->refcount = 1; - zend_hash_add(GLOBAL_CLASS_TABLE, "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry *), NULL); -} - - -static void zend_set_default_compile_time_values(TSRMLS_D) -{ - /* default compile-time values */ - CG(asp_tags) = 0; - CG(short_tags) = 1; - CG(allow_call_time_pass_reference) = 1; - CG(extended_info) = 0; -} - - -#ifdef ZTS -static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) -{ - zend_function tmp_func; - zend_class_entry tmp_class; - - compiler_globals->compiled_filename = NULL; - - compiler_globals->function_table = &compiler_globals->main_class.function_table; - zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0); - zend_hash_copy(compiler_globals->function_table, GLOBAL_FUNCTION_TABLE, NULL, &tmp_func, sizeof(zend_function)); - - compiler_globals->class_table = &compiler_globals->main_class.class_table; - zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); - zend_hash_copy(compiler_globals->class_table, GLOBAL_CLASS_TABLE, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry)); - - zend_set_default_compile_time_values(TSRMLS_C); - - CG(interactive) = 0; - - compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0); - zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL, NULL, sizeof(void *) /* empty element */); -} - - -static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS_DC) -{ - if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) { - zend_hash_destroy(compiler_globals->function_table); - } - if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) { - zend_hash_destroy(compiler_globals->class_table); - } - if (compiler_globals->auto_globals != global_auto_globals_table) { - zend_hash_destroy(compiler_globals->auto_globals); - free(compiler_globals->auto_globals); - } -} - - -static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS_DC) -{ - if (GLOBAL_CONSTANTS_TABLE) { - zend_startup_constants(TSRMLS_C); - zend_copy_constants(EG(zend_constants), GLOBAL_CONSTANTS_TABLE); - } - zend_init_rsrc_plist(TSRMLS_C); - EG(lambda_count)=0; - EG(user_error_handler) = NULL; - EG(in_execution) = 0; -} - - -static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS_DC) -{ - zend_shutdown_constants(TSRMLS_C); - zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); - zend_ini_shutdown(TSRMLS_C); -} - - -static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC) -{ - zend_copy_ini_directives(TSRMLS_C); - zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC); -} - -#endif - - -static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC) -{ - start_memory_manager(TSRMLS_C); -} - - -static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC) -{ - shutdown_memory_manager(0, 1 TSRMLS_CC); -} - - -#ifdef __FreeBSD__ -/* FreeBSD floating point precision fix */ -#include -#endif - - -static void scanner_globals_ctor(zend_scanner_globals *scanner_globals_p TSRMLS_DC) -{ - scanner_globals_p->c_buf_p = (char *) 0; - scanner_globals_p->init = 1; - scanner_globals_p->start = 0; - scanner_globals_p->current_buffer = NULL; - scanner_globals_p->yy_in = NULL; - scanner_globals_p->yy_out = NULL; - scanner_globals_p->_yy_more_flag = 0; - scanner_globals_p->_yy_more_len = 0; - -} - - -int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions) -{ -#ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - void ***tsrm_ls; -#ifdef ZTS - extern ZEND_API ts_rsrc_id ini_scanner_globals_id; - extern ZEND_API ts_rsrc_id language_scanner_globals_id; -#else - extern zend_scanner_globals ini_scanner_globals; - extern zend_scanner_globals language_scanner_globals; -#endif - - ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor); -#else - alloc_globals_ctor(&alloc_globals TSRMLS_CC); -#endif - -#ifdef __FreeBSD__ - /* FreeBSD floating point precision fix */ - fpsetmask(0); -#endif - - zend_startup_extensions_mechanism(); - - /* Set up utility functions and values */ - zend_error_cb = utility_functions->error_function; - zend_printf = utility_functions->printf_function; - zend_write = (zend_write_func_t) utility_functions->write_function; - zend_fopen = utility_functions->fopen_function; - if (!zend_fopen) { - zend_fopen = zend_fopen_wrapper; - } - zend_message_dispatcher_p = utility_functions->message_handler; - zend_block_interruptions = utility_functions->block_interruptions; - zend_unblock_interruptions = utility_functions->unblock_interruptions; - zend_get_configuration_directive_p = utility_functions->get_configuration_directive; - zend_ticks_function = utility_functions->ticks_function; - - zend_compile_file = compile_file; - zend_execute = execute; - - /* set up version */ - zend_version_info = strdup(ZEND_CORE_VERSION_INFO); - zend_version_info_length = sizeof(ZEND_CORE_VERSION_INFO)-1; - -#ifndef ZTS - GLOBAL_FUNCTION_TABLE = &compiler_globals.main_class.function_table; - GLOBAL_CLASS_TABLE = &compiler_globals.main_class.class_table; -#endif - GLOBAL_AUTO_GLOBALS_TABLE = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0); - zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0); - zend_hash_init_ex(GLOBAL_AUTO_GLOBALS_TABLE, 8, NULL, NULL, 1, 0); - - register_standard_class(); - zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0); - zend_init_rsrc_list_dtors(); - - /* This zval can be used to initialize allocate zval's to an uninit'ed value */ - zval_used_for_init.is_ref = 0; - zval_used_for_init.refcount = 1; - zval_used_for_init.type = IS_NULL; - -#ifdef ZTS - ts_allocate_id(&compiler_globals_id, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor); - ts_allocate_id(&executor_globals_id, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor); - ts_allocate_id(&language_scanner_globals_id, sizeof(zend_scanner_globals), (ts_allocate_ctor) scanner_globals_ctor, NULL); - ts_allocate_id(&ini_scanner_globals_id, sizeof(zend_scanner_globals), (ts_allocate_ctor) scanner_globals_ctor, NULL); - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - tsrm_ls = ts_resource_ex(0, NULL); - compiler_globals_dtor(compiler_globals, tsrm_ls); - *compiler_globals->function_table = *GLOBAL_FUNCTION_TABLE; - *compiler_globals->class_table = *GLOBAL_CLASS_TABLE; - compiler_globals->auto_globals = GLOBAL_AUTO_GLOBALS_TABLE; - zend_startup_constants(tsrm_ls); -#else - zend_hash_init_ex(CG(auto_globals), 8, NULL, NULL, 1, 0); - scanner_globals_ctor(&ini_scanner_globals TSRMLS_CC); - scanner_globals_ctor(&language_scanner_globals TSRMLS_CC); - zend_startup_constants(); - zend_set_default_compile_time_values(TSRMLS_C); - EG(user_error_handler) = NULL; -#endif - zend_register_standard_constants(TSRMLS_C); - -#ifndef ZTS - zend_init_rsrc_plist(TSRMLS_C); -#endif - - if (start_builtin_functions) { - zend_startup_builtin_functions(TSRMLS_C); - } - - zend_ini_startup(TSRMLS_C); - -#ifdef ZTS - tsrm_set_new_thread_end_handler(zend_new_thread_end_handler); - *GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table; - *GLOBAL_CLASS_TABLE = *compiler_globals->class_table; -#endif - - return SUCCESS; -} - - -void zend_shutdown(TSRMLS_D) -{ -#ifdef ZEND_WIN32 - zend_shutdown_timeout_thread(); -#endif -#ifndef ZTS - zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); -#endif - zend_destroy_rsrc_list_dtors(); - zend_hash_destroy(&module_registry); - -#ifndef ZTS - /* In ZTS mode these are freed by compiler_globals_dtor() */ - zend_hash_destroy(GLOBAL_FUNCTION_TABLE); - zend_hash_destroy(GLOBAL_CLASS_TABLE); -#endif - - zend_hash_destroy(GLOBAL_AUTO_GLOBALS_TABLE); - free(GLOBAL_AUTO_GLOBALS_TABLE); - zend_shutdown_extensions(TSRMLS_C); - free(zend_version_info); -#ifndef ZTS - zend_shutdown_constants(); -#endif -} - - -void zend_set_utility_values(zend_utility_values *utility_values) -{ - zend_uv = *utility_values; - zend_uv.import_use_extension_length = strlen(zend_uv.import_use_extension); -} - - -/* this should be compatible with the standard zenderror */ -void zenderror(char *error) -{ - zend_error(E_PARSE, error); -} - - -BEGIN_EXTERN_C() -ZEND_API void _zend_bailout(char *filename, uint lineno) -{ - TSRMLS_FETCH(); - - if (!EG(bailout_set)) { - zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno); - exit(-1); - } - CG(unclean_shutdown) = 1; - CG(in_compilation) = EG(in_execution) = 0; - longjmp(EG(bailout), FAILURE); -} -END_EXTERN_C() - - -void zend_append_version_info(zend_extension *extension) -{ - char *new_info; - uint new_info_length; - - new_info_length = sizeof(" with v, by \n") - + strlen(extension->name) - + strlen(extension->version) - + strlen(extension->copyright) - + strlen(extension->author); - - new_info = (char *) malloc(new_info_length+1); - - sprintf(new_info, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author); - - zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length+1); - strcat(zend_version_info, new_info); - zend_version_info_length += new_info_length; - free(new_info); -} - - -ZEND_API char *get_zend_version() -{ - return zend_version_info; -} - - -void zend_activate(TSRMLS_D) -{ - init_compiler(TSRMLS_C); - init_executor(TSRMLS_C); - startup_scanner(TSRMLS_C); -} - - -void zend_activate_modules(TSRMLS_D) -{ - zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup TSRMLS_CC); -} - -void zend_deactivate_modules(TSRMLS_D) -{ - EG(opline_ptr) = NULL; /* we're no longer executing anything */ - - zend_try { - zend_hash_apply(&module_registry, (apply_func_t) module_registry_cleanup TSRMLS_CC); - } zend_end_try(); -} - -void zend_deactivate(TSRMLS_D) -{ - /* we're no longer executing anything */ - EG(opline_ptr) = NULL; - EG(active_symbol_table) = NULL; - - zend_try { - shutdown_scanner(TSRMLS_C); - } zend_end_try(); - - /* shutdown_executor() takes care of its own bailout handling */ - shutdown_executor(TSRMLS_C); - - zend_try { - shutdown_compiler(TSRMLS_C); - } zend_end_try(); - - zend_try { - zend_ini_deactivate(TSRMLS_C); - } zend_end_try(); -} - - -BEGIN_EXTERN_C() -ZEND_API void zend_message_dispatcher(long message, void *data) -{ - if (zend_message_dispatcher_p) { - zend_message_dispatcher_p(message, data); - } -} -END_EXTERN_C() - - -ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents) -{ - if (zend_get_configuration_directive_p) { - return zend_get_configuration_directive_p(name, name_length, contents); - } else { - return FAILURE; - } -} - - -#define ZEND_ERROR_BUFFER_SIZE 1024 - -ZEND_API void zend_error(int type, const char *format, ...) -{ - va_list args; - zval ***params; - zval *retval; - zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context; - char *error_filename; - uint error_lineno; - zval *orig_user_error_handler; - TSRMLS_FETCH(); - - /* Obtain relevant filename and lineno */ - switch (type) { - case E_CORE_ERROR: - case E_CORE_WARNING: - error_filename = NULL; - error_lineno = 0; - break; - case E_PARSE: - case E_COMPILE_ERROR: - case E_COMPILE_WARNING: - case E_ERROR: - case E_NOTICE: - case E_WARNING: - case E_USER_ERROR: - case E_USER_WARNING: - case E_USER_NOTICE: - if (zend_is_compiling(TSRMLS_C)) { - error_filename = zend_get_compiled_filename(TSRMLS_C); - error_lineno = zend_get_compiled_lineno(TSRMLS_C); - } else if (zend_is_executing(TSRMLS_C)) { - error_filename = zend_get_executed_filename(TSRMLS_C); - error_lineno = zend_get_executed_lineno(TSRMLS_C); - } else { - error_filename = NULL; - error_lineno = 0; - } - break; - default: - error_filename = NULL; - error_lineno = 0; - break; - } - if (!error_filename) { - error_filename = "Unknown"; - } - - - va_start(args, format); - - /* if we don't have a user defined error handler */ - if (!EG(user_error_handler)) { - zend_error_cb(type, error_filename, error_lineno, format, args); - } else switch (type) { - case E_ERROR: - case E_PARSE: - case E_CORE_ERROR: - case E_CORE_WARNING: - case E_COMPILE_ERROR: - case E_COMPILE_WARNING: - /* The error may not be safe to handle in user-space */ - zend_error_cb(type, error_filename, error_lineno, format, args); - break; - default: - /* Handle the error in user space */ - ALLOC_INIT_ZVAL(z_error_message); - ALLOC_INIT_ZVAL(z_error_type); - ALLOC_INIT_ZVAL(z_error_filename); - ALLOC_INIT_ZVAL(z_error_lineno); - ALLOC_INIT_ZVAL(z_context); - z_error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE); - -#ifdef HAVE_VSNPRINTF - z_error_message->value.str.len = vsnprintf(z_error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args); - if (z_error_message->value.str.len > ZEND_ERROR_BUFFER_SIZE-1) { - z_error_message->value.str.len = ZEND_ERROR_BUFFER_SIZE-1; - } -#else - strncpy(z_error_message->value.str.val, format, ZEND_ERROR_BUFFER_SIZE); - /* This is risky... */ - /* z_error_message->value.str.len = vsprintf(z_error_message->value.str.val, format, args); */ -#endif - z_error_message->type = IS_STRING; - - z_error_type->value.lval = type; - z_error_type->type = IS_LONG; - - if (error_filename) { - z_error_filename->value.str.len = strlen(error_filename); - z_error_filename->value.str.val = estrndup(error_filename, z_error_filename->value.str.len); - z_error_filename->type = IS_STRING; - } - - z_error_lineno->value.lval = error_lineno; - z_error_lineno->type = IS_LONG; - - z_context->value.ht = EG(active_symbol_table); - z_context->type = IS_ARRAY; - ZVAL_ADDREF(z_context); /* we don't want this one to be freed */ - - params = (zval ***) emalloc(sizeof(zval **)*5); - params[0] = &z_error_type; - params[1] = &z_error_message; - params[2] = &z_error_filename; - params[3] = &z_error_lineno; - params[4] = &z_context; - - orig_user_error_handler = EG(user_error_handler); - EG(user_error_handler) = NULL; - if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) { - zval_ptr_dtor(&retval); - } else { - /* The user error handler failed, use built-in error handler */ - zend_error_cb(type, error_filename, error_lineno, format, args); - } - EG(user_error_handler) = orig_user_error_handler; - - efree(params); - zval_ptr_dtor(&z_error_message); - zval_ptr_dtor(&z_error_type); - zval_ptr_dtor(&z_error_filename); - zval_ptr_dtor(&z_error_lineno); - if (ZVAL_REFCOUNT(z_context)==2) { - FREE_ZVAL(z_context); - } - break; - } - - va_end(args); - - if (type==E_PARSE) { - zend_init_compiler_data_structures(TSRMLS_C); - } -} - - -ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...) -{ -#if ZEND_DEBUG - va_list args; - - va_start(args, format); -# ifdef ZEND_WIN32 - { - char output_buf[1024]; - - vsnprintf(output_buf, 1024, format, args); - OutputDebugString(output_buf); - OutputDebugString("\n"); - if (trigger_break && IsDebuggerPresent()) { - DebugBreak(); - } - } -# else - vfprintf(stderr, format, args); - fprintf(stderr, "\n"); -# endif - va_end(args); -#endif -} - - -ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...) -{ - va_list files; - int i; - zend_file_handle *file_handle; - zend_op_array *orig_op_array = EG(active_op_array); - zval *local_retval=NULL; - - va_start(files, file_count); - for (i=0; i | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_H -#define ZEND_H - -#define ZEND_VERSION "2.0.0-dev" - -#define ZEND_ENGINE_2 - -#ifdef __cplusplus -#define BEGIN_EXTERN_C() extern "C" { -#define END_EXTERN_C() } -#else -#define BEGIN_EXTERN_C() -#define END_EXTERN_C() -#endif - -#include - -/* - * general definitions - */ - -#ifdef ZEND_WIN32 -# include "zend_config.w32.h" -# define ZEND_PATHS_SEPARATOR ';' -#elif defined(__riscos__) -# include "zend_config.h" -# define ZEND_PATHS_SEPARATOR ';' -#else -# include "zend_config.h" -# define ZEND_PATHS_SEPARATOR ':' -#endif - -/* all HAVE_XXX test have to be after the include of zend_config above */ - -#ifdef HAVE_UNIX_H -# include -#endif - -#ifdef HAVE_STDARG_H -# include -#endif - -#ifdef HAVE_DLFCN_H -# include -#endif - -#if defined(HAVE_LIBDL) - -# ifndef RTLD_LAZY -# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */ -# endif - -# ifndef RTLD_GLOBAL -# define RTLD_GLOBAL 0 -# endif - -# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL) -# define DL_UNLOAD dlclose -# if defined(DLSYM_NEEDS_UNDERSCORE) -# define DL_FETCH_SYMBOL(h,s) dlsym((h), "_" ## s) -# else -# define DL_FETCH_SYMBOL dlsym -# endif -# define DL_HANDLE void * -# define ZEND_EXTENSIONS_SUPPORT 1 -#elif defined(ZEND_WIN32) -# define DL_LOAD(libname) LoadLibrary(libname) -# define DL_FETCH_SYMBOL GetProcAddress -# define DL_UNLOAD FreeLibrary -# define DL_HANDLE HMODULE -# define ZEND_EXTENSIONS_SUPPORT 1 -#else -# define DL_HANDLE void * -# define ZEND_EXTENSIONS_SUPPORT 0 -#endif - -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) -# define do_alloca(p) alloca(p) -# define free_alloca(p) -#else -# define do_alloca(p) emalloc(p) -# define free_alloca(p) efree(p) -#endif - -#if ZEND_DEBUG -#define ZEND_FILE_LINE_D char *__zend_filename, uint __zend_lineno -#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D -#define ZEND_FILE_LINE_ORIG_D char *__zend_orig_filename, uint __zend_orig_lineno -#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D -#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno -#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C -#define ZEND_FILE_LINE_C __FILE__, __LINE__ -#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C -#define ZEND_FILE_LINE_EMPTY_C NULL, 0 -#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C -#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno -#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C -#else -#define ZEND_FILE_LINE_D -#define ZEND_FILE_LINE_DC -#define ZEND_FILE_LINE_ORIG_D -#define ZEND_FILE_LINE_ORIG_DC -#define ZEND_FILE_LINE_RELAY_C -#define ZEND_FILE_LINE_RELAY_CC -#define ZEND_FILE_LINE_C -#define ZEND_FILE_LINE_CC -#define ZEND_FILE_LINE_EMPTY_C -#define ZEND_FILE_LINE_EMPTY_CC -#define ZEND_FILE_LINE_ORIG_RELAY_C -#define ZEND_FILE_LINE_ORIG_RELAY_CC -#endif /* ZEND_DEBUG */ - -#ifdef ZTS -#define ZTS_V 1 -#else -#define ZTS_V 0 -#endif - -#include "zend_errors.h" -#include "zend_alloc.h" - -typedef unsigned char zend_bool; -typedef unsigned char zend_uchar; -typedef unsigned int zend_uint; -typedef unsigned long zend_ulong; -typedef unsigned short zend_ushort; - -#ifdef HAVE_LIMITS_H -# include -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647L -#endif - -#ifndef LONG_MIN -#define LONG_MIN (- LONG_MAX - 1) -#endif - -#undef SUCCESS -#undef FAILURE -#define SUCCESS 0 -#define FAILURE -1 /* this MUST stay a negative number, or it may affect functions! */ - - -#include "zend_hash.h" -#include "zend_llist.h" - -#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval *this_ptr, int return_value_used TSRMLS_DC -#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, this_ptr, return_value_used TSRMLS_CC - - -/* - * zval - */ -typedef struct _zval_struct zval; -typedef struct _zend_class_entry zend_class_entry; - -typedef struct _zend_object { - zend_class_entry *ce; - HashTable *properties; -} zend_object; - -typedef unsigned int zend_object_handle; -typedef struct _zend_object_value zend_object_value; - -#include "zend_object_handlers.h" - -struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -}; - -typedef union _zvalue_value { - long lval; /* long value */ - double dval; /* double value */ - struct { - char *val; - int len; - } str; - HashTable *ht; /* hash table value */ -/* struct { - zend_class_entry *ce; - HashTable *properties; - } obj; -*/ - zend_object_value obj; -} zvalue_value; - - -struct _zval_struct { - /* Variable information */ - zvalue_value value; /* value */ - zend_uchar type; /* active type */ - zend_uchar is_ref; - zend_ushort refcount; -}; - - - -typedef struct _zend_function_entry { - char *fname; - void (*handler)(INTERNAL_FUNCTION_PARAMETERS); - unsigned char *func_arg_types; -} zend_function_entry; - - -typedef struct _zend_property_reference { - int type; /* read, write or r/w */ - zval *object; - zend_llist *elements_list; -} zend_property_reference; - - - -typedef struct _zend_overloaded_element { - int type; /* array offset or object proprety */ - zval element; -} zend_overloaded_element; - -/* excpt.h on Digital Unix 4.0 defines function_table */ -#undef function_table - -/* A lot of stuff needs shifiting around in order to include zend_compile.h here */ -union _zend_function; - -struct _zend_class_entry { - char type; - char *name; - uint name_length; - struct _zend_class_entry *parent; - int refcount; - zend_bool constants_updated; - - HashTable function_table; - HashTable default_properties; - HashTable private_properties; /* This is only needed at compile-time */ - HashTable class_table; - HashTable *static_members; - HashTable constants_table; - zend_function_entry *builtin_functions; - - union _zend_function *constructor; - union _zend_function *destructor; - union _zend_function *clone; - - /* handlers */ - zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC); - void (*handle_function_call)(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); - zval (*handle_property_get)(zend_property_reference *property_reference); - int (*handle_property_set)(zend_property_reference *property_reference, zval *value); -}; - - - -typedef struct _zend_utility_functions { - void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); - int (*printf_function)(const char *format, ...); - int (*write_function)(const char *str, uint str_length); - FILE *(*fopen_function)(const char *filename, char **opened_path); - void (*message_handler)(long message, void *data); - void (*block_interruptions)(void); - void (*unblock_interruptions)(void); - int (*get_configuration_directive)(char *name, uint name_length, zval *contents); - void (*ticks_function)(int ticks); -} zend_utility_functions; - - -typedef struct _zend_utility_values { - char *import_use_extension; - uint import_use_extension_length; -} zend_utility_values; - - -typedef int (*zend_write_func_t)(const char *str, uint str_length); - - -#undef MIN -#undef MAX -#define MAX(a, b) (((a)>(b))?(a):(b)) -#define MIN(a, b) (((a)<(b))?(a):(b)) -#define ZEND_STRL(str) (str), (sizeof(str)-1) -#define ZEND_STRS(str) (str), (sizeof(str)) -#define ZEND_NORMALIZE_BOOL(n) \ - ((n) ? (((n)>0) ? 1 : -1) : 0) - - -/* data types */ -#define IS_NULL 0 -#define IS_LONG 1 -#define IS_DOUBLE 2 -#define IS_STRING 3 -#define IS_ARRAY 4 -#define IS_OBJECT 5 -#define IS_BOOL 6 -#define IS_RESOURCE 7 -#define IS_CONSTANT 8 -#define IS_CONSTANT_ARRAY 9 - -/* Special data type to temporarily mark large numbers */ -#define FLAG_IS_BC 10 /* for parser internal use only */ - -/* Ugly hack to support constants as static array indices */ -#define IS_CONSTANT_INDEX 0x80 - - -/* overloaded elements data types */ -#define OE_IS_ARRAY (1<<0) -#define OE_IS_OBJECT (1<<1) -#define OE_IS_METHOD (1<<2) - - -/* Argument passing types */ -#define BYREF_NONE 0 -#define BYREF_FORCE 1 -#define BYREF_ALLOW 2 -#define BYREF_FORCE_REST 3 - -int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions); -void zend_shutdown(TSRMLS_D); - -void zend_set_utility_values(zend_utility_values *utility_values); - -BEGIN_EXTERN_C() -ZEND_API void _zend_bailout(char *filename, uint lineno); -END_EXTERN_C() - -#define zend_bailout() _zend_bailout(__FILE__, __LINE__) - -#define zend_try \ - { \ - jmp_buf orig_bailout; \ - zend_bool orig_bailout_set=EG(bailout_set); \ - \ - EG(bailout_set) = 1; \ - memcpy(&orig_bailout, &EG(bailout), sizeof(jmp_buf)); \ - if (setjmp(EG(bailout))==0) -#define zend_catch \ - else -#define zend_end_try() \ - memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); \ - EG(bailout_set) = orig_bailout_set; \ - } -#define zend_first_try EG(bailout_set)=0; zend_try - -ZEND_API char *get_zend_version(void); -ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy); -ZEND_API int zend_print_zval(zval *expr, int indent); -ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent); -ZEND_API void zend_print_zval_r(zval *expr, int indent); -ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent); -ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...); - -#if ZEND_DEBUG -#define Z_DBG(expr) (expr) -#else -#define Z_DBG(expr) -#endif - -ZEND_API extern char *empty_string; - -ZEND_API void free_estring(char **str_p); - -#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); } -#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); } - -#define STR_REALLOC(ptr, size) \ - if (ptr!=empty_string) { \ - ptr = (char *) erealloc(ptr, size); \ - } else { \ - ptr = (char *) emalloc(size); \ - memset(ptr, 0, size); \ - } - -/* output support */ -#define ZEND_WRITE(str, str_len) zend_write((str), (str_len)) -#define ZEND_PUTS(str) zend_write((str), strlen((str))) -#define ZEND_PUTC(c) zend_write(&(c), 1), (c) - - -BEGIN_EXTERN_C() -extern ZEND_API int (*zend_printf)(const char *format, ...); -extern ZEND_API zend_write_func_t zend_write; -extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); -extern ZEND_API void (*zend_block_interruptions)(void); -extern ZEND_API void (*zend_unblock_interruptions)(void); -extern ZEND_API void (*zend_ticks_function)(int ticks); -extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); - - -ZEND_API void zend_error(int type, const char *format, ...); - -void zenderror(char *error); - -/* The following #define is used for code duality in PHP for Engine 1 & 2 */ -#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def -extern ZEND_API zend_class_entry *zend_standard_class_def; -extern zend_utility_values zend_uv; -extern ZEND_API zval zval_used_for_init; - -END_EXTERN_C() - -#define ZEND_UV(name) (zend_uv.name) - - -#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); } -#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); } - -BEGIN_EXTERN_C() -ZEND_API void zend_message_dispatcher(long message, void *data); -END_EXTERN_C() - -ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents); - - -/* Messages for applications of Zend */ -#define ZMSG_FAILED_INCLUDE_FOPEN 1L -#define ZMSG_FAILED_REQUIRE_FOPEN 2L -#define ZMSG_FAILED_HIGHLIGHT_FOPEN 3L -#define ZMSG_MEMORY_LEAK_DETECTED 4L -#define ZMSG_MEMORY_LEAK_REPEATED 5L -#define ZMSG_LOG_SCRIPT_NAME 6L - - -#define ZVAL_ADDREF(pz) (++(pz)->refcount) -#define ZVAL_DELREF(pz) (--(pz)->refcount) -#define ZVAL_REFCOUNT(pz) ((pz)->refcount) - -#define INIT_PZVAL(z) \ - (z)->refcount = 1; \ - (z)->is_ref = 0; - -#define INIT_ZVAL(z) z = zval_used_for_init; - -#define ALLOC_INIT_ZVAL(zp) \ - ALLOC_ZVAL(zp); \ - INIT_ZVAL(*zp); - -#define MAKE_STD_ZVAL(zv) \ - ALLOC_ZVAL(zv); \ - INIT_PZVAL(zv); - -#define PZVAL_IS_REF(z) ((z)->is_ref) - -#define SEPARATE_ZVAL(ppzv) \ - { \ - zval *orig_ptr = *(ppzv); \ - \ - if (orig_ptr->refcount>1) { \ - orig_ptr->refcount--; \ - ALLOC_ZVAL(*(ppzv)); \ - **(ppzv) = *orig_ptr; \ - zval_copy_ctor(*(ppzv)); \ - (*(ppzv))->refcount=1; \ - (*(ppzv))->is_ref = 0; \ - } \ - } - -#define SEPARATE_ZVAL_IF_NOT_REF(ppzv) \ - if (!PZVAL_IS_REF(*ppzv)) { \ - SEPARATE_ZVAL(ppzv); \ - } - -#define SEPARATE_ZVAL_TO_MAKE_IS_REF(ppzv) \ - if (!PZVAL_IS_REF(*ppzv)) { \ - SEPARATE_ZVAL(ppzv); \ - (*(ppzv))->is_ref = 1; \ - } - -#define COPY_PZVAL_TO_ZVAL(zv, pzv) \ - (zv) = *(pzv); \ - if ((pzv)->refcount>1) { \ - zval_copy_ctor(&(zv)); \ - (pzv)->refcount--; \ - } else { \ - FREE_ZVAL(pzv); \ - } \ - INIT_PZVAL(&(zv)); - -#define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) { \ - int is_ref, refcount; \ - \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \ - is_ref = (*ppzv_dest)->is_ref; \ - refcount = (*ppzv_dest)->refcount; \ - zval_dtor(*ppzv_dest); \ - **ppzv_dest = *pzv_src; \ - if (copy) { \ - zval_copy_ctor(*ppzv_dest); \ - } \ - (*ppzv_dest)->is_ref = is_ref; \ - (*ppzv_dest)->refcount = refcount; \ -} - -#define ZEND_MAX_RESERVED_RESOURCES 4 - -#ifdef ZEND_WIN32 -/* Only use this macro if you know for sure that all of the switches values - are covered by its case statements */ -#define EMPTY_SWITCH_DEFAULT_CASE() \ - default: \ - __assume(0); \ - break; -#else -#define EMPTY_SWITCH_DEFAULT_CASE() -#endif - -#endif /* ZEND_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend.ico b/Zend/zend.ico deleted file mode 100644 index 80978a6c7eb9797674ed75679fced786ad6f47a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1382 zcmbW$F>KmE7>41m6)kkj%9h1ZSG*H3pvo{Yl(2iMgoGk_h{X~QY0Lx?L&l6%WhR!0 zEEUQCQin`dhlmNJsH2sIE!X!p6bIZ zsmI*m;qLnPm(sV__S|aeb4mL0hWi*>aY)$pY?te^b8O$0!zL&1Xc^{tny=={zJ5}g8BNzl!_=s|F!E+bPC}k+j8{_sR`Rc;W+1sO zr5pSbKf#ai0ltH66AgS7U%@;0GM;s(Q~VI$#d~-Mt7if)yzs)Sr44?GpWsLM0N=s4 z*~13Dim%`ud>NnN*Z35_z|ZgrKEaRieY}rv;$6JK8@$0Ayulm%Gj&D1rCw13YAg2{ zevMD@3;YakS5MGmbRX@bn`oEyH~1xff*;`nd~3HXCHKN;WHG(;=H>e1>1+Q~Uxy!zcIzKgRd*KE8=}?N^C6 zc!M{1gEu@6+qGi5ZrQFYwku$}S}iHVukk5Vp7i+msE3CK-QVBq?(R-EH#bU>MAz5X8jr`iyu4Ju-&e2KlkfXFIXO|Y+0^mz Mv0T^H(b1890N*_06aWAK diff --git a/Zend/zend_API.c b/Zend/zend_API.c deleted file mode 100644 index 26ee2ce77d6..00000000000 --- a/Zend/zend_API.c +++ /dev/null @@ -1,1417 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_execute.h" -#include "zend_API.h" -#include "zend_modules.h" -#include "zend_constants.h" - -#ifdef HAVE_STDARG_H -#include -#endif - -/* these variables are true statics/globals, and have to be mutex'ed on every access */ -static int module_count=0; -ZEND_API HashTable module_registry; - -/* this function doesn't check for too many parameters */ -ZEND_API int zend_get_parameters(int ht, int param_count, ...) -{ - void **p; - int arg_count; - va_list ptr; - zval **param, *param_ptr; - TSRMLS_FETCH(); - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - if (param_count>arg_count) { - return FAILURE; - } - - va_start(ptr, param_count); - - while (param_count-->0) { - param = va_arg(ptr, zval **); - param_ptr = *(p-arg_count); - if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) { - zval *new_tmp; - - ALLOC_ZVAL(new_tmp); - *new_tmp = *param_ptr; - zval_copy_ctor(new_tmp); - INIT_PZVAL(new_tmp); - param_ptr = new_tmp; - ((zval *) *(p-arg_count))->refcount--; - *(p-arg_count) = param_ptr; - } - *param = param_ptr; - arg_count--; - } - va_end(ptr); - - return SUCCESS; -} - - -ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC) -{ - void **p; - int arg_count; - zval *param_ptr; - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - if (param_count>arg_count) { - return FAILURE; - } - - while (param_count-->0) { - param_ptr = *(p-arg_count); - if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) { - zval *new_tmp; - - ALLOC_ZVAL(new_tmp); - *new_tmp = *param_ptr; - zval_copy_ctor(new_tmp); - INIT_PZVAL(new_tmp); - param_ptr = new_tmp; - ((zval *) *(p-arg_count))->refcount--; - *(p-arg_count) = param_ptr; - } - *(argument_array++) = param_ptr; - arg_count--; - } - - return SUCCESS; -} - - - - -/* Zend-optimized Extended functions */ -/* this function doesn't check for too many parameters */ -ZEND_API int zend_get_parameters_ex(int param_count, ...) -{ - void **p; - int arg_count; - va_list ptr; - zval ***param; - TSRMLS_FETCH(); - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - if (param_count>arg_count) { - return FAILURE; - } - - va_start(ptr, param_count); - while (param_count-->0) { - param = va_arg(ptr, zval ***); - *param = (zval **) p-(arg_count--); - } - va_end(ptr); - - return SUCCESS; -} - - -ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC) -{ - void **p; - int arg_count; - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - if (param_count>arg_count) { - return FAILURE; - } - - while (param_count-->0) { - *(argument_array++) = (zval **) p-(arg_count--); - } - - return SUCCESS; -} - - -ZEND_API void zend_wrong_param_count(TSRMLS_D) -{ - zend_error(E_WARNING, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C)); -} - - -/* Argument parsing API -- andrei */ - -ZEND_API char *zend_zval_type_name(zval *arg) -{ - switch (Z_TYPE_P(arg)) { - case IS_NULL: - return "null"; - - case IS_LONG: - return "integer"; - - case IS_DOUBLE: - return "double"; - - case IS_STRING: - return "string"; - - case IS_ARRAY: - return "array"; - - case IS_OBJECT: - return "object"; - - case IS_BOOL: - return "boolean"; - - case IS_RESOURCE: - return "resource"; - - default: - return "unknown"; - } -} - -static int zend_check_class(zval *obj, zend_class_entry *expected_ce) -{ - zend_class_entry *ce; - - if (Z_TYPE_P(obj) != IS_OBJECT) { - return 0; - } - - /* TBI!! new object handlers */ - if(!IS_ZEND_STD_OBJECT(*obj)) { - return 0; - } - - for (ce = Z_OBJCE_P(obj); ce != NULL; ce = ce->parent) { - if (ce == expected_ce) { - return 1; - } - } - return 0; -} - -static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec) -{ - char *spec_walk = *spec; - char c = *spec_walk++; - int return_null = 0; - - while (*spec_walk == '/' || *spec_walk == '!') { - if (*spec_walk == '/') { - SEPARATE_ZVAL_IF_NOT_REF(arg); - } else if (*spec_walk == '!' && Z_TYPE_PP(arg) == IS_NULL) { - return_null = 1; - } - spec_walk++; - } - - switch (c) { - case 'l': - { - long *p = va_arg(*va, long *); - switch (Z_TYPE_PP(arg)) { - case IS_STRING: - { - double d; - int type; - - if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, &d, 0)) == 0) { - return "long"; - } else if (type == IS_DOUBLE) { - *p = (long) d; - } - } - break; - - case IS_NULL: - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - convert_to_long_ex(arg); - *p = Z_LVAL_PP(arg); - break; - - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - default: - return "long"; - } - } - break; - - case 'd': - { - double *p = va_arg(*va, double *); - switch (Z_TYPE_PP(arg)) { - case IS_STRING: - { - long l; - int type; - - if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &l, p, 0)) == 0) { - return "double"; - } else if (type == IS_LONG) { - *p = (double) l; - } - } - break; - - case IS_NULL: - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - convert_to_double_ex(arg); - *p = Z_DVAL_PP(arg); - break; - - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - default: - return "double"; - } - } - break; - - case 's': - { - char **p = va_arg(*va, char **); - int *pl = va_arg(*va, int *); - switch (Z_TYPE_PP(arg)) { - case IS_NULL: - if (return_null) { - *p = NULL; - *pl = 0; - break; - } - /* break omitted intentionally */ - - case IS_STRING: - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - convert_to_string_ex(arg); - *p = Z_STRVAL_PP(arg); - *pl = Z_STRLEN_PP(arg); - break; - - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - default: - return "string"; - } - } - break; - - case 'b': - { - zend_bool *p = va_arg(*va, zend_bool *); - switch (Z_TYPE_PP(arg)) { - case IS_NULL: - case IS_STRING: - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - convert_to_boolean_ex(arg); - *p = Z_BVAL_PP(arg); - break; - - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - default: - return "boolean"; - } - } - break; - - case 'r': - { - zval **p = va_arg(*va, zval **); - if (Z_TYPE_PP(arg) != IS_RESOURCE) { - if (Z_TYPE_PP(arg) == IS_NULL && return_null) { - *p = NULL; - } else { - return "resource"; - } - } else - *p = *arg; - } - break; - - case 'a': - { - zval **p = va_arg(*va, zval **); - if (Z_TYPE_PP(arg) != IS_ARRAY) { - if (Z_TYPE_PP(arg) == IS_NULL && return_null) { - *p = NULL; - } else { - return "array"; - } - } else - *p = *arg; - } - break; - - case 'o': - { - zval **p = va_arg(*va, zval **); - if (Z_TYPE_PP(arg) != IS_OBJECT) { - if (Z_TYPE_PP(arg) == IS_NULL && return_null) { - *p = NULL; - } else { - return "object"; - } - } else - *p = *arg; - } - break; - - case 'O': - { - zval **p = va_arg(*va, zval **); - zend_class_entry *ce = va_arg(*va, zend_class_entry *); - if (Z_TYPE_PP(arg) != IS_OBJECT || !zend_check_class(*arg, ce)) { - if (Z_TYPE_PP(arg) == IS_NULL && return_null) { - *p = NULL; - } else { - return ce->name; - } - } else - *p = *arg; - } - break; - - case 'z': - { - zval **p = va_arg(*va, zval **); - if (Z_TYPE_PP(arg) == IS_NULL && return_null) { - *p = NULL; - } else { - *p = *arg; - } - } - break; - - default: - return "unknown"; - } - - *spec = spec_walk; - - return NULL; -} - -static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet TSRMLS_DC) -{ - char *expected_type = NULL; - char buf[1024]; - - expected_type = zend_parse_arg_impl(arg, va, spec); - if (expected_type) { - if (!quiet) { - sprintf(buf, "%s() expects parameter %d to be %s, %s given", - get_active_function_name(TSRMLS_C), arg_num, expected_type, - zend_zval_type_name(*arg)); - zend_error(E_WARNING, buf); - } - return FAILURE; - } - - return SUCCESS; -} - -static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC) -{ - char *spec_walk; - char buf[1024]; - int c, i; - int min_num_args = -1; - int max_num_args = 0; - zval **arg; - void **p; - int arg_count; - int quiet = flags & ZEND_PARSE_PARAMS_QUIET; - - for (spec_walk = type_spec; *spec_walk; spec_walk++) { - c = *spec_walk; - switch (c) { - case 'l': case 'd': - case 's': case 'b': - case 'r': case 'a': - case 'o': case 'O': - case 'z': - max_num_args++; - break; - - case '|': - min_num_args = max_num_args; - break; - - case '/': - case '!': - /* Pass */ - break; - - default: - if (!quiet) { - zend_error(E_WARNING, "%s(): bad type specifier while parsing parameters", get_active_function_name(TSRMLS_C)); - } - return FAILURE; - } - } - - if (min_num_args < 0) { - min_num_args = max_num_args; - } - - if (num_args < min_num_args || num_args > max_num_args) { - if (!quiet) { - sprintf(buf, "%s() expects %s %d parameter%s, %d given", - get_active_function_name(TSRMLS_C), - min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", - num_args < min_num_args ? min_num_args : max_num_args, - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - num_args); - zend_error(E_WARNING, buf); - } - return FAILURE; - } - - p = EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - if (num_args > arg_count) { - zend_error(E_WARNING, "%s(): could not obtain parameters for parsing", - get_active_function_name(TSRMLS_C)); - return FAILURE; - } - - i = 0; - while (num_args-- > 0) { - arg = (zval **) p - (arg_count-i); - if (*type_spec == '|') { - type_spec++; - } - if (zend_parse_arg(i+1, arg, va, &type_spec, quiet TSRMLS_CC) == FAILURE) { - return FAILURE; - } - i++; - } - - return SUCCESS; -} - -ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...) -{ - va_list va; - int retval; - - va_start(va, type_spec); - retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC); - va_end(va); - - return retval; -} - -ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...) -{ - va_list va; - int retval; - - va_start(va, type_spec); - retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC); - va_end(va); - - return retval; -} - -/* Argument parsing API -- andrei */ - - -ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC) -{ - ALLOC_HASHTABLE_REL(arg->value.ht); - - zend_hash_init(arg->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - arg->type = IS_ARRAY; - return SUCCESS; -} - - -ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) -{ - zval *tmp; - zend_object *object; - - if (!class_type->constants_updated) { - zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - class_type->constants_updated = 1; - } - - arg->type = IS_OBJECT; - if(class_type->create_object == NULL) { - arg->value.obj = zend_objects_new(&object, class_type); - if (properties) { - object->properties = properties; - } else { - ALLOC_HASHTABLE_REL(object->properties); - zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(object->properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - } else { - arg->value.obj = class_type->create_object(class_type TSRMLS_CC); - } - return SUCCESS; -} - -ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC TSRMLS_DC) -{ - return _object_and_properties_init(arg, class_type, 0 ZEND_FILE_LINE_CC TSRMLS_CC); -} - -ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC) -{ - return _object_init_ex(arg, zend_standard_class_def ZEND_FILE_LINE_CC TSRMLS_CC); -} - - -ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)) -{ - zend_error(E_WARNING, "add_assoc_function() is no longer supported"); - return FAILURE; -} - - -ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value) -{ - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_long(zval *arg, uint index, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_null(zval *arg, uint index) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_index_bool(zval *arg, uint index, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_resource(zval *arg, uint index, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_double(zval *arg, uint index, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_string(zval *arg, uint index, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_stringl(zval *arg, uint index, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_index_zval(zval *arg, uint index, zval *value) -{ - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &value, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_long(zval *arg, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_null(zval *arg) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_bool(zval *arg, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_resource(zval *arg, int r) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, r); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_double(zval *arg, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_next_index_zval(zval *arg, zval *value) -{ - return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &value, sizeof(zval *), NULL); -} - - -ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_get_index_long(zval *arg, uint index, long l, void **dest) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, l); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_get_index_double(zval *arg, uint index, double d, void **dest) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_get_index_string(zval *arg, uint index, char *str, void **dest, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_get_index_stringl(zval *arg, uint index, char *str, uint length, void **dest, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest); -} - - -ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_LONG(tmp, n); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_BOOL(tmp, b); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_NULL(tmp); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_RESOURCE(tmp, n); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_DOUBLE(tmp, d); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - - -ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRING(tmp, str, duplicate); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate) -{ - zval *tmp; - - MAKE_STD_ZVAL(tmp); - ZVAL_STRINGL(tmp, str, length, duplicate); - - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL); -} - -ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value) -{ - return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL); -} - -ZEND_API int zend_startup_module(zend_module_entry *module) -{ - if (module) { - module->module_number = zend_next_free_module(); - if (module->module_startup_func) { - TSRMLS_FETCH(); - - if (module->module_startup_func(MODULE_PERSISTENT, module->module_number TSRMLS_CC)==FAILURE) { - zend_error(E_CORE_ERROR,"Unable to start %s module", module->name); - return FAILURE; - } - } - module->type = MODULE_PERSISTENT; - zend_register_module(module); - } - return SUCCESS; -} - - -/* registers all functions in *library_functions in the function hash */ -int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC) -{ - zend_function_entry *ptr = functions; - zend_function function; - zend_internal_function *internal_function = (zend_internal_function *)&function; - int count=0, unload=0; - HashTable *target_function_table = function_table; - int error_type; - - if (type==MODULE_PERSISTENT) { - error_type = E_CORE_WARNING; - } else { - error_type = E_WARNING; - } - - if (!target_function_table) { - target_function_table = CG(function_table); - } - internal_function->type = ZEND_INTERNAL_FUNCTION; - - while (ptr->fname) { - internal_function->handler = ptr->handler; - internal_function->arg_types = ptr->func_arg_types; - internal_function->function_name = ptr->fname; - internal_function->scope = NULL; - if (!internal_function->handler) { - zend_error(error_type, "Null function defined as active function"); - zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); - return FAILURE; - } - if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &function, sizeof(zend_function), NULL) == FAILURE) { - unload=1; - break; - } - ptr++; - count++; - } - if (unload) { /* before unloading, display all remaining bad function in the module */ - while (ptr->fname) { - if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) { - zend_error(error_type, "Function registration failed - duplicate name - %s", ptr->fname); - } - ptr++; - } - zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); - return FAILURE; - } - return SUCCESS; -} - -/* count=-1 means erase all functions, otherwise, - * erase the first count functions - */ -void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC) -{ - zend_function_entry *ptr = functions; - int i=0; - HashTable *target_function_table = function_table; - - if (!target_function_table) { - target_function_table = CG(function_table); - } - while (ptr->fname) { - if (count!=-1 && i>=count) { - break; - } -#if 0 - zend_printf("Unregistering %s()\n", ptr->fname); -#endif - zend_hash_del(target_function_table, ptr->fname, strlen(ptr->fname)+1); - ptr++; - i++; - } -} - - -ZEND_API int zend_register_module(zend_module_entry *module) -{ - TSRMLS_FETCH(); - -#if 0 - zend_printf("%s: Registering module %d\n", module->name, module->module_number); -#endif - if (module->functions && zend_register_functions(module->functions, NULL, module->type TSRMLS_CC)==FAILURE) { - zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name); - return FAILURE; - } - module->module_started=1; - return zend_hash_add(&module_registry, module->name, strlen(module->name)+1, (void *)module, sizeof(zend_module_entry), NULL); -} - - -void module_destructor(zend_module_entry *module) -{ - TSRMLS_FETCH(); - - if (module->type == MODULE_TEMPORARY) { - zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC); - clean_module_constants(module->module_number TSRMLS_CC); - if (module->request_shutdown_func) - module->request_shutdown_func(module->type, module->module_number TSRMLS_CC); - } - - if (module->module_started && module->module_shutdown_func) { -#if 0 - zend_printf("%s: Module shutdown\n", module->name); -#endif - module->module_shutdown_func(module->type, module->module_number TSRMLS_CC); - } - module->module_started=0; - if (module->functions) { - zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC); - } - -#if HAVE_LIBDL - if (module->handle) { - dlclose(module->handle); - } -#endif -} - - -/* call request startup for all modules */ -int module_registry_request_startup(zend_module_entry *module TSRMLS_DC) -{ - if (module->request_startup_func) { -#if 0 - zend_printf("%s: Request startup\n", module->name); -#endif - if (module->request_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) { - zend_error(E_WARNING, "request_startup() for %s module failed", module->name); - exit(1); - } - } - return 0; -} - - -/* for persistent modules - call request shutdown and flag NOT to erase - * for temporary modules - do nothing, and flag to erase - */ -int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) -{ - switch(module->type) { - case MODULE_PERSISTENT: - if (module->request_shutdown_func) { -#if 0 - zend_printf("%s: Request shutdown\n", module->name); -#endif - module->request_shutdown_func(module->type, module->module_number TSRMLS_CC); - } - return 0; - break; - case MODULE_TEMPORARY: - return 1; - break; - } - return 0; -} - - -/* return the next free module number */ -int zend_next_free_module(void) -{ - return ++module_count; -} - -/* If parent_ce is not NULL then it inherits from parent_ce - * If parent_ce is NULL and parent_name isn't then it looks for the parent and inherits from it - * If both parent_ce and parent_name are NULL it does a regular class registration - * If parent_name is specified but not found NULL is returned - */ -ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC) -{ - zend_class_entry *register_class; - - if (!parent_ce && parent_name) { - zend_class_entry **pce; - if (zend_hash_find(CG(class_table), parent_name, strlen(parent_name)+1, (void **) &pce)==FAILURE) { - return NULL; - } else { - parent_ce = *pce; - } - } - - register_class = zend_register_internal_class(class_entry TSRMLS_CC); - - if (parent_ce) { - zend_do_inheritance(register_class, parent_ce); - } - return register_class; -} - -ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_class_entry TSRMLS_DC) -{ - zend_class_entry *class_entry = malloc(sizeof(zend_class_entry)); - char *lowercase_name = zend_strndup(orig_class_entry->name, orig_class_entry->name_length); - *class_entry = *orig_class_entry; - - zend_str_tolower(lowercase_name, class_entry->name_length); - - class_entry->type = ZEND_INTERNAL_CLASS; - class_entry->parent = NULL; - class_entry->refcount = 1; - class_entry->constants_updated = 0; - zend_hash_init(&class_entry->default_properties, 0, NULL, ZVAL_PTR_DTOR, 1); - zend_hash_init(&class_entry->private_properties, 0, NULL, ZVAL_PTR_DTOR, 1); - class_entry->static_members = (HashTable *) malloc(sizeof(HashTable)); - zend_hash_init(class_entry->static_members, 0, NULL, ZVAL_PTR_DTOR, 1); - zend_hash_init(&class_entry->constants_table, 0, NULL, ZVAL_PTR_DTOR, 1); - zend_hash_init(&class_entry->function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1); - zend_hash_init(&class_entry->class_table, 10, NULL, ZEND_CLASS_DTOR, 1); - - if (class_entry->builtin_functions) { - zend_register_functions(class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC); - } - - zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, &class_entry, sizeof(zend_class_entry *), NULL); - free(lowercase_name); - return class_entry; -} - - -ZEND_API zend_module_entry *zend_get_module(int module_number) -{ - zend_module_entry *module; - - if (zend_hash_index_find(&module_registry, module_number, (void **) &module)==SUCCESS) { - return module; - } else { - return NULL; - } -} - -ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, - int is_ref, int num_symbol_tables, ...) -{ - HashTable *symbol_table; - va_list symbol_table_list; - - if (num_symbol_tables <= 0) return FAILURE; - - symbol->is_ref = is_ref; - - va_start(symbol_table_list, num_symbol_tables); - while (num_symbol_tables-- > 0) { - symbol_table = va_arg(symbol_table_list, HashTable *); - zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL); - zval_add_ref(&symbol); - } - va_end(symbol_table_list); - return SUCCESS; -} - - - - -/* Disabled functions support */ - -static ZEND_FUNCTION(display_disabled_function) -{ - zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name(TSRMLS_C)); -} - - -static zend_function_entry disabled_function[] = { - ZEND_FE(display_disabled_function, NULL) - { NULL, NULL, NULL } -}; - - -ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) -{ - if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) { - return FAILURE; - } - disabled_function[0].fname = function_name; - return zend_register_functions(disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC); -} - -zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name) -{ - char *lcname; - int retval = 0; - TSRMLS_FETCH(); - - switch (Z_TYPE_P(callable)) { - case IS_STRING: - if (callable_name) - *callable_name = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); - - if (syntax_only) - return 1; - - lcname = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); - zend_str_tolower(lcname, Z_STRLEN_P(callable)); - if (zend_hash_exists(EG(function_table), lcname, Z_STRLEN_P(callable)+1)) - retval = 1; - efree(lcname); - break; - - case IS_ARRAY: - { - zval **method; - zval **obj; - zend_class_entry *ce = NULL, **pce; - char callable_name_len; - - if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 && - zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS && - zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS && - (Z_TYPE_PP(obj) == IS_OBJECT || Z_TYPE_PP(obj) == IS_STRING) && - Z_TYPE_PP(method) == IS_STRING) { - - if (Z_TYPE_PP(obj) == IS_STRING) { - if (callable_name) { - char *ptr; - - callable_name_len = Z_STRLEN_PP(obj) + Z_STRLEN_PP(method) + sizeof("::"); - ptr = *callable_name = emalloc(callable_name_len); - memcpy(ptr, Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); - ptr += Z_STRLEN_PP(obj); - memcpy(ptr, "::", sizeof("::") - 1); - ptr += sizeof("::") - 1; - memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1); - } - - if (syntax_only) - return 1; - - lcname = estrndup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); - zend_str_tolower(lcname, Z_STRLEN_PP(obj)); - if(zend_hash_find(EG(class_table), lcname, Z_STRLEN_PP(obj) + 1, (void**)&pce) == SUCCESS) { - ce = *pce; - } - - efree(lcname); - } else { - ce = Z_OBJCE_PP(obj); /* ??? */ - - if (callable_name) { - char *ptr; - - callable_name_len = ce->name_length + Z_STRLEN_PP(method) + sizeof("::"); - ptr = *callable_name = emalloc(callable_name_len); - memcpy(ptr, ce->name, ce->name_length); - ptr += ce->name_length; - memcpy(ptr, "::", sizeof("::") - 1); - ptr += sizeof("::") - 1; - memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1); - } - - if (syntax_only) - return 1; - } - - if (ce) { - lcname = estrndup(Z_STRVAL_PP(method), Z_STRLEN_PP(method)); - zend_str_tolower(lcname, Z_STRLEN_PP(method)); - if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1)) - retval = 1; - efree(lcname); - } - } else if (callable_name) - *callable_name = estrndup("Array", sizeof("Array")-1); - } - break; - - default: - if (callable_name) { - zval expr_copy; - int use_copy; - - zend_make_printable_zval(callable, &expr_copy, &use_copy); - *callable_name = estrndup(Z_STRVAL(expr_copy), Z_STRLEN(expr_copy)); - zval_dtor(&expr_copy); - } - break; - } - - return retval; -} - -ZEND_API char *zend_get_module_version(char *module_name) -{ - zend_module_entry *module; - - if (zend_hash_find(&module_registry, module_name, strlen(module_name) + 1, - (void**)&module) == FAILURE) { - return NULL; - } - return module->version; -} diff --git a/Zend/zend_API.h b/Zend/zend_API.h deleted file mode 100644 index c78c2fa1dbc..00000000000 --- a/Zend/zend_API.h +++ /dev/null @@ -1,435 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Andrei Zmievski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_API_H -#define ZEND_API_H - -#include "zend_modules.h" -#include "zend_list.h" -#include "zend_fast_cache.h" -#include "zend_operators.h" -#include "zend_variables.h" -#include "zend_execute.h" - -#define ZEND_FN(name) zif_##name -#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS) -#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name)) - -#define ZEND_NAMED_FE(zend_name, name, arg_types) { #zend_name, name, arg_types }, -#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(name), arg_types) -#define ZEND_FALIAS(name, alias, arg_types) ZEND_NAMED_FE(name, ZEND_FN(alias), arg_types) -#define ZEND_STATIC_FE(name, impl_name, arg_types) { name, impl_name, arg_types }, - -/* Name macros */ -#define ZEND_MODULE_STARTUP_N(module) zm_startup_##module -#define ZEND_MODULE_SHUTDOWN_N(module) zm_shutdown_##module -#define ZEND_MODULE_ACTIVATE_N(module) zm_activate_##module -#define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module -#define ZEND_MODULE_INFO_N(module) zm_info_##module - -/* Declaration macros */ -#define ZEND_MODULE_STARTUP_D(module) int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS) -#define ZEND_MODULE_SHUTDOWN_D(module) int ZEND_MODULE_SHUTDOWN_N(module)(SHUTDOWN_FUNC_ARGS) -#define ZEND_MODULE_ACTIVATE_D(module) int ZEND_MODULE_ACTIVATE_N(module)(INIT_FUNC_ARGS) -#define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS) -#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS) - -#define ZEND_GET_MODULE(name) \ - ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; } - -#define ZEND_BEGIN_MODULE_GLOBALS(module_name) \ - typedef struct _zend_##module_name##_globals { -#define ZEND_END_MODULE_GLOBALS(module_name) \ - } zend_##module_name##_globals; - -#ifdef ZTS - -#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \ - ts_rsrc_id module_name##_globals_id; -#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \ - extern ts_rsrc_id module_name##_globals_id; -#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \ - ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor); - -#else - -#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \ - zend_##module_name##_globals module_name##_globals; -#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \ - extern zend_##module_name##_globals module_name##_globals; -#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \ - globals_ctor(&module_name##_globals); - -#endif - - - -#define INIT_CLASS_ENTRY(class_container, class_name, functions) \ - { \ - class_container.name = strdup(class_name); \ - class_container.name_length = sizeof(class_name)-1; \ - class_container.builtin_functions = functions; \ - class_container.constructor = NULL; \ - class_container.destructor = NULL; \ - class_container.clone = NULL; \ - class_container.create_object = NULL; \ - class_container.handle_function_call = NULL; \ - class_container.handle_property_get = NULL; \ - class_container.handle_property_set = NULL; \ - } - -#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \ - { \ - class_container.name = strdup(class_name); \ - class_container.name_length = sizeof(class_name)-1; \ - class_container.builtin_functions = functions; \ - class_container.constructor = NULL; \ - class_container.destructor = NULL; \ - class_container.clone = NULL; \ - class_container.create_object = NULL; \ - class_container.handle_function_call = handle_fcall; \ - class_container.handle_property_get = handle_propget; \ - class_container.handle_property_set = handle_propset; \ - } - - - -int zend_next_free_module(void); - -ZEND_API int zend_get_parameters(int ht, int param_count, ...); -ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC); -ZEND_API int zend_get_parameters_ex(int param_count, ...); -ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC); - -#define zend_get_parameters_array(ht, param_count, argument_array) \ - _zend_get_parameters_array(ht, param_count, argument_array TSRMLS_CC) -#define zend_get_parameters_array_ex(param_count, argument_array) \ - _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC) - - -/* Parameter parsing API -- andrei */ - -#define ZEND_PARSE_PARAMS_QUIET 1<<1 -ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...); -ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...); -ZEND_API char *zend_zval_type_name(zval *arg); - -/* End of parameter parsing API -- andrei */ - -int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC); -void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC); -ZEND_API int zend_register_module(zend_module_entry *module_entry); - -ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC); -ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC); - -ZEND_API zend_module_entry *zend_get_module(int module_number); -ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC); - -ZEND_API void zend_wrong_param_count(TSRMLS_D); -ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name); -ZEND_API char *zend_get_module_version(char *module_name); - -#define getThis() (this_ptr) - -#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT() -#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) -#define ARG_COUNT(dummy) (ht) -#define ZEND_NUM_ARGS() (ht) -#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(TSRMLS_C); return; } -#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { zend_wrong_param_count(TSRMLS_C); return ret; } - -#ifndef ZEND_WIN32 -#define DLEXPORT -#endif - -ZEND_API int zend_startup_module(zend_module_entry *module); - -#define array_init(arg) _array_init((arg) ZEND_FILE_LINE_CC) -#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC) -#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC) -#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC TSRMLS_CC) -ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC); -ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC); -ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC); -ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC); - -/* no longer supported */ -ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS)); - -ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n); -ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len); -ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b); -ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r); -ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d); -ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate); -ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value); - -#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n) -#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1) -#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b) -#define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r) -#define add_assoc_double(__arg, __key, __d) add_assoc_double_ex(__arg, __key, strlen(__key)+1, __d) -#define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) -#define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) -#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value) - -/* unset() functions are only suported for legacy modules and null() functions should be used */ -#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1) -#define add_index_unset(__arg, __key) add_index_null(__arg, __key) -#define add_next_index_unset(__arg) add_next_index_null(__arg) -#define add_property_unset(__arg, __key) add_property_null(__arg, __key) - -ZEND_API int add_index_long(zval *arg, uint idx, long n); -ZEND_API int add_index_null(zval *arg, uint idx); -ZEND_API int add_index_bool(zval *arg, uint idx, int b); -ZEND_API int add_index_resource(zval *arg, uint idx, int r); -ZEND_API int add_index_double(zval *arg, uint idx, double d); -ZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate); -ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate); -ZEND_API int add_index_zval(zval *arg, uint index, zval *value); - -ZEND_API int add_next_index_long(zval *arg, long n); -ZEND_API int add_next_index_null(zval *arg); -ZEND_API int add_next_index_bool(zval *arg, int b); -ZEND_API int add_next_index_resource(zval *arg, int r); -ZEND_API int add_next_index_double(zval *arg, double d); -ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate); -ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate); -ZEND_API int add_next_index_zval(zval *arg, zval *value); - -ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate); -ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate); - -#define add_get_assoc_string(__arg, __key, __str, __dest, __duplicate) add_get_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __dest, __duplicate) -#define add_get_assoc_stringl(__arg, __key, __str, __length, __dest, __duplicate) add_get_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __dest, __duplicate) - -ZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest); -ZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest); -ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate); -ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate); - -ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l); -ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len); -ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b); -ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long r); -ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d); -ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate); -ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate); -ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value); - -#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n) -#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1) -#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b) -#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r) -#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d) -#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate) -#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate) -#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value) - -ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[] TSRMLS_DC); -ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC); - -ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length, - int is_ref, int num_symbol_tables, ...); - -#define add_method(arg, key, method) add_assoc_function((arg), (key), (method)) - -#if ZEND_DEBUG -#define CHECK_ZVAL_STRING(z) \ - if ((z)->value.str.val[ (z)->value.str.len ] != '\0') zend_error(E_WARNING, "String is not zero-terminated (%s)", (z)->value.str.val); -#define CHECK_ZVAL_STRING_REL(z) \ - if ((z)->value.str.val[ (z)->value.str.len ] != '\0') zend_error(E_WARNING, "String is not zero-terminated (%s) (source: %s:%d)", (z)->value.str.val ZEND_FILE_LINE_RELAY_CC); -#else -#define CHECK_ZVAL_STRING(z) -#define CHECK_ZVAL_STRING_REL(z) -#endif - -#define ZVAL_RESOURCE(z, l) { \ - (z)->type = IS_RESOURCE; \ - (z)->value.lval = l; \ - } - -#define ZVAL_BOOL(z, b) { \ - (z)->type = IS_BOOL; \ - (z)->value.lval = b; \ - } - -#define ZVAL_NULL(z) { \ - (z)->type = IS_NULL; \ - } - -#define ZVAL_LONG(z, l) { \ - (z)->type = IS_LONG; \ - (z)->value.lval = l; \ - } - -#define ZVAL_DOUBLE(z, d) { \ - (z)->type = IS_DOUBLE; \ - (z)->value.dval = d; \ - } - -#define ZVAL_STRING(z, s, duplicate) { \ - char *__s=(s); \ - (z)->value.str.len = strlen(__s); \ - (z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):__s); \ - (z)->type = IS_STRING; \ - } - -#define ZVAL_STRINGL(z, s, l, duplicate) { \ - char *__s=(s); int __l=l; \ - (z)->value.str.len = __l; \ - (z)->value.str.val = (duplicate?estrndup(__s, __l):__s); \ - (z)->type = IS_STRING; \ - } - -#define ZVAL_EMPTY_STRING(z) { \ - (z)->value.str.len = 0; \ - (z)->value.str.val = empty_string; \ - (z)->type = IS_STRING; \ - } - -#define ZVAL_FALSE(z) ZVAL_BOOL(z, 0) -#define ZVAL_TRUE(z) ZVAL_BOOL(z, 1) - -#define RETVAL_RESOURCE(l) ZVAL_RESOURCE(return_value, l) -#define RETVAL_BOOL(b) ZVAL_BOOL(return_value, b) -#define RETVAL_NULL() ZVAL_NULL(return_value) -#define RETVAL_LONG(l) ZVAL_LONG(return_value, l) -#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d) -#define RETVAL_STRING(s, duplicate) ZVAL_STRING(return_value, s, duplicate) -#define RETVAL_STRINGL(s, l, duplicate) ZVAL_STRINGL(return_value, s, l, duplicate) -#define RETVAL_EMPTY_STRING() ZVAL_EMPTY_STRING(return_value) -#define RETVAL_FALSE ZVAL_BOOL(return_value, 0) -#define RETVAL_TRUE ZVAL_BOOL(return_value, 1) - -#define RETURN_RESOURCE(l) { RETVAL_RESOURCE(l); return; } -#define RETURN_BOOL(b) { RETVAL_BOOL(b); return; } -#define RETURN_NULL() { RETVAL_NULL(); return;} -#define RETURN_LONG(l) { RETVAL_LONG(l); return; } -#define RETURN_DOUBLE(d) { RETVAL_DOUBLE(d); return; } -#define RETURN_STRING(s, duplicate) { RETVAL_STRING(s, duplicate); return; } -#define RETURN_STRINGL(s, l, duplicate) { RETVAL_STRINGL(s, l, duplicate); return; } -#define RETURN_EMPTY_STRING() { RETVAL_EMPTY_STRING(); return; } -#define RETURN_FALSE { RETVAL_FALSE; return; } -#define RETURN_TRUE { RETVAL_TRUE; return; } - -#define SET_VAR_STRING(n, v) { \ - { \ - zval *var; \ - ALLOC_ZVAL(var); \ - ZVAL_STRING(var, v, 0); \ - ZEND_SET_GLOBAL_VAR(n, var); \ - } \ - } - -#define SET_VAR_STRINGL(n, v, l) { \ - { \ - zval *var; \ - ALLOC_ZVAL(var); \ - ZVAL_STRINGL(var, v, l, 0); \ - ZEND_SET_GLOBAL_VAR(n, var); \ - } \ - } - -#define SET_VAR_LONG(n, v) { \ - { \ - zval *var; \ - ALLOC_ZVAL(var); \ - ZVAL_LONG(var, v); \ - ZEND_SET_GLOBAL_VAR(n, var); \ - } \ - } - -#define SET_VAR_DOUBLE(n, v) { \ - { \ - zval *var; \ - ALLOC_ZVAL(var); \ - ZVAL_DOUBLE(var, v); \ - ZEND_SET_GLOBAL_VAR(n, var); \ - } \ - } - - -#define ZEND_SET_SYMBOL(symtable, name, var) \ - { \ - char *_name = (name); \ - \ - ZEND_SET_SYMBOL_WITH_LENGTH(symtable, _name, strlen(_name)+1, var, 1, 0); \ - } - -#define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \ - { \ - zval **orig_var; \ - \ - if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \ - && PZVAL_IS_REF(*orig_var)) { \ - (var)->refcount = (*orig_var)->refcount; \ - (var)->is_ref = 1; \ - \ - if (_refcount) { \ - (var)->refcount += _refcount-1; \ - } \ - zval_dtor(*orig_var); \ - **orig_var = *(var); \ - FREE_ZVAL(var); \ - } else { \ - (var)->is_ref = _is_ref; \ - if (_refcount) { \ - (var)->refcount = _refcount; \ - } \ - zend_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \ - } \ - } - - -#define ZEND_SET_GLOBAL_VAR(name, var) \ - ZEND_SET_SYMBOL(&EG(symbol_table), name, var) - -#define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \ - ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), name, name_length, var, _refcount, _is_ref) - -#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL))) -#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL) - -/* For compatibility */ -#define ZEND_MINIT ZEND_MODULE_STARTUP_N -#define ZEND_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N -#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N -#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N -#define ZEND_MINFO ZEND_MODULE_INFO_N - -#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D -#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D -#define ZEND_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D -#define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D -#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D - -#endif /* ZEND_API_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c deleted file mode 100644 index b24e31c2a11..00000000000 --- a/Zend/zend_alloc.c +++ /dev/null @@ -1,768 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include - -#include "zend.h" -#include "zend_alloc.h" -#include "zend_globals.h" -#include "zend_fast_cache.h" -#ifdef HAVE_SIGNAL_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifndef ZTS -ZEND_API zend_alloc_globals alloc_globals; -#endif - - -#define ZEND_DISABLE_MEMORY_CACHE 0 - - -#ifdef ZEND_WIN32 -#define ZEND_DO_MALLOC(size) (AG(memory_heap) ? HeapAlloc(AG(memory_heap), HEAP_NO_SERIALIZE, size) : malloc(size)) -#define ZEND_DO_FREE(ptr) (AG(memory_heap) ? HeapFree(AG(memory_heap), HEAP_NO_SERIALIZE, ptr) : free(ptr)) -#define ZEND_DO_REALLOC(ptr, size) (AG(memory_heap) ? HeapReAlloc(AG(memory_heap), HEAP_NO_SERIALIZE, ptr, size) : realloc(ptr, size)) -#else -#define ZEND_DO_MALLOC(size) malloc(size) -#define ZEND_DO_FREE(ptr) free(ptr) -#define ZEND_DO_REALLOC(ptr, size) realloc(ptr, size) -#endif - -#if ZEND_DEBUG -# define END_MAGIC_SIZE sizeof(long) -static long mem_block_end_magic = MEM_BLOCK_END_MAGIC; -#else -# define END_MAGIC_SIZE 0 -#endif - - -# if MEMORY_LIMIT -# if ZEND_DEBUG -#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, __zend_filename, __zend_lineno) -# else -#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL, 0) -# endif - -#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\ - if (AG(memory_limit)persistent && p==AG(head)) { \ - AG(head) = p->pNext; \ - } else if (p->persistent && p==AG(phead)) { \ - AG(phead) = p->pNext; \ - } else { \ - p->pLast->pNext = p->pNext; \ - } \ - if (p->pNext) { \ - p->pNext->pLast = p->pLast; \ - } - -#define ADD_POINTER_TO_LIST(p) \ - if (p->persistent) { \ - p->pNext = AG(phead); \ - if (AG(phead)) { \ - AG(phead)->pLast = p; \ - } \ - AG(phead) = p; \ - } else { \ - p->pNext = AG(head); \ - if (AG(head)) { \ - AG(head)->pLast = p; \ - } \ - AG(head) = p; \ - } \ - p->pLast = (zend_mem_header *) NULL; - -#define DECLARE_CACHE_VARS() \ - unsigned int real_size; \ - unsigned int cache_index - -#define REAL_SIZE(size) ((size+7) & ~0x7) - -#define CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size) \ - real_size = REAL_SIZE(size); \ - cache_index = real_size >> 3; - -#define SIZE real_size - -#define CACHE_INDEX cache_index - -ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p; - DECLARE_CACHE_VARS(); - TSRMLS_FETCH(); - - CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size); - - if (!ZEND_DISABLE_MEMORY_CACHE && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] > 0)) { - p = AG(cache)[CACHE_INDEX][--AG(cache_count)[CACHE_INDEX]]; -#if ZEND_DEBUG - p->filename = __zend_filename; - p->lineno = __zend_lineno; - p->orig_filename = __zend_orig_filename; - p->orig_lineno = __zend_orig_lineno; - p->magic = MEM_BLOCK_START_MAGIC; - p->reported = 0; - /* Setting the thread id should not be necessary, because we fetched this block - * from this thread's cache - */ - AG(cache_stats)[CACHE_INDEX][1]++; - memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long)); -#endif - p->persistent = 0; - p->cached = 0; - p->size = size; - return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING); - } else { -#if ZEND_DEBUG - if (CACHE_INDEXpersistent = p->cached = 0; - ADD_POINTER_TO_LIST(p); - p->size = size; /* Save real size for correct cache output */ -#if ZEND_DEBUG - p->filename = __zend_filename; - p->lineno = __zend_lineno; - p->orig_filename = __zend_orig_filename; - p->orig_lineno = __zend_orig_lineno; - p->magic = MEM_BLOCK_START_MAGIC; - p->reported = 0; -# ifdef ZTS - p->thread_id = tsrm_thread_id(); -# endif - memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long)); -#endif -#if MEMORY_LIMIT - CHECK_MEMORY_LIMIT(size, SIZE); - if (AG(allocated_memory) > AG(allocated_memory_peak)) { - AG(allocated_memory_peak) = AG(allocated_memory); - } -#endif - - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING); -} - - -ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER_PADDING); - DECLARE_CACHE_VARS(); - TSRMLS_FETCH(); - -#if defined(ZTS) && TSRM_DEBUG - if (p->thread_id != tsrm_thread_id()) { - tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring", - p->filename, p->lineno, p->thread_id, - __zend_filename, __zend_lineno, tsrm_thread_id()); - return; - } -#endif - - CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size); -#if ZEND_DEBUG - if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) { - return; - } - memset(ptr, 0x5a, p->size); -#endif - - if (!ZEND_DISABLE_MEMORY_CACHE - && !p->persistent && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) { - AG(cache)[CACHE_INDEX][AG(cache_count)[CACHE_INDEX]++] = p; - p->cached = 1; -#if ZEND_DEBUG - p->magic = MEM_BLOCK_CACHED_MAGIC; -#endif - return; - } - HANDLE_BLOCK_INTERRUPTIONS(); - REMOVE_POINTER_FROM_LIST(p); - -#if MEMORY_LIMIT - AG(allocated_memory) -= SIZE; -#endif - - ZEND_DO_FREE(p); - HANDLE_UNBLOCK_INTERRUPTIONS(); -} - - -ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - void *p; - int final_size = size*nmemb; - - HANDLE_BLOCK_INTERRUPTIONS(); - p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - if (!p) { - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (void *) p; - } - memset(p, 0, final_size); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return p; -} - - -ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p; - zend_mem_header *orig; - DECLARE_CACHE_VARS(); - TSRMLS_FETCH(); - - if (!ptr) { - return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - } - - p = orig = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING); - -#if defined(ZTS) && TSRM_DEBUG - if (p->thread_id != tsrm_thread_id()) { - void *new_p; - - tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x reallocated at %s:(%d) on thread %x, duplicating", - p->filename, p->lineno, p->thread_id, - __zend_filename, __zend_lineno, tsrm_thread_id()); - new_p = _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - memcpy(new_p, ptr, p->size); - return new_p; - } -#endif - - CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size); - - HANDLE_BLOCK_INTERRUPTIONS(); - REMOVE_POINTER_FROM_LIST(p); - p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE); - if (!p) { - if (!allow_failure) { - fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size); -#if ZEND_DEBUG && HAVE_KILL && HAVE_GETPID - kill(getpid(), SIGSEGV); -#else - exit(1); -#endif - } - ADD_POINTER_TO_LIST(orig); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (void *)NULL; - } - ADD_POINTER_TO_LIST(p); -#if ZEND_DEBUG - p->filename = __zend_filename; - p->lineno = __zend_lineno; - p->magic = MEM_BLOCK_START_MAGIC; - memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long)); -#endif -#if MEMORY_LIMIT - CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size)); - if (AG(allocated_memory) > AG(allocated_memory_peak)) { - AG(allocated_memory_peak) = AG(allocated_memory); - } -#endif - - p->size = size; - - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (void *)((char *)p+sizeof(zend_mem_header)+MEM_HEADER_PADDING); -} - - -ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - int length; - char *p; - - length = strlen(s)+1; - HANDLE_BLOCK_INTERRUPTIONS(); - p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - if (!p) { - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (char *)NULL; - } - HANDLE_UNBLOCK_INTERRUPTIONS(); - memcpy(p, s, length); - return p; -} - - -ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - char *p; - - HANDLE_BLOCK_INTERRUPTIONS(); - p = (char *) _emalloc(length+1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - if (!p) { - HANDLE_UNBLOCK_INTERRUPTIONS(); - return (char *)NULL; - } - HANDLE_UNBLOCK_INTERRUPTIONS(); - memcpy(p, s, length); - p[length] = 0; - return p; -} - - -ZEND_API char *zend_strndup(const char *s, uint length) -{ - char *p; - - p = (char *) malloc(length+1); - if (!p) { - return (char *)NULL; - } - if (length) { - memcpy(p, s, length); - } - p[length] = 0; - return p; -} - - -ZEND_API int zend_set_memory_limit(unsigned int memory_limit) -{ -#if MEMORY_LIMIT - TSRMLS_FETCH(); - - AG(memory_limit) = memory_limit; - return SUCCESS; -#else - return FAILURE; -#endif -} - - -ZEND_API void start_memory_manager(TSRMLS_D) -{ -#if 0 -#ifndef ZTS - int i, j; - void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES]; -#endif -#endif - - AG(phead) = AG(head) = NULL; - -#if MEMORY_LIMIT - AG(memory_limit) = 1<<30; /* ridiculous limit, effectively no limit */ - AG(allocated_memory) = 0; - AG(memory_exhausted) = 0; - AG(allocated_memory_peak) = 0; -#endif - - memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head))); - memset(AG(cache_count), 0, sizeof(AG(cache_count))); - -#ifdef ZEND_WIN32 - AG(memory_heap) = HeapCreate(HEAP_NO_SERIALIZE, 256*1024, 0); -#endif - -#if 0 -#ifndef ZTS - /* Initialize cache, to prevent fragmentation */ - /* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager() - * will yield an endless recursion calling to alloc_globals_ctor() - */ - for (i=1; inext; - efree(fast_cache_list_entry); - fast_cache_list_entry = next_fast_cache_list_entry; - } - AG(fast_cache_list_head)[fci] = NULL; - } - - if (1 || clean_cache) { - zend_mem_header *ptr; - - for (i=1; isize); -#endif - REMOVE_POINTER_FROM_LIST(ptr); - ZEND_DO_FREE(ptr); - } - AG(cache_count)[i] = 0; - } - } - - p = AG(head); - t = AG(head); - while (t) { - if (!t->cached) { -#if ZEND_DEBUG - if (!t->cached && !t->reported) { - zend_mem_header *iterator; - int total_leak=0, total_leak_count=0; - - had_leaks = 1; - if (!silent) { - zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, t); - } - t->reported = 1; - for (iterator=t->pNext; iterator; iterator=iterator->pNext) { - if (!iterator->cached - && iterator->filename==t->filename - && iterator->lineno==t->lineno) { - total_leak += iterator->size; - total_leak_count++; - iterator->reported = 1; - } - } - if (!silent && total_leak_count>0) { - zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (total_leak_count)); - } - } -#endif -#if MEMORY_LIMIT - AG(allocated_memory) -= t->size; -#endif - p = t->pNext; - REMOVE_POINTER_FROM_LIST(t); - ZEND_DO_FREE(t); - t = p; - } else { - t = t->pNext; - } - } - -#if MEMORY_LIMIT - AG(memory_exhausted)=0; - AG(allocated_memory_peak) = 0; -#endif - - -#if (ZEND_DEBUG) - do { - zval display_memory_cache_stats; - int i, j; - - if (clean_cache) { - /* we're shutting down completely, don't even touch the INI subsystem */ - break; - } - if (zend_get_configuration_directive("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) { - break; - } - if (!atoi(display_memory_cache_stats.value.str.val)) { - break; - } - fprintf(stderr, "Memory cache statistics\n" - "-----------------------\n\n" - "[zval, %2ld]\t\t%d / %d (%.2f%%)\n" - "[hash, %2ld]\t\t%d / %d (%.2f%%)\n", - (long) sizeof(zval), - AG(fast_cache_stats)[ZVAL_CACHE_LIST][1], AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1], - ((double) AG(fast_cache_stats)[ZVAL_CACHE_LIST][1] / (AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1]))*100, - (long) sizeof(HashTable), - AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1], AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1], - ((double) AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1] / (AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1]))*100); - - - for (i=0; imagic) { - case MEM_BLOCK_START_MAGIC: - if (!silent) { - zend_debug_alloc_output("OK (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size); - } - break; /* ok */ - case MEM_BLOCK_FREED_MAGIC: - if (!silent) { - zend_debug_alloc_output("Freed\n"); - had_problems = 1; - } else { - return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - } - break; - case MEM_BLOCK_CACHED_MAGIC: - if (!silent) { - if (!no_cache_notice) { - zend_debug_alloc_output("Cached (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size); - had_problems = 1; - } - } else { - if (!no_cache_notice) { - return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - } - } - break; - default: - if (!silent) { - zend_debug_alloc_output("Overrun (magic=0x%0.8lX, expected=0x%0.8lX)\n", p->magic, MEM_BLOCK_START_MAGIC); - } else { - return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - } - had_problems = 1; - valid_beginning = 0; - break; - } - - - memcpy(&end_magic, (((char *) p)+sizeof(zend_mem_header)+MEM_HEADER_PADDING+p->size), sizeof(long)); - - if (valid_beginning && (end_magic != MEM_BLOCK_END_MAGIC)) { - char *overflow_ptr, *magic_ptr=(char *) &mem_block_end_magic; - int overflows=0; - int i; - - if (silent) { - return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); - } - had_problems = 1; - overflow_ptr = (char *) &end_magic; - - for (i=0; i=sizeof(long)) { - zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long)); - } else { - zend_debug_alloc_output("%d byte(s) overflown\n", overflows); - } - } else if (!silent) { - zend_debug_alloc_output("%10s\t", "End:"); - if (valid_beginning) { - zend_debug_alloc_output("OK\n"); - } else { - zend_debug_alloc_output("Unknown\n"); - } - } - - if (had_problems) { - int foo = 5; - - foo += 1; - } - - if (!silent) { - zend_debug_alloc_output("---------------------------------------\n"); - } - return ((!had_problems) ? 1 : 0); -} - - -ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p; - int errors=0; - TSRMLS_FETCH(); - - p = AG(head); - - - zend_debug_alloc_output("------------------------------------------------\n"); - zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC); - - while (p) { - if (!_mem_block_check((void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) { - errors++; - } - p = p->pNext; - } - zend_debug_alloc_output("End of full memory check %s:%d (%d errors)\n" ZEND_FILE_LINE_RELAY_CC, errors); - zend_debug_alloc_output("------------------------------------------------\n"); -} -#endif - - -ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING); - TSRMLS_FETCH(); - -#if ZEND_DEBUG - _mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -#endif - - HANDLE_BLOCK_INTERRUPTIONS(); - - /* remove the block from the non persistent list */ - REMOVE_POINTER_FROM_LIST(p); - - p->persistent = 1; - - /* add the block to the persistent list */ - ADD_POINTER_TO_LIST(p); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return REAL_SIZE(p->size)+sizeof(zend_mem_header)+MEM_HEADER_PADDING; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h deleted file mode 100644 index c89fbfd04ab..00000000000 --- a/Zend/zend_alloc.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_ALLOC_H -#define ZEND_ALLOC_H - -#include - -#include "../TSRM/TSRM.h" -#include "zend_globals_macros.h" - -#define MEM_BLOCK_START_MAGIC 0x7312F8DCL -#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L -#define MEM_BLOCK_FREED_MAGIC 0x99954317L -#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL - -typedef struct _zend_mem_header { -#if ZEND_DEBUG - long magic; - char *filename; - uint lineno; - int reported; - char *orig_filename; - uint orig_lineno; -# ifdef ZTS - THREAD_T thread_id; -# endif -#endif - struct _zend_mem_header *pNext; - struct _zend_mem_header *pLast; - unsigned int size:30; - unsigned int persistent:1; - unsigned int cached:1; -} zend_mem_header; - -typedef union _align_test { - void *ptr; - double dbl; - long lng; -} align_test; - -#define MAX_CACHED_MEMORY 11 -#define MAX_CACHED_ENTRIES 256 -#define PRE_INIT_CACHE_ENTRIES 32 - -#if (defined (__GNUC__) && __GNUC__ >= 2) -#define PLATFORM_ALIGNMENT (__alignof__ (align_test)) -#else -#define PLATFORM_ALIGNMENT (sizeof(align_test)) -#endif - -#define MEM_HEADER_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT) - - -BEGIN_EXTERN_C() - -ZEND_API char *zend_strndup(const char *s, unsigned int length); - -ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); - -/* Standard wrapper macros */ -#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define persist_alloc(p) _persist_alloc((p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) - -/* Relay wrapper macros */ -#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define persist_alloc_rel(p) _persist_alloc((p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) - -/* Selective persistent/non persistent allocation macros */ -#define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size)) -#define pefree(ptr, persistent) ((persistent)?free(ptr):efree(ptr)) -#define pecalloc(nmemb, size, persistent) ((persistent)?calloc((nmemb), (size)):ecalloc((nmemb), (size))) -#define perealloc(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc((ptr), (size))) -#define perealloc_recoverable(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable((ptr), (size))) -#define pestrdup(s, persistent) ((persistent)?strdup(s):estrdup(s)) - -#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string)) -#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string)) - -ZEND_API int zend_set_memory_limit(unsigned int memory_limit); - -ZEND_API void start_memory_manager(TSRMLS_D); -ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC); - -#if ZEND_DEBUG -ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -void zend_debug_alloc_output(char *format, ...); -#define mem_block_check(ptr, silent) _mem_block_check(ptr, silent ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define full_mem_check(silent) _full_mem_check(silent ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#else -#define mem_block_check(type, ptr, silent) -#define full_mem_check(silent) -#endif - - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c deleted file mode 100644 index 8341bd7df3b..00000000000 --- a/Zend/zend_builtin_functions.c +++ /dev/null @@ -1,1216 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_API.h" -#include "zend_builtin_functions.h" -#include "zend_constants.h" - -#undef ZEND_TEST_EXCEPTIONS - -static ZEND_FUNCTION(zend_version); -static ZEND_FUNCTION(func_num_args); -static ZEND_FUNCTION(func_get_arg); -static ZEND_FUNCTION(func_get_args); -static ZEND_NAMED_FUNCTION(zend_if_strlen); -static ZEND_FUNCTION(strcmp); -static ZEND_FUNCTION(strncmp); -static ZEND_FUNCTION(strcasecmp); -static ZEND_FUNCTION(strncasecmp); -static ZEND_FUNCTION(each); -static ZEND_FUNCTION(error_reporting); -static ZEND_FUNCTION(define); -static ZEND_FUNCTION(defined); -static ZEND_FUNCTION(get_class); -static ZEND_FUNCTION(get_parent_class); -static ZEND_FUNCTION(method_exists); -static ZEND_FUNCTION(class_exists); -static ZEND_FUNCTION(function_exists); -static ZEND_FUNCTION(leak); -#ifdef ZEND_TEST_EXCEPTIONS -static ZEND_FUNCTION(crash); -#endif -static ZEND_FUNCTION(get_included_files); -static ZEND_FUNCTION(is_subclass_of); -static ZEND_FUNCTION(is_a); -static ZEND_FUNCTION(get_class_vars); -static ZEND_FUNCTION(get_object_vars); -static ZEND_FUNCTION(get_class_methods); -static ZEND_FUNCTION(trigger_error); -static ZEND_FUNCTION(set_error_handler); -static ZEND_FUNCTION(restore_error_handler); -static ZEND_FUNCTION(get_declared_classes); -static ZEND_FUNCTION(get_defined_functions); -static ZEND_FUNCTION(get_defined_vars); -static ZEND_FUNCTION(create_function); -static ZEND_FUNCTION(get_resource_type); -static ZEND_FUNCTION(get_loaded_extensions); -static ZEND_FUNCTION(extension_loaded); -static ZEND_FUNCTION(get_extension_funcs); -static ZEND_FUNCTION(get_defined_constants); -#if ZEND_DEBUG -static ZEND_FUNCTION(zend_test_func); -#endif - -ZEND_API unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE }; -ZEND_API unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE }; -ZEND_API unsigned char third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; - -static zend_function_entry builtin_functions[] = { - ZEND_FE(zend_version, NULL) - ZEND_FE(func_num_args, NULL) - ZEND_FE(func_get_arg, NULL) - ZEND_FE(func_get_args, NULL) - { "strlen", zend_if_strlen, NULL }, - ZEND_FE(strcmp, NULL) - ZEND_FE(strncmp, NULL) - ZEND_FE(strcasecmp, NULL) - ZEND_FE(strncasecmp, NULL) - ZEND_FE(each, first_arg_force_ref) - ZEND_FE(error_reporting, NULL) - ZEND_FE(define, NULL) - ZEND_FE(defined, NULL) - ZEND_FE(get_class, NULL) - ZEND_FE(get_parent_class, NULL) - ZEND_FE(method_exists, NULL) - ZEND_FE(class_exists, NULL) - ZEND_FE(function_exists, NULL) - ZEND_FE(leak, NULL) -#ifdef ZEND_TEST_EXCEPTIONS - ZEND_FE(crash, NULL) -#endif - ZEND_FE(get_included_files, NULL) - ZEND_FALIAS(get_required_files, get_included_files, NULL) - ZEND_FE(is_subclass_of, NULL) - ZEND_FE(is_a, NULL) - ZEND_FE(get_class_vars, NULL) - ZEND_FE(get_object_vars, NULL) - ZEND_FE(get_class_methods, NULL) - ZEND_FE(trigger_error, NULL) - ZEND_FALIAS(user_error, trigger_error, NULL) - ZEND_FE(set_error_handler, NULL) - ZEND_FE(restore_error_handler, NULL) - ZEND_FE(get_declared_classes, NULL) - ZEND_FE(get_defined_functions, NULL) - ZEND_FE(get_defined_vars, NULL) - ZEND_FE(create_function, NULL) - ZEND_FE(get_resource_type, NULL) - ZEND_FE(get_loaded_extensions, NULL) - ZEND_FE(extension_loaded, NULL) - ZEND_FE(get_extension_funcs, NULL) - ZEND_FE(get_defined_constants, NULL) -#if ZEND_DEBUG - ZEND_FE(zend_test_func, NULL) -#endif - { NULL, NULL, NULL } -}; - - -int zend_startup_builtin_functions(TSRMLS_D) -{ - return zend_register_functions(builtin_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); -} - - -/* {{{ proto string zend_version(void) - Get the version of the Zend Engine */ -ZEND_FUNCTION(zend_version) -{ - RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1, 1); -} -/* }}} */ - - -/* {{{ proto int func_num_args(void) - Get the number of arguments that were passed to the function */ -ZEND_FUNCTION(func_num_args) -{ - void **p; - int arg_count; - - p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */ - p -= 1+arg_count; - if (*p) { - zend_error(E_ERROR, "func_num_args(): Can't be used as a function parameter"); - } - --p; - if (p>=EG(argument_stack).elements) { - RETURN_LONG((ulong) *p); - } else { - zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context"); - RETURN_LONG(-1); - } -} -/* }}} */ - - -/* {{{ proto mixed func_get_arg(int arg_num) - Get the $arg_num'th argument that was passed to the function */ -ZEND_FUNCTION(func_get_arg) -{ - void **p; - int arg_count; - zval **z_requested_offset; - zval *arg; - long requested_offset; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &z_requested_offset)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(z_requested_offset); - requested_offset = (*z_requested_offset)->value.lval; - - p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_arg(); */ - p -= 1+arg_count; - if (*p) { - zend_error(E_ERROR, "func_get_arg(): Can't be used as a function parameter"); - } - --p; - if (p=arg_count) { - zend_error(E_WARNING, "func_get_arg(): Argument %d not passed to function", requested_offset); - RETURN_FALSE; - } - - arg = *(p-(arg_count-requested_offset)); - *return_value = *arg; - zval_copy_ctor(return_value); -} -/* }}} */ - - -/* {{{ proto array func_get_args() - Get an array of the arguments that were passed to the function */ -ZEND_FUNCTION(func_get_args) -{ - void **p; - int arg_count; - int i; - - p = EG(argument_stack).top_element-1-1; - arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_args(); */ - p -= 1+arg_count; - if (*p) { - zend_error(E_ERROR, "func_get_args(): Can't be used as a function parameter"); - } - --p; - - if (pvalue.ht, &element, sizeof(zval *), NULL); - } -} -/* }}} */ - - -/* {{{ proto int strlen(string str) - Get string length */ -ZEND_NAMED_FUNCTION(zend_if_strlen) -{ - zval **str; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(str); - RETVAL_LONG((*str)->value.str.len); -} -/* }}} */ - - -/* {{{ proto int strcmp(string str1, string str2) - Binary safe string comparison */ -ZEND_FUNCTION(strcmp) -{ - zval **s1, **s2; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - RETURN_LONG(zend_binary_zval_strcmp(*s1, *s2)); -} -/* }}} */ - - -/* {{{ proto int strncmp(string str1, string str2, int len) - Binary safe string comparison */ -ZEND_FUNCTION(strncmp) -{ - zval **s1, **s2, **s3; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - convert_to_long_ex(s3); - RETURN_LONG(zend_binary_zval_strncmp(*s1, *s2, *s3)); -} -/* }}} */ - - -/* {{{ proto int strcasecmp(string str1, string str2) - Binary safe case-insensitive string comparison */ -ZEND_FUNCTION(strcasecmp) -{ - zval **s1, **s2; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - RETURN_LONG(zend_binary_zval_strcasecmp(*s1, *s2)); -} -/* }}} */ - - -/* {{{ proto int strncasecmp(string str1, string str2, int len) - Binary safe string comparison */ -ZEND_FUNCTION(strncasecmp) -{ - zval **s1, **s2, **s3; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(s1); - convert_to_string_ex(s2); - convert_to_long_ex(s3); - RETURN_LONG(zend_binary_zval_strncasecmp(*s1, *s2, *s3)); -} -/* }}} */ - - -/* {{{ proto array each(array arr) - Return the currently pointed key..value pair in the passed array, and advance the pointer to the next element */ -ZEND_FUNCTION(each) -{ - zval **array, *entry, **entry_ptr, *tmp; - char *string_key; - ulong num_key; - zval **inserted_pointer; - HashTable *target_hash; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - target_hash = HASH_OF(*array); - if (!target_hash) { - zend_error(E_WARNING,"Variable passed to each() is not an array or object"); - return; - } - if (zend_hash_get_current_data(target_hash, (void **) &entry_ptr)==FAILURE) { - RETURN_FALSE; - } - array_init(return_value); - entry = *entry_ptr; - - /* add value elements */ - if (entry->is_ref) { - ALLOC_ZVAL(tmp); - *tmp = *entry; - zval_copy_ctor(tmp); - tmp->is_ref=0; - tmp->refcount=0; - entry=tmp; - } - zend_hash_index_update(return_value->value.ht, 1, &entry, sizeof(zval *), NULL); - entry->refcount++; - zend_hash_update(return_value->value.ht, "value", sizeof("value"), &entry, sizeof(zval *), NULL); - entry->refcount++; - - /* add the key elements */ - switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1)) { - case HASH_KEY_IS_STRING: - add_get_index_string(return_value, 0, string_key, (void **) &inserted_pointer, 0); - break; - case HASH_KEY_IS_LONG: - add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer); - break; - } - zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL); - (*inserted_pointer)->refcount++; - zend_hash_move_forward(target_hash); -} -/* }}} */ - - -/* {{{ proto int error_reporting(int new_error_level=null) - Return the current error_reporting level, and if an argument was passed - change to the new level */ -ZEND_FUNCTION(error_reporting) -{ - zval **arg; - int old_error_reporting; - - old_error_reporting = EG(error_reporting); - switch (ZEND_NUM_ARGS()) { - case 0: - break; - case 1: - if (zend_get_parameters_ex(1, &arg) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(arg); - EG(error_reporting)=(*arg)->value.lval; - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - - RETVAL_LONG(old_error_reporting); -} -/* }}} */ - - -/* {{{ proto bool define(string constant_name, mixed value, case_sensitive=true) - Define a new constant */ -ZEND_FUNCTION(define) -{ - zval **var, **val, **non_cs; - int case_sensitive; - zend_constant c; - - switch(ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &var, &val)==FAILURE) { - RETURN_FALSE; - } - case_sensitive = CONST_CS; - break; - case 3: - if (zend_get_parameters_ex(3, &var, &val, &non_cs)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(non_cs); - if ((*non_cs)->value.lval) { - case_sensitive = 0; - } else { - case_sensitive = CONST_CS; - } - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - - switch((*val)->type) { - case IS_LONG: - case IS_DOUBLE: - case IS_STRING: - case IS_BOOL: - case IS_RESOURCE: - case IS_NULL: - break; - default: - zend_error(E_WARNING,"Constants may only evaluate to scalar values"); - RETURN_FALSE; - break; - } - convert_to_string_ex(var); - - c.value = **val; - zval_copy_ctor(&c.value); - c.flags = case_sensitive; /* non persistent */ - c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len); - c.name_len = (*var)->value.str.len+1; - if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool defined(string constant_name) - Check whether a constant exists */ -ZEND_FUNCTION(defined) -{ - zval **var; - zval c; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(var); - if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c TSRMLS_CC)) { - zval_dtor(&c); - RETURN_LONG(1); - } else { - RETURN_LONG(0); - } -} -/* }}} */ - - -/* {{{ proto string get_class(object object) - Retrieves the class name */ -ZEND_FUNCTION(get_class) -{ - zval **arg; - char *name; - int name_len; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - if (Z_TYPE_PP(arg) != IS_OBJECT) { - RETURN_FALSE; - } - - if(Z_OBJ_HT_PP(arg)->get_class_name == NULL || - Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; - } - - RETURN_STRINGL(name, name_len, 1); -} -/* }}} */ - - -/* {{{ proto string get_parent_class(mixed object) - Retrieves the parent class name for object or class. */ -ZEND_FUNCTION(get_parent_class) -{ - zval **arg; - zend_class_entry *ce = NULL; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (Z_TYPE_PP(arg) == IS_OBJECT) { - char *name; - zend_uint name_length; - - if(Z_OBJ_HT_PP(arg)->get_class_name == NULL || - Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_length, 1 TSRMLS_CC) != SUCCESS) { - RETURN_FALSE; - } - RETURN_STRINGL(name, name_length, 1); - } else if (Z_TYPE_PP(arg) == IS_STRING) { - zend_class_entry **pce; - - SEPARATE_ZVAL(arg); - zend_str_tolower(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg)); - if(zend_hash_find(EG(class_table), Z_STRVAL_PP(arg), Z_STRLEN_PP(arg)+1, (void **)&pce) == SUCCESS) { - ce = *pce; - } - } - - if (ce && ce->parent) { - RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) -{ - zval **obj, **class_name; - char *lcname; - zend_class_entry *ce = NULL; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &obj, &class_name)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (Z_TYPE_PP(obj) != IS_OBJECT) { - RETURN_FALSE; - } - - /* TBI!! new object handlers */ - if(!IS_ZEND_STD_OBJECT(**obj)) { - RETURN_FALSE; - } - - convert_to_string_ex(class_name); - - lcname = estrndup(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name)); - zend_str_tolower(lcname, Z_STRLEN_PP(class_name)); - - if (only_subclass) - ce = Z_OBJCE_PP(obj)->parent; - else - ce = Z_OBJCE_PP(obj); - for (; ce != NULL; ce = ce->parent) { - if ((ce->name_length == Z_STRLEN_PP(class_name)) && !memcmp(ce->name, lcname, ce->name_length)) { - efree(lcname); - RETURN_TRUE; - } - } - efree(lcname); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool is_subclass_of(object object, string class_name) - Returns true if the object has this class as one of its parents */ -ZEND_FUNCTION(is_subclass_of) -{ - is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - - -/* {{{ proto bool is_a(object object, string class_name) - Returns true if the object is of this class or has this class as one of its parents */ -ZEND_FUNCTION(is_a) -{ - is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - - -/* {{{ proto array get_class_vars(string class_name) - Returns an array of default properties of the class */ -ZEND_FUNCTION(get_class_vars) -{ - zval **class_name; - char *lcname; - zend_class_entry *ce, **pce; - zval *tmp; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(class_name); - lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len); - zend_str_tolower(lcname, (*class_name)->value.str.len); - - if (zend_hash_find(EG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&pce) == FAILURE) { - efree(lcname); - RETURN_FALSE; - } else { - ce = *pce; - efree(lcname); - array_init(return_value); - if (!ce->constants_updated) { - zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - ce->constants_updated = 1; - } - zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } -} -/* }}} */ - - -/* {{{ proto array get_object_vars(object obj) - Returns an array of object properties */ -ZEND_FUNCTION(get_object_vars) -{ - zval **obj; - zval *tmp; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if ((*obj)->type != IS_OBJECT) { - RETURN_FALSE; - } - if(Z_OBJ_HT_PP(obj)->get_properties == NULL) { - RETURN_FALSE; - } - - array_init(return_value); - zend_hash_copy(return_value->value.ht, Z_OBJ_HT_PP(obj)->get_properties(*obj TSRMLS_CC), - (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); -} -/* }}} */ - - -/* {{{ proto array get_class_methods(mixed class) - Returns an array of method names for class or class instance. */ -ZEND_FUNCTION(get_class_methods) -{ - zval **class; - zval *method_name; - zend_class_entry *ce = NULL, **pce; - char *string_key; - ulong num_key; - int key_type; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (Z_TYPE_PP(class) == IS_OBJECT) { - /* TBI!! new object handlers */ - if(!IS_ZEND_STD_OBJECT(**class)) { - RETURN_FALSE; - } - ce = Z_OBJCE_PP(class); - } else if (Z_TYPE_PP(class) == IS_STRING) { - SEPARATE_ZVAL(class); - zend_str_tolower(Z_STRVAL_PP(class), Z_STRLEN_PP(class)); - if(zend_hash_find(EG(class_table), Z_STRVAL_PP(class), Z_STRLEN_PP(class)+1, (void **)&pce) == SUCCESS) { - ce = *pce; - } - } - - if (!ce) { - RETURN_NULL(); - } - - array_init(return_value); - zend_hash_internal_pointer_reset(&ce->function_table); - while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key, 1)) != HASH_KEY_NON_EXISTANT) { - if (key_type == HASH_KEY_IS_STRING) { - MAKE_STD_ZVAL(method_name); - ZVAL_STRING(method_name, string_key, 0); - zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL); - } - zend_hash_move_forward(&ce->function_table); - } -} -/* }}} */ - - -/* {{{ proto bool method_exists(object object, string method) - Checks if the class method exists */ -ZEND_FUNCTION(method_exists) -{ - zval **klass, **method_name; - char *lcname; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - if ((*klass)->type != IS_OBJECT) { - RETURN_FALSE; - } - - /* TBI!! new object handlers */ - if(!IS_ZEND_STD_OBJECT(**klass)) { - RETURN_FALSE; - } - - convert_to_string_ex(method_name); - lcname = estrndup((*method_name)->value.str.val, (*method_name)->value.str.len); - zend_str_tolower(lcname, (*method_name)->value.str.len); - if (zend_hash_exists(&Z_OBJCE_PP(klass)->function_table, lcname, (*method_name)->value.str.len+1)) { - efree(lcname); - RETURN_TRUE; - } else { - efree(lcname); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool class_exists(string classname) - Checks if the class exists */ -ZEND_FUNCTION(class_exists) -{ - zval **class_name; - char *lcname; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(class_name); - lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len); - zend_str_tolower(lcname, (*class_name)->value.str.len); - if (zend_hash_exists(EG(class_table), lcname, (*class_name)->value.str.len+1)) { - efree(lcname); - RETURN_TRUE; - } else { - efree(lcname); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto bool function_exists(string function_name) - Checks if the function exists */ -ZEND_FUNCTION(function_exists) -{ - zval **function_name; - char *lcname; - int retval; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(function_name); - lcname = estrndup((*function_name)->value.str.val, (*function_name)->value.str.len); - zend_str_tolower(lcname, (*function_name)->value.str.len); - - retval = zend_hash_exists(EG(function_table), lcname, (*function_name)->value.str.len+1); - efree(lcname); - - RETURN_BOOL(retval); -} -/* }}} */ - - -/* {{{ proto void leak(int num_bytes=3) - Cause an intentional memory leak, for testing/debugging purposes */ -ZEND_FUNCTION(leak) -{ - int leakbytes=3; - zval **leak; - - if (ZEND_NUM_ARGS()>=1) { - if (zend_get_parameters_ex(1, &leak)==SUCCESS) { - convert_to_long_ex(leak); - leakbytes = (*leak)->value.lval; - } - } - - emalloc(leakbytes); -} -/* }}} */ - - -#ifdef ZEND_TEST_EXCEPTIONS -ZEND_FUNCTION(crash) -{ - char *nowhere=NULL; - - memcpy(nowhere, "something", sizeof("something")); -} -#endif - - -/* {{{ proto array get_included_files(void) - Returns an array with the file names that were include_once()'d */ -ZEND_FUNCTION(get_included_files) -{ - char *entry; - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - array_init(return_value); - zend_hash_internal_pointer_reset(&EG(included_files)); - while (zend_hash_get_current_key(&EG(included_files), &entry, NULL, 1) == HASH_KEY_IS_STRING) { - add_next_index_string(return_value, entry, 0); - zend_hash_move_forward(&EG(included_files)); - } -} -/* }}} */ - - -/* {{{ proto void trigger_error(string messsage [, int error_type]) - Generates a user-level error/warning/notice message */ -ZEND_FUNCTION(trigger_error) -{ - int error_type = E_USER_NOTICE; - zval **z_error_type, **z_error_message; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &z_error_message)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - break; - case 2: - if (zend_get_parameters_ex(2, &z_error_message, &z_error_type)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_long_ex(z_error_type); - error_type = (*z_error_type)->value.lval; - switch (error_type) { - case E_USER_ERROR: - case E_USER_WARNING: - case E_USER_NOTICE: - break; - default: - zend_error(E_WARNING, "Invalid error type specified"); - RETURN_FALSE; - break; - } - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_string_ex(z_error_message); - zend_error(error_type, "%s", (*z_error_message)->value.str.val); - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto string set_error_handler(string error_handler) - Sets a user-defined error handler function. Returns the previously defined error handler, or false on error */ -ZEND_FUNCTION(set_error_handler) -{ - zval **error_handler; - zend_bool had_orig_error_handler=0; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(error_handler); - if (EG(user_error_handler)) { - had_orig_error_handler = 1; - *return_value = *EG(user_error_handler); - zval_copy_ctor(return_value); - zend_ptr_stack_push(&EG(user_error_handlers), EG(user_error_handler)); - } - ALLOC_ZVAL(EG(user_error_handler)); - - if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */ - FREE_ZVAL(EG(user_error_handler)); - EG(user_error_handler) = NULL; - RETURN_TRUE; - } - - *EG(user_error_handler) = **error_handler; - zval_copy_ctor(EG(user_error_handler)); - - if (!had_orig_error_handler) { - RETURN_NULL(); - } -} -/* }}} */ - - -/* {{{ proto void restore_error_handler(void) - Restores the previously defined error handler function */ -ZEND_FUNCTION(restore_error_handler) -{ - if (EG(user_error_handler)) { - zval_ptr_dtor(&EG(user_error_handler)); - } - if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) { - EG(user_error_handler) = NULL; - } else { - EG(user_error_handler) = zend_ptr_stack_pop(&EG(user_error_handlers)); - } - RETURN_TRUE; -} - - -static int copy_class_name(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *array = va_arg(args, zval *); - zend_class_entry *ce = *pce; - - if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0) { - add_next_index_stringl(array, ce->name, ce->name_length, 1); - } - return 0; -} - - -/* {{{ proto array get_declared_classes(void) - Returns an array of all declared classes. */ -ZEND_FUNCTION(get_declared_classes) -{ - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - array_init(return_value); - zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) copy_class_name, 1, return_value); -} -/* }}} */ - - -static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key) -{ - zval *internal_ar = va_arg(args, zval *), - *user_ar = va_arg(args, zval *); - - if (hash_key->nKeyLength == 0 || hash_key->arKey[0] == 0) { - return 0; - } - - if (func->type == ZEND_INTERNAL_FUNCTION) { - add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength-1, 1); - } else if (func->type == ZEND_USER_FUNCTION) { - add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1); - } - - return 0; -} - - -/* {{{ proto array get_defined_functions(void) - Returns an array of all defined functions */ -ZEND_FUNCTION(get_defined_functions) -{ - zval *internal; - zval *user; - - if (ZEND_NUM_ARGS() != 0) { - ZEND_WRONG_PARAM_COUNT(); - } - - MAKE_STD_ZVAL(internal); - MAKE_STD_ZVAL(user); - - array_init(internal); - array_init(user); - array_init(return_value); - - zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user); - - if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) { - zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()"); - RETURN_FALSE; - } - - if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) { - zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()"); - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto array get_defined_vars(void) - Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */ -ZEND_FUNCTION(get_defined_vars) -{ - zval *tmp; - - array_init(return_value); - - zend_hash_copy(return_value->value.ht, EG(active_symbol_table), - (copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *)); -} -/* }}} */ - - -#define LAMBDA_TEMP_FUNCNAME "__lambda_func" -/* {{{ proto string create_function(string args, string code) - Creates an anonymous function, and returns its name (funny, eh?) */ -ZEND_FUNCTION(create_function) -{ - char *eval_code, *function_name; - int eval_code_length, function_name_length; - zval **z_function_args, **z_function_code; - int retval; - char *eval_name; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &z_function_args, &z_function_code)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(z_function_args); - convert_to_string_ex(z_function_code); - - eval_code_length = sizeof("function " LAMBDA_TEMP_FUNCNAME) - +Z_STRLEN_PP(z_function_args) - +2 /* for the args parentheses */ - +2 /* for the curly braces */ - +Z_STRLEN_PP(z_function_code); - - eval_code = (char *) emalloc(eval_code_length); - sprintf(eval_code, "function " LAMBDA_TEMP_FUNCNAME "(%s){%s}", Z_STRVAL_PP(z_function_args), Z_STRVAL_PP(z_function_code)); - - eval_name = zend_make_compiled_string_description("runtime-created function" TSRMLS_CC); - retval = zend_eval_string(eval_code, NULL, eval_name TSRMLS_CC); - efree(eval_code); - efree(eval_name); - - if (retval==SUCCESS) { - zend_function *func; - - if (zend_hash_find(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME), (void **) &func)==FAILURE) { - zend_error(E_ERROR, "Unexpected inconsistency in create_function()"); - RETURN_FALSE; - } - function_add_ref(func); - - function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG); - - do { - sprintf(function_name, "%clambda_%d", 0, ++EG(lambda_count)); - function_name_length = strlen(function_name+1)+1; - } while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE); - zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)); - RETURN_STRINGL(function_name, function_name_length, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -#if ZEND_DEBUG -ZEND_FUNCTION(zend_test_func) -{ - zval *arg1, *arg2; - - zend_get_parameters(ht, 2, &arg1, &arg2); -} -#endif - -/* {{{ proto string get_resource_type(resource res) - Get the resource type name for a given resource */ -ZEND_FUNCTION(get_resource_type) -{ - char *resource_type; - zval **z_resource_type; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &z_resource_type)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (Z_TYPE_PP(z_resource_type) != IS_RESOURCE) { - zend_error(E_WARNING, "Supplied argument is not a valid resource handle"); - RETURN_FALSE; - } - - resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type) TSRMLS_CC); - if (resource_type) { - RETURN_STRING(resource_type, 1); - } else { - RETURN_STRING("Unknown", 1); - } -} -/* }}} */ - - -static int add_extension_info(zend_module_entry *module, void *arg TSRMLS_DC) -{ - zval *name_array = (zval *)arg; - add_next_index_string(name_array, module->name, 1); - return 0; -} - -static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC) -{ - zval *name_array = (zval *)arg; - zval *const_val; - - MAKE_STD_ZVAL(const_val); - *const_val = constant->value; - zval_copy_ctor(const_val); - INIT_PZVAL(const_val); - add_assoc_zval_ex(name_array, constant->name, constant->name_len, const_val); - return 0; -} - - -/* {{{ proto array get_loaded_extensions(void) - Return an array containing names of loaded extensions */ -ZEND_FUNCTION(get_loaded_extensions) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) add_extension_info, return_value TSRMLS_CC); -} -/* }}} */ - - -/* {{{ proto array get_defined_constants(void) - Return an array containing the names and values of all defined constants */ -ZEND_FUNCTION(get_defined_constants) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) add_constant_info, return_value TSRMLS_CC); -} - - -/* {{{ proto bool extension_loaded(string extension_name) - Returns true if the named extension is loaded */ -ZEND_FUNCTION(extension_loaded) -{ - zval **extension_name; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &extension_name)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(extension_name); - if (zend_hash_exists(&module_registry, Z_STRVAL_PP(extension_name), Z_STRLEN_PP(extension_name)+1)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -/* {{{ proto array get_extension_funcs(string extension_name) - Returns an array with the names of functions belonging to the named extension */ -ZEND_FUNCTION(get_extension_funcs) -{ - zval **extension_name; - zend_module_entry *module; - zend_function_entry *func; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &extension_name)) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(extension_name); - if (zend_hash_find(&module_registry, Z_STRVAL_PP(extension_name), - Z_STRLEN_PP(extension_name)+1, (void**)&module) == FAILURE) { - return; - } - - array_init(return_value); - func = module->functions; - if (!func) { - return; - } - - while (func->fname) { - add_next_index_string(return_value, func->fname, 1); - func++; - } -} -/* }}} */ diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h deleted file mode 100644 index 471037a3f9b..00000000000 --- a/Zend/zend_builtin_functions.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_BUILTIN_FUNCTIONS_H -#define ZEND_BUILTIN_FUNCTIONS_H - -int zend_startup_builtin_functions(TSRMLS_D); - -#endif /* ZEND_BUILTIN_FUNCTIONS_H */ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c deleted file mode 100644 index 674aa0c429d..00000000000 --- a/Zend/zend_compile.c +++ /dev/null @@ -1,3026 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend_language_parser.h" -#include "zend.h" -#include "zend_compile.h" -#include "zend_llist.h" -#include "zend_API.h" -#include "zend_fast_cache.h" - - -ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); - - -#ifndef ZTS -ZEND_API zend_compiler_globals compiler_globals; -ZEND_API zend_executor_globals executor_globals; -#endif - - -static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline TSRMLS_DC) -{ - char lineno_buf[32]; - uint lineno_len; - char *filename; - - lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno); - if (CG(active_op_array)->filename) { - filename = CG(active_op_array)->filename; - } else { - filename = "-"; - } - - /* NULL, name length, filename length, line number length */ - result->value.str.len = 1+name->value.str.len+strlen(filename)+lineno_len; - result->value.str.val = (char *) emalloc(result->value.str.len+1); - sprintf(result->value.str.val, "%c%s%s%s", '\0', name->value.str.val, filename, lineno_buf); - result->type = IS_STRING; - result->refcount = 1; -} - - -static void init_compiler_declarables(TSRMLS_D) -{ - CG(declarables).ticks.type = IS_LONG; - CG(declarables).ticks.value.lval = 0; -} - - - -void zend_init_compiler_data_structures(TSRMLS_D) -{ - zend_stack_init(&CG(bp_stack)); - zend_stack_init(&CG(function_call_stack)); - zend_stack_init(&CG(switch_cond_stack)); - zend_stack_init(&CG(foreach_copy_stack)); - zend_stack_init(&CG(object_stack)); - zend_stack_init(&CG(declare_stack)); - CG(active_class_entry) = NULL; - CG(active_ce_parent_class_name).value.str.val = NULL; - zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0); - zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0); - zend_stack_init(&CG(list_stack)); - CG(handle_op_arrays) = 1; - CG(in_compilation) = 0; - init_compiler_declarables(TSRMLS_C); - CG(throw_list) = NULL; - zend_register_auto_global("GLOBALS", sizeof("GLOBALS")-1 TSRMLS_CC); -} - - -void init_compiler(TSRMLS_D) -{ - zend_init_compiler_data_structures(TSRMLS_C); - zend_init_rsrc_list(TSRMLS_C); - zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0); - zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0); - CG(unclean_shutdown) = 0; -} - - -void shutdown_compiler(TSRMLS_D) -{ - zend_stack_destroy(&CG(bp_stack)); - zend_stack_destroy(&CG(function_call_stack)); - zend_stack_destroy(&CG(switch_cond_stack)); - zend_stack_destroy(&CG(foreach_copy_stack)); - zend_stack_destroy(&CG(object_stack)); - zend_stack_destroy(&CG(declare_stack)); - zend_stack_destroy(&CG(list_stack)); - zend_hash_destroy(&CG(filenames_table)); - zend_llist_destroy(&CG(open_files)); -} - - -ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC) -{ - char **pp, *p; - int length = strlen(new_compiled_filename); - - if (zend_hash_find(&CG(filenames_table), new_compiled_filename, length+1, (void **) &pp)==SUCCESS) { - CG(compiled_filename) = *pp; - return *pp; - } - p = estrndup(new_compiled_filename, length); - zend_hash_update(&CG(filenames_table), new_compiled_filename, length+1, &p, sizeof(char *), (void **) &pp); - CG(compiled_filename) = p; - return p; -} - - -ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC) -{ - CG(compiled_filename) = original_compiled_filename; -} - - -ZEND_API char *zend_get_compiled_filename(TSRMLS_D) -{ - return CG(compiled_filename); -} - - -ZEND_API int zend_get_compiled_lineno(TSRMLS_D) -{ - return CG(zend_lineno); -} - - -ZEND_API zend_bool zend_is_compiling(TSRMLS_D) -{ - return CG(in_compilation); -} - - -static zend_uint get_temporary_variable(zend_op_array *op_array) -{ - return (op_array->T)++; -} - - -void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = op; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *op1; - opline->op2 = *op2; - *result = opline->result; -} - - -void zend_do_unary_op(int op, znode *result, znode *op1 TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = op; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *op1; - *result = opline->result; - SET_UNUSED(opline->op2); -} - -#define MAKE_NOP(opline) { opline->opcode = ZEND_NOP; memset(&opline->result,0,sizeof(znode)); memset(&opline->op1,0,sizeof(znode)); memset(&opline->op2,0,sizeof(znode)); opline->result.op_type=opline->op1.op_type=opline->op2.op_type=IS_UNUSED; } - -static void zend_replace_object_fetch(zend_op *last_op, znode *value TSRMLS_DC) -{ - if(value->op_type != IS_VAR) { - last_op->opcode = ZEND_MAKE_VAR; - last_op->result.op_type = IS_VAR; - last_op->result.u.EA.type = 0; - last_op->result.u.var = get_temporary_variable(CG(active_op_array)); - last_op->op1 = *value; - SET_UNUSED(last_op->op2); - value->op_type = IS_VAR; - value->u.EA.type = 0; - value->u.var = last_op->result.u.var; - } else { - MAKE_NOP(last_op); - } -} - -void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - int last_op_number = get_next_op_number(CG(active_op_array))-1; - zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number]; - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if(last_op->opcode == ZEND_FETCH_OBJ_RW) { - - switch(op) { - case ZEND_ASSIGN_ADD: - opline->opcode = ZEND_ASSIGN_ADD_OBJ; - break; - case ZEND_ASSIGN_SUB: - opline->opcode = ZEND_ASSIGN_SUB_OBJ; - break; - case ZEND_ASSIGN_MUL: - opline->opcode = ZEND_ASSIGN_MUL_OBJ; - break; - case ZEND_ASSIGN_DIV: - opline->opcode = ZEND_ASSIGN_DIV_OBJ; - break; - case ZEND_ASSIGN_MOD: - opline->opcode = ZEND_ASSIGN_MOD_OBJ; - break; - case ZEND_ASSIGN_SL: - opline->opcode = ZEND_ASSIGN_SL_OBJ; - break; - case ZEND_ASSIGN_SR: - opline->opcode = ZEND_ASSIGN_SR_OBJ; - break; - case ZEND_ASSIGN_CONCAT: - opline->opcode = ZEND_ASSIGN_CONCAT_OBJ; - break; - case ZEND_ASSIGN_BW_OR: - opline->opcode = ZEND_ASSIGN_BW_OR_OBJ; - break; - case ZEND_ASSIGN_BW_AND: - opline->opcode = ZEND_ASSIGN_BW_AND_OBJ; - break; - case ZEND_ASSIGN_BW_XOR: - opline->opcode = ZEND_ASSIGN_BW_XOR_OBJ; - break; - default: - zend_error(E_ERROR, "Unknown binary op opcode %d", op); - } - - opline->op2 = last_op->op2; - opline->op1 = last_op->op1; - zend_replace_object_fetch(last_op, op2 TSRMLS_CC); - opline->extended_value = op2->u.var; - - } else { - opline->opcode = op; - opline->op1 = *op1; - opline->op2 = *op2; - } - - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; -} - - -void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op TSRMLS_DC) -{ - zend_op opline; - zend_op *opline_ptr; - zend_llist *fetch_list_ptr; - - if (bp) { - opline_ptr = &opline; - init_op(opline_ptr TSRMLS_CC); - } else { - opline_ptr = get_next_op(CG(active_op_array) TSRMLS_CC); - } - - opline_ptr->opcode = op; - opline_ptr->result.op_type = IS_VAR; - opline_ptr->result.u.EA.type = 0; - opline_ptr->result.u.var = get_temporary_variable(CG(active_op_array)); - opline_ptr->op1 = *varname; - *result = opline_ptr->result; - SET_UNUSED(opline_ptr->op2); - - if (varname->op_type == IS_CONST && varname->u.constant.type == IS_STRING - && zend_hash_exists(CG(auto_globals), varname->u.constant.value.str.val, varname->u.constant.value.str.len+1)) { - opline_ptr->op2.u.EA.type = ZEND_FETCH_GLOBAL; - } else { - opline_ptr->op2.u.EA.type = ZEND_FETCH_LOCAL; - } - - if (bp) { - zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr); - zend_llist_add_element(fetch_list_ptr, opline_ptr); - } -} - -void fetch_simple_variable(znode *result, znode *varname, int bp TSRMLS_DC) -{ - /* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */ - fetch_simple_variable_ex(result, varname, bp, ZEND_FETCH_W TSRMLS_CC); -} - -void zend_do_fetch_static_member(znode *class TSRMLS_DC) -{ - zend_llist *fetch_list_ptr; - zend_llist_element *le; - zend_op *opline_ptr; - - zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr); - le = fetch_list_ptr->head; - - opline_ptr = (zend_op *)le->data; - opline_ptr->op2 = *class; - opline_ptr->op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER; -} - -void fetch_array_begin(znode *result, znode *varname, znode *first_dim TSRMLS_DC) -{ - fetch_simple_variable(result, varname, 1 TSRMLS_CC); - - fetch_array_dim(result, result, first_dim TSRMLS_CC); -} - - -void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC) -{ - zend_op opline; - zend_llist *fetch_list_ptr; - - init_op(&opline TSRMLS_CC); - opline.opcode = ZEND_FETCH_DIM_W; /* the backpatching routine assumes W */ - opline.result.op_type = IS_VAR; - opline.result.u.EA.type = 0; - opline.result.u.var = get_temporary_variable(CG(active_op_array)); - opline.op1 = *parent; - opline.op2 = *dim; - opline.extended_value = ZEND_FETCH_STANDARD; - *result = opline.result; - - zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr); - zend_llist_add_element(fetch_list_ptr, &opline); -} - - -void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC) -{ - fetch_array_dim(result, parent, offset TSRMLS_CC); -} - - -void zend_do_print(znode *result, znode *arg TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->opcode = ZEND_PRINT; - opline->op1 = *arg; - SET_UNUSED(opline->op2); - *result = opline->result; -} - - -void zend_do_echo(znode *arg TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ECHO; - opline->op1 = *arg; - SET_UNUSED(opline->op2); -} - - -void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) -{ - int last_op_number = get_next_op_number(CG(active_op_array))-1; - zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number]; - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if(last_op->opcode == ZEND_FETCH_OBJ_W) { - opline->opcode = ZEND_ASSIGN_OBJ; - opline->op1 = last_op->op1; - opline->op2 = last_op->op2; - - zend_replace_object_fetch(last_op, value TSRMLS_CC); - - opline->extended_value = value->u.var; - } else { - opline->opcode = ZEND_ASSIGN; - opline->op1 = *variable; - opline->op2 = *value; - } - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; -} - - -void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ASSIGN_REF; - if (result) { - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; - } else { - /* SET_UNUSED(opline->result); */ - opline->result.u.EA.type |= EXT_TYPE_UNUSED; - } - opline->op1 = *lvar; - opline->op2 = *rvar; -} - - -static inline void do_begin_loop(TSRMLS_D) -{ - zend_brk_cont_element *brk_cont_element; - int parent; - - parent = CG(active_op_array)->current_brk_cont; - CG(active_op_array)->current_brk_cont = CG(active_op_array)->last_brk_cont; - brk_cont_element = get_next_brk_cont_element(CG(active_op_array)); - brk_cont_element->parent = parent; -} - - -static inline void do_end_loop(int cont_addr TSRMLS_DC) -{ - CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].cont = cont_addr; - CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].brk = get_next_op_number(CG(active_op_array)); - CG(active_op_array)->current_brk_cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].parent; -} - - -void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC) -{ - int while_cond_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPZ; - opline->op1 = *expr; - close_bracket_token->u.opline_num = while_cond_op_number; - SET_UNUSED(opline->op2); - - do_begin_loop(TSRMLS_C); - INC_BPC(CG(active_op_array)); -} - - -void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - /* add unconditional jump */ - opline->opcode = ZEND_JMP; - opline->op1.u.opline_num = while_token->u.opline_num; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - - /* update while's conditional jmp */ - CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); - - do_end_loop(while_token->u.opline_num TSRMLS_CC); - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC) -{ - int for_cond_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPZNZ; - opline->op1 = *expr; /* the conditional expression */ - second_semicolon_token->u.opline_num = for_cond_op_number; - SET_UNUSED(opline->op2); -} - - -void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMP; - opline->op1.u.opline_num = cond_start->u.opline_num; - CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array)); - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - - do_begin_loop(TSRMLS_C); - - INC_BPC(CG(active_op_array)); -} - - -void zend_do_for_end(znode *second_semicolon_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMP; - opline->op1.u.opline_num = second_semicolon_token->u.opline_num+1; - CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - - do_end_loop(second_semicolon_token->u.opline_num+1 TSRMLS_CC); - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_pre_incdec(znode *result, znode *op1, int op TSRMLS_DC) -{ - int last_op_number = get_next_op_number(CG(active_op_array))-1; - zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number]; - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if(last_op->opcode == ZEND_FETCH_OBJ_RW) { - opline->opcode = (op==ZEND_PRE_INC)?ZEND_PRE_INC_OBJ:ZEND_PRE_DEC_OBJ; - opline->op1 = last_op->op1; - opline->op2 = last_op->op2; - - MAKE_NOP(last_op); - } else { - opline->opcode = op; - opline->op1 = *op1; - SET_UNUSED(opline->op2); - } - - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; -} - - -void zend_do_post_incdec(znode *result, znode *op1, int op TSRMLS_DC) -{ - int last_op_number = get_next_op_number(CG(active_op_array))-1; - zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number]; - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if(last_op->opcode == ZEND_FETCH_OBJ_RW) { - opline->opcode = (op==ZEND_POST_INC)?ZEND_POST_INC_OBJ:ZEND_POST_DEC_OBJ; - opline->op1 = last_op->op1; - opline->op2 = last_op->op2; - - MAKE_NOP(last_op); - } else { - opline->opcode = op; - opline->op1 = *op1; - SET_UNUSED(opline->op2); - } - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; -} - - -void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC) -{ - int if_cond_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPZ; - opline->op1 = *cond; - closing_bracket_token->u.opline_num = if_cond_op_number; - SET_UNUSED(opline->op2); - INC_BPC(CG(active_op_array)); -} - - -void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize TSRMLS_DC) -{ - int if_end_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - zend_llist *jmp_list_ptr; - - opline->opcode = ZEND_JMP; - /* save for backpatching */ - if (initialize) { - zend_llist jmp_list; - - zend_llist_init(&jmp_list, sizeof(int), NULL, 0); - zend_stack_push(&CG(bp_stack), (void *) &jmp_list, sizeof(zend_llist)); - } - zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr); - zend_llist_add_element(jmp_list_ptr, &if_end_op_number); - - CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_if_end(TSRMLS_D) -{ - int next_op_number = get_next_op_number(CG(active_op_array)); - zend_llist *jmp_list_ptr; - zend_llist_element *le; - - zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr); - for (le=jmp_list_ptr->head; le; le = le->next) { - CG(active_op_array)->opcodes[*((int *) le->data)].op1.u.opline_num = next_op_number; - } - zend_llist_destroy(jmp_list_ptr); - zend_stack_del_top(&CG(bp_stack)); - DEC_BPC(CG(active_op_array)); -} - -#if 0 -/* variable parsing type (compile-time) */ -#define ZEND_PARSED_MEMBER (1<<0) -#define ZEND_PARSED_METHOD_CALL (1<<1) -#define ZEND_PARSED_STATIC_MEMBER (1<<2) -#define ZEND_PARSED_FUNCTION_CALL (1<<3) -#define ZEND_PARSED_VARIABLE (1<<4) - -#endif - -void zend_check_writable_variable(znode *variable) -{ - zend_uint type = variable->u.EA.type; - - if (type & ZEND_PARSED_METHOD_CALL) { - zend_error(E_ERROR, "Can't use method return value in write context"); - } - if (type == ZEND_PARSED_FUNCTION_CALL) { - zend_error(E_ERROR, "Can't use function return value in write context"); - } -} - -zend_bool zend_is_function_or_method_call(znode *variable) -{ - zend_uint type = variable->u.EA.type; - - return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL)); -} - -void zend_do_begin_import(TSRMLS_D) -{ - zend_llist_init(&CG(import_commands), sizeof(zend_op), NULL, 0); -} - -void zend_do_import(int type, znode *what TSRMLS_DC) -{ - zend_op opline; - - init_op(&opline TSRMLS_CC); - - switch (type) { - case T_FUNCTION: - opline.opcode = ZEND_IMPORT_FUNCTION; - break; - case T_CLASS: - opline.opcode = ZEND_IMPORT_CLASS; - break; - case T_CONST: - opline.opcode = ZEND_IMPORT_CONST; - break; - } - - if (what) { - if (type == T_FUNCTION || type == T_CLASS) { - zend_str_tolower(what->u.constant.value.str.val, what->u.constant.value.str.len); - } - opline.op2 = *what; - } else { - SET_UNUSED(opline.op2); - } - - zend_llist_add_element(&CG(import_commands), &opline); -} - -void zend_do_end_import(znode *import_from TSRMLS_DC) -{ - zend_llist_element *le; - zend_op *opline, *opline_ptr; - - - le = CG(import_commands).head; - - while (le) { - opline_ptr = (zend_op *)le->data; - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - memcpy(opline, opline_ptr, sizeof(zend_op)); - opline->op1 = *import_from; - le = le->next; - } - zend_llist_destroy(&CG(import_commands)); -} - - - -void zend_do_begin_variable_parse(TSRMLS_D) -{ - zend_llist fetch_list; - - zend_llist_init(&fetch_list, sizeof(zend_op), NULL, 0); - zend_stack_push(&CG(bp_stack), (void *) &fetch_list, sizeof(zend_llist)); -} - - -void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC) -{ - zend_llist *fetch_list_ptr; - zend_llist_element *le; - zend_op *opline, *opline_ptr; - int num_of_created_opcodes = 0; - - /* - if (zend_variable_buffer_empty(TSRMLS_C) && (type == BP_VAR_W || type == BP_VAR_RW)) { - zend_error(E_ERROR, "Method can't be used as l-value"); - } - */ - zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr); - - le = fetch_list_ptr->head; - - while (le) { - opline_ptr = (zend_op *)le->data; - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - memcpy(opline, opline_ptr, sizeof(zend_op)); - switch (type) { - case BP_VAR_R: - if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); - } - opline->opcode -= 3; - break; - case BP_VAR_W: - break; - case BP_VAR_RW: - opline->opcode += 3; - break; - case BP_VAR_IS: - opline->opcode += 6; /* 3+3 */ - break; - case BP_VAR_FUNC_ARG: - opline->opcode += 9; /* 3+3+3 */ - opline->extended_value = arg_offset; - break; - case BP_VAR_UNSET: - if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting"); - } - opline->opcode += 12; /* 3+3+3+3 */ - break; - } - le = le->next; - num_of_created_opcodes++; - } - - if (num_of_created_opcodes == 1) { - if ((opline_ptr->op1.op_type == IS_CONST) && (opline_ptr->op1.u.constant.type == IS_STRING) && - (opline_ptr->op1.u.constant.value.str.len == (sizeof("this")-1)) && - !memcmp(opline_ptr->op1.u.constant.value.str.val, "this", sizeof("this"))) { - CG(active_op_array)->uses_this = 1; - } - } - - zend_llist_destroy(fetch_list_ptr); - zend_stack_del_top(&CG(bp_stack)); -} - - -void zend_do_init_string(znode *result TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_INIT_STRING; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_add_char(znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ADD_CHAR; - opline->op1 = *op1; - opline->op2 = *op2; - opline->op2.op_type = IS_CONST; - opline->result = opline->op1; - *result = opline->result; -} - - -void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ADD_STRING; - opline->op1 = *op1; - opline->op2 = *op2; - opline->op2.op_type = IS_CONST; - opline->result = opline->op1; - *result = opline->result; -} - - -void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC) -{ - zend_op *opline; - - if (op1->op_type == IS_CONST) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_INIT_STRING; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - *result = opline->result; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - - if (op1->u.constant.value.str.len>0) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_ADD_STRING; - opline->result = *result; - opline->op1 = *result; - opline->op2 = *op1; - opline->result = opline->op1; - } else { - zval_dtor(&op1->u.constant); - } - } else { - *result = *op1; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_ADD_VAR; - opline->result = *result; - opline->op1 = *result; - opline->op2 = *op2; - *result = opline->result; -} - -static void zend_lowercase_znode_if_const(znode *z) -{ - if (z->op_type == IS_CONST) { - zend_str_tolower(z->u.constant.value.str.val, z->u.constant.value.str.len); - } -} - -void zend_do_free(znode *op1 TSRMLS_DC) -{ - if (op1->op_type==IS_TMP_VAR) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_FREE; - opline->op1 = *op1; - SET_UNUSED(opline->op2); - } else if (op1->op_type==IS_VAR) { - zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; - - while (opline->opcode == ZEND_END_SILENCE || opline->opcode == ZEND_EXT_FCALL_END) { - opline--; - } - if (opline->result.op_type == op1->op_type - && opline->result.u.var == op1->u.var) { - opline->result.u.EA.type |= EXT_TYPE_UNUSED; - } else { - while (opline>CG(active_op_array)->opcodes) { - /* This should be an object instantiation - * Find JMP_NO_CTOR, mark the preceding ASSIGN and the - * proceeding INIT_FCALL_BY_NAME as unused - */ - if (opline->opcode == ZEND_JMP_NO_CTOR) { - (opline-1)->result.u.EA.type |= EXT_TYPE_UNUSED; - (opline+1)->op1.u.EA.type |= EXT_TYPE_UNUSED; - break; - } else if (opline->opcode == ZEND_FETCH_DIM_R - && opline->op1.op_type == IS_VAR - && opline->op1.u.var == op1->u.var) { - /* This should the end of a list() construct - * Mark its result as unused - */ - opline->extended_value = ZEND_FETCH_STANDARD; - break; - } else if (opline->result.op_type==IS_VAR - && opline->result.u.var == op1->u.var) { - break; - } - opline--; - } - } - } else if (op1->op_type == IS_CONST) { - zval_dtor(&op1->u.constant); - } -} - -#define ZEND_CLONE_FUNC_NAME "__clone" -#define ZEND_CONSTRUCTOR_FUNC_NAME "__construct" -#define ZEND_DESTRUCTOR_FUNC_NAME "__destruct" - -void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference TSRMLS_DC) -{ - zend_op_array op_array; - char *name = function_name->u.constant.value.str.val; - int name_len = function_name->u.constant.value.str.len; - int function_begin_line = function_token->u.opline_num; - - function_token->u.op_array = CG(active_op_array); - zend_str_tolower(name, name_len); - - init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - - op_array.function_name = name; - op_array.arg_types = NULL; - op_array.return_reference = return_reference; - - op_array.scope = CG(active_class_entry); - - if (is_method) { - zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - if ((CG(active_class_entry)->name_length == (uint) name_len) && (!memcmp(CG(active_class_entry)->name, name, name_len))) { - CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); - } else if ((function_name->u.constant.value.str.len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(function_name->u.constant.value.str.val, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) { - CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array); - } else if ((function_name->u.constant.value.str.len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(function_name->u.constant.value.str.val, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) { - CG(active_class_entry)->destructor = (zend_function *) CG(active_op_array); - } else if ((function_name->u.constant.value.str.len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && (!memcmp(function_name->u.constant.value.str.val, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)))) { - CG(active_class_entry)->clone = (zend_function *) CG(active_op_array); - } - } else { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS; - opline->op1.op_type = IS_CONST; - build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline TSRMLS_CC); - opline->op2.op_type = IS_CONST; - opline->op2.u.constant.type = IS_STRING; - opline->op2.u.constant.value.str.val = estrndup(name, name_len); - opline->op2.u.constant.value.str.len = name_len; - opline->op2.u.constant.refcount = 1; - opline->extended_value = ZEND_DECLARE_FUNCTION; - zend_hash_update(CG(function_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - } - - if (CG(extended_info)) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_EXT_NOP; - opline->lineno = function_begin_line; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - } - - { - /* Push a seperator to the switch and foreach stacks */ - zend_switch_entry switch_entry; - - switch_entry.cond.op_type = IS_UNUSED; - switch_entry.default_case = 0; - switch_entry.control_var = 0; - - zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry)); - - zend_stack_push(&CG(foreach_copy_stack), (void *) &switch_entry.cond, sizeof(znode)); - } - function_token->throw_list = CG(throw_list); - CG(throw_list) = NULL; -} - - -void zend_do_end_function_declaration(znode *function_token TSRMLS_DC) -{ - zend_do_extended_info(TSRMLS_C); - zend_do_return(NULL, 0 TSRMLS_CC); - pass_two(CG(active_op_array) TSRMLS_CC); - CG(active_op_array) = function_token->u.op_array; - - /* Pop the switch and foreach seperators */ - zend_stack_del_top(&CG(switch_cond_stack)); - zend_stack_del_top(&CG(foreach_copy_stack)); - - CG(throw_list) = function_token->throw_list; -} - - -void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = op; - opline->result = *var; - opline->op1 = *offset; - if ((op == ZEND_RECV_INIT)) { - opline->op2 = *initialization; - } else { - SET_UNUSED(opline->op2); - } - if (!CG(active_op_array)->arg_types) { - if (pass_type==BYREF_FORCE) { - int i; - - CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1)); - for (i=1; iu.constant.value.lval; i++) { - CG(active_op_array)->arg_types[i] = BYREF_NONE; - } - CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval; - CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type; - } - } else { - CG(active_op_array)->arg_types = (unsigned char *) erealloc(CG(active_op_array)->arg_types, sizeof(unsigned char)*(offset->u.constant.value.lval+1)); - CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval; - CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type; - } -} - - -int zend_do_begin_function_call(znode *function_name TSRMLS_DC) -{ - zend_function *function; - - zend_str_tolower(function_name->u.constant.value.str.val, function_name->u.constant.value.str.len); - if (zend_hash_find(CG(function_table), function_name->u.constant.value.str.val, function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) { - zend_do_begin_dynamic_function_call(function_name TSRMLS_CC); - return 1; /* Dynamic */ - } - - switch (function->type) { - case ZEND_USER_FUNCTION: { - zend_op_array *op_array = (zend_op_array *) function; - - zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *)); - } - break; - case ZEND_INTERNAL_FUNCTION: { - zend_internal_function *internal_function = (zend_internal_function *) function; - - zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *)); - } - break; - } - zend_do_extended_fcall_begin(TSRMLS_C); - return 0; -} - - - -void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) -{ - zend_op *last_op; - int last_op_number; - unsigned char *ptr = NULL; - - zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); - zend_do_begin_variable_parse(TSRMLS_C); - - last_op_number = get_next_op_number(CG(active_op_array))-1; - last_op = &CG(active_op_array)->opcodes[last_op_number]; - - if ((last_op->op2.op_type == IS_CONST) && (last_op->op2.u.constant.value.str.len == sizeof(ZEND_CLONE_FUNC_NAME)-1) - && !memcmp(last_op->op2.u.constant.value.str.val, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME))) { - last_op->opcode = ZEND_CLONE; - left_bracket->u.constant.value.lval = ZEND_CLONE; - zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); - zend_do_extended_fcall_begin(TSRMLS_C); - return; - } - - last_op->opcode = ZEND_INIT_METHOD_CALL; - - if (last_op->op2.op_type == IS_UNUSED && last_op->op2.u.EA.type == ZEND_FETCH_FROM_THIS) { - last_op->op2 = last_op->op1; - memset(&last_op->op1, 0, sizeof(znode)); - SET_UNUSED(last_op->op1); - last_op->extended_value = ZEND_FETCH_FROM_THIS; - } - - zend_lowercase_znode_if_const(&last_op->op2); - - left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME; - - zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); - zend_do_extended_fcall_begin(TSRMLS_C); -} - - -void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC) -{ - unsigned char *ptr = NULL; - zend_op *opline; - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_INIT_FCALL_BY_NAME; - opline->op2 = *function_name; - opline->extended_value = 0; - SET_UNUSED(opline->op1); - - zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); - zend_do_extended_fcall_begin(TSRMLS_C); -} - - -void do_fetch_class(znode *result, znode *class_entry, znode *class_name TSRMLS_DC) -{ - long fetch_class_op_number; - zend_op *opline; - - fetch_class_op_number = get_next_op_number(CG(active_op_array)); - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_FETCH_CLASS; - if (class_entry) { - opline->op1 = *class_entry; - } else { - SET_UNUSED(opline->op1); - CG(catch_begin) = fetch_class_op_number; - } - zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); - if ((class_name->u.constant.value.str.len == (sizeof("self") - 1)) && - !memcmp(class_name->u.constant.value.str.val, "self", sizeof("self"))) { - SET_UNUSED(opline->op2); - opline->extended_value = ZEND_FETCH_CLASS_SELF; - zval_dtor(&class_name->u.constant); - } else if ((class_name->u.constant.value.str.len == (sizeof("parent") - 1)) && - !memcmp(class_name->u.constant.value.str.val, "parent", sizeof("parent"))) { - SET_UNUSED(opline->op2); - opline->extended_value = ZEND_FETCH_CLASS_PARENT; - zval_dtor(&class_name->u.constant); - } else if ((class_name->u.constant.value.str.len == (sizeof("main") - 1)) && - !memcmp(class_name->u.constant.value.str.val, "main", sizeof("main"))) { - SET_UNUSED(opline->op2); - opline->extended_value = ZEND_FETCH_CLASS_MAIN; - zval_dtor(&class_name->u.constant); - } else { - opline->op2 = *class_name; - } - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_CONST; /* FIXME: Hack so that INIT_FCALL_BY_NAME still knows this is a class */ - *result = opline->result; -} - - -void do_fetch_class_name(znode *result, znode *class_name_entry, znode *class_name, zend_bool case_sensitive TSRMLS_DC) -{ - zend_uint length; - - if (!result) { - result = class_name_entry; - } else { - *result = *class_name_entry; - } - if (!case_sensitive) { - zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); - } - length = 1 + result->u.constant.value.str.len + class_name->u.constant.value.str.len; - result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], ":", sizeof(":")-1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len+1], class_name->u.constant.value.str.val, class_name->u.constant.value.str.len+1); - STR_FREE(class_name->u.constant.value.str.val); - result->u.constant.value.str.len = length; -} - -void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name TSRMLS_DC) -{ - unsigned char *ptr = NULL; - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_INIT_STATIC_METHOD_CALL; - opline->op1 = *class_name; - zend_lowercase_znode_if_const(function_name); - opline->op2 = *function_name; - - zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); -} - - -void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC) -{ - zend_op *opline; - - if (is_method && function_name && function_name->u.constant.value.lval == ZEND_CLONE) { - if (argument_list->u.constant.value.lval > 0) { - zend_error(E_ERROR, "Can't pass arguments to __clone()"); - } - /* FIXME: throw_list */ - zend_stack_del_top(&CG(function_call_stack)); - *result = CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1].result; - return; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) { - opline->opcode = ZEND_DO_FCALL; - opline->op1 = *function_name; - } else { - opline->opcode = ZEND_DO_FCALL_BY_NAME; - SET_UNUSED(opline->op1); - } - - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_VAR; - *result = opline->result; - SET_UNUSED(opline->op2); - - /* Check how much this is really needed - opline->op2.u.constant.value.lval = is_method; - */ - if (CG(throw_list) != NULL) { - long op_number = get_next_op_number(CG(active_op_array))-1; - zend_llist_add_element(CG(throw_list), &op_number); - } else { - opline->op2.u.opline_num = -1; - } - - zend_stack_del_top(&CG(function_call_stack)); - opline->extended_value = argument_list->u.constant.value.lval; -} - - -void zend_do_pass_param(znode *param, int op, int offset TSRMLS_DC) -{ - zend_op *opline; - unsigned char *arg_types; - int original_op=op; - zend_function **function_ptr_ptr, *function_ptr; - int send_by_reference; - - - zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr); - function_ptr = *function_ptr_ptr; - - if (original_op==ZEND_SEND_REF - && !CG(allow_call_time_pass_reference)) { - zend_error(E_COMPILE_WARNING, - "Call-time pass-by-reference has been deprecated - argument passed by value; " - "If you would like to pass it by reference, modify the declaration of %s(). " - "If you would like to enable call-time pass-by-reference, you can set " - "allow_call_time_pass_reference to true in your INI file. " - "However, future versions may not support this any longer. ", - (function_ptr?function_ptr->common.function_name:"[runtime function name]"), - offset+1); - } - - if (function_ptr) { - arg_types = function_ptr->common.arg_types; - } else { - arg_types = NULL; - } - - send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)?ZEND_ARG_SEND_BY_REF:0; - - - if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) { - /* Method call */ - op = ZEND_SEND_VAR_NO_REF; - } else if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) { - op = ZEND_SEND_VAR_NO_REF; - } - - if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference == ZEND_ARG_SEND_BY_REF) { - /* change to passing by reference */ - switch (param->op_type) { - case IS_VAR: - op = ZEND_SEND_REF; - break; - default: - zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference"); - break; - } - } - - if (original_op == ZEND_SEND_VAR) { - switch(op) { - case ZEND_SEND_VAR_NO_REF: - zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); - break; - case ZEND_SEND_VAR: - if (function_ptr) { - zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); - } else { - zend_do_end_variable_parse(BP_VAR_FUNC_ARG, offset TSRMLS_CC); - } - break; - case ZEND_SEND_REF: - zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); - break; - } - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - if (op == ZEND_SEND_VAR_NO_REF) { - if (function_ptr) { - opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference; - } else { - opline->extended_value = 0; - } - } else { - if (function_ptr) { - opline->extended_value = ZEND_DO_FCALL; - } else { - opline->extended_value = ZEND_DO_FCALL_BY_NAME; - } - } - opline->opcode = op; - opline->op1 = *param; - opline->op2.u.opline_num = offset; - SET_UNUSED(opline->op2); -} - - -static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC) -{ - zend_op *opline; - - if (switch_entry->cond.op_type!=IS_VAR && switch_entry->cond.op_type!=IS_TMP_VAR) { - return 1; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_SWITCH_FREE; - opline->op1 = switch_entry->cond; - SET_UNUSED(opline->op2); - opline->extended_value = 0; - return 0; -} - -static int generate_free_foreach_copy(znode *foreach_copy TSRMLS_DC) -{ - zend_op *opline; - - if (foreach_copy->op_type!=IS_VAR && foreach_copy->op_type!=IS_TMP_VAR) { - return 1; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_SWITCH_FREE; - opline->op1 = *foreach_copy; - SET_UNUSED(opline->op2); - opline->extended_value = 1; - return 0; -} - -void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) -{ - zend_op *opline; - - if (do_end_vparse) { - if (CG(active_op_array)->return_reference) { - zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); - } else { - zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); - } -#if 0 - } else if (expr && CG(active_op_array)->return_reference) { - zend_error(E_COMPILE_ERROR, "Only variables may be returned by reference"); -#endif - } - -#ifdef ZTS - zend_stack_apply_with_argument(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_switch_expr TSRMLS_CC); - zend_stack_apply_with_argument(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_foreach_copy TSRMLS_CC); -#else - zend_stack_apply(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_switch_expr); - zend_stack_apply(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_foreach_copy); -#endif - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_RETURN; - - if (expr) { - opline->op1 = *expr; - } else { - opline->op1.op_type = IS_CONST; - INIT_ZVAL(opline->op1.u.constant); - } - SET_UNUSED(opline->op2); -} - - -void zend_do_try(znode *try_token TSRMLS_DC) -{ - try_token->throw_list = (void *) CG(throw_list); - CG(throw_list) = (zend_llist *) emalloc(sizeof(zend_llist)); - zend_llist_init(CG(throw_list), sizeof(long), NULL, 0); - /* Initialize try backpatch list used to backpatch throw, do_fcall */ -} - -static void throw_list_applier(long *opline_num, long *catch_opline) -{ - zend_op *opline; - TSRMLS_FETCH(); /* Pass this by argument */ - - opline = &CG(active_op_array)->opcodes[*opline_num]; - - /* Backpatch the opline of the catch statement */ - switch (opline->opcode) { - case ZEND_DO_FCALL: - case ZEND_DO_FCALL_BY_NAME: - case ZEND_THROW: - opline->op2.u.opline_num = *catch_opline; - break; - default: - zend_error(E_ERROR, "Bad opcode in throw list"); - break; - } -} - -void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var, zend_bool first_catch TSRMLS_DC) -{ - long catch_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline; - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_CATCH; - opline->op1 = *catch_class; - SET_UNUSED(opline->op1); /* FIXME: Define IS_CLASS or something like that */ - opline->op2 = *catch_var; - - if (first_catch) { - zend_llist_apply_with_argument(CG(throw_list), (llist_apply_with_arg_func_t) throw_list_applier, &CG(catch_begin) TSRMLS_CC); - zend_llist_destroy(CG(throw_list)); - efree(CG(throw_list)); - CG(throw_list) = (void *) try_token->throw_list; - } - try_token->u.opline_num = catch_op_number; -} - -void zend_do_end_catch(znode *try_token TSRMLS_DC) -{ - CG(active_op_array)->opcodes[try_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array)); -} - -void zend_do_throw(znode *expr TSRMLS_DC) -{ - zend_op *opline; - long throw_op_number = get_next_op_number(CG(active_op_array)); - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_THROW; - opline->op1 = *expr; - SET_UNUSED(opline->op2); - - if (CG(throw_list) != NULL) { - zend_llist_add_element(CG(throw_list), &throw_op_number); - } else { - opline->op2.u.opline_num = -1; - } -} - -ZEND_API void function_add_ref(zend_function *function) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_op_array *op_array = &function->op_array; - - (*op_array->refcount)++; - if (op_array->static_variables) { - HashTable *static_variables = op_array->static_variables; - zval *tmp_zval; - - ALLOC_HASHTABLE(op_array->static_variables); - zend_hash_init(op_array->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(op_array->static_variables, static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_zval, sizeof(zval *)); - } - } -} - - -static void do_inherit_parent_constructor(zend_class_entry *ce) -{ - if (ce->parent - && !zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) { - zend_function *function; - - if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) { - /* inherit parent's constructor */ - zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL); - function_add_ref(function); - } - } -} - -void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) -{ - zend_function tmp_zend_function; - zval *tmp; - - /* Perform inheritance */ - zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - /* STATIC_MEMBERS_FIXME */ - zend_hash_merge(ce->static_members, parent_ce->static_members, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0); - ce->parent = parent_ce; - if (!ce->handle_property_get) - ce->handle_property_get = parent_ce->handle_property_get; - if (!ce->handle_property_set) - ce->handle_property_set = parent_ce->handle_property_set; - if (!ce->handle_function_call) - ce->handle_function_call = parent_ce->handle_function_call; - do_inherit_parent_constructor(ce); -} - -static void create_class(HashTable *class_table, char *name, int name_length, zend_class_entry **ce) -{ - zend_class_entry *new_class_entry; - - new_class_entry = emalloc(sizeof(zend_class_entry)); - *ce = new_class_entry; - new_class_entry->type = ZEND_USER_CLASS; - new_class_entry->name = estrndup(name, name_length); - new_class_entry->name_length = name_length; - new_class_entry->refcount = 1; - new_class_entry->constants_updated = 0; - - zend_str_tolower(new_class_entry->name, new_class_entry->name_length); - - zend_hash_init(&new_class_entry->function_table, 10, NULL, ZEND_FUNCTION_DTOR, 0); - zend_hash_init(&new_class_entry->class_table, 10, NULL, ZEND_CLASS_DTOR, 0); - zend_hash_init(&new_class_entry->default_properties, 10, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(&new_class_entry->private_properties, 10, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_HASHTABLE(new_class_entry->static_members); - zend_hash_init(new_class_entry->static_members, 10, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(&new_class_entry->constants_table, 10, NULL, ZVAL_PTR_DTOR, 0); - - new_class_entry->constructor = NULL; - new_class_entry->destructor = NULL; - new_class_entry->clone = NULL; - - new_class_entry->create_object = NULL; - new_class_entry->handle_function_call = NULL; - new_class_entry->handle_property_set = NULL; - new_class_entry->handle_property_get = NULL; - - new_class_entry->parent = NULL; - - if (zend_hash_update(class_table, new_class_entry->name, name_length+1, &new_class_entry, sizeof(zend_class_entry *), NULL) == FAILURE) { - zend_error(E_ERROR, "Can't create class. Fatal error, please report!"); - } -} - - -#include "../TSRM/tsrm_strtok_r.h" - -static int create_nested_class(HashTable *class_table, char *path, zend_class_entry *new_ce) -{ - char *cur, *temp; - char *last; - zend_class_entry *ce, **pce; - - - cur = tsrm_strtok_r(path, ":", &temp); - - if (zend_hash_find(class_table, cur, strlen(cur)+1, (void **)&pce) == FAILURE) { - create_class(class_table, cur, strlen(cur), &ce); - } else { - ce = *pce; - } - - last = tsrm_strtok_r(NULL, ":", &temp); - - for(;;) { - cur = tsrm_strtok_r(NULL, ":", &temp); - if (!cur) { - break; - } - if (zend_hash_find(&ce->class_table, last, strlen(last)+1, (void **)&pce) == FAILURE) { - create_class(&ce->class_table, last, strlen(last), &ce); - } else { - ce = *pce; - } - last = cur; - } - new_ce->refcount++; - if (zend_hash_add(&ce->class_table, last, strlen(last)+1, &new_ce, sizeof(zend_class_entry *), NULL) == FAILURE) { - new_ce->refcount--; - zend_error(E_ERROR, "Cannot redeclare class %s", last); - return FAILURE; - } - return SUCCESS; -} - -ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time) -{ - switch (opline->extended_value) { - case ZEND_DECLARE_FUNCTION: { - zend_function *function; - - zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &function); - if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) { - int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR; - zend_function *function; - - if (zend_hash_find(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void *) &function)==SUCCESS - && function->type==ZEND_USER_FUNCTION - && ((zend_op_array *) function)->last>0) { - zend_error(error_level, "Cannot redeclare %s() (previously declared in %s:%d)", - opline->op2.u.constant.value.str.val, - ((zend_op_array *) function)->filename, - ((zend_op_array *) function)->opcodes[0].lineno); - } else { - zend_error(error_level, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val); - } - return FAILURE; - } else { - (*function->op_array.refcount)++; - function->op_array.static_variables = NULL; /* NULL out the unbound function */ - return SUCCESS; - } - } - break; - case ZEND_DECLARE_CLASS: { - zend_class_entry *ce, **pce; - - if (zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &pce)==FAILURE) { - zend_error(E_ERROR, "Internal Zend error - Missing class information for %s", opline->op1.u.constant.value.str.val); - return FAILURE; - } else { - ce = *pce; - } - if (strchr(opline->op2.u.constant.value.str.val, ':')) { - return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce); - } - ce->refcount++; - if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, &ce, sizeof(zend_class_entry *), NULL)==FAILURE) { - ce->refcount--; - if (!compile_time) { - zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val); - } - return FAILURE; - } else { - return SUCCESS; - } - } - break; - case ZEND_DECLARE_INHERITED_CLASS: { - zend_class_entry **parent_pce, *ce, **pce; - int parent_name_length; - char *class_name, *parent_name; - int found_ce; - - - found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &pce); - - /* Restore base class / derived class names */ - class_name = strchr(opline->op2.u.constant.value.str.val, ':'); - if (!class_name) { - zend_error(E_CORE_ERROR, "Invalid runtime class entry"); - } - class_name++; - - if (found_ce==FAILURE) { - zend_error(E_ERROR, "Cannot redeclare class %s", class_name); - return FAILURE; - } else { - ce = *pce; - } - ce->refcount++; - - /* Obtain parent class */ - parent_name_length = class_name - opline->op2.u.constant.value.str.val - 1; - parent_name = estrndup(opline->op2.u.constant.value.str.val, parent_name_length); - if (zend_hash_find(class_table, parent_name, parent_name_length+1, (void **) &parent_pce)==FAILURE) { - if (!compile_time) { - zend_error(E_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name); - } - ce->refcount--; - efree(parent_name); - return FAILURE; - } - efree(parent_name); - - zend_do_inheritance(ce, *parent_pce); - - /* Register the derived class */ - if (zend_hash_add(class_table, class_name, strlen(class_name)+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) { - if (!compile_time) { - zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val); - } - ce->refcount--; - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->private_properties); - zend_hash_destroy(ce->static_members); - zend_hash_destroy(&ce->constants_table); - return FAILURE; - } - return SUCCESS; - } - break; - } - return FAILURE; -} - - -void zend_do_early_binding(TSRMLS_D) -{ - zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1]; - HashTable *table; - - if (strchr(opline->op2.u.constant.value.str.val, ':')) { - return; - } - if (do_bind_function_or_class(opline, CG(function_table), CG(class_table), 1)==FAILURE) { - return; - } - switch (opline->extended_value) { - case ZEND_DECLARE_FUNCTION: - table = CG(function_table); - break; - case ZEND_DECLARE_CLASS: - table = CG(class_table); - break; - default: - zend_error(E_COMPILE_ERROR, "Invalid binding type"); - return; - } - zend_hash_del(table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len); - zval_dtor(&opline->op1.u.constant); - zval_dtor(&opline->op2.u.constant); - opline->opcode = ZEND_NOP; - memset(&opline->op1, 0, sizeof(znode)); - memset(&opline->op2, 0, sizeof(znode)); - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC) -{ - int next_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPNZ_EX; - if (expr1->op_type == IS_TMP_VAR) { - opline->result = *expr1; - } else { - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_TMP_VAR; - } - opline->op1 = *expr1; - SET_UNUSED(opline->op2); - - op_token->u.opline_num = next_op_number; - - *expr1 = opline->result; -} - - -void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - *result = *expr1; /* we saved the original result in expr1 */ - opline->opcode = ZEND_BOOL; - opline->result = *result; - opline->op1 = *expr2; - SET_UNUSED(opline->op2); - - CG(active_op_array)->opcodes[op_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); -} - - -void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC) -{ - int next_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPZ_EX; - if (expr1->op_type == IS_TMP_VAR) { - opline->result = *expr1; - } else { - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_TMP_VAR; - } - opline->op1 = *expr1; - SET_UNUSED(opline->op2); - - op_token->u.opline_num = next_op_number; - - *expr1 = opline->result; -} - - -void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - *result = *expr1; /* we saved the original result in expr1 */ - opline->opcode = ZEND_BOOL; - opline->result = *result; - opline->op1 = *expr2; - SET_UNUSED(opline->op2); - - CG(active_op_array)->opcodes[op_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); -} - - -void zend_do_do_while_begin(TSRMLS_D) -{ - do_begin_loop(TSRMLS_C); - INC_BPC(CG(active_op_array)); -} - - -void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPNZ; - opline->op1 = *expr; - opline->op2.u.opline_num = do_token->u.opline_num; - SET_UNUSED(opline->op2); - - do_end_loop(expr_open_bracket->u.opline_num TSRMLS_CC); - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_brk_cont(int op, znode *expr TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = op; - opline->op1.u.opline_num = CG(active_op_array)->current_brk_cont; - SET_UNUSED(opline->op1); - if (expr) { - opline->op2 = *expr; - } else { - opline->op2.u.constant.type = IS_LONG; - opline->op2.u.constant.value.lval = 1; - INIT_PZVAL(&opline->op2.u.constant); - opline->op2.op_type = IS_CONST; - } -} - - -void zend_do_switch_cond(znode *cond TSRMLS_DC) -{ - zend_switch_entry switch_entry; - zend_op *opline; - - /* Initialize the conditional value */ - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_BOOL; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_TMP_VAR; - opline->op1.op_type = IS_CONST; - opline->op1.u.constant.type = IS_BOOL; - opline->op1.u.constant.value.lval = 0; - INIT_PZVAL(&opline->op1.u.constant); - SET_UNUSED(opline->op2); - - switch_entry.cond = *cond; - switch_entry.default_case = -1; - switch_entry.control_var = opline->result.u.var; - zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry)); - - do_begin_loop(TSRMLS_C); - - INC_BPC(CG(active_op_array)); -} - - - -void zend_do_switch_end(znode *case_list TSRMLS_DC) -{ - zend_op *opline; - zend_switch_entry *switch_entry_ptr; - - zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr); - - if (case_list->op_type != IS_UNUSED) { /* non-empty switch */ - int next_op_number = get_next_op_number(CG(active_op_array)); - - CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number; - } - - /* add code to jmp to default case */ - if (switch_entry_ptr->default_case != -1) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_JMPZ; - opline->op1.op_type = IS_TMP_VAR; - opline->op1.u.var = switch_entry_ptr->control_var; - opline->op2.u.opline_num = switch_entry_ptr->default_case; - SET_UNUSED(opline->op2); - } - - - /* remember break/continue loop information */ - CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].brk = get_next_op_number(CG(active_op_array)); - CG(active_op_array)->current_brk_cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].parent; - - if (switch_entry_ptr->cond.op_type==IS_VAR || switch_entry_ptr->cond.op_type==IS_TMP_VAR) { - /* emit free for the switch condition*/ - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_SWITCH_FREE; - opline->op1 = switch_entry_ptr->cond; - SET_UNUSED(opline->op2); - } - if (switch_entry_ptr->cond.op_type == IS_CONST) { - zval_dtor(&switch_entry_ptr->cond.u.constant); - } - - zend_stack_del_top(&CG(switch_cond_stack)); - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - int next_op_number; - zend_switch_entry *switch_entry_ptr; - znode result; - - zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr); - - opline->opcode = ZEND_CASE; - opline->result.u.var = switch_entry_ptr->control_var; - opline->result.op_type = IS_TMP_VAR; - opline->op1 = switch_entry_ptr->cond; - opline->op2 = *case_expr; - if (opline->op1.op_type == IS_CONST) { - zval_copy_ctor(&opline->op1.u.constant); - } - result = opline->result; - - next_op_number = get_next_op_number(CG(active_op_array)); - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_JMPZ; - opline->op1 = result; - SET_UNUSED(opline->op2); - case_token->u.opline_num = next_op_number; - - if (case_list->op_type==IS_UNUSED) { - return; - } - next_op_number = get_next_op_number(CG(active_op_array)); - CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number; -} - - -void zend_do_case_after_statement(znode *result, znode *case_token TSRMLS_DC) -{ - int next_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMP; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - result->u.opline_num = next_op_number; - - switch (CG(active_op_array)->opcodes[case_token->u.opline_num].opcode) { - case ZEND_JMP: - CG(active_op_array)->opcodes[case_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array)); - break; - case ZEND_JMPZ: - CG(active_op_array)->opcodes[case_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); - break; - } -} - - - -void zend_do_default_before_statement(znode *case_list, znode *default_token TSRMLS_DC) -{ - int next_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - zend_switch_entry *switch_entry_ptr; - - zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr); - - opline->opcode = ZEND_JMP; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - default_token->u.opline_num = next_op_number; - - next_op_number = get_next_op_number(CG(active_op_array)); - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_BOOL; - opline->result.u.var = switch_entry_ptr->control_var; - opline->result.op_type = IS_TMP_VAR; - opline->op1.op_type = IS_CONST; - opline->op1.u.constant.type = IS_BOOL; - opline->op1.u.constant.value.lval = 1; - INIT_PZVAL(&opline->op1.u.constant); - SET_UNUSED(opline->op2); - switch_entry_ptr->default_case = next_op_number; - - if (case_list->op_type==IS_UNUSED) { - return; - } - next_op_number = get_next_op_number(CG(active_op_array)); - CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number; -} - - -void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znode *parent_class_name TSRMLS_DC) -{ - zend_op *opline; - int runtime_inheritance = 0; - zend_class_entry *new_class_entry = emalloc(sizeof(zend_class_entry)); - - class_token->u.previously_active_class_entry = CG(active_class_entry); - new_class_entry->type = ZEND_USER_CLASS; - new_class_entry->name = class_name->u.constant.value.str.val; - new_class_entry->name_length = class_name->u.constant.value.str.len; - new_class_entry->refcount = 1; - new_class_entry->constants_updated = 0; - - zend_str_tolower(new_class_entry->name, new_class_entry->name_length); - - zend_hash_init(&new_class_entry->function_table, 10, NULL, ZEND_FUNCTION_DTOR, 0); - zend_hash_init(&new_class_entry->class_table, 10, NULL, ZEND_CLASS_DTOR, 0); - zend_hash_init(&new_class_entry->default_properties, 10, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(&new_class_entry->private_properties, 10, NULL, ZVAL_PTR_DTOR, 0); - ALLOC_HASHTABLE(new_class_entry->static_members); - zend_hash_init(new_class_entry->static_members, 10, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(&new_class_entry->constants_table, 10, NULL, ZVAL_PTR_DTOR, 0); - - new_class_entry->constructor = NULL; - new_class_entry->destructor = NULL; - new_class_entry->clone = NULL; - - new_class_entry->create_object = NULL; - new_class_entry->handle_function_call = NULL; - new_class_entry->handle_property_set = NULL; - new_class_entry->handle_property_get = NULL; - - /* code for inheritance from parent class */ - if (parent_class_name) { - zend_class_entry *parent_class, **parent_class_p; - zend_function tmp_zend_function; - zval *tmp; - - zend_str_tolower(parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len); - CG(active_ce_parent_class_name).value.str.val = estrndup(parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len); - CG(active_ce_parent_class_name).value.str.len = parent_class_name->u.constant.value.str.len; - - if (zend_hash_find(CG(active_class_entry)?&CG(active_class_entry)->class_table:CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class_p)==SUCCESS) { - parent_class = *parent_class_p; - /* copy functions */ - zend_hash_copy(&new_class_entry->function_table, &parent_class->function_table, (copy_ctor_func_t) function_add_ref, &tmp_zend_function, sizeof(zend_function)); - - /* copy default properties */ - zend_hash_copy(&new_class_entry->default_properties, &parent_class->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - /* copy static members */ - zend_hash_copy(new_class_entry->static_members, parent_class->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - /* copy constants */ - zend_hash_copy(&new_class_entry->constants_table, &parent_class->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - - new_class_entry->constructor = parent_class->constructor; - new_class_entry->destructor = parent_class->destructor; - - /* FIXME: What do we do with clone? */ - - /* copy overloaded handlers */ - new_class_entry->handle_function_call = parent_class->handle_function_call; - new_class_entry->handle_property_get = parent_class->handle_property_get; - new_class_entry->handle_property_set = parent_class->handle_property_set; - - new_class_entry->parent = parent_class; - - zval_dtor(&parent_class_name->u.constant); - } else { - runtime_inheritance = 1; - new_class_entry->parent = NULL; - } - } else { - new_class_entry->parent = NULL; - } - - if (CG(active_class_entry)) { - if (runtime_inheritance) { - zend_error(E_ERROR, "Only first level classes can inherit from undefined classes"); - } - zend_hash_update(&CG(active_class_entry)->class_table, new_class_entry->name, new_class_entry->name_length+1, &new_class_entry, sizeof(zend_class_entry *), NULL); - CG(active_class_entry) = new_class_entry; - return; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS; - opline->op1.op_type = IS_CONST; - build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline TSRMLS_CC); - opline->op2.op_type = IS_CONST; - opline->op2.u.constant.type = IS_STRING; - opline->op2.u.constant.refcount = 1; - if (runtime_inheritance) { - char *full_class_name; - - opline->op2.u.constant.value.str.len = parent_class_name->u.constant.value.str.len+1+new_class_entry->name_length; - full_class_name = opline->op2.u.constant.value.str.val = (char *) emalloc(opline->op2.u.constant.value.str.len+1); - - memcpy(full_class_name, parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len); - full_class_name += parent_class_name->u.constant.value.str.len; - full_class_name[0] = ':'; - full_class_name++; - memcpy(full_class_name, new_class_entry->name, new_class_entry->name_length); - zval_dtor(&parent_class_name->u.constant); - full_class_name += new_class_entry->name_length; - full_class_name[0] = 0; - opline->extended_value = ZEND_DECLARE_INHERITED_CLASS; - } else { - opline->op2.u.constant.value.str.val = estrndup(new_class_entry->name, new_class_entry->name_length); - opline->op2.u.constant.value.str.len = new_class_entry->name_length; - opline->extended_value = ZEND_DECLARE_CLASS; - } - - zend_hash_update(CG(class_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &new_class_entry, sizeof(zend_class_entry *), NULL); - CG(active_class_entry) = new_class_entry; -} - - -void zend_do_end_class_declaration(znode *class_token TSRMLS_DC) -{ - do_inherit_parent_constructor(CG(active_class_entry)); - CG(active_class_entry) = class_token->u.previously_active_class_entry; - if (CG(active_ce_parent_class_name).value.str.val) { - efree(CG(active_ce_parent_class_name).value.str.val); - CG(active_ce_parent_class_name).value.str.val = NULL; - } -} - -void mangle_private_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length) -{ - char *priv_name; - int priv_name_length; - - priv_name_length = 1 + src1_length + 1 + src2_length; - priv_name = emalloc(priv_name_length+1); - priv_name[0] = '\0'; - memcpy(priv_name + 1, src1, src1_length+1); - memcpy(priv_name + 1 + src1_length + 1, src2, src2_length+1); - - *dest = priv_name; - *dest_length = priv_name_length; -} - -void zend_do_declare_property(znode *var_name, znode *value, int declaration_type TSRMLS_DC) -{ - zval *property; - - ALLOC_ZVAL(property); - - if (value) { - *property = value->u.constant; - } else { - INIT_PZVAL(property); - property->type = IS_NULL; - } - - switch (declaration_type) { - case T_PRIVATE: - { - char *priv_name; - int priv_name_length; - - mangle_private_property_name(&priv_name, &priv_name_length, CG(active_class_entry)->name, CG(active_class_entry)->name_length, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len); - zend_hash_update(&CG(active_class_entry)->default_properties, priv_name, priv_name_length+1, &property, sizeof(zval *), NULL); - efree(priv_name); - - property->refcount++; - zend_hash_update(&CG(active_class_entry)->private_properties, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - break; - } - case T_VAR: - zend_hash_update(&CG(active_class_entry)->default_properties, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - break; - case T_STATIC: - zend_hash_update(CG(active_class_entry)->static_members, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - break; - case T_CONST: - zend_hash_update(&CG(active_class_entry)->constants_table, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - break; - } - FREE_PNODE(var_name); -} - - -void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC) -{ - zend_op opline; - zend_llist *fetch_list_ptr; - - zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr); - - if (fetch_list_ptr->count == 1) { - zend_llist_element *le; - zend_op *opline_ptr; - - le = fetch_list_ptr->head; - opline_ptr = (zend_op *) le->data; - if ((opline_ptr->op1.op_type == IS_CONST) && (opline_ptr->op1.u.constant.type == IS_STRING) && - (opline_ptr->op1.u.constant.value.str.len == (sizeof("this")-1)) && - !memcmp(opline_ptr->op1.u.constant.value.str.val, "this", sizeof("this"))) { - efree(opline_ptr->op1.u.constant.value.str.val); - opline_ptr->op1 = *property; - SET_UNUSED(opline_ptr->op2); - opline_ptr->op2.u.EA.type = ZEND_FETCH_FROM_THIS; - - if ((opline_ptr->op1.op_type == IS_CONST) && zend_hash_exists(&CG(active_class_entry)->private_properties, opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len+1)) { - char *priv_name; - int priv_name_length; - - mangle_private_property_name(&priv_name, &priv_name_length, CG(active_class_entry)->name, CG(active_class_entry)->name_length, opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len); - - STR_FREE(opline_ptr->op1.u.constant.value.str.val); - opline_ptr->op1.u.constant.value.str.val = priv_name; - opline_ptr->op1.u.constant.value.str.len = priv_name_length; - } - - *result = opline_ptr->result; - return; - } - } - - init_op(&opline TSRMLS_CC); - opline.opcode = ZEND_FETCH_OBJ_W; /* the backpatching routine assumes W */ - opline.result.op_type = IS_VAR; - opline.result.u.EA.type = 0; - opline.result.u.var = get_temporary_variable(CG(active_op_array)); - opline.op1 = *object; - opline. op2 = *property; - *result = opline.result; - - zend_llist_add_element(fetch_list_ptr, &opline); -} - - -void zend_do_push_object(znode *object TSRMLS_DC) -{ - zend_stack_push(&CG(object_stack), object, sizeof(znode)); -} - - -void zend_do_pop_object(znode *object TSRMLS_DC) -{ - znode *tmp; - - zend_stack_top(&CG(object_stack), (void **) &tmp); - *object = *tmp; - zend_stack_del_top(&CG(object_stack)); -} - - -void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - unsigned char *ptr = NULL; - - opline->opcode = ZEND_NEW; - opline->result.op_type = IS_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *class_type; - SET_UNUSED(opline->op2); - - new_token->u.opline_num = get_next_op_number(CG(active_op_array)); - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_JMP_NO_CTOR; - opline->op1 = (opline-1)->result; - SET_UNUSED(opline->op2); - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_INIT_CTOR_CALL; - opline->op1 = (opline-2)->result; - SET_UNUSED(opline->op2); - - zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *)); -} - - -void zend_do_end_new_object(znode *result, znode *new_token, znode *argument_list TSRMLS_DC) -{ - znode ctor_result; - - zend_do_end_function_call(NULL, &ctor_result, argument_list, 1, 0 TSRMLS_CC); - zend_do_free(&ctor_result TSRMLS_CC); - - CG(active_op_array)->opcodes[new_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); - *result = CG(active_op_array)->opcodes[new_token->u.opline_num].op1; -} - - -void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode TSRMLS_DC) -{ - switch (mode) { - case ZEND_CT: - if (constant_container) { - do_fetch_class_name(NULL, constant_container, constant_name, 1 TSRMLS_CC); - *result = *constant_container; - } else { - *result = *constant_name; - } - result->u.constant.type = IS_CONSTANT; - break; - case ZEND_RT: - { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_FETCH_CONSTANT; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - if (constant_container) { - opline->op1 = *constant_container; - } else { - SET_UNUSED(opline->op1); - } - opline->op2 = *constant_name; - *result = opline->result; - } - break; - } -} - - -void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - switch (cmd->op_type) { - case IS_TMP_VAR: - opline->opcode = ZEND_SEND_VAL; - break; - default: - opline->opcode = ZEND_SEND_VAR; - break; - } - opline->op1 = *cmd; - opline->op2.u.opline_num = 0; - opline->extended_value = ZEND_DO_FCALL; - SET_UNUSED(opline->op2); - - /* FIXME: exception support not added to this op2 */ - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_DO_FCALL; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_VAR; - opline->op1.u.constant.value.str.val = estrndup("shell_exec", sizeof("shell_exec")-1); - opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1; - INIT_PZVAL(&opline->op1.u.constant); - opline->op1.u.constant.type = IS_STRING; - opline->op1.op_type = IS_CONST; - opline->extended_value = 1; - SET_UNUSED(opline->op2); - *result = opline->result; -} - - - -void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_INIT_ARRAY; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->result.op_type = IS_TMP_VAR; - *result = opline->result; - if (expr) { - opline->op1 = *expr; - if (offset) { - opline->op2 = *offset; - } else { - SET_UNUSED(opline->op2); - } - } else { - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - } - opline->extended_value = is_ref; -} - - -void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_ADD_ARRAY_ELEMENT; - opline->result = *result; - opline->op1 = *expr; - if (offset) { - opline->op2 = *offset; - } else { - SET_UNUSED(opline->op2); - } - opline->extended_value = is_ref; -} - - - -void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr) -{ - zval *element; - - ALLOC_ZVAL(element); - *element = expr->u.constant; - if (offset) { - switch (offset->u.constant.type) { - case IS_CONSTANT: - /* Ugly hack to denote that this value has a constant index */ - element->type |= IS_CONSTANT_INDEX; - /* break missing intentionally */ - case IS_STRING: - zend_hash_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL); - zval_dtor(&offset->u.constant); - break; - case IS_LONG: - zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL); - break; - } - } else { - zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL); - } -} - - -void zend_do_add_list_element(znode *element TSRMLS_DC) -{ - list_llist_element lle; - - if (element) { - lle.var = *element; - zend_llist_copy(&lle.dimensions, &CG(dimension_llist)); - zend_llist_prepend_element(&CG(list_llist), &lle); - } - (*((int *)CG(dimension_llist).tail->data))++; -} - - -void zend_do_new_list_begin(TSRMLS_D) -{ - int current_dimension = 0; - zend_llist_add_element(&CG(dimension_llist), ¤t_dimension); -} - - -void zend_do_new_list_end(TSRMLS_D) -{ - zend_llist_remove_tail(&CG(dimension_llist)); - (*((int *)CG(dimension_llist).tail->data))++; -} - - -void zend_do_list_init(TSRMLS_D) -{ - zend_stack_push(&CG(list_stack), &CG(list_llist), sizeof(zend_llist)); - zend_stack_push(&CG(list_stack), &CG(dimension_llist), sizeof(zend_llist)); - zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0); - zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0); - zend_do_new_list_begin(TSRMLS_C); -} - - -void zend_do_list_end(znode *result, znode *expr TSRMLS_DC) -{ - zend_llist_element *le; - zend_llist_element *dimension; - zend_op *opline; - znode last_container; - - le = CG(list_llist).head; - while (le) { - zend_llist *tmp_dimension_llist = &((list_llist_element *)le->data)->dimensions; - dimension = tmp_dimension_llist->head; - while (dimension) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - if (dimension == tmp_dimension_llist->head) { /* first */ - last_container = *expr; - switch(expr->op_type) { - case IS_VAR: - opline->opcode = ZEND_FETCH_DIM_R; - break; - case IS_TMP_VAR: - opline->opcode = ZEND_FETCH_DIM_TMP_VAR; - break; - case IS_CONST: /* fetch_dim_tmp_var will handle this bogus fetch */ - zval_copy_ctor(&expr->u.constant); - opline->opcode = ZEND_FETCH_DIM_TMP_VAR; - break; - } - } else { - opline->opcode = ZEND_FETCH_DIM_R; - } - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = last_container; - opline->op2.op_type = IS_CONST; - opline->op2.u.constant.type = IS_LONG; - opline->op2.u.constant.value.lval = *((int *) dimension->data); - INIT_PZVAL(&opline->op2.u.constant); - opline->extended_value = ZEND_FETCH_ADD_LOCK; - last_container = opline->result; - dimension = dimension->next; - } - ((list_llist_element *) le->data)->value = last_container; - zend_llist_destroy(&((list_llist_element *) le->data)->dimensions); - zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); - zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value TSRMLS_CC); - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED; - le = le->next; - } - zend_llist_destroy(&CG(dimension_llist)); - zend_llist_destroy(&CG(list_llist)); - *result = *expr; - { - zend_llist *p; - - /* restore previous lists */ - zend_stack_top(&CG(list_stack), (void **) &p); - CG(dimension_llist) = *p; - zend_stack_del_top(&CG(list_stack)); - zend_stack_top(&CG(list_stack), (void **) &p); - CG(list_llist) = *p; - zend_stack_del_top(&CG(list_stack)); - } -} - - -void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - znode lval; - znode result; - - if (fetch_type==ZEND_FETCH_STATIC && static_assignment) { - zval *tmp; - - ALLOC_ZVAL(tmp); - convert_to_string(&varname->u.constant); - *tmp = static_assignment->u.constant; - if (!CG(active_op_array)->static_variables) { - ALLOC_HASHTABLE(CG(active_op_array)->static_variables); - zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0); - } - zend_hash_update(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, &tmp, sizeof(zval *), NULL); - } - - - opline->opcode = ZEND_FETCH_W; /* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */ - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *varname; - SET_UNUSED(opline->op2); - opline->op2.u.EA.type = fetch_type; - result = opline->result; - - if (varname->op_type == IS_CONST) { - zval_copy_ctor(&varname->u.constant); - } - fetch_simple_variable(&lval, varname, 0 TSRMLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */ - - zend_do_assign_ref(NULL, &lval, &result TSRMLS_CC); - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED; -} - - -void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_CAST; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *expr; - SET_UNUSED(opline->op2); - opline->extended_value = type; - *result = opline->result; -} - - -void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC) -{ - zend_do_extended_fcall_begin(TSRMLS_C); - { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_INCLUDE_OR_EVAL; - opline->result.op_type = IS_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *op1; - SET_UNUSED(opline->op2); - opline->op2.u.constant.value.lval = type; - *result = opline->result; - if (type==ZEND_REQUIRE) { - opline->result.u.EA.type |= EXT_TYPE_UNUSED; - } - } - zend_do_extended_fcall_end(TSRMLS_C); -} - - -void zend_do_indirect_references(znode *result, znode *num_references, znode *variable TSRMLS_DC) -{ - int i; - - zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); - for (i=1; iu.constant.value.lval; i++) { - fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R TSRMLS_CC); - *variable = *result; - } - zend_do_begin_variable_parse(TSRMLS_C); - fetch_simple_variable(result, variable, 1 TSRMLS_CC); -} - - -void zend_do_unset(znode *variable, int type TSRMLS_DC) -{ - zend_op *last_op; - - last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1]; - - switch (last_op->opcode) { - case ZEND_FETCH_UNSET: - last_op->opcode = ZEND_UNSET_VAR; - break; - case ZEND_FETCH_DIM_UNSET: - case ZEND_FETCH_OBJ_UNSET: - last_op->opcode = ZEND_UNSET_DIM_OBJ; - break; - - } - last_op->extended_value = type; -} - - -void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC) -{ - zend_op *last_op; - - zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC); - - /* Check what to do with this later on when adding all of the check writable stuff - * zend_check_writable_variable(variable); - */ - - last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1]; - - switch (last_op->opcode) { - case ZEND_FETCH_IS: - last_op->opcode = ZEND_ISSET_ISEMPTY_VAR; - break; - case ZEND_FETCH_DIM_IS: - case ZEND_FETCH_OBJ_IS: - last_op->opcode = ZEND_ISSET_ISEMPTY_DIM_OBJ; - break; - } - last_op->result.op_type = IS_TMP_VAR; - last_op->extended_value = type; - - *result = last_op->result; -} - - -void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable TSRMLS_DC) -{ - zend_op *opline; - zend_bool is_variable; - - if (variable) { - if (zend_is_function_or_method_call(array)) { - is_variable = 0; - } else { - is_variable = 1; - } - zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); - } else { - is_variable = 0; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - /* Preform array reset */ - opline->opcode = ZEND_FE_RESET; - opline->result.op_type = IS_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *array; - SET_UNUSED(opline->op2); - opline->extended_value = is_variable; - *open_brackets_token = opline->result; - - zend_stack_push(&CG(foreach_copy_stack), (void *) &opline->result, sizeof(znode)); - - /* save the location of the beginning of the loop (array fetching) */ - foreach_token->u.opline_num = get_next_op_number(CG(active_op_array)); - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_FE_FETCH; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *open_brackets_token; - SET_UNUSED(opline->op2); - *as_token = opline->result; -} - - -void zend_do_foreach_cont(znode *value, znode *key, znode *as_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - znode result_value, result_key, dummy; - - if (key->op_type != IS_UNUSED) { - znode *tmp; - - /* switch between the key and value... */ - tmp = key; - key = value; - value = tmp; - } - - opline->opcode = ZEND_FETCH_DIM_TMP_VAR; - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.opline_num = get_temporary_variable(CG(active_op_array)); - opline->op1 = *as_token; - opline->op2.op_type = IS_CONST; - opline->op2.u.constant.type = IS_LONG; - opline->op2.u.constant.value.lval = 0; - opline->extended_value = ZEND_FETCH_STANDARD; /* ignored in fetch_dim_tmp_var, but what the hell. */ - result_value = opline->result; - - if (key->op_type != IS_UNUSED) { - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_FETCH_DIM_TMP_VAR; - opline->result.op_type = IS_VAR; - opline->result.u.EA.type = 0; - opline->result.u.opline_num = get_temporary_variable(CG(active_op_array)); - opline->op1 = *as_token; - opline->op2.op_type = IS_CONST; - opline->op2.u.constant.type = IS_LONG; - opline->op2.u.constant.value.lval = 1; - opline->extended_value = ZEND_FETCH_STANDARD; /* ignored in fetch_dim_tmp_var, but what the hell. */ - result_key = opline->result; - } - - zend_do_assign(&dummy, value, &result_value TSRMLS_CC); - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED; - if (key->op_type != IS_UNUSED) { - zend_do_assign(&dummy, key, &result_key TSRMLS_CC); - CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED; - } - zend_do_free(as_token TSRMLS_CC); - - do_begin_loop(TSRMLS_C); - INC_BPC(CG(active_op_array)); -} - - -void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMP; - opline->op1.u.opline_num = foreach_token->u.opline_num; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - - CG(active_op_array)->opcodes[foreach_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array)); - - do_end_loop(foreach_token->u.opline_num TSRMLS_CC); - - generate_free_foreach_copy(open_brackets_token TSRMLS_CC); - - zend_stack_del_top(&CG(foreach_copy_stack)); - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_declare_begin(TSRMLS_D) -{ - zend_stack_push(&CG(declare_stack), &CG(declarables), sizeof(zend_declarables)); -} - - -void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) -{ - convert_to_string(&var->u.constant); - - if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) { - convert_to_long(&val->u.constant); - CG(declarables).ticks = val->u.constant; - } - zval_dtor(&var->u.constant); -} - - -void zend_do_declare_end(TSRMLS_D) -{ - zend_declarables *declarables; - - zend_stack_top(&CG(declare_stack), (void **) &declarables); - CG(declarables) = *declarables; -} - - -void zend_do_end_heredoc(TSRMLS_D) -{ - int opline_num = get_next_op_number(CG(active_op_array))-1; - zend_op *opline = &CG(active_op_array)->opcodes[opline_num]; - - if (opline->opcode != ZEND_ADD_STRING) { - return; - } - - opline->op2.u.constant.value.str.val[(opline->op2.u.constant.value.str.len--)-1] = 0; - if (opline->op2.u.constant.value.str.len>0) { - if (opline->op2.u.constant.value.str.val[opline->op2.u.constant.value.str.len-1]=='\r') { - opline->op2.u.constant.value.str.val[(opline->op2.u.constant.value.str.len--)-1] = 0; - } - } -} - - -void zend_do_exit(znode *result, znode *message TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_EXIT; - opline->op1 = *message; - SET_UNUSED(opline->op2); - - result->op_type = IS_CONST; - result->u.constant.type = IS_BOOL; - result->u.constant.value.lval = 1; -} - - -void zend_do_begin_silence(znode *strudel_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_BEGIN_SILENCE; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); - *strudel_token = opline->result; -} - - -void zend_do_end_silence(znode *strudel_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_END_SILENCE; - opline->op1 = *strudel_token; - SET_UNUSED(opline->op2); -} - - -void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC) -{ - int jmpz_op_number = get_next_op_number(CG(active_op_array)); - zend_op *opline; - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_JMPZ; - opline->op1 = *cond; - SET_UNUSED(opline->op2); - opline->op2.u.opline_num = jmpz_op_number; - *qm_token = opline->op2; - - INC_BPC(CG(active_op_array)); -} - - -void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - CG(active_op_array)->opcodes[qm_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array))+1; /* jmp over the ZEND_JMP */ - - opline->opcode = ZEND_QM_ASSIGN; - opline->result.op_type = IS_TMP_VAR; - opline->result.u.var = get_temporary_variable(CG(active_op_array)); - opline->op1 = *true_value; - SET_UNUSED(opline->op2); - - *qm_token = opline->result; - colon_token->u.opline_num = get_next_op_number(CG(active_op_array)); - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_JMP; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token TSRMLS_DC) -{ - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_QM_ASSIGN; - opline->result = *qm_token; - opline->op1 = *false_value; - SET_UNUSED(opline->op2); - - CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array)); - - *result = opline->result; - - DEC_BPC(CG(active_op_array)); -} - - -void zend_do_extended_info(TSRMLS_D) -{ - zend_op *opline; - - if (!CG(extended_info)) { - return; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_EXT_STMT; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_extended_fcall_begin(TSRMLS_D) -{ - zend_op *opline; - - if (!CG(extended_info)) { - return; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_EXT_FCALL_BEGIN; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_extended_fcall_end(TSRMLS_D) -{ - zend_op *opline; - - if (!CG(extended_info)) { - return; - } - - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_EXT_FCALL_END; - SET_UNUSED(opline->op1); - SET_UNUSED(opline->op2); -} - - -void zend_do_ticks(TSRMLS_D) -{ - if (CG(declarables).ticks.value.lval) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - - opline->opcode = ZEND_TICKS; - opline->op1.u.constant = CG(declarables).ticks; - opline->op1.op_type = IS_CONST; - SET_UNUSED(opline->op2); - } -} - - -int zend_register_auto_global(char *name, uint name_len TSRMLS_DC) -{ - return zend_hash_add_empty_element(CG(auto_globals), name, name_len+1); -} - - -int zendlex(znode *zendlval TSRMLS_DC) -{ - int retval; - - if (CG(increment_lineno)) { - CG(zend_lineno)++; - CG(increment_lineno) = 0; - } - - zendlval->u.constant.type = IS_LONG; - retval = lex_scan(&zendlval->u.constant TSRMLS_CC); - switch(retval) { - case T_COMMENT: - case T_OPEN_TAG: - case T_WHITESPACE: - retval = zendlex(zendlval TSRMLS_CC); - break; - case T_CLOSE_TAG: - if (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1]=='\n' - || (LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-2]=='\r' && LANG_SCNG(yy_text)[LANG_SCNG(yy_leng)-1])) { - CG(increment_lineno) = 1; - } - retval = ';'; /* implicit ; */ - break; - case T_OPEN_TAG_WITH_ECHO: - retval = T_ECHO; - break; - case T_END_HEREDOC: - efree(zendlval->u.constant.value.str.val); - break; - } - - INIT_PZVAL(&zendlval->u.constant); - zendlval->op_type = IS_CONST; - return retval; -} diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h deleted file mode 100644 index 4dc3a172619..00000000000 --- a/Zend/zend_compile.h +++ /dev/null @@ -1,693 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_COMPILE_H -#define ZEND_COMPILE_H - -#include "zend.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#include "zend_llist.h" - -#define DEBUG_ZEND 0 - -#define FREE_PNODE(znode) zval_dtor(&znode->u.constant); -#define FREE_OP(Ts, op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var); - -#define SET_UNUSED(op) (op).op_type = IS_UNUSED - -#define INC_BPC(op_array) if (CG(interactive)) { ((op_array)->backpatch_count++); } -#define DEC_BPC(op_array) if (CG(interactive)) { ((op_array)->backpatch_count--); } -#define HANDLE_INTERACTIVE() if (CG(interactive)) { execute_new_code(TSRMLS_C); } - -typedef struct _zend_op_array zend_op_array; - -typedef struct _znode { - int op_type; - zend_llist *throw_list; /* Try and save this space later on */ - union { - zval constant; - - zend_uint var; - zend_uint opline_num; /* Needs to be signed */ - zend_op_array *op_array; - zend_class_entry *previously_active_class_entry; /* Used at compile-time */ - struct { - zend_uint var; /* dummy */ - zend_uint type; - } EA; - } u; -} znode; - - -typedef struct _zend_op { - zend_uchar opcode; - znode result; - znode op1; - znode op2; - ulong extended_value; - uint lineno; -} zend_op; - - -typedef struct _zend_brk_cont_element { - int cont; - int brk; - int parent; -} zend_brk_cont_element; - - -struct _zend_op_array { - zend_uchar type; /* MUST be the first element of this struct! */ - - zend_uchar *arg_types; /* MUST be the second element of this struct! */ - char *function_name; /* MUST be the third element of this struct! */ - zend_class_entry *scope; /* MUST be the fourth element of this struct! */ - - zend_uint *refcount; - - zend_op *opcodes; - zend_uint last, size; - - zend_uint T; - - zend_brk_cont_element *brk_cont_array; - zend_uint last_brk_cont; - zend_uint current_brk_cont; - - /* static variables support */ - HashTable *static_variables; - - zend_op *start_op; - int backpatch_count; - - zend_bool return_reference; - zend_bool done_pass_two; - zend_bool uses_this; - - char *filename; - - void *reserved[ZEND_MAX_RESERVED_RESOURCES]; -}; - - -typedef struct _zend_internal_function { - zend_uchar type; /* MUST be the first element of this struct! */ - - zend_uchar *arg_types; /* MUST be the second element of this struct! */ - char *function_name; /* MUST be the third element of this struct! */ - zend_class_entry *scope; /* MUST be the fourth element of this struct! */ - - void (*handler)(INTERNAL_FUNCTION_PARAMETERS); -} zend_internal_function; - - -typedef struct _zend_overloaded_function { - zend_uchar type; /* MUST be the first element of this struct! */ - - zend_uchar *arg_types; /* MUST be the second element of this struct! */ - char *function_name; /* MUST be the third element of this struct! */ - zend_class_entry *scope; /* MUST be the fourth element of this struct! */ - - zend_uint var; -} zend_overloaded_function; - - -typedef union _zend_function { - zend_uchar type; /* MUST be the first element of this struct! */ - - struct { - zend_uchar type; /* never used */ - zend_uchar *arg_types; - char *function_name; - zend_class_entry *scope; - } common; - - zend_op_array op_array; - zend_internal_function internal_function; - zend_overloaded_function overloaded_function; -} zend_function; - - -typedef struct _zend_function_state { - HashTable *function_symbol_table; - zend_function *function; - void *reserved[ZEND_MAX_RESERVED_RESOURCES]; -} zend_function_state; - - -typedef struct _zend_switch_entry { - znode cond; - int default_case; - int control_var; -} zend_switch_entry; - - -typedef struct _list_llist_element { - znode var; - zend_llist dimensions; - znode value; -} list_llist_element; - - -typedef struct _zend_file_handle { - zend_uchar type; - char *filename; - char *opened_path; - union { - int fd; - FILE *fp; - } handle; - zend_bool free_filename; -} zend_file_handle; - - - -#define IS_CONST (1<<0) -#define IS_TMP_VAR (1<<1) -#define IS_VAR (1<<2) -#define IS_UNUSED (1<<3) /* Unused variable */ - - -#define EXT_TYPE_UNUSED (1<<0) - -#include "zend_globals.h" - -BEGIN_EXTERN_C() - -void init_compiler(TSRMLS_D); -void shutdown_compiler(TSRMLS_D); -void zend_init_compiler_data_structures(TSRMLS_D); - -extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); - -void zend_activate(TSRMLS_D); -void zend_deactivate(TSRMLS_D); -void zend_activate_modules(TSRMLS_D); -void zend_deactivate_modules(TSRMLS_D); - - -ZEND_API int lex_scan(zval *zendlval TSRMLS_DC); -void startup_scanner(TSRMLS_D); -void shutdown_scanner(TSRMLS_D); - -ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename TSRMLS_DC); -ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC); -ZEND_API char *zend_get_compiled_filename(TSRMLS_D); -ZEND_API int zend_get_compiled_lineno(TSRMLS_D); - -#ifdef ZTS -const char *zend_get_zendtext(TSRMLS_D); -int zend_get_zendleng(TSRMLS_D); -#endif - - -/* parser-driven code generators */ -void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 TSRMLS_DC); -void zend_do_unary_op(int op, znode *result, znode *op1 TSRMLS_DC); -void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 TSRMLS_DC); -void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC); -void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC); -void fetch_simple_variable(znode *result, znode *varname, int bp TSRMLS_DC); -void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op TSRMLS_DC); -void zend_do_indirect_references(znode *result, znode *num_references, znode *variable TSRMLS_DC); -void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type TSRMLS_DC); - -void fetch_array_begin(znode *result, znode *varname, znode *first_dim TSRMLS_DC); -void fetch_array_dim(znode *result, znode *parent, znode *dim TSRMLS_DC); -void fetch_string_offset(znode *result, znode *parent, znode *offset TSRMLS_DC); -void zend_do_fetch_static_member(znode *class TSRMLS_DC); -void zend_do_print(znode *result, znode *arg TSRMLS_DC); -void zend_do_echo(znode *arg TSRMLS_DC); -typedef int (*unary_op_type)(zval *, zval *); -ZEND_API unary_op_type get_unary_op(int opcode); -ZEND_API void *get_binary_op(int opcode); - -void zend_do_while_cond(znode *expr, znode *close_bracket_token TSRMLS_DC); -void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC); -void zend_do_do_while_begin(TSRMLS_D); -void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr TSRMLS_DC); - - -void zend_do_if_cond(znode *cond, znode *closing_bracket_token TSRMLS_DC); -void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize TSRMLS_DC); -void zend_do_if_end(TSRMLS_D); - -void zend_do_for_cond(znode *expr, znode *second_semicolon_token TSRMLS_DC); -void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token TSRMLS_DC); -void zend_do_for_end(znode *second_semicolon_token TSRMLS_DC); - -void zend_do_pre_incdec(znode *result, znode *op1, int op TSRMLS_DC); -void zend_do_post_incdec(znode *result, znode *op1, int op TSRMLS_DC); - -void zend_do_begin_variable_parse(TSRMLS_D); -void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC); - -void zend_check_writable_variable(znode *variable); - -void zend_do_free(znode *op1 TSRMLS_DC); - -void zend_do_init_string(znode *result TSRMLS_DC); -void zend_do_add_char(znode *result, znode *op1, znode *op2 TSRMLS_DC); -void zend_do_add_string(znode *result, znode *op1, znode *op2 TSRMLS_DC); -void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC); - -void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference TSRMLS_DC); -void zend_do_end_function_declaration(znode *function_token TSRMLS_DC); -void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type TSRMLS_DC); -int zend_do_begin_function_call(znode *function_name TSRMLS_DC); -void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC); -void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC); -void do_fetch_class(znode *result, znode *class_entry, znode *class_name TSRMLS_DC); -void do_fetch_class_name(znode *result, znode *class_entry, znode *class_name, zend_bool case_sensitive TSRMLS_DC); -void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name TSRMLS_DC); -void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC); -void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC); - -void zend_do_try(znode *try_token TSRMLS_DC); -void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var, zend_bool first_catch TSRMLS_DC); -void zend_do_end_catch(znode *try_token TSRMLS_DC); -void zend_do_throw(znode *expr TSRMLS_DC); - -ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time); -void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce); -void zend_do_early_binding(TSRMLS_D); - -void zend_do_pass_param(znode *param, int op, int offset TSRMLS_DC); - - -void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC); -void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC); -void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC); -void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token TSRMLS_DC); - -void zend_do_brk_cont(int op, znode *expr TSRMLS_DC); - -void zend_do_switch_cond(znode *cond TSRMLS_DC); -void zend_do_switch_end(znode *case_list TSRMLS_DC); -void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr TSRMLS_DC); -void zend_do_case_after_statement(znode *result, znode *case_token TSRMLS_DC); -void zend_do_default_before_statement(znode *case_list, znode *default_token TSRMLS_DC); - -void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znode *parent_class_name TSRMLS_DC); -void zend_do_end_class_declaration(znode *class_token TSRMLS_DC); -void zend_do_declare_property(znode *var_name, znode *value, int declaration_type TSRMLS_DC); - -void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC); - - -void zend_do_push_object(znode *object TSRMLS_DC); -void zend_do_pop_object(znode *object TSRMLS_DC); - - -void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC); -void zend_do_end_new_object(znode *result, znode *new_token, znode *argument_list TSRMLS_DC); - -void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode TSRMLS_DC); - -void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC); - -void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref TSRMLS_DC); -void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref TSRMLS_DC); -void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr); -void zend_do_list_init(TSRMLS_D); -void zend_do_list_end(znode *result, znode *expr TSRMLS_DC); -void zend_do_add_list_element(znode *element TSRMLS_DC); -void zend_do_new_list_begin(TSRMLS_D); -void zend_do_new_list_end(TSRMLS_D); - -void zend_do_cast(znode *result, znode *expr, int type TSRMLS_DC); -void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC); - -void zend_do_unset(znode *variable, int type TSRMLS_DC); -void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC); - -void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable TSRMLS_DC); -void zend_do_foreach_cont(znode *value, znode *key, znode *as_token TSRMLS_DC); -void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token TSRMLS_DC); - -void zend_do_declare_begin(TSRMLS_D); -void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC); -void zend_do_declare_end(TSRMLS_D); - -void zend_do_end_heredoc(TSRMLS_D); - -void zend_do_exit(znode *result, znode *message TSRMLS_DC); - -void zend_do_begin_silence(znode *strudel_token TSRMLS_DC); -void zend_do_end_silence(znode *strudel_token TSRMLS_DC); - -void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC); -void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token TSRMLS_DC); -void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token TSRMLS_DC); - -void zend_do_extended_info(TSRMLS_D); -void zend_do_extended_fcall_begin(TSRMLS_D); -void zend_do_extended_fcall_end(TSRMLS_D); - -void zend_do_ticks(TSRMLS_D); - -void zend_do_begin_import(TSRMLS_D); -void zend_do_import(int type, znode *what TSRMLS_DC); -void zend_do_end_import(znode *import_from TSRMLS_DC); - -ZEND_API void function_add_ref(zend_function *function); - -#define INITIAL_OP_ARRAY_SIZE 64 - - -/* helper functions in zend_language_scanner.l */ -ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC); -ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC); -ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC); -ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...); -ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size TSRMLS_DC); -ZEND_API void destroy_op_array(zend_op_array *op_array); -ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API void zend_file_handle_dtor(zend_file_handle *fh); - -ZEND_API void destroy_zend_function(zend_function *function); -ZEND_API void destroy_zend_class(zend_class_entry **pce); -void zend_class_add_ref(zend_class_entry **ce); - -#define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function -#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class - -zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC); -void init_op(zend_op *op TSRMLS_DC); -int get_next_op_number(zend_op_array *op_array); -int print_class(zend_class_entry *class_entry TSRMLS_DC); -void print_op_array(zend_op_array *op_array, int optimizations); -int pass_two(zend_op_array *op_array TSRMLS_DC); -zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array); -ZEND_API zend_bool zend_is_compiling(TSRMLS_D); -ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC); - -int zend_register_auto_global(char *name, uint name_len TSRMLS_DC); - -int zendlex(znode *zendlval TSRMLS_DC); - -#define ZEND_NOP 0 - -#define ZEND_ADD 1 -#define ZEND_SUB 2 -#define ZEND_MUL 3 -#define ZEND_DIV 4 -#define ZEND_MOD 5 -#define ZEND_SL 6 -#define ZEND_SR 7 -#define ZEND_CONCAT 8 -#define ZEND_BW_OR 9 -#define ZEND_BW_AND 10 -#define ZEND_BW_XOR 11 -#define ZEND_BW_NOT 12 -#define ZEND_BOOL_NOT 13 -#define ZEND_BOOL_XOR 14 -#define ZEND_IS_IDENTICAL 15 -#define ZEND_IS_NOT_IDENTICAL 16 -#define ZEND_IS_EQUAL 17 -#define ZEND_IS_NOT_EQUAL 18 -#define ZEND_IS_SMALLER 19 -#define ZEND_IS_SMALLER_OR_EQUAL 20 -#define ZEND_CAST 21 -#define ZEND_QM_ASSIGN 22 - -#define ZEND_ASSIGN_ADD 23 -#define ZEND_ASSIGN_SUB 24 -#define ZEND_ASSIGN_MUL 25 -#define ZEND_ASSIGN_DIV 26 -#define ZEND_ASSIGN_MOD 27 -#define ZEND_ASSIGN_SL 28 -#define ZEND_ASSIGN_SR 29 -#define ZEND_ASSIGN_CONCAT 30 -#define ZEND_ASSIGN_BW_OR 31 -#define ZEND_ASSIGN_BW_AND 32 -#define ZEND_ASSIGN_BW_XOR 33 - -#define ZEND_PRE_INC 34 -#define ZEND_PRE_DEC 35 -#define ZEND_POST_INC 36 -#define ZEND_POST_DEC 37 - -#define ZEND_ASSIGN 38 -#define ZEND_ASSIGN_REF 39 - -#define ZEND_ECHO 40 -#define ZEND_PRINT 41 - -#define ZEND_JMP 42 -#define ZEND_JMPZ 43 -#define ZEND_JMPNZ 44 -#define ZEND_JMPZNZ 45 -#define ZEND_JMPZ_EX 46 -#define ZEND_JMPNZ_EX 47 -#define ZEND_CASE 48 -#define ZEND_SWITCH_FREE 49 -#define ZEND_BRK 50 -#define ZEND_CONT 51 -#define ZEND_BOOL 52 - -#define ZEND_INIT_STRING 53 -#define ZEND_ADD_CHAR 54 -#define ZEND_ADD_STRING 55 -#define ZEND_ADD_VAR 56 - -#define ZEND_BEGIN_SILENCE 57 -#define ZEND_END_SILENCE 58 - -#define ZEND_INIT_FCALL_BY_NAME 59 -#define ZEND_DO_FCALL 60 -#define ZEND_DO_FCALL_BY_NAME 61 -#define ZEND_RETURN 62 - -#define ZEND_RECV 63 -#define ZEND_RECV_INIT 64 - -#define ZEND_SEND_VAL 65 -#define ZEND_SEND_VAR 66 -#define ZEND_SEND_REF 67 - -#define ZEND_NEW 68 -#define ZEND_JMP_NO_CTOR 69 -#define ZEND_FREE 70 - -#define ZEND_INIT_ARRAY 71 -#define ZEND_ADD_ARRAY_ELEMENT 72 - -#define ZEND_INCLUDE_OR_EVAL 73 - -#define ZEND_UNSET_VAR 74 -#define ZEND_UNSET_DIM_OBJ 75 - -#define ZEND_FE_RESET 77 -#define ZEND_FE_FETCH 78 - -#define ZEND_EXIT 79 - - -/* the following 18 opcodes are 6 groups of 3 opcodes each, and must - * remain in that order! - */ -#define ZEND_FETCH_R 80 -#define ZEND_FETCH_DIM_R 81 -#define ZEND_FETCH_OBJ_R 82 -#define ZEND_FETCH_W 83 -#define ZEND_FETCH_DIM_W 84 -#define ZEND_FETCH_OBJ_W 85 -#define ZEND_FETCH_RW 86 -#define ZEND_FETCH_DIM_RW 87 -#define ZEND_FETCH_OBJ_RW 88 -#define ZEND_FETCH_IS 89 -#define ZEND_FETCH_DIM_IS 90 -#define ZEND_FETCH_OBJ_IS 91 -#define ZEND_FETCH_FUNC_ARG 92 -#define ZEND_FETCH_DIM_FUNC_ARG 93 -#define ZEND_FETCH_OBJ_FUNC_ARG 94 -#define ZEND_FETCH_UNSET 95 -#define ZEND_FETCH_DIM_UNSET 96 -#define ZEND_FETCH_OBJ_UNSET 97 - -#define ZEND_FETCH_DIM_TMP_VAR 98 -#define ZEND_FETCH_CONSTANT 99 - -#define ZEND_DECLARE_FUNCTION_OR_CLASS 100 - -#define ZEND_EXT_STMT 101 -#define ZEND_EXT_FCALL_BEGIN 102 -#define ZEND_EXT_FCALL_END 103 -#define ZEND_EXT_NOP 104 - -#define ZEND_TICKS 105 - -#define ZEND_SEND_VAR_NO_REF 106 - -#define ZEND_CATCH 107 -#define ZEND_THROW 108 - -#define ZEND_FETCH_CLASS 109 - -#define ZEND_CLONE 110 - -#define ZEND_INIT_CTOR_CALL 111 -#define ZEND_INIT_METHOD_CALL 112 -#define ZEND_INIT_STATIC_METHOD_CALL 113 - -#define ZEND_ISSET_ISEMPTY_VAR 114 -#define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 - -#define ZEND_IMPORT_FUNCTION 116 -#define ZEND_IMPORT_CLASS 117 -#define ZEND_IMPORT_CONST 118 - -#define ZEND_ASSIGN_ADD_OBJ 121 -#define ZEND_ASSIGN_SUB_OBJ 122 -#define ZEND_ASSIGN_MUL_OBJ 123 -#define ZEND_ASSIGN_DIV_OBJ 124 -#define ZEND_ASSIGN_MOD_OBJ 125 -#define ZEND_ASSIGN_SL_OBJ 126 -#define ZEND_ASSIGN_SR_OBJ 127 -#define ZEND_ASSIGN_CONCAT_OBJ 128 -#define ZEND_ASSIGN_BW_OR_OBJ 129 -#define ZEND_ASSIGN_BW_AND_OBJ 130 -#define ZEND_ASSIGN_BW_XOR_OBJ 131 - -#define ZEND_PRE_INC_OBJ 132 -#define ZEND_PRE_DEC_OBJ 133 -#define ZEND_POST_INC_OBJ 134 -#define ZEND_POST_DEC_OBJ 135 - -#define ZEND_ASSIGN_OBJ 136 -#define ZEND_MAKE_VAR 137 -/* end of block */ - - - - -/* global/local fetches */ -#define ZEND_FETCH_GLOBAL 0 -#define ZEND_FETCH_LOCAL 1 -#define ZEND_FETCH_STATIC 2 -#define ZEND_FETCH_STATIC_MEMBER 3 -#define ZEND_FETCH_FROM_THIS 4 - -/* class fetches */ -#define ZEND_FETCH_CLASS_DEFAULT 0 -#define ZEND_FETCH_CLASS_SELF 1 -#define ZEND_FETCH_CLASS_PARENT 2 -#define ZEND_FETCH_CLASS_MAIN 3 - - -/* variable parsing type (compile-time) */ -#define ZEND_PARSED_MEMBER (1<<0) -#define ZEND_PARSED_METHOD_CALL (1<<1) -#define ZEND_PARSED_STATIC_MEMBER (1<<2) -#define ZEND_PARSED_FUNCTION_CALL (1<<3) -#define ZEND_PARSED_VARIABLE (1<<4) - - -/* unset types */ -#define ZEND_UNSET_REG 0 -#define ZEND_UNSET_OBJ 1 - -/* var status for backpatching */ -#define BP_VAR_R 0 -#define BP_VAR_W 1 -#define BP_VAR_RW 2 -#define BP_VAR_IS 3 -#define BP_VAR_NA 4 /* if not applicable */ -#define BP_VAR_FUNC_ARG 5 -#define BP_VAR_UNSET 6 - - -#define ZEND_INTERNAL_FUNCTION 1 -#define ZEND_USER_FUNCTION 2 -#define ZEND_OVERLOADED_FUNCTION 3 -#define ZEND_EVAL_CODE 4 - -#define ZEND_INTERNAL_CLASS 1 -#define ZEND_USER_CLASS 2 - -#define ZEND_EVAL (1<<0) -#define ZEND_INCLUDE (1<<1) -#define ZEND_INCLUDE_ONCE (1<<2) -#define ZEND_REQUIRE (1<<3) -#define ZEND_REQUIRE_ONCE (1<<4) - -#define ZEND_ISSET (1<<0) -#define ZEND_ISEMPTY (1<<1) - -#define ZEND_CT (1<<0) -#define ZEND_RT (1<<1) - - -#define ZEND_HANDLE_FILENAME 0 -#define ZEND_HANDLE_FD 1 -#define ZEND_HANDLE_FP 2 -#define ZEND_HANDLE_STDIOSTREAM 3 -#define ZEND_HANDLE_FSTREAM 4 - -#define ZEND_DECLARE_CLASS 1 -#define ZEND_DECLARE_FUNCTION 2 -#define ZEND_DECLARE_INHERITED_CLASS 3 - -#define ZEND_FETCH_STANDARD 0 -#define ZEND_FETCH_ADD_LOCK 1 - -#define ZEND_MEMBER_FUNC_CALL 1<<0 - -#define ZEND_ARG_SEND_BY_REF (1<<0) -#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1) - -#define AI_USE_PTR(ai) \ - if ((ai).ptr_ptr) { \ - (ai).ptr = *((ai).ptr_ptr); \ - (ai).ptr_ptr = &((ai).ptr); \ - } else { \ - (ai).ptr = NULL; \ - } - -/* Lost In Stupid Parentheses */ -#define ARG_SHOULD_BE_SENT_BY_REF(offset, conduct_check, arg_types) \ - ( \ - conduct_check \ - && arg_types \ - && \ - ( \ - ( \ - offset<=arg_types[0] \ - && arg_types[offset]==BYREF_FORCE \ - ) \ - || ( \ - offset>=arg_types[0] \ - && arg_types[arg_types[0]]==BYREF_FORCE_REST \ - ) \ - ) \ - ) - -#define ZEND_RETURN_VAL 0 -#define ZEND_RETURN_REF 1 - -END_EXTERN_C() - -#endif /* ZEND_COMPILE_H */ diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h deleted file mode 100644 index e9ad6475e4a..00000000000 --- a/Zend/zend_config.w32.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_CONFIG_W32_H -#define ZEND_CONFIG_W32_H - - -#include -#include -#include - -typedef unsigned long ulong; -typedef unsigned int uint; - -#define HAVE_ALLOCA 1 -#define HAVE_LIMITS_H 1 -#include - -#undef HAVE_KILL -#define HAVE_GETPID 1 -/* #define HAVE_ALLOCA_H 1 */ -#define HAVE_MEMCPY 1 -#define HAVE_STRDUP 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIOSTR_H 1 -#define HAVE_CLASS_ISTDIOSTREAM -#define istdiostream stdiostream -#define HAVE_STDARG_H 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 - -#define vsnprintf _vsnprintf -#define zend_isinf(a) 0 -#define zend_finite(x) _finite(x) -#define zend_isnan(x) _isnan(x) - -#define zend_sprintf sprintf - -/* This will cause the compilation process to be MUCH longer, but will generate - * a much quicker PHP binary - */ -#undef inline -#ifdef ZEND_WIN32_FORCE_INLINE -# define inline __forceinline -#else -# define inline -#endif - -#define zend_finite(A) _finite(A) -#define zend_isnan(A) _isnan(A) - -#ifdef LIBZEND_EXPORTS -# define ZEND_API __declspec(dllexport) -#else -# define ZEND_API __declspec(dllimport) -#endif - -#define ZEND_DLEXPORT __declspec(dllexport) - -/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT - * (and requires _WIN32_WINNT to be defined, which prevents the resulting executable - * from running under Windows 9x - * Windows 9x should silently ignore it, so it's being used here directly - */ -#ifndef MB_SERVICE_NOTIFICATION -#define MB_SERVICE_NOTIFICATION 0x00200000L -#endif - -#define ZEND_SERVICE_MB_STYLE (MB_TOPMOST|MB_SERVICE_NOTIFICATION) - -#endif /* ZEND_CONFIG_W32_H */ diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c deleted file mode 100644 index 2874a24bf94..00000000000 --- a/Zend/zend_constants.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_constants.h" -#include "zend_variables.h" -#include "zend_operators.h" -#include "zend_globals.h" - - -void free_zend_constant(zend_constant *c) -{ - if (!(c->flags & CONST_PERSISTENT) - || (c->flags & CONST_EFREE_PERSISTENT)) { - zval_dtor(&c->value); - } - free(c->name); -} - - -void copy_zend_constant(zend_constant *c) -{ - c->name = zend_strndup(c->name, c->name_len); - if (!(c->flags & CONST_PERSISTENT)) { - zval_copy_ctor(&c->value); - if (c->flags & CONST_EFREE_PERSISTENT) { /* persist_alloc()'d data */ - persist_alloc(&c->value); - } - } -} - - -void zend_copy_constants(HashTable *target, HashTable *source) -{ - zend_constant tmp_constant; - - zend_hash_copy(target, source, (copy_ctor_func_t) copy_zend_constant, &tmp_constant, sizeof(zend_constant)); -} - - -static int clean_non_persistent_constant(zend_constant *c TSRMLS_DC) -{ - if (c->flags & CONST_PERSISTENT) { - return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP; - } else { - return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE; - } -} - - -static int clean_module_constant(zend_constant *c, int *module_number TSRMLS_DC) -{ - if (c->module_number == *module_number) { - return 1; - } else { - return 0; - } -} - - -void clean_module_constants(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC); -} - - -int zend_startup_constants(TSRMLS_D) -{ -#ifdef ZEND_WIN32 - DWORD dwBuild=0; - DWORD dwVersion = GetVersion(); - DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); - DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); -#endif - - EG(zend_constants) = &CG(main_class).constants_table; - - if (zend_hash_init(EG(zend_constants), 20, NULL, ZEND_CONSTANT_DTOR, 1)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - - -void zend_register_standard_constants(TSRMLS_D) -{ - REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_CORE_ERROR", E_CORE_ERROR, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS); - - REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS); - - /* true/false constants */ - { - zend_constant c; - - c.value.type = IS_BOOL; - c.flags = CONST_PERSISTENT; - c.module_number = 0; - - c.name = zend_strndup(ZEND_STRL("TRUE")); - c.name_len = sizeof("TRUE"); - c.value.value.lval = 1; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("FALSE")); - c.name_len = sizeof("FALSE"); - c.value.value.lval = 0; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE")); - c.name_len = sizeof("ZEND_THREAD_SAFE"); - c.value.value.lval = ZTS_V; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("NULL")); - c.name_len = sizeof("NULL"); - c.value.type = IS_NULL; - zend_register_constant(&c TSRMLS_CC); - } -} - - -int zend_shutdown_constants(TSRMLS_D) -{ - zend_hash_destroy(EG(zend_constants)); - return SUCCESS; -} - - -void clean_non_persistent_constants(TSRMLS_D) -{ - if (EG(full_tables_cleanup)) { - zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC); - } else { - zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC); - } -} - - -ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC) -{ - zend_constant c; - - c.value.type = IS_LONG; - c.value.value.lval = lval; - c.flags = flags; - c.name = zend_strndup(name, name_len); - c.name_len = name_len; - c.module_number = module_number; - zend_register_constant(&c TSRMLS_CC); -} - - -ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC) -{ - zend_constant c; - - c.value.type = IS_DOUBLE; - c.value.value.dval = dval; - c.flags = flags; - c.name = zend_strndup(name, name_len); - c.name_len = name_len; - c.module_number = module_number; - zend_register_constant(&c TSRMLS_CC); -} - - -ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC) -{ - zend_constant c; - - c.value.type = IS_STRING; - c.value.value.str.val = strval; - c.value.value.str.len = strlen; - c.flags = flags; - c.name = zend_strndup(name, name_len); - c.name_len = name_len; - c.module_number = module_number; - zend_register_constant(&c TSRMLS_CC); -} - - -ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC) -{ - zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number TSRMLS_CC); -} - - -ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) -{ - zend_constant *c; - char *lookup_name; - int retval; - - lookup_name = do_alloca(name_len+1); - memcpy(lookup_name, name, name_len+1); - - zend_str_tolower(lookup_name, name_len); - - if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) { - if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) { - retval=0; - } else { - retval=1; - *result = c->value; - zval_copy_ctor(result); - } - } else { - retval=0; - } - - free_alloca(lookup_name); - - return retval; -} - - -ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) -{ - char *lowercase_name = zend_strndup(c->name, c->name_len); - int ret = SUCCESS; - -#if 0 - printf("Registering constant for module %d\n", c->module_number); -#endif - - zend_str_tolower(lowercase_name, c->name_len); - if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { - free(c->name); - if (!(c->flags & CONST_PERSISTENT) - || (c->flags & CONST_EFREE_PERSISTENT)) { - zval_dtor(&c->value); - } - zend_error(E_NOTICE,"Constant %s already defined", lowercase_name); - ret = FAILURE; - } - free(lowercase_name); - return ret; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h deleted file mode 100644 index 3b7c27445d5..00000000000 --- a/Zend/zend_constants.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_CONSTANTS_H -#define ZEND_CONSTANTS_H - -#include "zend_globals.h" - -#define CONST_CS (1<<0) /* Case Sensitive */ -#define CONST_PERSISTENT (1<<1) /* Persistent */ -#define CONST_EFREE_PERSISTENT (1<<2) /* In conjunction with CONST_PERSISTENT, - * means that the constant should be freed - * using zval_dtor() on shutdown. - */ - -typedef struct _zend_constant { - zval value; - int flags; - char *name; - uint name_len; - int module_number; -} zend_constant; - -#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC) -#define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC) -#define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC) -#define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC) - -#define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC) -#define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC) -#define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC) -#define REGISTER_MAIN_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), 0 TSRMLS_CC) - -void clean_module_constants(int module_number TSRMLS_DC); -void free_zend_constant(zend_constant *c); -int zend_startup_constants(TSRMLS_D); -int zend_shutdown_constants(TSRMLS_D); -void zend_register_standard_constants(TSRMLS_D); -void clean_non_persistent_constants(TSRMLS_D); -ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC); -ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC); -ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC); -ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC); -ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC); -ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC); -void zend_copy_constants(HashTable *target, HashTable *sourc); -void copy_zend_constant(zend_constant *c); - -#define ZEND_CONSTANT_DTOR (void (*)(void *)) free_zend_constant - -#endif diff --git a/Zend/zend_dynamic_array.c b/Zend/zend_dynamic_array.c deleted file mode 100644 index ad5b39c9766..00000000000 --- a/Zend/zend_dynamic_array.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#include "zend.h" - -typedef struct _dynamic_array { - char *array; - unsigned int element_size; - unsigned int current; - unsigned int allocated; -} dynamic_array; - -ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size) -{ - da->element_size = element_size; - da->allocated = size; - da->current = 0; - da->array = (char *) emalloc(size*element_size); - if (da->array == NULL) { - return 1; - } - return 0; -} - -ZEND_API void *zend_dynamic_array_push(dynamic_array *da) -{ - if (da->current == da->allocated) { - da->allocated *= 2; - da->array = (char *) erealloc(da->array, da->allocated*da->element_size); - } - return (void *)(da->array+(da->current++)*da->element_size); -} - -ZEND_API void *zend_dynamic_array_pop(dynamic_array *da) -{ - return (void *)(da->array+(--(da->current))*da->element_size); - -} - -ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index) -{ - if (index >= da->current) { - return NULL; - } - return (void *)(da->array+index*da->element_size); -} diff --git a/Zend/zend_dynamic_array.h b/Zend/zend_dynamic_array.h deleted file mode 100644 index 8ad2a7277a3..00000000000 --- a/Zend/zend_dynamic_array.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_DYNAMIC_ARRAY_H -#define ZEND_DYNAMIC_ARRAY_H - -typedef struct _dynamic_array { - char *array; - unsigned int element_size; - unsigned int last_used; - unsigned int allocated; -} dynamic_array; - -BEGIN_EXTERN_C() -ZEND_API int zend_dynamic_array_init(dynamic_array *da); -ZEND_API void *zend_dynamic_array_push(dynamic_array *da); -ZEND_API void *zend_dynamic_array_pop(dynamic_array *da); -ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index); -END_EXTERN_C() - -#endif /* ZEND_DYNAMIC_ARRAY_H */ diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h deleted file mode 100644 index 1535f49fc23..00000000000 --- a/Zend/zend_errors.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_ERRORS_H -#define ZEND_ERRORS_H - -#define E_ERROR (1<<0L) -#define E_WARNING (1<<1L) -#define E_PARSE (1<<2L) -#define E_NOTICE (1<<3L) -#define E_CORE_ERROR (1<<4L) -#define E_CORE_WARNING (1<<5L) -#define E_COMPILE_ERROR (1<<6L) -#define E_COMPILE_WARNING (1<<7L) -#define E_USER_ERROR (1<<8L) -#define E_USER_WARNING (1<<9L) -#define E_USER_NOTICE (1<<10L) - -#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE) -#define E_CORE (E_CORE_ERROR | E_CORE_WARNING) - -#endif /* ZEND_ERRORS_H */ - diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c deleted file mode 100644 index d1150f520cf..00000000000 --- a/Zend/zend_execute.c +++ /dev/null @@ -1,3217 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#define ZEND_INTENSIVE_DEBUGGING 0 - -#include -#include - -#include "zend.h" -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_API.h" -#include "zend_ptr_stack.h" -#include "zend_constants.h" -#include "zend_extensions.h" -#include "zend_fast_cache.h" -#include "zend_execute_locks.h" - -#define get_zval_ptr(node, Ts, should_free, type) _get_zval_ptr(node, Ts, should_free TSRMLS_CC) -#define get_zval_ptr_ptr(node, Ts, type) _get_zval_ptr_ptr(node, Ts TSRMLS_CC) - -#define get_incdec_op(op, opcode) \ - switch (opcode) { \ - case ZEND_PRE_INC: \ - case ZEND_POST_INC: \ - case ZEND_PRE_INC_OBJ: \ - case ZEND_POST_INC_OBJ: \ - (op) = increment_function; \ - break; \ - case ZEND_PRE_DEC: \ - case ZEND_POST_DEC: \ - case ZEND_PRE_DEC_OBJ: \ - case ZEND_POST_DEC_OBJ: \ - (op) = decrement_function; \ - break; \ - default: \ - (op) = NULL; \ - break; \ - } \ - -/* These globals don't have to be thread safe since they're never modified */ - - -/* Prototypes */ -static void zend_fetch_var_address(zend_op *opline, temp_variable *Ts, int type TSRMLS_DC); -static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC); -static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC); -static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC); -static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC); -static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC); -static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC); - -#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED)) - -static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free TSRMLS_DC) -{ - switch(node->op_type) { - case IS_CONST: - *should_free = 0; - return &node->u.constant; - break; - case IS_TMP_VAR: - *should_free = 1; - return &Ts[node->u.var].tmp_var; - break; - case IS_VAR: - if (Ts[node->u.var].var.ptr) { - PZVAL_UNLOCK(Ts[node->u.var].var.ptr); - *should_free = 0; - return Ts[node->u.var].var.ptr; - } else { - *should_free = 1; - - switch (Ts[node->u.var].EA.type) { - case IS_STRING_OFFSET: { - temp_variable *T = &Ts[node->u.var]; - zval *str = T->EA.data.str_offset.str; - - if (T->EA.data.str_offset.str->type != IS_STRING - || (T->EA.data.str_offset.offset<0) - || (T->EA.data.str_offset.str->value.str.len <= T->EA.data.str_offset.offset)) { - zend_error(E_NOTICE, "Uninitialized string offset: %d", T->EA.data.str_offset.offset); - T->tmp_var.value.str.val = empty_string; - T->tmp_var.value.str.len = 0; - } else { - char c = str->value.str.val[T->EA.data.str_offset.offset]; - - T->tmp_var.value.str.val = estrndup(&c, 1); - T->tmp_var.value.str.len = 1; - } - PZVAL_UNLOCK(str); - T->tmp_var.refcount=1; - T->tmp_var.is_ref=1; - T->tmp_var.type = IS_STRING; - return &T->tmp_var; - } - break; - } - } - break; - case IS_UNUSED: - *should_free = 0; - return NULL; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - return NULL; -} - -static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *should_free TSRMLS_DC) -{ - switch(node->op_type) { - case IS_TMP_VAR: - *should_free = 1; - return &Ts[node->u.var].tmp_var; - break; - case IS_VAR: - if (Ts[node->u.var].var.ptr_ptr) { - PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr); - *should_free = 0; - return *Ts[node->u.var].var.ptr_ptr; - } else { - if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) { - PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str); - } - *should_free = 1; - return NULL; - } - break; - case IS_UNUSED: - return NULL; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - return NULL; -} - - -static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts TSRMLS_DC) -{ - if (node->op_type==IS_VAR) { - if (Ts[node->u.var].var.ptr_ptr) { - PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr); - } else if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) { - PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str); - } - return Ts[node->u.var].var.ptr_ptr; - } else { - return NULL; - } -} - -static inline zval **zend_fetch_property_address_inner(zval *object, znode *op2, temp_variable *Ts, int type TSRMLS_DC) -{ - zval *prop_ptr = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval **retval; - zval tmp; - - - switch (op2->op_type) { - case IS_CONST: - /* already a constant string */ - break; - case IS_VAR: - tmp = *prop_ptr; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - prop_ptr = &tmp; - break; - case IS_TMP_VAR: - convert_to_string(prop_ptr); - break; - } - - if(Z_OBJ_HT_P(object)->get_property_ptr != NULL) { - retval = Z_OBJ_HT_P(object)->get_property_ptr(object, prop_ptr TSRMLS_CC); - } else { - zend_error(E_WARNING, "This object doesn't support property references"); - retval = &EG(error_zval_ptr); - } - - if (prop_ptr == &tmp) { - zval_dtor(prop_ptr); - } - FREE_OP(Ts, op2, EG(free_op2)); - return retval; -} - - - -static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC) -{ - switch (opline->op1.op_type) { - case IS_VAR: - if (!Ts[opline->op1.u.var].var.ptr_ptr) { - get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R); - FREE_OP(Ts, &opline->op1, EG(free_op1)); - } else { - zval_ptr_dtor(&Ts[opline->op1.u.var].var.ptr); - if (opline->extended_value) { /* foreach() free */ - zval_ptr_dtor(&Ts[opline->op1.u.var].var.ptr); - } - } - break; - case IS_TMP_VAR: - zendi_zval_dtor(Ts[opline->op1.u.var].tmp_var); - break; - EMPTY_SWITCH_DEFAULT_CASE() - } -} - -void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts TSRMLS_DC) -{ - zval *variable_ptr; - zval *value_ptr; - - if (!value_ptr_ptr || !variable_ptr_ptr) { - zend_error(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - return; - } - - variable_ptr = *variable_ptr_ptr; - value_ptr = *value_ptr_ptr; - - if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) { - variable_ptr_ptr = &EG(uninitialized_zval_ptr); -/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ - } else if (variable_ptr_ptr != value_ptr_ptr) { - variable_ptr->refcount--; - if (variable_ptr->refcount==0) { - zendi_zval_dtor(*variable_ptr); - FREE_ZVAL(variable_ptr); - } - - if (!PZVAL_IS_REF(value_ptr)) { - /* break it away */ - value_ptr->refcount--; - if (value_ptr->refcount>0) { - ALLOC_ZVAL(*value_ptr_ptr); - **value_ptr_ptr = *value_ptr; - value_ptr = *value_ptr_ptr; - zendi_zval_copy_ctor(*value_ptr); - } - value_ptr->refcount = 1; - value_ptr->is_ref = 1; - } - - *variable_ptr_ptr = value_ptr; - value_ptr->refcount++; - } else { - if (variable_ptr->refcount>1) { /* we need to break away */ - SEPARATE_ZVAL(variable_ptr_ptr); - } - (*variable_ptr_ptr)->is_ref = 1; - } - - if (result && !(result->u.EA.type & EXT_TYPE_UNUSED)) { - Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr; - SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result); - AI_USE_PTR(Ts[result->u.var].var); - } -} - -static inline void make_real_object(zval **object_ptr TSRMLS_DC) -{ - if ((*object_ptr)->type == IS_NULL - || ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0) - || ((*object_ptr)->type == IS_STRING && (*object_ptr)->value.str.len == 0)) { - if (!PZVAL_IS_REF(*object_ptr)) { - SEPARATE_ZVAL(object_ptr); - } - zend_error(E_NOTICE, "Creating default object from empty value"); - object_init(*object_ptr); - } -} - -static inline void zend_assign_to_object(znode *result, znode *op1, znode *op2, zval *value, temp_variable *Ts TSRMLS_DC) -{ - zval **object_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W); - zval *object; - zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval tmp; - zval **retval = &Ts[result->u.var].var.ptr; - - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - FREE_OP(Ts, op2, EG(free_op2)); - *retval = EG(uninitialized_zval_ptr); - - SELECTIVE_PZVAL_LOCK(*retval, result); - return; - } - - /* here we are sure we are dealing with an object */ - switch (op2->op_type) { - case IS_CONST: - /* already a constant string */ - break; - case IS_VAR: - tmp = *property; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - property = &tmp; - break; - case IS_TMP_VAR: - convert_to_string(property); - break; - } - - /* here property is a string */ - PZVAL_UNLOCK(value); - - Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC); - if (property == &tmp) { - zval_dtor(property); - } - - FREE_OP(Ts, op2, EG(free_op2)); - if (result) { - Ts[result->u.var].var.ptr = value; - Ts[result->u.var].var.ptr_ptr = NULL; /* see if we can nuke this */ - SELECTIVE_PZVAL_LOCK(value, result); - } -} - -static inline void zend_assign_to_object_op(znode *result, znode *op1, znode *op2, zval *value, temp_variable *Ts, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) TSRMLS_DC) -{ - zval **object_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W); - zval *object; - zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval tmp; - zval **retval = &Ts[result->u.var].var.ptr; - - Ts[result->u.var].var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - FREE_OP(Ts, op2, EG(free_op2)); - *retval = EG(uninitialized_zval_ptr); - - SELECTIVE_PZVAL_LOCK(*retval, result); - return; - } - - /* here we are sure we are dealing with an object */ - switch (op2->op_type) { - case IS_CONST: - /* already a constant string */ - break; - case IS_VAR: - tmp = *property; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - property = &tmp; - break; - case IS_TMP_VAR: - convert_to_string(property); - break; - } - - /* here property is a string */ - PZVAL_UNLOCK(value); - - if(Z_OBJ_HT_P(object)->get_property_zval_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_zval_ptr(object, property TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - binary_op(*zptr, *zptr, value TSRMLS_CC); - *retval = *zptr; - SELECTIVE_PZVAL_LOCK(*retval, result); - } else { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - *retval = z; - SELECTIVE_PZVAL_LOCK(*retval, result); - if(z->refcount <= 1) { - zval_dtor(z); - } - } - - if (property == &tmp) { - zval_dtor(property); - } - - FREE_OP(Ts, op2, EG(free_op2)); -} - -static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2, zval *value, int type, temp_variable *Ts TSRMLS_DC) -{ - zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W); - zval *variable_ptr; - - if (!variable_ptr_ptr) { - switch (Ts[op1->u.var].EA.type) { - case IS_STRING_OFFSET: { - temp_variable *T = &Ts[op1->u.var]; - - if (T->EA.data.str_offset.str->type == IS_STRING) do { - zval tmp; - zval *final_value = value; - - if ((T->EA.data.str_offset.offset < 0)) { - zend_error(E_WARNING, "Illegal string offset: %d", T->EA.data.str_offset.offset); - break; - } - if (T->EA.data.str_offset.offset >= T->EA.data.str_offset.str->value.str.len) { - int i; - - if (T->EA.data.str_offset.str->value.str.len==0) { - STR_FREE(T->EA.data.str_offset.str->value.str.val); - T->EA.data.str_offset.str->value.str.val = (char *) emalloc(T->EA.data.str_offset.offset+1+1); - } else { - T->EA.data.str_offset.str->value.str.val = (char *) erealloc(T->EA.data.str_offset.str->value.str.val, T->EA.data.str_offset.offset+1+1); - } - for (i=T->EA.data.str_offset.str->value.str.len; iEA.data.str_offset.offset; i++) { - T->EA.data.str_offset.str->value.str.val[i] = ' '; - } - T->EA.data.str_offset.str->value.str.val[T->EA.data.str_offset.offset+1] = 0; - T->EA.data.str_offset.str->value.str.len = T->EA.data.str_offset.offset+1; - } - - if (value->type!=IS_STRING) { - tmp = *value; - if (op2 && op2->op_type == IS_VAR) { - zval_copy_ctor(&tmp); - } - convert_to_string(&tmp); - final_value = &tmp; - } - - T->EA.data.str_offset.str->value.str.val[T->EA.data.str_offset.offset] = final_value->value.str.val[0]; - if (op2 - && op2->op_type == IS_VAR - && value==&Ts[op2->u.var].tmp_var) { - STR_FREE(value->value.str.val); - } - if (final_value == &tmp) { - zval_dtor(final_value); - } - /* - * the value of an assignment to a string offset is undefined - Ts[result->u.var].var = &T->EA.data.str_offset.str; - */ - } while(0); - /* zval_ptr_dtor(&T->EA.data.str_offset.str); Nuke this line if it doesn't cause a leak */ - T->tmp_var.type = IS_STRING; - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); - AI_USE_PTR(Ts[result->u.var].var); - return; - } - - variable_ptr = *variable_ptr_ptr; - - if (variable_ptr == EG(error_zval_ptr)) { - if (result) { - Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); - AI_USE_PTR(Ts[result->u.var].var); - } - if (type==IS_TMP_VAR) { - zval_dtor(value); - } - return; - } - - if (PZVAL_IS_REF(variable_ptr)) { - if (variable_ptr!=value) { - short refcount=variable_ptr->refcount; - zval garbage; - - if (type!=IS_TMP_VAR) { - value->refcount++; - } - garbage = *variable_ptr; - *variable_ptr = *value; - variable_ptr->refcount = refcount; - variable_ptr->is_ref = 1; - if (type!=IS_TMP_VAR) { - zendi_zval_copy_ctor(*variable_ptr); - value->refcount--; - } - zendi_zval_dtor(garbage); - } - } else { - variable_ptr->refcount--; - if (variable_ptr->refcount==0) { - switch (type) { - case IS_VAR: - /* break missing intentionally */ - case IS_CONST: - if (variable_ptr==value) { - variable_ptr->refcount++; - } else if (PZVAL_IS_REF(value)) { - zval tmp; - - tmp = *value; - zval_copy_ctor(&tmp); - tmp.refcount=1; - zendi_zval_dtor(*variable_ptr); - *variable_ptr = tmp; - } else { - value->refcount++; - zendi_zval_dtor(*variable_ptr); - safe_free_zval_ptr(variable_ptr); - *variable_ptr_ptr = value; - } - break; - case IS_TMP_VAR: - zendi_zval_dtor(*variable_ptr); - value->refcount=1; - *variable_ptr = *value; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { /* we need to split */ - switch (type) { - case IS_VAR: - /* break missing intentionally */ - case IS_CONST: - if (PZVAL_IS_REF(value) && value->refcount > 0) { - ALLOC_ZVAL(variable_ptr); - *variable_ptr_ptr = variable_ptr; - *variable_ptr = *value; - zval_copy_ctor(variable_ptr); - variable_ptr->refcount=1; - break; - } - *variable_ptr_ptr = value; - value->refcount++; - break; - case IS_TMP_VAR: - ALLOC_ZVAL(*variable_ptr_ptr); - value->refcount=1; - **variable_ptr_ptr = *value; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - (*variable_ptr_ptr)->is_ref=0; - } - if (result) { - Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr; - SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result); - AI_USE_PTR(Ts[result->u.var].var); - } -} - - -/* Utility Functions for Extensions */ -static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->statement_handler) { - extension->statement_handler(op_array); - } -} - - -static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->fcall_begin_handler) { - extension->fcall_begin_handler(op_array); - } -} - - -static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->fcall_end_handler) { - extension->fcall_end_handler(op_array); - } -} - - -static void print_refcount(zval *p, char *str) -{ - print_refcount(NULL, NULL); -} - -static inline HashTable *zend_get_target_symbol_table(zend_op *opline, temp_variable *Ts, int type TSRMLS_DC) -{ - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_LOCAL: - return EG(active_symbol_table); - break; - case ZEND_FETCH_GLOBAL: - /* Don't think this is actually needed. - if (opline->op1.op_type == IS_VAR) { - PZVAL_LOCK(varname); - } -+ */ - return &EG(symbol_table); - break; - case ZEND_FETCH_STATIC: - if (!EG(active_op_array)->static_variables) { - ALLOC_HASHTABLE(EG(active_op_array)->static_variables); - zend_hash_init(EG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0); - } - return EG(active_op_array)->static_variables; - break; - case ZEND_FETCH_STATIC_MEMBER: - return Ts[opline->op2.u.var].EA.class_entry->static_members; - break; - case ZEND_FETCH_FROM_THIS: - if (!EG(This)) { - zend_error(E_ERROR, "Using $this when not in object context"); - } - /* HACK!! 'this' should be always zend_object */ - return Z_OBJPROP_P(EG(This)); - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - return NULL; -} - - -static void zend_fetch_var_address(zend_op *opline, temp_variable *Ts, int type TSRMLS_DC) -{ - int free_op1; - zval *varname = get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - target_symbol_table = zend_get_target_symbol_table(opline, Ts, type TSRMLS_CC); - if (!target_symbol_table) { - return; - } - - if (varname->type != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - if (opline->op2.u.EA.type == ZEND_FETCH_LOCAL) { - FREE_OP(Ts, &opline->op1, free_op1); - } else if (opline->op2.u.EA.type == ZEND_FETCH_STATIC || opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zval_update_constant(retval, (void *) 1 TSRMLS_CC); - } - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - Ts[opline->result.u.var].var.ptr_ptr = retval; - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); -} - - -static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, znode *op2, temp_variable *Ts, int type TSRMLS_DC) -{ - zval *dim = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval **retval; - char *offset_key; - int offset_key_length; - - switch (dim->type) { - case IS_NULL: - offset_key = ""; - offset_key_length = 0; - goto fetch_string_dim; - case IS_STRING: - offset_key = dim->value.str.val; - offset_key_length = dim->value.str.len; - -fetch_string_dim: - if (zend_hash_find(ht, offset_key, offset_key_length+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - zend_error(E_NOTICE,"Undefined index: %s", offset_key); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined index: %s", offset_key); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(ht, offset_key, offset_key_length+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - } - } - break; - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: { - long index; - - if (dim->type == IS_DOUBLE) { - index = (long)dim->value.dval; - } else { - index = dim->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - zend_error(E_NOTICE,"Undefined offset: %d", index); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined offset: %d", index); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_index_update(ht, index, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - } - } - } - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - if (type == BP_VAR_R || type == BP_VAR_IS) { - retval = &EG(uninitialized_zval_ptr); - } else { - retval = &EG(error_zval_ptr); - } - break; - } - FREE_OP(Ts, op2, EG(free_op2)); - return retval; -} - -static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC) -{ - zval **container_ptr = get_zval_ptr_ptr(op1, Ts, type); - zval *container; - zval ***retval = &Ts[result->u.var].var.ptr_ptr; - - container = *container_ptr; - - if (container == EG(error_zval_ptr)) { - *retval = &EG(error_zval_ptr); - SELECTIVE_PZVAL_LOCK(**retval, result); - return; - } - - if (container->type==IS_NULL - || (container->type==IS_BOOL && container->value.lval==0) - || (container->type==IS_STRING && container->value.str.len==0)) { - switch (type) { - case BP_VAR_RW: - case BP_VAR_W: - if (!PZVAL_IS_REF(container)) { - SEPARATE_ZVAL(container_ptr); - container = *container_ptr; - } - array_init(container); - break; - } - } - - switch (container->type) { - case IS_ARRAY: - if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) { - SEPARATE_ZVAL(container_ptr); - container = *container_ptr; - } - if (op2->op_type == IS_UNUSED) { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_next_index_insert(container->value.ht, &new_zval, sizeof(zval *), (void **) retval); - } else { - *retval = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, type TSRMLS_CC); - } - SELECTIVE_PZVAL_LOCK(**retval, result); - break; - case IS_NULL: - /* for read-mode only */ - get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - *retval = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(**retval, result); - FREE_OP(Ts, op2, EG(free_op2)); - if (type==BP_VAR_W || type==BP_VAR_RW) { - zend_error(E_WARNING, "Cannot use a NULL value as an array"); - } - break; - case IS_STRING: { - zval *offset; - zval tmp; - - if (op2->op_type==IS_UNUSED) { - zend_error(E_ERROR, "[] operator not supported for strings"); - } - - offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - - if (offset->type != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (type!=BP_VAR_R && type!=BP_VAR_IS) { - SEPARATE_ZVAL_IF_NOT_REF(container_ptr); - } - container = *container_ptr; - Ts[result->u.var].EA.data.str_offset.str = container; - PZVAL_LOCK(container); - Ts[result->u.var].EA.data.str_offset.offset = offset->value.lval; - Ts[result->u.var].EA.type = IS_STRING_OFFSET; - FREE_OP(Ts, op2, EG(free_op2)); - *retval = NULL; - return; - } - break; - default: { - zval *offset; - - offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - if (type==BP_VAR_R || type==BP_VAR_IS) { - *retval = &EG(uninitialized_zval_ptr); - } else { - *retval = &EG(error_zval_ptr); - } - FREE_OP(Ts, op2, EG(free_op2)); - SELECTIVE_PZVAL_LOCK(**retval, result); - if (type==BP_VAR_W || type==BP_VAR_RW) { - zend_error(E_WARNING, "Cannot use a scalar value as an array"); - } - } - break; - } -} - - -static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC) -{ - int free_op1; - zval *container = get_zval_ptr(op1, Ts, &free_op1, BP_VAR_R); - - if (container->type != IS_ARRAY) { - Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); - return; - } - - Ts[result->u.var].var.ptr_ptr = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); -} - -static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC) -{ - zval **container_ptr = get_zval_ptr_ptr(op1, Ts, type); - zval *container; - zval ***retval = &Ts[result->u.var].var.ptr_ptr; - - container = *container_ptr; - if (container == EG(error_zval_ptr)) { - *retval = &EG(error_zval_ptr); - SELECTIVE_PZVAL_LOCK(**retval, result); - return; - } - - if (container->type == IS_NULL - || (container->type == IS_BOOL && container->value.lval==0) - || (container->type == IS_STRING && container->value.str.len == 0)) { - switch (type) { - case BP_VAR_RW: - case BP_VAR_W: - if (!PZVAL_IS_REF(container)) { - SEPARATE_ZVAL(container_ptr); - container = *container_ptr; - } - object_init(container); - break; - } - } - - if (container->type != IS_OBJECT) { - zval *offset; - - offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - FREE_OP(Ts, op2, EG(free_op2)); - if (type == BP_VAR_R || type == BP_VAR_IS) { - *retval = &EG(uninitialized_zval_ptr); - } else { - *retval = &EG(error_zval_ptr); - } - SELECTIVE_PZVAL_LOCK(**retval, result); - return; - } - - - if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) { - SEPARATE_ZVAL(container_ptr); - container = *container_ptr; - } - *retval = zend_fetch_property_address_inner(container, op2, Ts, type TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(**retval, result); -} - -static void zend_fetch_property_address_read(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC) -{ - zval *container; - zval **retval; - - retval = &Ts[result->u.var].var.ptr; - Ts[result->u.var].var.ptr_ptr = retval; - - container = get_zval_ptr(op1, Ts, &EG(free_op1), type); - - if (container == EG(error_zval_ptr)) { - *retval = EG(error_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, result); - return; - } - - - if(container->type != IS_OBJECT) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - - if (type==BP_VAR_R || type==BP_VAR_IS) { - *retval = EG(uninitialized_zval_ptr); - } else { - *retval = EG(error_zval_ptr); - } - } else { - zval *offset; - zval tmp; - - offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - switch (op2->op_type) { - case IS_CONST: - /* already a constant string */ - break; - case IS_VAR: - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - offset = &tmp; - break; - case IS_TMP_VAR: - convert_to_string(offset); - break; - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - if (offset == &tmp) { - zval_dtor(offset); - } - FREE_OP(Ts, op2, EG(free_op2)); - } - - SELECTIVE_PZVAL_LOCK(*retval, result); - return; -} - -static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp_variable * Ts, int (*incdec_op)(zval *) TSRMLS_DC) -{ - zval **object_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W); - zval *object; - zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval **retval = &Ts[result->u.var].var.ptr; - - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP(Ts, op2, EG(free_op2)); - *retval = EG(uninitialized_zval_ptr); - - SELECTIVE_PZVAL_LOCK(*retval, result); - return; - } - - /* here we are sure we are dealing with an object */ - - if(Z_OBJ_HT_P(object)->get_property_zval_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_zval_ptr(object, property TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - incdec_op(*zptr); - *retval = *zptr; - SELECTIVE_PZVAL_LOCK(*retval, result); - } else { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - if(z->refcount <= 1) { - zval_dtor(z); - } - } - - FREE_OP(Ts, op2, EG(free_op2)); -} - -static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, temp_variable * Ts, int (*incdec_op)(zval *) TSRMLS_DC) -{ - zval **object_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W); - zval *object; - zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); - zval *retval = &Ts[result->u.var].tmp_var; - - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (object->type != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP(Ts, op2, EG(free_op2)); - *retval = *EG(uninitialized_zval_ptr); - return; - } - - /* here we are sure we are dealing with an object */ - - if(Z_OBJ_HT_P(object)->get_property_zval_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_zval_ptr(object, property TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - } else { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC); - SEPARATE_ZVAL_IF_NOT_REF(&z); - *retval = *z; - zendi_zval_copy_ctor(*retval); - incdec_op(z); - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - if(z->refcount <= 1) { - zval_dtor(z); - } - } - - FREE_OP(Ts, op2, EG(free_op2)); -} - - -#if ZEND_INTENSIVE_DEBUGGING - -#define CHECK_SYMBOL_TABLES() \ - zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC); \ - if (&EG(symbol_table)!=EG(active_symbol_table)) { \ - zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC); \ - } - -static int zend_check_symbol(zval **pz TSRMLS_DC) -{ - if (Z_TYPE_PP(pz) > 9) { - fprintf(stderr, "Warning! %x has invalid type!\n", *pz); - } else if (Z_TYPE_PP(pz) == IS_ARRAY) { - zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC); - } else if (Z_TYPE_PP(pz) == IS_OBJECT) { - - /* OBJ-TBI - doesn't support new object model! */ - zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC); - } - - return 0; -} - - -#else -#define CHECK_SYMBOL_TABLES() -#endif - -#define NEXT_OPCODE() \ - CHECK_SYMBOL_TABLES() \ - EX(opline)++; \ - continue; - -#define RETURN_FROM_EXECUTE_LOOP(execute_data) \ - free_alloca(EX(Ts)); \ - EG(in_execution) = EX(original_in_execution); \ - return; - -typedef struct _object_info { - zval *ptr; -} object_info; - -typedef struct _zend_execute_data { - zend_op *opline; - zend_function_state function_state; - zend_function *fbc; /* Function Being Called */ - zend_function *fbc_constructor; - object_info object; - temp_variable *Ts; - zend_bool original_in_execution; - zend_class_entry *calling_scope; -} zend_execute_data; - -#define EX(element) execute_data.element - -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object).ptr = NULL; - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable)*op_array->T); - EX(original_in_execution)=EG(in_execution); - - EG(in_execution) = 1; - if (op_array->start_op) { - EX(opline) = op_array->start_op; - } else { - EX(opline) = op_array->opcodes; - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - zend_clean_garbage(TSRMLS_C); - - switch(EX(opline)->opcode) { - case ZEND_ADD: - EG(binary_op) = add_function; - goto binary_op_addr; - case ZEND_SUB: - EG(binary_op) = sub_function; - goto binary_op_addr; - case ZEND_MUL: - EG(binary_op) = mul_function; - goto binary_op_addr; - case ZEND_DIV: - EG(binary_op) = div_function; - goto binary_op_addr; - case ZEND_MOD: - EG(binary_op) = mod_function; - goto binary_op_addr; - case ZEND_SL: - EG(binary_op) = shift_left_function; - goto binary_op_addr; - case ZEND_SR: - EG(binary_op) = shift_right_function; - goto binary_op_addr; - case ZEND_CONCAT: - EG(binary_op) = concat_function; - goto binary_op_addr; - case ZEND_IS_IDENTICAL: - EG(binary_op) = is_identical_function; - goto binary_op_addr; - case ZEND_IS_NOT_IDENTICAL: - EG(binary_op) = is_not_identical_function; - goto binary_op_addr; - case ZEND_IS_EQUAL: - EG(binary_op) = is_equal_function; - goto binary_op_addr; - case ZEND_IS_NOT_EQUAL: - EG(binary_op) = is_not_equal_function; - goto binary_op_addr; - case ZEND_IS_SMALLER: - EG(binary_op) = is_smaller_function; - goto binary_op_addr; - case ZEND_IS_SMALLER_OR_EQUAL: - EG(binary_op) = is_smaller_or_equal_function; - goto binary_op_addr; - case ZEND_BW_OR: - EG(binary_op) = bitwise_or_function; - goto binary_op_addr; - case ZEND_BW_AND: - EG(binary_op) = bitwise_and_function; - goto binary_op_addr; - case ZEND_BW_XOR: - EG(binary_op) = bitwise_xor_function; - goto binary_op_addr; - case ZEND_BOOL_XOR: - EG(binary_op) = boolean_xor_function; - /* Fall through */ -binary_op_addr: - EG(binary_op)(&EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R), - get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R) TSRMLS_CC); - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - NEXT_OPCODE(); - case ZEND_BW_NOT: - case ZEND_BOOL_NOT: - EG(unary_op) = get_unary_op(EX(opline)->opcode); - EG(unary_op)(&EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R) ); - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - NEXT_OPCODE(); - case ZEND_ASSIGN_ADD: - EG(binary_op) = add_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_SUB: - EG(binary_op) = sub_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_MUL: - EG(binary_op) = mul_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_DIV: - EG(binary_op) = div_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_MOD: - EG(binary_op) = mod_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_SL: - EG(binary_op) = shift_left_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_SR: - EG(binary_op) = shift_right_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_CONCAT: - EG(binary_op) = concat_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_OR: - EG(binary_op) = bitwise_or_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_AND: - EG(binary_op) = bitwise_and_function; - goto binary_assign_op_addr; - case ZEND_ASSIGN_BW_XOR: - EG(binary_op) = bitwise_xor_function; - /* Fall through */ -binary_assign_op_addr: { - zval **var_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_RW); - - if (!var_ptr) { - zend_error(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr, &EX(opline)->result); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - EX(opline)++; - continue; - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R) TSRMLS_CC); - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = var_ptr; - SELECTIVE_PZVAL_LOCK(*var_ptr, &EX(opline)->result); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - } - NEXT_OPCODE(); - - case ZEND_ASSIGN_ADD_OBJ: - EG(binary_op) = add_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_SUB_OBJ: - EG(binary_op) = sub_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_MUL_OBJ: - EG(binary_op) = mul_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_DIV_OBJ: - EG(binary_op) = div_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_MOD_OBJ: - EG(binary_op) = mod_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_SL_OBJ: - EG(binary_op) = shift_left_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_SR_OBJ: - EG(binary_op) = shift_right_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_CONCAT_OBJ: - EG(binary_op) = concat_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_BW_OR_OBJ: - EG(binary_op) = bitwise_or_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_BW_AND_OBJ: - EG(binary_op) = bitwise_and_function; - goto binary_assign_op_addr_obj; - case ZEND_ASSIGN_BW_XOR_OBJ: - EG(binary_op) = bitwise_xor_function; - /* Fall through */ -binary_assign_op_addr_obj: - zend_assign_to_object_op(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts)[EX(opline)->extended_value].var.ptr, EX(Ts), EG(binary_op) TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_PRE_INC_OBJ: - case ZEND_PRE_DEC_OBJ: { - int (*incdec_op)(zval *op); - - get_incdec_op(incdec_op, EX(opline)->opcode); - zend_pre_incdec_property(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), incdec_op TSRMLS_CC); - } - NEXT_OPCODE(); - case ZEND_POST_INC_OBJ: - case ZEND_POST_DEC_OBJ: { - int (*incdec_op)(zval *op); - - get_incdec_op(incdec_op, EX(opline)->opcode); - zend_post_incdec_property(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), incdec_op TSRMLS_CC); - } - NEXT_OPCODE(); - case ZEND_PRE_INC: - case ZEND_PRE_DEC: - case ZEND_POST_INC: - case ZEND_POST_DEC: { - int (*incdec_op)(zval *op); - zval **var_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_RW); - - if (!var_ptr) { - zend_error(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr, &EX(opline)->result); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - EX(opline)++; - continue; - } - - get_incdec_op(incdec_op, EX(opline)->opcode); - - switch (EX(opline)->opcode) { - case ZEND_POST_INC: - case ZEND_POST_DEC: - EX(Ts)[EX(opline)->result.u.var].tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX(Ts)[EX(opline)->result.u.var].tmp_var); - break; - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - incdec_op(*var_ptr); - switch (EX(opline)->opcode) { - case ZEND_PRE_INC: - case ZEND_PRE_DEC: - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = var_ptr; - SELECTIVE_PZVAL_LOCK(*var_ptr, &EX(opline)->result); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - break; - } - } - NEXT_OPCODE(); - case ZEND_PRINT: - zend_print_variable(get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R)); - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = 1; - EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_LONG; - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - NEXT_OPCODE(); - case ZEND_ECHO: - zend_print_variable(get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R)); - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - NEXT_OPCODE(); - case ZEND_FETCH_R: - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_W: - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_W TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_RW: - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_RW TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_FUNC_ARG: - if (ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->extended_value, EX(fbc), EX(fbc)->common.arg_types)) { - /* Behave like FETCH_W */ - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - /* Behave like FETCH_R */ - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - } - NEXT_OPCODE(); - case ZEND_FETCH_UNSET: - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_R TSRMLS_CC); - PZVAL_UNLOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - if (EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - } - PZVAL_LOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - NEXT_OPCODE(); - case ZEND_FETCH_IS: - zend_fetch_var_address(EX(opline), EX(Ts), BP_VAR_IS TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_R: - if (EX(opline)->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr); - } - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_W: - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_RW: - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_RW TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_IS: - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_IS TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_FUNC_ARG: - if (ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->extended_value, EX(fbc), EX(fbc)->common.arg_types)) { - /* Behave like FETCH_DIM_W */ - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - /* Behave like FETCH_DIM_R, except for locking used for list() */ - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - } - NEXT_OPCODE(); - case ZEND_FETCH_DIM_UNSET: - /* Not needed in DIM_UNSET - if (EX(opline)->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr); - } - */ - zend_fetch_dimension_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - PZVAL_UNLOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - if (EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - } - PZVAL_LOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_R: - zend_fetch_property_address_read(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_W: - zend_fetch_property_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_RW: - zend_fetch_property_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_RW TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_IS: - zend_fetch_property_address_read(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_IS TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_FUNC_ARG: - if (ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->extended_value, EX(fbc), EX(fbc)->common.arg_types)) { - /* Behave like FETCH_OBJ_W */ - zend_fetch_property_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - zend_fetch_property_address_read(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - } - NEXT_OPCODE(); - case ZEND_FETCH_OBJ_UNSET: - zend_fetch_property_address(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - PZVAL_UNLOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - if (EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - } - PZVAL_LOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - NEXT_OPCODE(); - case ZEND_FETCH_DIM_TMP_VAR: - zend_fetch_dimension_address_from_tmp_var(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts) TSRMLS_CC); - AI_USE_PTR(EX(Ts)[EX(opline)->result.u.var].var); - NEXT_OPCODE(); - case ZEND_MAKE_VAR: { - zval *value, *value2; - - value = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - switch(EX(opline)->op1.op_type) { - case IS_TMP_VAR: - value2 = value; - ALLOC_ZVAL(value); - *value = *value2; - value->is_ref = 0; - value->refcount = 0; /* lock will increase this */ - break; - case IS_CONST: - value2 = value; - ALLOC_ZVAL(value); - *value = *value2; - zval_copy_ctor(value); - value->is_ref = 0; - value->refcount = 0; /* lock will increase this */ - break; - } - - EX(Ts)[EX(opline)->result.u.var].var.ptr = value; - PZVAL_LOCK(EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - NEXT_OPCODE(); - case ZEND_ASSIGN_OBJ: - zend_assign_to_object(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, EX(Ts)[EX(opline)->extended_value].var.ptr, EX(Ts) TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_ASSIGN: { - zval *value; - value = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - zend_assign_to_variable(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, value, (EG(free_op2)?IS_TMP_VAR:EX(opline)->op2.op_type), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - } - NEXT_OPCODE(); - case ZEND_ASSIGN_REF: - zend_assign_to_variable_reference(&EX(opline)->result, get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W), get_zval_ptr_ptr(&EX(opline)->op2, EX(Ts), BP_VAR_W), EX(Ts) TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_JMP: -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op1.u.opline_num]; - continue; - break; - case ZEND_JMPZ: { - znode *op1 = &EX(opline)->op1; - - if (!i_zend_is_true(get_zval_ptr(op1, EX(Ts), &EG(free_op1), BP_VAR_R))) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - FREE_OP(EX(Ts), op1, EG(free_op1)); - continue; - } - FREE_OP(EX(Ts), op1, EG(free_op1)); - } - NEXT_OPCODE(); - case ZEND_JMPNZ: { - znode *op1 = &EX(opline)->op1; - - if (zend_is_true(get_zval_ptr(op1, EX(Ts), &EG(free_op1), BP_VAR_R))) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - FREE_OP(EX(Ts), op1, EG(free_op1)); - continue; - } - FREE_OP(EX(Ts), op1, EG(free_op1)); - } - NEXT_OPCODE(); - case ZEND_JMPZNZ: { - znode *res = &EX(opline)->op1; - - if (zend_is_true(get_zval_ptr(res, EX(Ts), &EG(free_op1), BP_VAR_R))) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", EX(opline)->extended_value); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->extended_value]; - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", EX(opline)->op2.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - } - FREE_OP(EX(Ts), res, EG(free_op1)); - } - continue; - break; - case ZEND_JMPZ_EX: { - zend_op *original_opline = EX(opline); - int retval = zend_is_true(get_zval_ptr(&original_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R)); - - FREE_OP(EX(Ts), &original_opline->op1, EG(free_op1)); - EX(Ts)[original_opline->result.u.var].tmp_var.value.lval = retval; - EX(Ts)[original_opline->result.u.var].tmp_var.type = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - continue; - } - } - NEXT_OPCODE(); - case ZEND_JMPNZ_EX: { - zend_op *original_opline = EX(opline); - int retval = zend_is_true(get_zval_ptr(&original_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R)); - - FREE_OP(EX(Ts), &original_opline->op1, EG(free_op1)); - EX(Ts)[original_opline->result.u.var].tmp_var.value.lval = retval; - EX(Ts)[original_opline->result.u.var].tmp_var.type = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", EX(opline)->op2.u.opline_num); -#endif - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - continue; - } - } - NEXT_OPCODE(); - case ZEND_FREE: - zendi_zval_dtor(EX(Ts)[EX(opline)->op1.u.var].tmp_var); - NEXT_OPCODE(); - case ZEND_INIT_STRING: - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.str.val = emalloc(1); - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.str.val[0] = 0; - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.str.len = 0; - EX(Ts)[EX(opline)->result.u.var].tmp_var.refcount = 1; - NEXT_OPCODE(); - case ZEND_ADD_CHAR: - add_char_to_string( &EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_NA), - &EX(opline)->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - NEXT_OPCODE(); - case ZEND_ADD_STRING: - add_string_to_string( &EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_NA), - &EX(opline)->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - NEXT_OPCODE(); - case ZEND_ADD_VAR: { - zval *var = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - zval var_copy; - int use_copy; - - zend_make_printable_zval(var, &var_copy, &use_copy); - if (use_copy) { - var = &var_copy; - } - add_string_to_string( &EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_NA), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - NEXT_OPCODE(); - case ZEND_IMPORT_FUNCTION: - { - zend_class_entry *ce; - zend_function *function; - - ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen + 1, (void **) &function)==FAILURE) { - zend_error(E_ERROR, "Import: function %s() not found", function_name_strval); - } - if (zend_hash_add(EG(function_table), function_name_strval, function_name_strlen + 1, function, sizeof(zend_function), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: function %s() already exists in current scope", function_name_strval); - } - function_add_ref(function); - } else { - zend_function tmp_zend_function; - - zend_hash_copy(EG(function_table), &ce->function_table, (copy_ctor_func_t) function_add_ref, &tmp_zend_function, sizeof(zend_function)); - } - NEXT_OPCODE(); - } - case ZEND_IMPORT_CLASS: - { - zend_class_entry *ce; - zend_class_entry **import_ce; - - ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *class_name_strval; - int class_name_strlen; - - class_name_strval = EX(opline)->op2.u.constant.value.str.val; - class_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->class_table, class_name_strval, class_name_strlen + 1, (void **) &import_ce)==FAILURE) { - zend_error(E_ERROR, "Import: class %s not found", class_name_strval); - } - if (zend_hash_add(EG(class_table), class_name_strval, class_name_strlen + 1, import_ce, sizeof(zend_class_entry *), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: class %s already exists in current scope", class_name_strval); - } - zend_class_add_ref(import_ce); - } else { - zend_class_entry *tmp_zend_class_entry; - - zend_hash_copy(EG(class_table), &ce->class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_zend_class_entry, sizeof(zend_class_entry *)); - } - - NEXT_OPCODE(); - } - case ZEND_IMPORT_CONST: - { - zend_class_entry *ce; - zval **import_constant; - zend_constant c; - - ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *const_name_strval; - int const_name_strlen; - - const_name_strval = EX(opline)->op2.u.constant.value.str.val; - const_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->constants_table, const_name_strval, const_name_strlen + 1, (void **) &import_constant)==FAILURE) { - zend_error(E_ERROR, "Import: constant %s not found", const_name_strval); - } - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(const_name_strval, const_name_strlen); - c.name_len = const_name_strlen + 1; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", const_name_strval); - } - } else { - HashPosition pos; - char *key; - uint key_length; - int key_type; - ulong dummy; - - zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos); - while(zend_hash_get_current_data_ex(&ce->constants_table, (void **)&import_constant, &pos) == SUCCESS) { - key_type = zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_length, &dummy, 0, &pos); - - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(key, key_length - 1); - c.name_len = key_length; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", key); - } - zend_hash_move_forward_ex(&ce->constants_table, &pos); - } - } - NEXT_OPCODE(); - } - case ZEND_FETCH_CLASS: - { - zend_class_entry **pce; - - if (EX(opline)->op1.op_type == IS_UNUSED) { - zval tmp; - zval *class_name; - zend_bool is_const; - char *class_name_strval; - int class_name_strlen; - - if (EX(opline)->extended_value == ZEND_FETCH_CLASS_SELF) { - if (!EG(scope)) { - zend_error(E_ERROR, "Cannot fetch self:: when no class scope is active"); - } - EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(scope); - NEXT_OPCODE(); - } else if (EX(opline)->extended_value == ZEND_FETCH_CLASS_MAIN) { - EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(main_class_ptr); - NEXT_OPCODE(); - } else if (EX(opline)->extended_value == ZEND_FETCH_CLASS_PARENT) { - if (!EG(scope)) { - zend_error(E_ERROR, "Cannot fetch parent:: when no class scope is active"); - } - if (!EG(scope)->parent) { - zend_error(E_ERROR, "Cannot fetch parent:: as current class scope has no parent"); - } - EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(scope)->parent; - NEXT_OPCODE(); - } - - is_const = (EX(opline)->op2.op_type == IS_CONST); - - if (is_const) { - class_name_strval = EX(opline)->op2.u.constant.value.str.val; - class_name_strlen = EX(opline)->op2.u.constant.value.str.len; - } else { - class_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - tmp = *class_name; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - zend_str_tolower(tmp.value.str.val, tmp.value.str.len); - - class_name_strval = tmp.value.str.val; - class_name_strlen = tmp.value.str.len; - } - - if (zend_hash_find(EG(class_table), class_name_strval, class_name_strlen+1, (void **) &pce) == FAILURE) { - zend_error(E_ERROR, "Class '%s' not found", class_name_strval); - } else { - EX(Ts)[EX(opline)->result.u.var].EA.class_entry = *pce; - } - if (!is_const) { - zval_dtor(&tmp); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - } else { - if (zend_hash_find(&EX(Ts)[EX(opline)->op1.u.var].EA.class_entry->class_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **)&pce) == FAILURE) { - zend_error(E_ERROR, "Class '%s' not found", EX(opline)->op2.u.constant.value.str.val); - } else { - EX(Ts)[EX(opline)->result.u.var].EA.class_entry = *pce; - } - } - NEXT_OPCODE(); - } - case ZEND_INIT_CTOR_CALL: - { - zend_ptr_stack_n_push(&EG(arg_types_stack), 2, EX(fbc), EX(object).ptr); - - if (EX(opline)->op1.op_type == IS_VAR) { - SELECTIVE_PZVAL_LOCK(*EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr, &EX(opline)->op1); - } - - /* We are not handling overloaded classes right now */ - EX(object).ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - if (!PZVAL_IS_REF(EX(object).ptr)) { - EX(object).ptr->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - - ALLOC_ZVAL(this_ptr); - *this_ptr = *EX(object).ptr; - INIT_PZVAL(this_ptr); - zval_copy_ctor(this_ptr); - EX(object).ptr = this_ptr; - } - - EX(fbc) = EX(fbc_constructor); - if(EX(fbc)->type == ZEND_USER_FUNCTION) { /* HACK!! */ - EX(calling_scope) = Z_OBJCE_P(EX(object).ptr); - } else { - EX(calling_scope) = NULL; - } - - NEXT_OPCODE(); - } - case ZEND_INIT_METHOD_CALL: - { - zval *function_name; - zval tmp; - zend_bool is_const; - char *function_name_strval; - int function_name_strlen; - - zend_ptr_stack_n_push(&EG(arg_types_stack), 2, EX(fbc), EX(object).ptr); - - is_const = (EX(opline)->op2.op_type == IS_CONST); - - if (is_const) { - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - } else { - function_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - tmp = *function_name; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - function_name = &tmp; - zend_str_tolower(tmp.value.str.val, tmp.value.str.len); - - function_name_strval = tmp.value.str.val; - function_name_strlen = tmp.value.str.len; - } - - EX(calling_scope) = EG(scope); - - if (EX(opline)->extended_value == ZEND_FETCH_FROM_THIS) { - if (!EG(This)) { - zend_error(E_ERROR, "Can't fetch $this as not in object context"); - } - EX(object).ptr = EG(This); - } else { - EX(object).ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - } - - if (EX(object).ptr && EX(object).ptr->type == IS_OBJECT) { - EX(fbc) = Z_OBJ_HT_P(EX(object).ptr)->get_method(EX(object).ptr, function_name_strval, function_name_strlen TSRMLS_CC); - } else { - zend_error(E_ERROR, "Call to a member function on a non-object"); - } - if (!EX(fbc)) { - zend_error(E_ERROR, "Call to undefined function: %s()", function_name_strval); - } - - if (!PZVAL_IS_REF(EX(object).ptr)) { - EX(object).ptr->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - *this_ptr = *EX(object).ptr; - INIT_PZVAL(this_ptr); - zval_copy_ctor(this_ptr); - EX(object).ptr = this_ptr; - } - - if(EX(fbc)->type == ZEND_USER_FUNCTION) { - EX(calling_scope) = Z_OBJCE_P(EX(object).ptr); - } else { - EX(calling_scope) = NULL; - } - - if (!is_const) { - zval_dtor(&tmp); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - - NEXT_OPCODE(); - } - case ZEND_INIT_STATIC_METHOD_CALL: - { - zval *function_name; - zend_function *function; - zval tmp; - zend_class_entry *ce; - zend_bool is_const; - char *function_name_strval; - int function_name_strlen; - - zend_ptr_stack_n_push(&EG(arg_types_stack), 2, EX(fbc), EX(object).ptr); - - is_const = (EX(opline)->op2.op_type == IS_CONST); - - if (is_const) { - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - } else { - function_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - tmp = *function_name; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - zend_str_tolower(tmp.value.str.val, tmp.value.str.len); - - function_name_strval = tmp.value.str.val; - function_name_strlen = tmp.value.str.len; - } - - if ((EX(object).ptr = EG(This))) { - EX(object).ptr->refcount++; - } - - ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - - EX(calling_scope) = ce; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &function)==FAILURE) { - zend_error(E_ERROR, "Call to undefined function: %s()", function_name_strval); - } - - if (!is_const) { - zval_dtor(&tmp); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - - EX(fbc) = function; - - NEXT_OPCODE(); - } - case ZEND_INIT_FCALL_BY_NAME: - { - zval *function_name; - zend_function *function; - zval tmp; - zend_bool is_const; - char *function_name_strval; - int function_name_strlen; - - zend_ptr_stack_n_push(&EG(arg_types_stack), 2, EX(fbc), EX(object).ptr); - - is_const = (EX(opline)->op2.op_type == IS_CONST); - - if (is_const) { - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - } else { - function_name = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - tmp = *function_name; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - zend_str_tolower(tmp.value.str.val, tmp.value.str.len); - - function_name_strval = tmp.value.str.val; - function_name_strlen = tmp.value.str.len; - } - - - do { - if (EG(scope)) { - if (zend_hash_find(&EG(scope)->function_table, function_name_strval, function_name_strlen+1, (void **) &function) == SUCCESS) { - if ((EX(object).ptr = EG(This))) { - EX(object).ptr->refcount++; - } - EX(calling_scope) = EG(scope); - break; - } - } - if (zend_hash_find(EG(function_table), function_name_strval, function_name_strlen+1, (void **) &function)==FAILURE) { - zend_error(E_ERROR, "Call to undefined function: %s()", function_name_strval); - } - EX(calling_scope) = function->common.scope; - EX(object).ptr = NULL; - } while (0); - - if (!is_const) { - zval_dtor(&tmp); - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - EX(fbc) = function; - - NEXT_OPCODE(); - } - case ZEND_DO_FCALL_BY_NAME: - EX(function_state).function = EX(fbc); - goto do_fcall_common; - case ZEND_DO_FCALL: { - zval *fname = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - zend_ptr_stack_push(&EG(arg_types_stack), EX(object).ptr); - - do { - if (EG(scope)) { - if (zend_hash_find(&EG(scope)->function_table, fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function) == SUCCESS) { - if ((EX(object).ptr = EG(This))) { - EX(object).ptr->refcount++; - } - EX(calling_scope) = EG(scope); - break; - } - } - if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) { - zend_error(E_ERROR, "Unknown function: %s()\n", fname->value.str.val); - } - EX(object).ptr = NULL; - EX(calling_scope) = EX(function_state).function->common.scope; - } while (0); - - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - - goto do_fcall_common; - } -do_fcall_common: - { - zval **original_return_value; - zend_class_entry *current_scope; - zval *current_this; - int return_value_used = RETURN_VALUE_USED(EX(opline)); - - zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) EX(opline)->extended_value, NULL); - current_scope = EG(scope); - EG(scope) = EX(calling_scope); - - current_this = EG(This); - EG(This) = EX(object).ptr; - - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr; - - if (EX(function_state).function->type==ZEND_INTERNAL_FUNCTION) { - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - INIT_ZVAL(*(EX(Ts)[EX(opline)->result.u.var].var.ptr)); - ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); - EX(Ts)[EX(opline)->result.u.var].var.ptr->is_ref = 0; - EX(Ts)[EX(opline)->result.u.var].var.ptr->refcount = 1; - if (!return_value_used) { - zval_ptr_dtor(&EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - } else if (EX(function_state).function->type==ZEND_USER_FUNCTION) { - HashTable *calling_symbol_table; - - EX(Ts)[EX(opline)->result.u.var].var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - calling_symbol_table = EG(active_symbol_table); - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - - if (return_value_used && !EX(Ts)[EX(opline)->result.u.var].var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - INIT_ZVAL(*EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - } else if (!return_value_used && EX(Ts)[EX(opline)->result.u.var].var.ptr) { - zval_ptr_dtor(&EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = op_array; - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - zend_hash_clean(*EG(symtable_cache_ptr)); - } - EG(active_symbol_table) = calling_symbol_table; - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - INIT_ZVAL(*(EX(Ts)[EX(opline)->result.u.var].var.ptr)); - - if(EX(object).ptr) { - Z_OBJ_HT_P(EX(object).ptr)->call_method(EX(fbc)->common.function_name, EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); - } else { - zend_error(E_ERROR, "Cannot call overloaded function for non-object"); - } - - efree(EX(fbc)); - if (!return_value_used) { - zval_ptr_dtor(&EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - } - if (EX(opline)->opcode == ZEND_DO_FCALL_BY_NAME) { - zend_ptr_stack_n_pop(&EG(arg_types_stack), 2, &EX(object).ptr, &EX(fbc)); - } else { - EX(object).ptr = zend_ptr_stack_pop(&EG(arg_types_stack)); - } - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); - zend_ptr_stack_clear_multiple(TSRMLS_C); - - EG(scope) = current_scope; - - if (EG(This)) { - zval_ptr_dtor(&EG(This)); - } - - EG(This) = current_this; - - if (EG(exception)) { - if (EX(opline)->op2.u.opline_num == -1) { - RETURN_FROM_EXECUTE_LOOP(execute_data); - } else { - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - continue; - } - } - } - NEXT_OPCODE(); - case ZEND_RETURN: { - zval *retval_ptr; - zval **retval_ptr_ptr; - - if ((EG(active_op_array)->return_reference == ZEND_RETURN_REF) && - (EX(opline)->op1.op_type != IS_CONST) && - (EX(opline)->op1.op_type != IS_TMP_VAR)) { - - retval_ptr_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W); - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { - retval_ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - if (!EG(free_op1)) { /* Not a temp var */ - if (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0) { - ALLOC_ZVAL(*(EG(return_value_ptr_ptr))); - **EG(return_value_ptr_ptr) = *retval_ptr; - (*EG(return_value_ptr_ptr))->is_ref = 0; - (*EG(return_value_ptr_ptr))->refcount = 1; - zval_copy_ctor(*EG(return_value_ptr_ptr)); - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - ALLOC_ZVAL(*(EG(return_value_ptr_ptr))); - **EG(return_value_ptr_ptr) = *retval_ptr; - (*EG(return_value_ptr_ptr))->refcount = 1; - (*EG(return_value_ptr_ptr))->is_ref = 0; - } - } - RETURN_FROM_EXECUTE_LOOP(execute_data); - } - break; - case ZEND_THROW: - { - zval *value; - zval *exception; - - value = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - if (value->type != IS_OBJECT) { - zend_error(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - MAKE_STD_ZVAL(exception); - *exception = *value; - if (!EG(free_op1)) { - zval_copy_ctor(exception); - } - INIT_PZVAL(exception); - EG(exception) = exception; - - if (EX(opline)->op2.u.opline_num == -1) { - RETURN_FROM_EXECUTE_LOOP(execute_data); - } else { - EX(opline) = &op_array->opcodes[EX(opline)->op2.u.opline_num]; - continue; - } - } - NEXT_OPCODE(); - case ZEND_CATCH: - { - zend_class_entry *ce; - - /* Check if this is really an exception, if not, jump over code */ - if (EG(exception) == NULL) { - EX(opline) = &op_array->opcodes[EX(opline)->extended_value]; - continue; - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX(Ts)[EX(opline)->op1.u.var].EA.class_entry) { - while (ce->parent) { - if (ce->parent == EX(Ts)[EX(opline)->op1.u.var].EA.class_entry) { - goto exception_should_be_taken; - } - ce = ce->parent; - } - EX(opline) = &op_array->opcodes[EX(opline)->extended_value]; - continue; - } -exception_should_be_taken: - zend_hash_update(EG(active_symbol_table), EX(opline)->op2.u.constant.value.str.val, - EX(opline)->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - NEXT_OPCODE(); - } - case ZEND_SEND_VAL: - if (EX(opline)->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->op2.u.opline_num, EX(fbc), EX(fbc)->common.arg_types)) { - zend_error(E_ERROR, "Cannot pass parameter %d by reference", EX(opline)->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - value = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - ALLOC_ZVAL(valptr); - *valptr = *value; - if (!EG(free_op1)) { - zval_copy_ctor(valptr); - } - INIT_PZVAL(valptr); - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - NEXT_OPCODE(); - case ZEND_SEND_VAR_NO_REF: - if (EX(opline)->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(EX(opline)->extended_value & ZEND_ARG_SEND_BY_REF)) { - goto send_by_var; - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->op2.u.opline_num, EX(fbc), EX(fbc)->common.arg_types)) { - goto send_by_var; - } - { - zval *varptr; - varptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - if (varptr != &EG(uninitialized_zval) && (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - NEXT_OPCODE(); - } - zend_error(E_ERROR, "Only variables can be passed by reference"); - } - NEXT_OPCODE(); - case ZEND_SEND_VAR: - if ((EX(opline)->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->op2.u.opline_num, EX(fbc), EX(fbc)->common.arg_types)) { - goto send_by_ref; - } -send_by_var: - { - zval *varptr; - varptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); /* for string offsets */ - } - NEXT_OPCODE(); -send_by_ref: - case ZEND_SEND_REF: { - zval **varptr_ptr; - zval *varptr; - varptr_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W); - - if (!varptr_ptr) { - zend_error(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } - NEXT_OPCODE(); - case ZEND_RECV: { - zval **param; - - if (zend_ptr_stack_get_arg(EX(opline)->op1.u.constant.value.lval, (void **) ¶m TSRMLS_CC)==FAILURE) { - zend_error(E_WARNING, "Missing argument %d for %s()\n", EX(opline)->op1.u.constant.value.lval, get_active_function_name(TSRMLS_C)); - if (EX(opline)->result.op_type == IS_VAR) { - PZVAL_UNLOCK(*EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr); - } - } else if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&EX(opline)->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC); - } else { - zend_assign_to_variable(NULL, &EX(opline)->result, NULL, *param, IS_VAR, EX(Ts) TSRMLS_CC); - } - } - NEXT_OPCODE(); - case ZEND_RECV_INIT: { - zval **param, *assignment_value; - - if (zend_ptr_stack_get_arg(EX(opline)->op1.u.constant.value.lval, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (EX(opline)->op2.u.constant.type == IS_CONSTANT || EX(opline)->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = EX(opline)->op2.u.constant; - if (EX(opline)->op2.u.constant.type==IS_CONSTANT_ARRAY) { - zval_copy_ctor(default_value); - } - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &EX(opline)->op2.u.constant; - } - zend_assign_to_variable(NULL, &EX(opline)->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - assignment_value = *param; - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&EX(opline)->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC); - } else { - zend_assign_to_variable(NULL, &EX(opline)->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } - } - } - NEXT_OPCODE(); - case ZEND_BOOL: - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = zend_is_true(get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R)); - EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_BOOL; - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - NEXT_OPCODE(); - case ZEND_BRK: - case ZEND_CONT: { - zval *nest_levels_zval = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - zval tmp; - int array_offset, nest_levels, original_nest_levels; - zend_brk_cont_element *jmp_to; - - if (nest_levels_zval->type != IS_LONG) { - tmp = *nest_levels_zval; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - nest_levels = tmp.value.lval; - } else { - nest_levels = nest_levels_zval->value.lval; - } - original_nest_levels = nest_levels; - array_offset = EX(opline)->op1.u.opline_num; - do { - if (array_offset==-1) { - zend_error(E_ERROR, "Cannot break/continue %d level%s", original_nest_levels, (original_nest_levels == 1) ? "" : "s"); - } - jmp_to = &op_array->brk_cont_array[array_offset]; - if (nest_levels>1) { - zend_op *brk_opline = &op_array->opcodes[jmp_to->brk]; - - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); - break; - case ZEND_FREE: - zendi_zval_dtor(EX(Ts)[brk_opline->op1.u.var].tmp_var); - break; - } - } - array_offset = jmp_to->parent; - } while (--nest_levels > 0); - - if (EX(opline)->opcode == ZEND_BRK) { - EX(opline) = op_array->opcodes+jmp_to->brk; - } else { - EX(opline) = op_array->opcodes+jmp_to->cont; - } - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - continue; - } - /* Never reaches this point */ - case ZEND_CASE: { - int switch_expr_is_overloaded=0; - - if (EX(opline)->op1.op_type==IS_VAR) { - if (EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr) { - PZVAL_LOCK(*EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr); - } else { - switch_expr_is_overloaded = 1; - if (EX(Ts)[EX(opline)->op1.u.var].EA.type==IS_STRING_OFFSET) { - EX(Ts)[EX(opline)->op1.u.var].EA.data.str_offset.str->refcount++; - } - } - } - is_equal_function(&EX(Ts)[EX(opline)->result.u.var].tmp_var, - get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R), - get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R) TSRMLS_CC); - - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr = NULL; - AI_USE_PTR(EX(Ts)[EX(opline)->op1.u.var].var); - } - } - NEXT_OPCODE(); - case ZEND_SWITCH_FREE: - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - NEXT_OPCODE(); - case ZEND_NEW: - { - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr; - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - object_init_ex(EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(Ts)[EX(opline)->op1.u.var].EA.class_entry); - EX(Ts)[EX(opline)->result.u.var].var.ptr->refcount=1; - EX(Ts)[EX(opline)->result.u.var].var.ptr->is_ref=1; - } - NEXT_OPCODE(); - case ZEND_CLONE: - { - zval *obj = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr; - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - EX(Ts)[EX(opline)->result.u.var].var.ptr->value.obj = Z_OBJ_HT_P(obj)->clone_obj(obj TSRMLS_CC); - EX(Ts)[EX(opline)->result.u.var].var.ptr->type = IS_OBJECT; - EX(Ts)[EX(opline)->result.u.var].var.ptr->refcount=1; - EX(Ts)[EX(opline)->result.u.var].var.ptr->is_ref=1; - NEXT_OPCODE(); - } - case ZEND_FETCH_CONSTANT: - { - zend_class_entry *ce; - zval **value; - - if (EX(opline)->op1.op_type == IS_UNUSED) { - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX(Ts)[EX(opline)->result.u.var].tmp_var = **value; - zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); - NEXT_OPCODE(); - } - } - if (!zend_get_constant(EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len, &EX(Ts)[EX(opline)->result.u.var].tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - EX(opline)->op2.u.constant.value.str.val, - EX(opline)->op2.u.constant.value.str.val); - EX(Ts)[EX(opline)->result.u.var].tmp_var = EX(opline)->op2.u.constant; - zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); - } - NEXT_OPCODE(); - } - - ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - - if (&ce->constants_table == &EG(main_class_ptr)->constants_table) { - if (!zend_get_constant(EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len, &EX(Ts)[EX(opline)->result.u.var].tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - EX(opline)->op2.u.constant.value.str.val, - EX(opline)->op2.u.constant.value.str.val); - EX(Ts)[EX(opline)->result.u.var].tmp_var = EX(opline)->op2.u.constant; - zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); - } - NEXT_OPCODE(); - } - if (zend_hash_find(&ce->constants_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX(Ts)[EX(opline)->result.u.var].tmp_var = **value; - zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); - } else { - zend_error(E_ERROR, "Undefined constant. Improve this error message"); - } - } - NEXT_OPCODE(); - case ZEND_INIT_ARRAY: - case ZEND_ADD_ARRAY_ELEMENT: { - zval *array_ptr = &EX(Ts)[EX(opline)->result.u.var].tmp_var; - zval *expr_ptr, **expr_ptr_ptr = NULL; - zval *offset=get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - - if (EX(opline)->extended_value) { - expr_ptr_ptr=get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_R); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - } - - if (EX(opline)->opcode==ZEND_INIT_ARRAY) { - array_init(array_ptr); - if (!expr_ptr) { - NEXT_OPCODE(); - } - } - if (!EX(opline)->extended_value && EG(free_op1)) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - *new_expr = *expr_ptr; - expr_ptr = new_expr; - INIT_PZVAL(expr_ptr); - } else { - if (EX(opline)->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - *new_expr = *expr_ptr; - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - INIT_PZVAL(expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch(offset->type) { - case IS_DOUBLE: - zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_hash_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } else { - zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL); - } - } - NEXT_OPCODE(); - case ZEND_CAST: { - zval *expr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - zval *result = &EX(Ts)[EX(opline)->result.u.var].tmp_var; - - *result = *expr; - if (!EG(free_op1)) { - zendi_zval_copy_ctor(*result); - } - switch (EX(opline)->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: - convert_to_string(result); - break; - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - } - NEXT_OPCODE(); - case ZEND_INCLUDE_OR_EVAL: { - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zval *inc_filename = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(EX(opline)); - - switch (EX(opline)->op2.u.constant.value.lval) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - char *opened_path=NULL; - int dummy = 1; - zend_file_handle file_handle; - - file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path); - file_handle.type = ZEND_HANDLE_FP; - file_handle.filename = inc_filename->value.str.val; - file_handle.opened_path = opened_path; - file_handle.free_filename = 0; - - if (file_handle.handle.fp) { - if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - opened_path = NULL; /* zend_destroy_file_handle() already frees it */ - } else { - fclose(file_handle.handle.fp); - failure_retval=1; - } - } else { - if (EX(opline)->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle.filename); - } - } - if (opened_path) { - efree(opened_path); - } - break; - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(EX(opline)->op2.u.constant.value.lval, inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr; - if (new_op_array) { - EG(return_value_ptr_ptr) = EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX(Ts)[EX(opline)->result.u.var].var.ptr = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - if (!return_value_used) { - if (EX(Ts)[EX(opline)->result.u.var].var.ptr) { - zval_ptr_dtor(&EX(Ts)[EX(opline)->result.u.var].var.ptr); - } - } else { /* return value is used */ - if (!EX(Ts)[EX(opline)->result.u.var].var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - INIT_PZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - EX(Ts)[EX(opline)->result.u.var].var.ptr->value.lval = 1; - EX(Ts)[EX(opline)->result.u.var].var.ptr->type = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = op_array; - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array); - efree(new_op_array); - } else { - if (return_value_used) { - ALLOC_ZVAL(EX(Ts)[EX(opline)->result.u.var].var.ptr); - INIT_ZVAL(*EX(Ts)[EX(opline)->result.u.var].var.ptr); - EX(Ts)[EX(opline)->result.u.var].var.ptr->value.lval = failure_retval; - EX(Ts)[EX(opline)->result.u.var].var.ptr->type = IS_BOOL; - } - } - EG(return_value_ptr_ptr) = original_return_value; - } - NEXT_OPCODE(); - case ZEND_UNSET_VAR: - { - zval tmp, *variable = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - zval **object; - zend_bool unset_object; - - - unset_object = (EX(opline)->extended_value == ZEND_UNSET_OBJ); - if (variable->type != IS_STRING) { - tmp = *variable; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - variable = &tmp; - } - - if (unset_object) { - if (zend_hash_find(EG(active_symbol_table), variable->value.str.val, variable->value.str.len+1, (void **)&object) == FAILURE) { - zend_error(E_ERROR, "Cannot delete non-existing object"); - } - if (Z_TYPE_PP(object) != IS_OBJECT) { - zend_error(E_ERROR, "Cannot call delete on non-object type"); - } - Z_OBJ_HT_PP(object)->delete_obj(*object TSRMLS_CC); - } - - zend_hash_del(EG(active_symbol_table), variable->value.str.val, variable->value.str.len+1); - - if (variable == &tmp) { - zval_dtor(&tmp); - } - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - } - NEXT_OPCODE(); - case ZEND_UNSET_DIM_OBJ: { - zval **container = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_R); - zval *offset = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - zend_bool unset_object; - zval **object; - - unset_object = (EX(opline)->extended_value == ZEND_UNSET_OBJ); - - if (container) { - HashTable *ht; - - if((*container)->type == IS_ARRAY) { - ht = (*container)->value.ht; - } else { - ht = NULL; - if((*container)->type == IS_OBJECT) { - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - } - } - if (ht) { - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - { - long index; - - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.lval; - } else { - index = offset->value.lval; - } - - if (unset_object) { - if (zend_hash_index_find(ht, index, (void **)&object) == FAILURE) { - zend_error(E_ERROR, "Cannot delete non-existing object"); - } - if (Z_TYPE_PP(object) != IS_OBJECT) { - zend_error(E_ERROR, "Cannot call delete on non-object type"); - } - Z_OBJ_HT_PP(object)->delete_obj(*object TSRMLS_CC); - } - - zend_hash_index_del(ht, index); - break; - } - case IS_STRING: - if (unset_object) { - if (zend_hash_find(ht, offset->value.str.val, offset->value.str.len+1, (void **)&object) == FAILURE) { - zend_error(E_ERROR, "Cannot delete non-existing object"); - } - if (Z_TYPE_PP(object) != IS_OBJECT) { - zend_error(E_ERROR, "Cannot call delete on non-object type"); - } - Z_OBJ_HT_PP(object)->delete_obj(*object TSRMLS_CC); - } - - zend_hash_del(ht, offset->value.str.val, offset->value.str.len+1); - break; - case IS_NULL: - if (unset_object) { - if (zend_hash_find(ht, "", sizeof(""), (void **)&object) == FAILURE) { - zend_error(E_ERROR, "Cannot delete non-existing object"); - } - if (Z_TYPE_PP(object) != IS_OBJECT) { - zend_error(E_ERROR, "Cannot call delete on non-object type"); - } - Z_OBJ_HT_PP(object)->delete_obj(*object TSRMLS_CC); - } - - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - } - } else { - /* overloaded element */ - } - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - NEXT_OPCODE(); - case ZEND_FE_RESET: { - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - - if (EX(opline)->extended_value) { - array_ptr_ptr = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_R); - if (array_ptr_ptr == NULL) { - MAKE_STD_ZVAL(array_ptr); - } else { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - if (EG(free_op1)) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - *tmp = *array_ptr; - INIT_PZVAL(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - PZVAL_LOCK(array_ptr); - EX(Ts)[EX(opline)->result.u.var].var.ptr = array_ptr; - EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr; - - if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - /* probably redundant */ - zend_hash_internal_pointer_reset(fe_ht); - } else { - /* JMP to the end of foreach - TBD */ - } - } - NEXT_OPCODE(); - case ZEND_FE_FETCH: { - zval *array = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - zval *result = &EX(Ts)[EX(opline)->result.u.var].tmp_var; - zval **value, *key; - char *str_key; - ulong int_key; - HashTable *fe_ht; - - PZVAL_LOCK(array); - - fe_ht = HASH_OF(array); - if (!fe_ht) { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - EX(opline) = op_array->opcodes+EX(opline)->op2.u.opline_num; - continue; - } else if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - EX(opline) = op_array->opcodes+EX(opline)->op2.u.opline_num; - continue; - } - array_init(result); - - - (*value)->refcount++; - zend_hash_index_update(result->value.ht, 0, value, sizeof(zval *), NULL); - - ALLOC_ZVAL(key); - INIT_PZVAL(key); - switch (zend_hash_get_current_key(fe_ht, &str_key, &int_key, 1)) { - case HASH_KEY_IS_STRING: - key->value.str.val = str_key; - key->value.str.len = strlen(str_key); - key->type = IS_STRING; - break; - case HASH_KEY_IS_LONG: - key->value.lval = int_key; - key->type = IS_LONG; - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - zend_hash_index_update(result->value.ht, 1, &key, sizeof(zval *), NULL); - zend_hash_move_forward(fe_ht); - } - NEXT_OPCODE(); - case ZEND_JMP_NO_CTOR: { - zval *object_zval; - zend_function *constructor; - - if (EX(opline)->op1.op_type == IS_VAR) { - PZVAL_LOCK(*EX(Ts)[EX(opline)->op1.u.var].var.ptr_ptr); - } - - object_zval = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - EX(fbc_constructor) = NULL; - if (constructor == NULL) { - EX(opline) = op_array->opcodes + EX(opline)->op2.u.opline_num; - continue; - } else { - EX(fbc_constructor) = constructor; - } - - } - NEXT_OPCODE(); - case ZEND_ISSET_ISEMPTY_VAR: - { - zval tmp, *variable = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - target_symbol_table = zend_get_target_symbol_table(EX(opline), EX(Ts), BP_VAR_IS TSRMLS_CC); - - if (variable->type != IS_STRING) { - tmp = *variable; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - variable = &tmp; - } - - if (zend_hash_find(target_symbol_table, variable->value.str.val, variable->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - - EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_BOOL; - - switch (EX(opline)->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = 0; - } else { - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !zend_is_true(*value)) { - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = 1; - } else { - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = 0; - } - break; - } - - if (variable == &tmp) { - zval_dtor(&tmp); - } - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - } - NEXT_OPCODE(); - case ZEND_ISSET_ISEMPTY_DIM_OBJ: - { - zval **container = get_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_R); - zval *offset = get_zval_ptr(&EX(opline)->op2, EX(Ts), &EG(free_op2), BP_VAR_R); - zval **value = NULL; - int result = 0; - - if (container) { - - if((*container)->type == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = (*container)->value.ht; - - switch (offset->type) { - case IS_DOUBLE: - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - { - long index; - - if (offset->type == IS_DOUBLE) { - index = (long) offset->value.lval; - } else { - index = offset->value.lval; - } - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - } - case IS_STRING: - if (zend_hash_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - - break; - } - - switch (EX(opline)->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - } else { - if((*container)->type == IS_OBJECT) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (EX(opline)->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - } - } else { - /* string offsets */ - } - - EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_BOOL; - - switch (EX(opline)->extended_value) { - case ZEND_ISSET: - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = result; - break; - case ZEND_ISEMPTY: - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = !result; - break; - } - - FREE_OP(EX(Ts), &EX(opline)->op2, EG(free_op2)); - } - NEXT_OPCODE(); - break; - case ZEND_EXIT: - if (EX(opline)->op1.op_type != IS_UNUSED) { - zval *ptr; - - ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1)); - } - zend_bailout(); - NEXT_OPCODE(); - case ZEND_BEGIN_SILENCE: - EX(Ts)[EX(opline)->result.u.var].tmp_var.value.lval = EG(error_reporting); - EX(Ts)[EX(opline)->result.u.var].tmp_var.type = IS_LONG; /* shouldn't be necessary */ - EG(error_reporting) = 0; - NEXT_OPCODE(); - case ZEND_END_SILENCE: - EG(error_reporting) = EX(Ts)[EX(opline)->op1.u.var].tmp_var.value.lval; - NEXT_OPCODE(); - case ZEND_QM_ASSIGN: { - zval *value = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - - EX(Ts)[EX(opline)->result.u.var].tmp_var = *value; - if (!EG(free_op1)) { - zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); - } - } - NEXT_OPCODE(); - case ZEND_EXT_STMT: - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, op_array TSRMLS_CC); - } - NEXT_OPCODE(); - case ZEND_EXT_FCALL_BEGIN: - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, op_array TSRMLS_CC); - } - NEXT_OPCODE(); - case ZEND_EXT_FCALL_END: - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, op_array TSRMLS_CC); - } - NEXT_OPCODE(); - case ZEND_DECLARE_FUNCTION_OR_CLASS: - do_bind_function_or_class(EX(opline), EG(function_table), EG(class_table), 0); - NEXT_OPCODE(); - case ZEND_TICKS: - if (++EG(ticks_count)==EX(opline)->op1.u.constant.value.lval) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(EX(opline)->op1.u.constant.value.lval); - } - } - NEXT_OPCODE(); - case ZEND_EXT_NOP: - case ZEND_NOP: - NEXT_OPCODE(); - EMPTY_SWITCH_DEFAULT_CASE() - } - } - zend_error(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h deleted file mode 100644 index f4ee73dbf63..00000000000 --- a/Zend/zend_execute.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_EXECUTE_H -#define ZEND_EXECUTE_H - -#include "zend_compile.h" -#include "zend_hash.h" -#include "zend_variables.h" -#include "zend_operators.h" - -typedef union _temp_variable { - zval tmp_var; - struct { - zval **ptr_ptr; - zval *ptr; - } var; - struct { - zval tmp_var; /* a dummy */ - - union { - struct { - zval *str; - int offset; - } str_offset; - zend_property_reference overloaded_element; - } data; - - unsigned char type; - zend_class_entry *class_entry; - } EA; -} temp_variable; - - -ZEND_API extern void (*zend_execute)(zend_op_array *op_array TSRMLS_DC); - -void init_executor(TSRMLS_D); -void shutdown_executor(TSRMLS_D); -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC); -ZEND_API int zend_is_true(zval *op); -static inline void safe_free_zval_ptr(zval *p) -{ - TSRMLS_FETCH(); - - if (p!=EG(uninitialized_zval_ptr)) { - FREE_ZVAL(p); - } -} - -ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC); - -static inline int i_zend_is_true(zval *op) -{ - int result; - - switch (op->type) { - case IS_NULL: - result = 0; - break; - case IS_LONG: - case IS_BOOL: - case IS_RESOURCE: - result = (op->value.lval?1:0); - break; - case IS_DOUBLE: - result = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - result = 0; - } else { - result = 1; - } - break; - case IS_ARRAY: - result = (zend_hash_num_elements(op->value.ht)?1:0); - break; - case IS_OBJECT: - /* OBJ-TBI */ - result = 1; - break; - default: - result = 0; - break; - } - return result; -} - -ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC); - -/* dedicated Zend executor functions - do not use! */ -static inline void zend_ptr_stack_clear_multiple(TSRMLS_D) -{ - void **p = EG(argument_stack).top_element-2; - int delete_count = (ulong) *p; - - EG(argument_stack).top -= (delete_count+2); - while (--delete_count>=0) { - zval_ptr_dtor((zval **) --p); - } - EG(argument_stack).top_element = p; -} - -static inline int zend_ptr_stack_get_arg(int requested_arg, void **data TSRMLS_DC) -{ - void **p = EG(argument_stack).top_element-2; - int arg_count = (ulong) *p; - - if (requested_arg>arg_count) { - return FAILURE; - } - *data = (p-arg_count+requested_arg-1); - return SUCCESS; -} - -void execute_new_code(TSRMLS_D); - - -/* services */ -ZEND_API char *get_active_function_name(TSRMLS_D); -ZEND_API char *zend_get_executed_filename(TSRMLS_D); -ZEND_API uint zend_get_executed_lineno(TSRMLS_D); -ZEND_API zend_bool zend_is_executing(TSRMLS_D); - -ZEND_API void zend_set_timeout(long seconds); -ZEND_API void zend_unset_timeout(TSRMLS_D); -ZEND_API void zend_timeout(int dummy); - -#ifdef ZEND_WIN32 -void zend_init_timeout_thread(); -void zend_shutdown_timeout_thread(); -#define WM_REGISTER_ZEND_TIMEOUT (WM_USER+1) -#define WM_UNREGISTER_ZEND_TIMEOUT (WM_USER+2) -#endif - -#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p)) -#define zendi_zval_dtor(p) zval_dtor(&(p)) - -#define active_opline (*EG(opline_ptr)) - -void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts TSRMLS_DC); - -#define IS_OVERLOADED_OBJECT 1 -#define IS_STRING_OFFSET 2 - -#endif /* ZEND_EXECUTE_H */ diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c deleted file mode 100644 index bed4fb96859..00000000000 --- a/Zend/zend_execute_API.c +++ /dev/null @@ -1,908 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include -#include - -#include "zend.h" -#include "zend_compile.h" -#include "zend_execute.h" -#include "zend_API.h" -#include "zend_ptr_stack.h" -#include "zend_constants.h" -#include "zend_extensions.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif - - -ZEND_API void (*zend_execute)(zend_op_array *op_array TSRMLS_DC); - -#ifdef ZEND_WIN32 -#include -/* true global */ -static WNDCLASS wc; -static HWND timeout_window; -static HANDLE timeout_thread_event; -static DWORD timeout_thread_id; -static int timeout_thread_initialized=0; -#endif - - -#if ZEND_DEBUG -static void (*original_sigsegv_handler)(int); -static void zend_handle_sigsegv(int dummy) -{ - fflush(stdout); - fflush(stderr); - if (original_sigsegv_handler==zend_handle_sigsegv) { - signal(SIGSEGV, original_sigsegv_handler); - } else { - signal(SIGSEGV, SIG_DFL); - } - { - TSRMLS_FETCH(); - - fprintf(stderr, "SIGSEGV caught on opcode %d on opline %d of %s() at %s:%d\n\n", - active_opline->opcode, - active_opline-EG(active_op_array)->opcodes, - get_active_function_name(TSRMLS_C), - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C)); - } - if (original_sigsegv_handler!=zend_handle_sigsegv) { - original_sigsegv_handler(dummy); - } -} -#endif - - -static void zend_extension_activator(zend_extension *extension TSRMLS_DC) -{ - if (extension->activate) { - extension->activate(); - } -} - - -static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC) -{ - if (extension->deactivate) { - extension->deactivate(); - } -} - - -static int is_not_internal_function(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_INTERNAL_FUNCTION) { - return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP; - } else { - return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE; - } -} - - -static int is_not_internal_class(zend_class_entry **ce TSRMLS_DC) -{ - if ((*ce)->type == ZEND_INTERNAL_CLASS) { - return EG(full_tables_cleanup) ? 0 : ZEND_HASH_APPLY_STOP; - } else { - return EG(full_tables_cleanup) ? 1 : ZEND_HASH_APPLY_REMOVE; - } -} - - -void init_executor(TSRMLS_D) -{ - INIT_ZVAL(EG(uninitialized_zval)); - INIT_ZVAL(EG(error_zval)); - EG(uninitialized_zval_ptr)=&EG(uninitialized_zval); - EG(error_zval_ptr)=&EG(error_zval); - zend_ptr_stack_init(&EG(arg_types_stack)); -/* destroys stack frame, therefore makes core dumps worthless */ -#if 0&&ZEND_DEBUG - original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv); -#endif - EG(return_value_ptr_ptr) = NULL; - - EG(symtable_cache_ptr) = EG(symtable_cache)-1; - EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1; - EG(no_extensions)=0; - - EG(function_table) = CG(function_table); - EG(class_table) = CG(class_table); - - EG(in_execution) = 0; - - zend_ptr_stack_init(&EG(argument_stack)); - - zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0); - { - zval *globals; - - ALLOC_ZVAL(globals); - globals->refcount=1; - globals->is_ref=1; - globals->type = IS_ARRAY; - globals->value.ht = &EG(symbol_table); - zend_hash_update(&EG(symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL); - } - EG(active_symbol_table) = &EG(symbol_table); - - zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator TSRMLS_CC); - EG(opline_ptr) = NULL; - EG(garbage_ptr) = 0; - - zend_hash_init(&EG(included_files), 5, NULL, NULL, 0); - - EG(ticks_count) = 0; - - EG(user_error_handler) = NULL; - - zend_ptr_stack_init(&EG(user_error_handlers)); - - EG(orig_error_reporting) = EG(error_reporting); - zend_objects_init(&EG(objects), 1024); - - EG(full_tables_cleanup) = 0; -#ifdef ZEND_WIN32 - EG(timed_out) = 0; -#endif - - EG(exception) = NULL; - - EG(scope) = NULL; - - EG(main_class_ptr) = &CG(main_class); - CG(main_class).static_members = &EG(symbol_table); - - EG(This) = NULL; -} - - -void shutdown_executor(TSRMLS_D) -{ - zend_try { - zend_objects_call_destructors(&EG(objects) TSRMLS_CC); - - zend_ptr_stack_destroy(&EG(arg_types_stack)); - - while (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - zend_hash_destroy(*EG(symtable_cache_ptr)); - efree(*EG(symtable_cache_ptr)); - EG(symtable_cache_ptr)--; - } - zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC); - - zend_hash_destroy(&EG(symbol_table)); - - while (EG(garbage_ptr)--) { - if (EG(garbage)[EG(garbage_ptr)]->refcount==1) { - zval_ptr_dtor(&EG(garbage)[EG(garbage_ptr)]); - } - } - - zend_ptr_stack_destroy(&EG(argument_stack)); - - /* Destroy all op arrays */ - if (EG(full_tables_cleanup)) { - zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC); - zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC); - } else { - zend_hash_reverse_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC); - zend_hash_reverse_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC); - } - } zend_end_try(); - - /* The regular list must be destroyed after the main symbol table and - * op arrays are destroyed. - */ - zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC); - - zend_try { - clean_non_persistent_constants(TSRMLS_C); -#if ZEND_DEBUG - signal(SIGSEGV, original_sigsegv_handler); -#endif - - zend_hash_destroy(&EG(included_files)); - - if (EG(user_error_handler)) { - zval_dtor(EG(user_error_handler)); - FREE_ZVAL(EG(user_error_handler)); - } - - zend_ptr_stack_clean(&EG(user_error_handlers), ZVAL_DESTRUCTOR, 1); - zend_ptr_stack_destroy(&EG(user_error_handlers)); - - EG(error_reporting) = EG(orig_error_reporting); - zend_objects_destroy(&EG(objects)); - } zend_end_try(); -} - - -ZEND_API char *get_active_function_name(TSRMLS_D) -{ - switch(EG(function_state_ptr)->function->type) { - case ZEND_USER_FUNCTION: { - char *function_name = ((zend_op_array *) EG(function_state_ptr)->function)->function_name; - - if (function_name) { - return function_name; - } else { - return "main"; - } - } - break; - case ZEND_INTERNAL_FUNCTION: - return ((zend_internal_function *) EG(function_state_ptr)->function)->function_name; - break; - default: - return NULL; - } -} - - -ZEND_API char *zend_get_executed_filename(TSRMLS_D) -{ - if (EG(active_op_array)) { - return EG(active_op_array)->filename; - } else { - return "[no active file]"; - } -} - - -ZEND_API uint zend_get_executed_lineno(TSRMLS_D) -{ - if (EG(opline_ptr)) { - return active_opline->lineno; - } else { - return 0; - } -} - - -ZEND_API zend_bool zend_is_executing(TSRMLS_D) -{ - return EG(in_execution); -} - - -ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) -{ -#if DEBUG_ZEND>=2 - printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1); -#endif - (*zval_ptr)->refcount--; - if ((*zval_ptr)->refcount==0) { - zval_dtor(*zval_ptr); - safe_free_zval_ptr(*zval_ptr); - } else if ((*zval_ptr)->refcount == 1) { - (*zval_ptr)->is_ref = 0; - } -} - - -ZEND_API int zend_is_true(zval *op) -{ - return i_zend_is_true(op); -} - -#include "../TSRM/tsrm_strtok_r.h" - -ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) -{ - zval *p = *pp; - zend_bool inline_change = (zend_bool) (unsigned long) arg; - zval const_value; - - if (p->type == IS_CONSTANT) { - int refcount; - - SEPARATE_ZVAL(pp); - p = *pp; - - refcount = p->refcount; - - if (strchr(p->value.str.val, ':')) { - char *cur, *temp; - char *last; - zend_class_entry *ce; - zval **value; - - last = tsrm_strtok_r(p->value.str.val, ":", &temp); - - if (zend_hash_find(EG(class_table), last, strlen(last)+1, (void **)&ce) == FAILURE) { - zend_error(E_ERROR, "Invalid class! Improve this error message"); - } - - last = tsrm_strtok_r(NULL, ":", &temp); - - for(;;) { - cur = tsrm_strtok_r(NULL, ":", &temp); - if (!cur) { - break; - } - if (zend_hash_find(&ce->class_table, last, strlen(last)+1, (void **)&ce) == FAILURE) { - zend_error(E_ERROR, "Invalid class! Improve this error message"); - } - last = cur; - } - if (zend_hash_find(&ce->constants_table, last, strlen(last)+1, (void **) &value) == FAILURE) { - zend_error(E_ERROR, "Invalid class! Improve this error message"); - } - const_value = **value; - zval_copy_ctor(&const_value); - if (inline_change) { - STR_FREE(p->value.str.val); - } - *p = const_value; - } else { - if (!zend_get_constant(p->value.str.val, p->value.str.len, &const_value TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - p->value.str.val, - p->value.str.val); - p->type = IS_STRING; - if (!inline_change) { - zval_copy_ctor(p); - } - } else { - if (inline_change) { - STR_FREE(p->value.str.val); - } - *p = const_value; - } - } - INIT_PZVAL(p); - p->refcount = refcount; - } else if (p->type == IS_CONSTANT_ARRAY) { - zval **element; - char *str_index; - uint str_index_len; - ulong num_index; - - SEPARATE_ZVAL(pp); - p = *pp; - p->type = IS_ARRAY; - - /* First go over the array and see if there are any constant indices */ - zend_hash_internal_pointer_reset(p->value.ht); - while (zend_hash_get_current_data(p->value.ht, (void **) &element)==SUCCESS) { - if (!(Z_TYPE_PP(element) & IS_CONSTANT_INDEX)) { - zend_hash_move_forward(p->value.ht); - continue; - } - Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX; - if (zend_hash_get_current_key_ex(p->value.ht, &str_index, &str_index_len, &num_index, 0, NULL)!=HASH_KEY_IS_STRING) { - zend_hash_move_forward(p->value.ht); - continue; - } - if (!zend_get_constant(str_index, str_index_len-1, &const_value TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index); - zend_hash_move_forward(p->value.ht); - continue; - } - switch (const_value.type) { - case IS_STRING: - zend_hash_update(p->value.ht, const_value.value.str.val, const_value.value.str.len+1, element, sizeof(zval *), NULL); - (*element)->refcount++; - break; - case IS_LONG: - zend_hash_index_update(p->value.ht, const_value.value.lval, element, sizeof(zval *), NULL); - (*element)->refcount++; - break; - } - zend_hash_del(p->value.ht, str_index, str_index_len); - } - zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - } - return 0; -} - - -int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[] TSRMLS_DC) -{ - zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count); - int i; - int ex_retval; - zval *local_retval_ptr; - - for (i=0; itype==IS_ARRAY) { /* assume array($obj, $name) couple */ - zval **tmp_object_ptr, **tmp_real_function_name; - - if (zend_hash_index_find(function_name->value.ht, 0, (void **) &tmp_object_ptr)==FAILURE) { - return FAILURE; - } - if (zend_hash_index_find(function_name->value.ht, 1, (void **) &tmp_real_function_name)==FAILURE) { - return FAILURE; - } - function_name = *tmp_real_function_name; - SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr); - object_pp = tmp_object_ptr; - (*object_pp)->is_ref = 1; - } - - if (object_pp && !*object_pp) { - object_pp = NULL; - } - - if (object_pp) { - /* TBI!! new object handlers */ - if (Z_TYPE_PP(object_pp) == IS_OBJECT) { - if(!IS_ZEND_STD_OBJECT(**object_pp)) { - zend_error(E_WARNING, "Cannot use call_user_function on overloaded objects"); - return FAILURE; - } - - function_table = &Z_OBJCE_PP(object_pp)->function_table; - calling_scope = Z_OBJCE_PP(object_pp); - } else if (Z_TYPE_PP(object_pp) == IS_STRING) { - zend_class_entry **ce; - char *lc_class; - int found; - - lc_class = estrndup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp)); - zend_str_tolower(lc_class, Z_STRLEN_PP(object_pp)); - found = zend_hash_find(EG(class_table), lc_class, Z_STRLEN_PP(object_pp) + 1, (void **) &ce); - efree(lc_class); - if (found == FAILURE) - return FAILURE; - - function_table = &(*ce)->function_table; - calling_scope = *ce; - object_pp = NULL; - } else - return FAILURE; - } - - if (function_name->type!=IS_STRING) { - return FAILURE; - } - - function_name_copy = *function_name; - zval_copy_ctor(&function_name_copy); - zend_str_tolower(function_name_copy.value.str.val, function_name_copy.value.str.len); - - original_function_state_ptr = EG(function_state_ptr); - if (zend_hash_find(function_table, function_name_copy.value.str.val, function_name_copy.value.str.len+1, (void **) &function_state.function)==FAILURE) { - zval_dtor(&function_name_copy); - return FAILURE; - } - zval_dtor(&function_name_copy); - - for (i=0; icommon.arg_types - && icommon.arg_types[0] - && function_state.function->common.arg_types[i+1]==BYREF_FORCE - && !PZVAL_IS_REF(*params[i])) { - if ((*params[i])->refcount>1) { - zval *new_zval; - - if (no_separation) { - return FAILURE; - } - ALLOC_ZVAL(new_zval); - *new_zval = **params[i]; - zval_copy_ctor(new_zval); - new_zval->refcount = 1; - (*params[i])->refcount--; - *params[i] = new_zval; - } - (*params[i])->refcount++; - (*params[i])->is_ref = 1; - param = *params[i]; - } else if (*params[i] != &EG(uninitialized_zval)) { - (*params[i])->refcount++; - param = *params[i]; - } else { - ALLOC_ZVAL(param); - *param = **(params[i]); - INIT_PZVAL(param); - } - zend_ptr_stack_push(&EG(argument_stack), param); - } - - zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) param_count, NULL); - - EG(function_state_ptr) = &function_state; - - current_scope = EG(scope); - EG(scope) = calling_scope; - - current_this = EG(This); - - if (object_pp) { - EG(This) = *object_pp; - - if (!PZVAL_IS_REF(EG(This))) { - EG(This)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - - ALLOC_ZVAL(this_ptr); - *this_ptr = *EG(This); - INIT_PZVAL(this_ptr); - zval_copy_ctor(this_ptr); - EG(This) = this_ptr; - } - } else { - EG(This) = NULL; - } - - - if (function_state.function->type == ZEND_USER_FUNCTION) { - calling_symbol_table = EG(active_symbol_table); - if (symbol_table) { - EG(active_symbol_table) = symbol_table; - } else { - ALLOC_HASHTABLE(EG(active_symbol_table)); - zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0); - } - - original_return_value = EG(return_value_ptr_ptr); - original_op_array = EG(active_op_array); - EG(return_value_ptr_ptr) = retval_ptr_ptr; - EG(active_op_array) = (zend_op_array *) function_state.function; - original_opline_ptr = EG(opline_ptr); - orig_free_op1 = EG(free_op1); - orig_free_op2 = EG(free_op2); - orig_unary_op = EG(unary_op); - orig_binary_op = EG(binary_op); - zend_execute(EG(active_op_array) TSRMLS_CC); - if (!symbol_table) { - zend_hash_destroy(EG(active_symbol_table)); - FREE_HASHTABLE(EG(active_symbol_table)); - } - EG(active_symbol_table) = calling_symbol_table; - EG(active_op_array) = original_op_array; - EG(return_value_ptr_ptr)=original_return_value; - EG(opline_ptr) = original_opline_ptr; - EG(free_op1) = orig_free_op1; - EG(free_op2) = orig_free_op2; - EG(unary_op) = orig_unary_op; - EG(binary_op) = orig_binary_op; - } else { - ALLOC_INIT_ZVAL(*retval_ptr_ptr); - ((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, (object_pp?*object_pp:NULL), 1 TSRMLS_CC); - INIT_PZVAL(*retval_ptr_ptr); - } - zend_ptr_stack_clear_multiple(TSRMLS_C); - EG(function_state_ptr) = original_function_state_ptr; - - if (EG(This)) { - zval_ptr_dtor(&EG(This)); - } - EG(scope) = current_scope; - EG(This) = current_this; - - return SUCCESS; -} - - -ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC) -{ - zval pv; - zend_op_array *new_op_array; - zend_op_array *original_active_op_array = EG(active_op_array); - zend_function_state *original_function_state_ptr = EG(function_state_ptr); - int original_handle_op_arrays; - int retval; - - if (retval_ptr) { - pv.value.str.len = strlen(str)+sizeof("return ;")-1; - pv.value.str.val = emalloc(pv.value.str.len+1); - strcpy(pv.value.str.val, "return "); - strcat(pv.value.str.val, str); - strcat(pv.value.str.val, " ;"); - } else { - pv.value.str.len = strlen(str); - pv.value.str.val = estrndup(str, pv.value.str.len); - } - pv.type = IS_STRING; - - /*printf("Evaluating '%s'\n", pv.value.str.val);*/ - - original_handle_op_arrays = CG(handle_op_arrays); - CG(handle_op_arrays) = 0; - new_op_array = compile_string(&pv, string_name TSRMLS_CC); - CG(handle_op_arrays) = original_handle_op_arrays; - - if (new_op_array) { - zval *local_retval_ptr=NULL; - zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr); - zend_op **original_opline_ptr = EG(opline_ptr); - - EG(return_value_ptr_ptr) = &local_retval_ptr; - EG(active_op_array) = new_op_array; - EG(no_extensions)=1; - - zend_execute(new_op_array TSRMLS_CC); - - if (local_retval_ptr) { - if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr); - } else { - zval_ptr_dtor(&local_retval_ptr); - } - } else { - if (retval_ptr) { - INIT_ZVAL(*retval_ptr); - } - } - - EG(no_extensions)=0; - EG(opline_ptr) = original_opline_ptr; - EG(active_op_array) = original_active_op_array; - EG(function_state_ptr) = original_function_state_ptr; - destroy_op_array(new_op_array); - efree(new_op_array); - EG(return_value_ptr_ptr) = original_return_value_ptr_ptr; - retval = SUCCESS; - } else { - retval = FAILURE; - } - zval_dtor(&pv); - return retval; -} - - -void execute_new_code(TSRMLS_D) -{ - zend_op *opline, *end; - zend_op *ret_opline; - zval *local_retval=NULL; - - if (!CG(interactive) - || CG(active_op_array)->backpatch_count>0 - || CG(active_op_array)->function_name - || CG(active_op_array)->type!=ZEND_USER_FUNCTION) { - return; - } - - ret_opline = get_next_op(CG(active_op_array) TSRMLS_CC); - ret_opline->opcode = ZEND_RETURN; - ret_opline->op1.op_type = IS_CONST; - INIT_ZVAL(ret_opline->op1.u.constant); - SET_UNUSED(ret_opline->op2); - - if (!CG(active_op_array)->start_op) { - CG(active_op_array)->start_op = CG(active_op_array)->opcodes; - } - - opline=CG(active_op_array)->start_op; - end=CG(active_op_array)->opcodes+CG(active_op_array)->last; - - while (oplineop1.op_type==IS_CONST) { - opline->op1.u.constant.is_ref = 1; - opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ - } - if (opline->op2.op_type==IS_CONST) { - opline->op2.u.constant.is_ref = 1; - opline->op2.u.constant.refcount = 2; - } - opline++; - } - - EG(return_value_ptr_ptr) = &local_retval; - EG(active_op_array) = CG(active_op_array); - zend_execute(CG(active_op_array) TSRMLS_CC); - if (local_retval) { - zval_ptr_dtor(&local_retval); - } - - CG(active_op_array)->last--; /* get rid of that ZEND_RETURN */ - CG(active_op_array)->start_op = CG(active_op_array)->opcodes+CG(active_op_array)->last; -} - - -ZEND_API void zend_timeout(int dummy) -{ - TSRMLS_FETCH(); - - /* is there any point in this? we're terminating the request anyway... - PG(connection_status) |= PHP_CONNECTION_TIMEOUT; - */ - zend_error(E_ERROR, "Maximum execution time of %d second%s exceeded", - EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s"); -} - - -#ifdef ZEND_WIN32 -static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - case WM_DESTROY: - PostQuitMessage(0); - break; - case WM_REGISTER_ZEND_TIMEOUT: - /* wParam is the thread id pointer, lParam is the timeout amount in seconds */ - if (lParam==0) { - KillTimer(timeout_window, wParam); - } else { - SetTimer(timeout_window, wParam, lParam*1000, NULL); - } - break; - case WM_UNREGISTER_ZEND_TIMEOUT: - /* wParam is the thread id pointer */ - KillTimer(timeout_window, wParam); - break; - case WM_TIMER: { -#ifdef ZTS - void ***tsrm_ls; - - tsrm_ls = ts_resource_ex(0, &wParam); - if (!tsrm_ls) { - /* Thread died before receiving its timeout? */ - break; - } -#endif - KillTimer(timeout_window, wParam); - EG(timed_out) = 1; - } - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - return 0; -} - - - -static unsigned __stdcall timeout_thread_proc(void *pArgs) -{ - MSG message; - - wc.style=0; - wc.lpfnWndProc = zend_timeout_WndProc; - wc.cbClsExtra=0; - wc.cbWndExtra=0; - wc.hInstance=NULL; - wc.hIcon=NULL; - wc.hCursor=NULL; - wc.hbrBackground=(HBRUSH)(COLOR_BACKGROUND + 5); - wc.lpszMenuName=NULL; - wc.lpszClassName = "Zend Timeout Window"; - if (!RegisterClass(&wc)) { - return -1; - } - timeout_window = CreateWindow(wc.lpszClassName, wc.lpszClassName, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); - SetEvent(timeout_thread_event); - while (GetMessage(&message, NULL, 0, 0)) { - SendMessage(timeout_window, message.message, message.wParam, message.lParam); - if (message.message == WM_QUIT) { - break; - } - } - DestroyWindow(timeout_window); - UnregisterClass(wc.lpszClassName, NULL); - return 0; -} - - -void zend_init_timeout_thread() -{ - timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL); - _beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id); - WaitForSingleObject(timeout_thread_event, INFINITE); -} - - -void zend_shutdown_timeout_thread() -{ - if (!timeout_thread_initialized) { - return; - } - PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0); -} - -#endif - -/* This one doesn't exists on QNX */ -#ifndef SIGPROF -#define SIGPROF 27 -#endif - -void zend_set_timeout(long seconds) -{ - TSRMLS_FETCH(); - - EG(timeout_seconds) = seconds; -#ifdef ZEND_WIN32 - if (timeout_thread_initialized==0 && InterlockedIncrement(&timeout_thread_initialized)==1) { - /* We start up this process-wide thread here and not in zend_startup(), because if Zend - * is initialized inside a DllMain(), you're not supposed to start threads from it. - */ - zend_init_timeout_thread(); - } - PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds); -#else -# ifdef HAVE_SETITIMER - { - struct itimerval t_r; /* timeout requested */ - sigset_t sigset; - - t_r.it_value.tv_sec = seconds; - t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0; - - setitimer(ITIMER_PROF, &t_r, NULL); - signal(SIGPROF, zend_timeout); - sigemptyset(&sigset); - sigaddset(&sigset, SIGPROF); - sigprocmask(SIG_UNBLOCK, &sigset, NULL); - } -# endif -#endif -} - - -void zend_unset_timeout(TSRMLS_D) -{ -#ifdef ZEND_WIN32 - PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0); -#else -# ifdef HAVE_SETITIMER - { - struct itimerval no_timeout; - - no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0; - - setitimer(ITIMER_PROF, &no_timeout, NULL); - } -# endif -#endif -} diff --git a/Zend/zend_execute_locks.h b/Zend/zend_execute_locks.h deleted file mode 100644 index 88381268a2a..00000000000 --- a/Zend/zend_execute_locks.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ZEND_EXECUTE_LOCKS_H -#define ZEND_EXECUTE_LOCKS_H - -#define PZVAL_LOCK(z) zend_pzval_lock_func(z) - -static inline void zend_pzval_lock_func(zval *z) -{ - z->refcount++; -} - -#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC) - -static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC) -{ - z->refcount--; - if (!z->refcount) { - z->refcount = 1; - z->is_ref = 0; - EG(garbage)[EG(garbage_ptr)++] = z; - } -} - -static inline void zend_clean_garbage(TSRMLS_D) -{ - while (EG(garbage_ptr)) { - zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]); - } -} - -#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } - -#endif /* ZEND_EXECUTE_LOCKS_H */ diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c deleted file mode 100644 index 45769d654a6..00000000000 --- a/Zend/zend_extensions.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend_extensions.h" - -ZEND_API zend_llist zend_extensions; -static int last_resource_number; - -int zend_load_extension(char *path) -{ -#if ZEND_EXTENSIONS_SUPPORT - DL_HANDLE handle; - zend_extension *new_extension; - zend_extension_version_info *extension_version_info; - - handle = DL_LOAD(path); - if (!handle) { -#ifndef ZEND_WIN32 - fprintf(stderr, "Failed loading %s: %s\n", path, dlerror()); -#else - fprintf(stderr, "Failed loading %s\n", path); -#endif - return FAILURE; - } - - extension_version_info = (zend_extension_version_info *) DL_FETCH_SYMBOL(handle, "extension_version_info"); - new_extension = (zend_extension *) DL_FETCH_SYMBOL(handle, "zend_extension_entry"); - if (!extension_version_info || !new_extension) { - fprintf(stderr, "%s doesn't appear to be a valid Zend extension\n", path); - return FAILURE; - } - - - /* allow extension to proclaim compatibility with any Zend version */ - if (extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) { - if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) { - fprintf(stderr, "%s requires Zend Engine API version %d.\n" - "The Zend Engine API version %d which is installed, is outdated.\n\n", - new_extension->name, - extension_version_info->zend_extension_api_no, - ZEND_EXTENSION_API_NO); - DL_UNLOAD(handle); - return FAILURE; - } else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) { - fprintf(stderr, "%s requires Zend Engine API version %d.\n" - "The Zend Engine API version %d which is installed, is newer.\n" - "Contact %s at %s for a later version of %s.\n\n", - new_extension->name, - extension_version_info->zend_extension_api_no, - ZEND_EXTENSION_API_NO, - new_extension->author, - new_extension->URL, - new_extension->name); - DL_UNLOAD(handle); - return FAILURE; - } - } else if (ZTS_V!=extension_version_info->thread_safe) { - fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n", - new_extension->name, - (extension_version_info->thread_safe?"is":"isn't"), - (ZTS_V?"is":"isn't")); - DL_UNLOAD(handle); - return FAILURE; - } else if (ZEND_DEBUG!=extension_version_info->debug) { - fprintf(stderr, "Cannot load %s - it %s debug information, whereas Zend %s\n", - new_extension->name, - (extension_version_info->debug?"contains":"does not contain"), - (ZEND_DEBUG?"does":"does not")); - DL_UNLOAD(handle); - return FAILURE; - } - - return zend_register_extension(new_extension, handle); -#else - fprintf(stderr, "Extensions are not supported on this platform.\n"); - return FAILURE; -#endif -} - - -int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle) -{ -#if ZEND_EXTENSIONS_SUPPORT - zend_extension extension; - - extension = *new_extension; - extension.handle = handle; - - zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension); - - zend_llist_add_element(&zend_extensions, &extension); - - /*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/ -#endif - - return SUCCESS; -} - - -static void zend_extension_shutdown(zend_extension *extension TSRMLS_DC) -{ -#if ZEND_EXTENSIONS_SUPPORT - if (extension->shutdown) { - extension->shutdown(extension); - } -#endif -} - -static int zend_extension_startup(zend_extension *extension) -{ -#if ZEND_EXTENSIONS_SUPPORT - if (extension->startup) { - if (extension->startup(extension)!=SUCCESS) { - return 1; - } - zend_append_version_info(extension); - } -#endif - return 0; -} - - -int zend_startup_extensions_mechanism() -{ - /* Startup extensions mechanism */ - zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1); - last_resource_number = 0; - return SUCCESS; -} - - -int zend_startup_extensions() -{ - zend_llist_apply_with_del(&zend_extensions, (int (*)(void *)) zend_extension_startup); - return SUCCESS; -} - - -void zend_shutdown_extensions(TSRMLS_D) -{ - zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_shutdown TSRMLS_CC); - zend_llist_destroy(&zend_extensions); -} - - -void zend_extension_dtor(zend_extension *extension) -{ -#if ZEND_EXTENSIONS_SUPPORT && !ZEND_DEBUG - if (extension->handle) { - DL_UNLOAD(extension->handle); - } -#endif -} - - -static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args TSRMLS_DC) -{ - int message; - void *arg; - - if (!extension->message_handler || num_args!=2) { - return; - } - message = va_arg(args, int); - arg = va_arg(args, void *); - extension->message_handler(message, arg); -} - - -ZEND_API void zend_extension_dispatch_message(int message, void *arg) -{ - TSRMLS_FETCH(); - - zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg); -} - - -ZEND_API int zend_get_resource_handle(zend_extension *extension) -{ - if (last_resource_numberresource_number = last_resource_number; - return last_resource_number++; - } else { - return -1; - } -} - - -ZEND_API zend_extension *zend_get_extension(char *extension_name) -{ - zend_llist_element *element; - - for (element = zend_extensions.head; element; element = element->next) { - zend_extension *extension = (zend_extension *) element->data; - - if (!strcmp(extension->name, extension_name)) { - return extension; - } - } - return NULL; -} diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h deleted file mode 100644 index 3f7e0ebfd34..00000000000 --- a/Zend/zend_extensions.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_EXTENSIONS_H -#define ZEND_EXTENSIONS_H - -#include "zend_compile.h" - -#define ZEND_EXTENSION_API_NO 20010710 - -typedef struct _zend_extension_version_info { - int zend_extension_api_no; - char *required_zend_version; - unsigned char thread_safe; - unsigned char debug; -} zend_extension_version_info; - - -typedef struct _zend_extension zend_extension; - -/* Typedef's for zend_extension function pointers */ -typedef int (*startup_func_t)(zend_extension *extension); -typedef void (*shutdown_func_t)(zend_extension *extension); -typedef void (*activate_func_t)(void); -typedef void (*deactivate_func_t)(void); - -typedef void (*message_handler_func_t)(int message, void *arg); - -typedef void (*op_array_handler_func_t)(zend_op_array *op_array); - -typedef void (*statement_handler_func_t)(zend_op_array *op_array); -typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array); -typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array); - -typedef void (*op_array_ctor_func_t)(zend_op_array *op_array); -typedef void (*op_array_dtor_func_t)(zend_op_array *op_array); - -struct _zend_extension { - char *name; - char *version; - char *author; - char *URL; - char *copyright; - - startup_func_t startup; - shutdown_func_t shutdown; - activate_func_t activate; - deactivate_func_t deactivate; - - message_handler_func_t message_handler; - - op_array_handler_func_t op_array_handler; - - statement_handler_func_t statement_handler; - fcall_begin_handler_func_t fcall_begin_handler; - fcall_end_handler_func_t fcall_end_handler; - - op_array_ctor_func_t op_array_ctor; - op_array_dtor_func_t op_array_dtor; - - int (*api_no_check)(int api_no); - void *reserved2; - void *reserved3; - void *reserved4; - void *reserved5; - void *reserved6; - void *reserved7; - void *reserved8; - - DL_HANDLE handle; - int resource_number; -}; - - -ZEND_API int zend_get_resource_handle(zend_extension *extension); -ZEND_API void zend_extension_dispatch_message(int message, void *arg); - -#define ZEND_EXTMSG_NEW_EXTENSION 1 - - -#define ZEND_EXTENSION() \ - ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG } - -#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1 -#define COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1 - - -ZEND_API extern zend_llist zend_extensions; - -void zend_extension_dtor(zend_extension *extension); -ZEND_API int zend_load_extension(char *path); -ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle); -void zend_append_version_info(zend_extension *extension); -int zend_startup_extensions_mechanism(void); -int zend_startup_extensions(void); -void zend_shutdown_extensions(TSRMLS_D); -ZEND_API zend_extension *zend_get_extension(char *extension_name); - -#endif /* ZEND_EXTENSIONS_H */ diff --git a/Zend/zend_fast_cache.h b/Zend/zend_fast_cache.h deleted file mode 100644 index 53ea657ce50..00000000000 --- a/Zend/zend_fast_cache.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_FAST_CACHE_H -#define ZEND_FAST_CACHE_H - -#ifndef ZEND_ENABLE_FAST_CACHE -# if ZEND_DEBUG -# define ZEND_ENABLE_FAST_CACHE 0 -# else -# define ZEND_ENABLE_FAST_CACHE 1 -# endif -#endif - -typedef struct _zend_fast_cache_list_entry { - struct _zend_fast_cache_list_entry *next; -} zend_fast_cache_list_entry; - -#define MAX_FAST_CACHE_TYPES 4 - - -#define ZVAL_CACHE_LIST 0 -#define HASHTABLE_CACHE_LIST 1 - -#if ZEND_ENABLE_FAST_CACHE - - -#include "zend_globals.h" -#include "zend_globals_macros.h" -#include "zend_alloc.h" - - -#if ZEND_DEBUG -# define RECORD_ZVAL_CACHE_HIT(fc_type) AG(fast_cache_stats)[fc_type][1]++; -# define RECORD_ZVAL_CACHE_MISS(fc_type) AG(fast_cache_stats)[fc_type][0]++; -#else -# define RECORD_ZVAL_CACHE_HIT(fc_type) -# define RECORD_ZVAL_CACHE_MISS(fc_type) -#endif - - -#define ZEND_FAST_ALLOC(p, type, fc_type) \ - { \ - TSRMLS_FETCH(); \ - \ - if (((p) = (type *) AG(fast_cache_list_head)[fc_type])) { \ - AG(fast_cache_list_head)[fc_type] = ((zend_fast_cache_list_entry *) AG(fast_cache_list_head)[fc_type])->next; \ - RECORD_ZVAL_CACHE_HIT(fc_type); \ - } else { \ - (p) = (type *) emalloc(sizeof(type)); \ - RECORD_ZVAL_CACHE_MISS(fc_type); \ - } \ - } - - -#define ZEND_FAST_FREE(p, fc_type) \ - { \ - TSRMLS_FETCH(); \ - \ - ((zend_fast_cache_list_entry *) (p))->next = (zend_fast_cache_list_entry *) AG(fast_cache_list_head)[fc_type]; \ - AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \ - } - -#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \ - ZEND_FAST_ALLOC(p, type, fc_type) - -#define ZEND_FAST_FREE_REL(p, fc_type) \ - ZEND_FAST_FREE(p, fc_type) - - -#else /* !ZEND_ENABLE_FAST_CACHE */ - -#define ZEND_FAST_ALLOC(p, type, fc_type) \ - (p) = (type *) emalloc(sizeof(type)) - -#define ZEND_FAST_FREE(p, fc_type) \ - efree(p) - -#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \ - (p) = (type *) emalloc_rel(sizeof(type)) - -#define ZEND_FAST_FREE_REL(p, fc_type) \ - efree_rel(p) - -#endif /* ZEND_ENABLE_FAST_CACHE */ - - - - -/* fast cache for zval's */ -#define ALLOC_ZVAL(z) \ - ZEND_FAST_ALLOC(z, zval, ZVAL_CACHE_LIST) - -#define FREE_ZVAL(z) \ - ZEND_FAST_FREE(z, ZVAL_CACHE_LIST) - -#define ALLOC_ZVAL_REL(z) \ - ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST) - -#define FREE_ZVAL_REL(z) \ - ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST) - -/* fast cache for HashTables */ -#define ALLOC_HASHTABLE(ht) \ - ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST) - -#define FREE_HASHTABLE(ht) \ - ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST) - -#define ALLOC_HASHTABLE_REL(ht) \ - ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST) - -#define FREE_HASHTABLE_REL(ht) \ - ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST) - -#endif /* ZEND_FAST_CACHE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h deleted file mode 100644 index 7b029b0e316..00000000000 --- a/Zend/zend_globals.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_GLOBALS_H -#define ZEND_GLOBALS_H - - -#include - -#include "zend_globals_macros.h" - -#include "zend_stack.h" -#include "zend_ptr_stack.h" -#include "zend_hash.h" -#include "zend_llist.h" -#include "zend_fast_cache.h" -#include "zend_objects.h" - -/* Define ZTS if you want a thread-safe Zend */ -/*#undef ZTS*/ - -#ifdef ZTS - -BEGIN_EXTERN_C() -ZEND_API extern int compiler_globals_id; -ZEND_API extern int executor_globals_id; -ZEND_API extern int alloc_globals_id; -END_EXTERN_C() - -#endif - -#define SYMTABLE_CACHE_SIZE 32 - - -#include "zend_compile.h" - -/* excpt.h on Digital Unix 4.0 defines function_table */ -#undef function_table - - -typedef struct _zend_declarables { - zval ticks; -} zend_declarables; - - -struct _zend_compiler_globals { - zend_stack bp_stack; - zend_stack switch_cond_stack; - zend_stack foreach_copy_stack; - zend_stack object_stack; - zend_stack declare_stack; - - zend_class_entry *active_class_entry; - zval active_ce_parent_class_name; - - /* variables for list() compilation */ - zend_llist list_llist; - zend_llist dimension_llist; - zend_stack list_stack; - - zend_stack function_call_stack; - - char *compiled_filename; - - int zend_lineno; - int comment_start_line; - char *heredoc; - int heredoc_len; - - zend_op_array *active_op_array; - - zend_class_entry main_class; - HashTable *function_table; /* function symbol table */ - HashTable *class_table; /* class table */ - - HashTable filenames_table; - - HashTable *auto_globals; - - zend_bool in_compilation; - zend_bool short_tags; - zend_bool asp_tags; - zend_bool allow_call_time_pass_reference; - - zend_declarables declarables; - - /* For extensions support */ - zend_bool extended_info; /* generate extension information for debugger/profiler */ - zend_bool handle_op_arrays; /* run op_arrays through op_array handlers */ - - zend_bool unclean_shutdown; - - zend_bool ini_parser_unbuffered_errors; - - zend_llist open_files; - - zend_llist *throw_list; - long catch_begin; - - struct _zend_ini_parser_param *ini_parser_param; - - int interactive; - - zend_bool increment_lineno; - - zend_llist import_commands; -}; - - -struct _zend_executor_globals { - zval **return_value_ptr_ptr; - - zval uninitialized_zval; - zval *uninitialized_zval_ptr; - - zval error_zval; - zval *error_zval_ptr; - - zend_function_state *function_state_ptr; - zend_ptr_stack arg_types_stack; - - /* symbol table cache */ - HashTable *symtable_cache[SYMTABLE_CACHE_SIZE]; - HashTable **symtable_cache_limit; - HashTable **symtable_cache_ptr; - - zend_op **opline_ptr; - - HashTable *active_symbol_table; - HashTable symbol_table; /* main symbol table */ - - HashTable included_files; /* files already included */ - - jmp_buf bailout; - - int error_reporting; - int orig_error_reporting; - int exit_status; - - zend_op_array *active_op_array; - - HashTable *function_table; /* function symbol table */ - HashTable *class_table; /* class table */ - HashTable *zend_constants; /* constants table */ - - zend_class_entry *scope; - zend_class_entry *main_class_ptr; - - zval *This; - - long precision; - - int ticks_count; - - zend_bool in_execution; - zend_bool bailout_set; - zend_bool full_tables_cleanup; - - /* for extended information support */ - zend_bool no_extensions; - -#ifdef ZEND_WIN32 - zend_bool timed_out; -#endif - - HashTable regular_list; - HashTable persistent_list; - - zend_ptr_stack argument_stack; - int free_op1, free_op2; - int (*unary_op)(zval *result, zval *op1); - int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC); - - zval *garbage[2]; - int garbage_ptr; - - zval *user_error_handler; - zend_ptr_stack user_error_handlers; - - /* timeout support */ - int timeout_seconds; - - int lambda_count; - - HashTable ini_directives; - zend_objects objects; - zval *exception; - - void *reserved[ZEND_MAX_RESERVED_RESOURCES]; -}; - - -struct _zend_alloc_globals { - zend_mem_header *head; /* standard list */ - zend_mem_header *phead; /* persistent list */ - void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES]; - unsigned int cache_count[MAX_CACHED_MEMORY]; - void *fast_cache_list_head[MAX_FAST_CACHE_TYPES]; - -#ifdef ZEND_WIN32 - HANDLE memory_heap; -#endif - -#if ZEND_DEBUG - /* for performance tuning */ - int cache_stats[MAX_CACHED_MEMORY][2]; - int fast_cache_stats[MAX_FAST_CACHE_TYPES][2]; -#endif -#if MEMORY_LIMIT - unsigned int memory_limit; - unsigned int allocated_memory; - unsigned int allocated_memory_peak; - unsigned char memory_exhausted; -#endif -}; - -struct _zend_scanner_globals { - FILE *yy_in; - FILE *yy_out; - int yy_leng; - char *yy_text; - struct yy_buffer_state *current_buffer; - char *c_buf_p; - int init; - int start; - char _yy_hold_char; - int yy_n_chars; - int _yy_did_buffer_switch_on_eof; - int _yy_last_accepting_state; /* Must be of the same type as yy_state_type, - * if for whatever reason it's no longer int! - */ - char *_yy_last_accepting_cpos; - int _yy_more_flag; - int _yy_more_len; -}; - -#endif /* ZEND_GLOBALS_H */ diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h deleted file mode 100644 index f03a9845ad5..00000000000 --- a/Zend/zend_globals_macros.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_GLOBALS_MACROS_H -#define ZEND_GLOBALS_MACROS_H - -typedef struct _zend_compiler_globals zend_compiler_globals; -typedef struct _zend_executor_globals zend_executor_globals; -typedef struct _zend_alloc_globals zend_alloc_globals; -typedef struct _zend_scanner_globals zend_scanner_globals; - -/* Compiler */ -#ifdef ZTS -# define CG(v) TSRMG(compiler_globals_id, zend_compiler_globals *, v) -BEGIN_EXTERN_C() -int zendparse(void *compiler_globals); -END_EXTERN_C() -#else -# define CG(v) (compiler_globals.v) -extern ZEND_API struct _zend_compiler_globals compiler_globals; -int zendparse(void); -#endif - - -/* Executor */ -#ifdef ZTS -# define EG(v) TSRMG(executor_globals_id, zend_executor_globals *, v) -#else -# define EG(v) (executor_globals.v) -extern ZEND_API zend_executor_globals executor_globals; -#endif - - -/* Memory Manager */ -#ifdef ZTS -# define AG(v) TSRMG(alloc_globals_id, zend_alloc_globals *, v) -#else -# define AG(v) (alloc_globals.v) -extern ZEND_API zend_alloc_globals alloc_globals; -#endif - - -/* Language Scanner */ -#ifdef ZTS -# define LANG_SCNG(v) TSRMG(language_scanner_globals_id, zend_scanner_globals *, v) -extern ZEND_API ts_rsrc_id language_scanner_globals_id; -#else -# define LANG_SCNG(v) (language_scanner_globals.v) -extern ZEND_API zend_scanner_globals language_scanner_globals; -#endif - - -/* INI Scanner */ -#ifdef ZTS -# define INI_SCNG(v) TSRMG(ini_scanner_globals_id, zend_scanner_globals *, v) -extern ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -# define INI_SCNG(v) (ini_scanner_globals.v) -extern ZEND_API zend_scanner_globals ini_scanner_globals; -#endif - - -/* For limited downwards source compatibility */ -#define CLS_FETCH() -#define ELS_FETCH() -#define ALS_FETCH() -#define PLS_FETCH() -#define SLS_FETCH() -#define CLS_D -#define ELS_D -#define ALS_D -#define PLS_D -#define SLS_D -#define CLS_DC -#define ELS_DC -#define ALS_DC -#define PLS_DC -#define SLS_DC -#define CLS_C -#define ELS_C -#define ALS_C -#define PLS_C -#define SLS_C -#define CLS_CC -#define ELS_CC -#define ALS_CC -#define PLS_CC -#define SLS_CC - - -#endif /* ZEND_GLOBALS_MACROS_H */ - diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c deleted file mode 100644 index 7ef542c4dfe..00000000000 --- a/Zend/zend_hash.c +++ /dev/null @@ -1,1307 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" - -#include - -#ifdef HAVE_STDLIB_H -# include -#endif - -#define HANDLE_NUMERIC(key, length, func) { \ - register char *tmp=key; \ - \ - if ((*tmp>='0' && *tmp<='9')) do { /* possibly a numeric index */ \ - char *end=tmp+length-1; \ - ulong idx; \ - \ - if (*tmp++=='0' && length>2) { /* don't accept numbers with leading zeros */ \ - break; \ - } \ - while (tmp='0' && *tmp<='9')) { \ - break; \ - } \ - tmp++; \ - } \ - if (tmp==end && *tmp=='\0') { /* a numeric index */ \ - idx = strtol(key, NULL, 10); \ - if (idx!=LONG_MAX) { \ - return func; \ - } \ - } \ - } while (0); \ -} - - -#define CONNECT_TO_BUCKET_DLLIST(element, list_head) \ - (element)->pNext = (list_head); \ - (element)->pLast = NULL; \ - if ((element)->pNext) { \ - (element)->pNext->pLast = (element); \ - } - -#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \ - (element)->pListLast = (ht)->pListTail; \ - (ht)->pListTail = (element); \ - (element)->pListNext = NULL; \ - if ((element)->pListLast != NULL) { \ - (element)->pListLast->pListNext = (element); \ - } \ - if (!(ht)->pListHead) { \ - (ht)->pListHead = (element); \ - } \ - if ((ht)->pInternalPointer == NULL) { \ - (ht)->pInternalPointer = (element); \ - } - -#if ZEND_DEBUG -#define HT_OK 0 -#define HT_IS_DESTROYING 1 -#define HT_DESTROYED 2 -#define HT_CLEANING 3 - -static void _zend_is_inconsistent(HashTable *ht, char *file, int line) -{ - if (ht->inconsistent==HT_OK) { - return; - } - switch (ht->inconsistent) { - case HT_IS_DESTROYING: - zend_output_debug_string(1, "%s(%d) : ht=0x%08x is being destroyed", file, line, ht); - break; - case HT_DESTROYED: - zend_output_debug_string(1, "%s(%d) : ht=0x%08x is already destroyed", file, line, ht); - break; - case HT_CLEANING: - zend_output_debug_string(1, "%s(%d) : ht=0x%08x is being cleaned", file, line, ht); - break; - } - zend_bailout(); -} -#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__); -#define SET_INCONSISTENT(n) ht->inconsistent = n; -#else -#define IS_CONSISTENT(a) -#define SET_INCONSISTENT(n) -#endif - -#define HASH_PROTECT_RECURSION(ht) \ - if ((ht)->bApplyProtection) { \ - if ((ht)->nApplyCount++ >= 3) { \ - zend_error(E_ERROR, "Nesting level too deep - recursive dependency?"); \ - } \ - } - - -#define HASH_UNPROTECT_RECURSION(ht) \ - (ht)->nApplyCount--; - - -#define ZEND_HASH_IF_FULL_DO_RESIZE(ht) \ - if ((ht)->nNumOfElements > (ht)->nTableSize) { \ - zend_hash_do_resize(ht); \ - } - -static int zend_hash_do_resize(HashTable *ht); - -ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength) -{ - return zend_inline_hash_func(arKey, nKeyLength); -} - - -#define UPDATE_DATA(ht, p, pData, nDataSize) \ - if (nDataSize == sizeof(void*)) { \ - if (!(p)->pDataPtr) { \ - pefree((p)->pData, (ht)->persistent); \ - } \ - memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \ - (p)->pData = &(p)->pDataPtr; \ - } else { \ - if ((p)->pDataPtr) { \ - (p)->pData = (void *) pemalloc(nDataSize, (ht)->persistent); \ - (p)->pDataPtr=NULL; \ - } \ - memcpy((p)->pData, pData, nDataSize); \ - } - -#define INIT_DATA(ht, p, pData, nDataSize); \ - if (nDataSize == sizeof(void*)) { \ - memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \ - (p)->pData = &(p)->pDataPtr; \ - } else { \ - (p)->pData = (void *) pemalloc(nDataSize, (ht)->persistent); \ - if (!(p)->pData) { \ - pefree(p, (ht)->persistent); \ - return FAILURE; \ - } \ - memcpy((p)->pData, pData, nDataSize); \ - (p)->pDataPtr=NULL; \ - } - - -ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent) -{ - uint i = 3; - - SET_INCONSISTENT(HT_OK); - - while ((1U << i) < nSize) { - i++; - } - - ht->nTableSize = 1 << i; - ht->nTableMask = ht->nTableSize - 1; - - /* Uses ecalloc() so that Bucket* == NULL */ - ht->arBuckets = (Bucket **) pecalloc(ht->nTableSize, sizeof(Bucket *), persistent); - - if (!ht->arBuckets) { - return FAILURE; - } - - ht->pDestructor = pDestructor; - ht->pListHead = NULL; - ht->pListTail = NULL; - ht->nNumOfElements = 0; - ht->nNextFreeElement = 0; - ht->pInternalPointer = NULL; - ht->persistent = persistent; - ht->nApplyCount = 0; - ht->bApplyProtection = 1; - return SUCCESS; -} - - -ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection) -{ - int retval = zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent); - - ht->bApplyProtection = bApplyProtection; - return retval; -} - - -ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection) -{ - ht->bApplyProtection = bApplyProtection; -} - - - -ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag) -{ - ulong h; - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - if (nKeyLength <= 0) { -#if ZEND_DEBUG - ZEND_PUTS("zend_hash_update: Can't put in empty key\n"); -#endif - return FAILURE; - } - - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update_or_next_insert(ht, idx, pData, nDataSize, pDest, flag)); - - h = zend_inline_hash_func(arKey, nKeyLength); - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == nKeyLength)) { - if (!memcmp(p->arKey, arKey, nKeyLength)) { - if (flag & HASH_ADD) { - return FAILURE; - } - HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } - UPDATE_DATA(ht, p, pData, nDataSize); - if (pDest) { - *pDest = p->pData; - } - HANDLE_UNBLOCK_INTERRUPTIONS(); - return SUCCESS; - } - } - p = p->pNext; - } - - p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent); - if (!p) { - return FAILURE; - } - memcpy(p->arKey, arKey, nKeyLength); - p->nKeyLength = nKeyLength; - INIT_DATA(ht, p, pData, nDataSize); - p->h = h; - CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]); - if (pDest) { - *pDest = p->pData; - } - - HANDLE_BLOCK_INTERRUPTIONS(); - CONNECT_TO_GLOBAL_DLLIST(p, ht); - ht->arBuckets[nIndex] = p; - HANDLE_UNBLOCK_INTERRUPTIONS(); - - ht->nNumOfElements++; - ZEND_HASH_IF_FULL_DO_RESIZE(ht); /* If the Hash table is full, resize it */ - return SUCCESS; -} - -ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - if (nKeyLength <= 0) { -#if ZEND_DEBUG - ZEND_PUTS("zend_hash_update: Can't put in empty key\n"); -#endif - return FAILURE; - } - - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == nKeyLength)) { - if (!memcmp(p->arKey, arKey, nKeyLength)) { - if (flag & HASH_ADD) { - return FAILURE; - } - HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } - UPDATE_DATA(ht, p, pData, nDataSize); - if (pDest) { - *pDest = p->pData; - } - HANDLE_UNBLOCK_INTERRUPTIONS(); - return SUCCESS; - } - } - p = p->pNext; - } - - p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent); - if (!p) { - return FAILURE; - } - - memcpy(p->arKey, arKey, nKeyLength); - p->nKeyLength = nKeyLength; - INIT_DATA(ht, p, pData, nDataSize); - p->h = h; - - CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]); - - if (pDest) { - *pDest = p->pData; - } - - HANDLE_BLOCK_INTERRUPTIONS(); - ht->arBuckets[nIndex] = p; - CONNECT_TO_GLOBAL_DLLIST(p, ht); - HANDLE_UNBLOCK_INTERRUPTIONS(); - - ht->nNumOfElements++; - ZEND_HASH_IF_FULL_DO_RESIZE(ht); /* If the Hash table is full, resize it */ - return SUCCESS; -} - - -ZEND_API int zend_hash_add_empty_element(HashTable *ht, char *arKey, uint nKeyLength) -{ - void *dummy = (void *) 1; - - return zend_hash_add(ht, arKey, nKeyLength, &dummy, sizeof(void *), NULL); -} - - -ZEND_API int zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - if (flag & HASH_NEXT_INSERT) { - h = ht->nNextFreeElement; - } - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->nKeyLength == 0) && (p->h == h)) { - if (flag & HASH_NEXT_INSERT || flag & HASH_ADD) { - return FAILURE; - } - HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_index_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } - UPDATE_DATA(ht, p, pData, nDataSize); - HANDLE_UNBLOCK_INTERRUPTIONS(); - if (h >= ht->nNextFreeElement) { - ht->nNextFreeElement = h + 1; - } - if (pDest) { - *pDest = p->pData; - } - return SUCCESS; - } - p = p->pNext; - } - p = (Bucket *) pemalloc(sizeof(Bucket)-1, ht->persistent); - if (!p) { - return FAILURE; - } - p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */ - p->h = h; - INIT_DATA(ht, p, pData, nDataSize); - if (pDest) { - *pDest = p->pData; - } - - CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]); - - HANDLE_BLOCK_INTERRUPTIONS(); - ht->arBuckets[nIndex] = p; - CONNECT_TO_GLOBAL_DLLIST(p, ht); - HANDLE_UNBLOCK_INTERRUPTIONS(); - - if (h >= ht->nNextFreeElement) { - ht->nNextFreeElement = h + 1; - } - ht->nNumOfElements++; - ZEND_HASH_IF_FULL_DO_RESIZE(ht); - return SUCCESS; -} - - -static int zend_hash_do_resize(HashTable *ht) -{ - Bucket **t; - - IS_CONSISTENT(ht); - - if ((ht->nTableSize << 1) > 0) { /* Let's double the table size */ - t = (Bucket **) perealloc_recoverable(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent); - if (t) { - HANDLE_BLOCK_INTERRUPTIONS(); - ht->arBuckets = t; - ht->nTableSize = (ht->nTableSize << 1); - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return SUCCESS; - } - return FAILURE; - } - return SUCCESS; -} - -ZEND_API int zend_hash_rehash(HashTable *ht) -{ - Bucket *p; - uint nIndex; - - IS_CONSISTENT(ht); - - memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *)); - p = ht->pListHead; - while (p != NULL) { - nIndex = p->h & ht->nTableMask; - CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]); - ht->arBuckets[nIndex] = p; - p = p->pListNext; - } - return SUCCESS; -} - -ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - if (flag == HASH_DEL_KEY) { - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_del_key_or_index(ht, arKey, nKeyLength, idx, HASH_DEL_INDEX)); - h = zend_inline_hash_func(arKey, nKeyLength); - } - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && ((p->nKeyLength == 0) || /* Numeric index */ - ((p->nKeyLength == nKeyLength) && (!memcmp(p->arKey, arKey, nKeyLength))))) { - HANDLE_BLOCK_INTERRUPTIONS(); - if (p == ht->arBuckets[nIndex]) { - ht->arBuckets[nIndex] = p->pNext; - } else { - p->pLast->pNext = p->pNext; - } - if (p->pNext) { - p->pNext->pLast = p->pLast; - } - if (p->pListLast != NULL) { - p->pListLast->pListNext = p->pListNext; - } else { - /* Deleting the head of the list */ - ht->pListHead = p->pListNext; - } - if (p->pListNext != NULL) { - p->pListNext->pListLast = p->pListLast; - } else { - ht->pListTail = p->pListLast; - } - if (ht->pInternalPointer == p) { - ht->pInternalPointer = p->pListNext; - } - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } - if (!p->pDataPtr) { - pefree(p->pData, ht->persistent); - } - pefree(p, ht->persistent); - HANDLE_UNBLOCK_INTERRUPTIONS(); - ht->nNumOfElements--; - return SUCCESS; - } - p = p->pNext; - } - return FAILURE; -} - - -ZEND_API void zend_hash_destroy(HashTable *ht) -{ - Bucket *p, *q; - - IS_CONSISTENT(ht); - - SET_INCONSISTENT(HT_IS_DESTROYING); - - p = ht->pListHead; - while (p != NULL) { - q = p; - p = p->pListNext; - if (ht->pDestructor) { - ht->pDestructor(q->pData); - } - if (!q->pDataPtr && q->pData) { - pefree(q->pData, ht->persistent); - } - pefree(q, ht->persistent); - } - pefree(ht->arBuckets, ht->persistent); - - SET_INCONSISTENT(HT_DESTROYED); -} - - -ZEND_API void zend_hash_clean(HashTable *ht) -{ - Bucket *p, *q; - - IS_CONSISTENT(ht); - - SET_INCONSISTENT(HT_CLEANING); - - p = ht->pListHead; - while (p != NULL) { - q = p; - p = p->pListNext; - if (ht->pDestructor) { - ht->pDestructor(q->pData); - } - if (!q->pDataPtr && q->pData) { - pefree(q->pData, ht->persistent); - } - pefree(q, ht->persistent); - } - memset(ht->arBuckets, 0, ht->nTableSize*sizeof(Bucket *)); - ht->pListHead = NULL; - ht->pListTail = NULL; - ht->nNumOfElements = 0; - ht->nNextFreeElement = 0; - ht->pInternalPointer = NULL; - - SET_INCONSISTENT(HT_OK); -} - -/* This function is used by the various apply() functions. - * It deletes the passed bucket, and returns the address of the - * next bucket. The hash *may* be altered during that time, the - * returned value will still be valid. - */ -static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p) -{ - Bucket *retval; - - HANDLE_BLOCK_INTERRUPTIONS(); - - if (ht->pDestructor) { - ht->pDestructor(p->pData); - } - if (!p->pDataPtr) { - pefree(p->pData, ht->persistent); - } - retval = p->pListNext; - - if (p->pLast) { - p->pLast->pNext = p->pNext; - } else { - uint nIndex; - - nIndex = p->h & ht->nTableMask; - ht->arBuckets[nIndex] = p->pNext; - } - if (p->pNext) { - p->pNext->pLast = p->pLast; - } else { - /* Nothing to do as this list doesn't have a tail */ - } - - if (p->pListLast != NULL) { - p->pListLast->pListNext = p->pListNext; - } else { - /* Deleting the head of the list */ - ht->pListHead = p->pListNext; - } - if (p->pListNext != NULL) { - p->pListNext->pListLast = p->pListLast; - } else { - ht->pListTail = p->pListLast; - } - if (ht->pInternalPointer == p) { - ht->pInternalPointer = p->pListNext; - } - pefree(p, ht->persistent); - HANDLE_UNBLOCK_INTERRUPTIONS(); - ht->nNumOfElements--; - - return retval; -} - - -ZEND_API void zend_hash_graceful_destroy(HashTable *ht) -{ - Bucket *p; - - IS_CONSISTENT(ht); - - p = ht->pListHead; - while (p != NULL) { - p = zend_hash_apply_deleter(ht, p); - } - pefree(ht->arBuckets, ht->persistent); - - SET_INCONSISTENT(HT_DESTROYED); -} - -/* This is used to selectively delete certain entries from a hashtable. - * destruct() receives the data and decides if the entry should be deleted - * or not - */ - - -ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - Bucket *p; - - IS_CONSISTENT(ht); - - HASH_PROTECT_RECURSION(ht); - p = ht->pListHead; - while (p != NULL) { - if (apply_func(p->pData TSRMLS_CC)) { - p = zend_hash_apply_deleter(ht, p); - } else { - p = p->pListNext; - } - } - HASH_UNPROTECT_RECURSION(ht); -} - - -ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC) -{ - Bucket *p; - - IS_CONSISTENT(ht); - - HASH_PROTECT_RECURSION(ht); - p = ht->pListHead; - while (p != NULL) { - if (apply_func(p->pData, argument TSRMLS_CC)) { - p = zend_hash_apply_deleter(ht, p); - } else { - p = p->pListNext; - } - } - HASH_UNPROTECT_RECURSION(ht); -} - - -ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t destruct, int num_args, ...) -{ - Bucket *p; - va_list args; - zend_hash_key hash_key; - - IS_CONSISTENT(ht); - - HASH_PROTECT_RECURSION(ht); - - va_start(args, num_args); - p = ht->pListHead; - while (p != NULL) { - hash_key.arKey = p->arKey; - hash_key.nKeyLength = p->nKeyLength; - hash_key.h = p->h; - if (destruct(p->pData, num_args, args, &hash_key)) { - p = zend_hash_apply_deleter(ht, p); - } else { - p = p->pListNext; - } - } - va_end(args); - - HASH_UNPROTECT_RECURSION(ht); -} - - -ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - Bucket *p, *q; - - IS_CONSISTENT(ht); - - HASH_PROTECT_RECURSION(ht); - p = ht->pListTail; - while (p != NULL) { - int result = apply_func(p->pData TSRMLS_CC); - - q = p; - p = p->pListLast; - if (result & ZEND_HASH_APPLY_REMOVE) { - if (q->nKeyLength>0) { - zend_hash_del(ht, q->arKey, q->nKeyLength); - } else { - zend_hash_index_del(ht, q->h); - } - } - if (result & ZEND_HASH_APPLY_STOP) { - break; - } - } - HASH_UNPROTECT_RECURSION(ht); -} - - -ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) -{ - Bucket *p; - void *new_entry; - - IS_CONSISTENT(source); - IS_CONSISTENT(target); - - p = source->pListHead; - while (p) { - if (p->nKeyLength) { - zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &new_entry); - } else { - zend_hash_index_update(target, p->h, p->pData, size, &new_entry); - } - if (pCopyConstructor) { - pCopyConstructor(new_entry); - } - p = p->pListNext; - } - target->pInternalPointer = target->pListHead; -} - - -ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite) -{ - Bucket *p; - void *t; - int mode = (overwrite?HASH_UPDATE:HASH_ADD); - - IS_CONSISTENT(source); - IS_CONSISTENT(target); - - p = source->pListHead; - while (p) { - if (p->nKeyLength>0) { - if (zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode)==SUCCESS && pCopyConstructor) { - pCopyConstructor(t); - } - } else { - if ((mode==HASH_UPDATE || !zend_hash_index_exists(target, p->h)) && zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { - pCopyConstructor(t); - } - } - p = p->pListNext; - } - target->pInternalPointer = target->pListHead; -} - - -ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new)) -{ - Bucket *p; - void *t; - void *pOrig; - - IS_CONSISTENT(source); - IS_CONSISTENT(target); - - p = source->pListHead; - while (p) { - if (p->nKeyLength>0) { - if (zend_hash_find(target, p->arKey, p->nKeyLength, &pOrig)==FAILURE - || pReplaceOrig(pOrig, p->pData)) { - if (zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &t)==SUCCESS && pCopyConstructor) { - pCopyConstructor(t); - } - } - } else { - if (zend_hash_index_find(target, p->h, &pOrig)==FAILURE - || pReplaceOrig(pOrig, p->pData)) { - if (zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { - pCopyConstructor(t); - } - } - } - p = p->pListNext; - } - target->pInternalPointer = target->pListHead; -} - - -ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength) -{ - IS_CONSISTENT(ht); - - return zend_inline_hash_func(arKey, nKeyLength); -} - - -/* Returns SUCCESS if found and FAILURE if not. The pointer to the - * data is returned in pData. The reason is that there's no reason - * someone using the hash table might not want to have NULL data - */ -ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData) -{ - ulong h; - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData)); - - h = zend_inline_hash_func(arKey, nKeyLength); - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == nKeyLength)) { - if (!memcmp(p->arKey, arKey, nKeyLength)) { - *pData = p->pData; - return SUCCESS; - } - } - p = p->pNext; - } - return FAILURE; -} - - -ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == nKeyLength)) { - if (!memcmp(p->arKey, arKey, nKeyLength)) { - *pData = p->pData; - return SUCCESS; - } - } - p = p->pNext; - } - return FAILURE; -} - - -ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength) -{ - ulong h; - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx)); - - h = zend_inline_hash_func(arKey, nKeyLength); - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == nKeyLength)) { - if (!memcmp(p->arKey, arKey, nKeyLength)) { - return 1; - } - } - p = p->pNext; - } - return 0; -} - - -ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == 0)) { - *pData = p->pData; - return SUCCESS; - } - p = p->pNext; - } - return FAILURE; -} - - -ZEND_API int zend_hash_index_exists(HashTable *ht, ulong h) -{ - uint nIndex; - Bucket *p; - - IS_CONSISTENT(ht); - - nIndex = h & ht->nTableMask; - - p = ht->arBuckets[nIndex]; - while (p != NULL) { - if ((p->h == h) && (p->nKeyLength == 0)) { - return 1; - } - p = p->pNext; - } - return 0; -} - - -ZEND_API int zend_hash_num_elements(HashTable *ht) -{ - IS_CONSISTENT(ht); - - return ht->nNumOfElements; -} - - -ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos) -{ - IS_CONSISTENT(ht); - - if (pos) - *pos = ht->pListHead; - else - ht->pInternalPointer = ht->pListHead; -} - - -/* This function will be extremely optimized by remembering - * the end of the list - */ -ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos) -{ - IS_CONSISTENT(ht); - - if (pos) - *pos = ht->pListTail; - else - ht->pInternalPointer = ht->pListTail; -} - - -ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos) -{ - HashPosition *current = pos ? pos : &ht->pInternalPointer; - - IS_CONSISTENT(ht); - - if (*current) { - *current = (*current)->pListNext; - return SUCCESS; - } else - return FAILURE; -} - -ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos) -{ - HashPosition *current = pos ? pos : &ht->pInternalPointer; - - IS_CONSISTENT(ht); - - if (*current) { - *current = (*current)->pListLast; - return SUCCESS; - } else - return FAILURE; -} - - -/* This function should be made binary safe */ -ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos) -{ - Bucket *p; - - p = pos ? (*pos) : ht->pInternalPointer; - - IS_CONSISTENT(ht); - - if (p) { - if (p->nKeyLength) { - if (duplicate) { - *str_index = estrndup(p->arKey, p->nKeyLength); - } else { - *str_index = p->arKey; - } - if (str_length) { - *str_length = p->nKeyLength; - } - return HASH_KEY_IS_STRING; - } else { - *num_index = p->h; - return HASH_KEY_IS_LONG; - } - } - return HASH_KEY_NON_EXISTANT; -} - - -ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos) -{ - Bucket *p; - - p = pos ? (*pos) : ht->pInternalPointer; - - IS_CONSISTENT(ht); - - if (p) { - if (p->nKeyLength) { - return HASH_KEY_IS_STRING; - } else { - return HASH_KEY_IS_LONG; - } - } - return HASH_KEY_NON_EXISTANT; -} - - -ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos) -{ - Bucket *p; - - p = pos ? (*pos) : ht->pInternalPointer; - - IS_CONSISTENT(ht); - - if (p) { - *pData = p->pData; - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, - compare_func_t compar, int renumber TSRMLS_DC) -{ - Bucket **arTmp; - Bucket *p; - int i, j; - - IS_CONSISTENT(ht); - - if (ht->nNumOfElements <= 1) { /* Doesn't require sorting */ - return SUCCESS; - } - arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent); - if (!arTmp) { - return FAILURE; - } - p = ht->pListHead; - i = 0; - while (p) { - arTmp[i] = p; - p = p->pListNext; - i++; - } - - (*sort_func)((void *) arTmp, i, sizeof(Bucket *), compar TSRMLS_CC); - - HANDLE_BLOCK_INTERRUPTIONS(); - ht->pListHead = arTmp[0]; - ht->pListTail = NULL; - ht->pInternalPointer = ht->pListHead; - - for (j = 0; j < i; j++) { - if (ht->pListTail) { - ht->pListTail->pListNext = arTmp[j]; - } - arTmp[j]->pListLast = ht->pListTail; - arTmp[j]->pListNext = NULL; - ht->pListTail = arTmp[j]; - } - pefree(arTmp, ht->persistent); - HANDLE_UNBLOCK_INTERRUPTIONS(); - - if (renumber) { - p = ht->pListHead; - i=0; - while (p != NULL) { - p->nKeyLength = 0; - p->h = i++; - p = p->pListNext; - } - ht->nNextFreeElement = i; - zend_hash_rehash(ht); - } - return SUCCESS; -} - - -ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) -{ - Bucket *p1, *p2; - int result; - void *pData2; - - IS_CONSISTENT(ht1); - IS_CONSISTENT(ht2); - - HASH_PROTECT_RECURSION(ht1); - HASH_PROTECT_RECURSION(ht2); - - result = ht1->nNumOfElements - ht2->nNumOfElements; - if (result!=0) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return result; - } - - p1 = ht1->pListHead; - if (ordered) { - p2 = ht2->pListHead; - } - - while (p1) { - if (ordered && !p2) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return 1; /* That's not supposed to happen */ - } - if (ordered) { - if (p1->nKeyLength==0 && p2->nKeyLength==0) { /* numeric indices */ - result = p1->h - p2->h; - if (result!=0) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return result; - } - } else { /* string indices */ - result = p1->nKeyLength - p2->nKeyLength; - if (result!=0) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return result; - } - result = memcmp(p1->arKey, p2->arKey, p1->nKeyLength); - if (result!=0) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return result; - } - } - pData2 = p2->pData; - } else { - if (p1->nKeyLength==0) { /* numeric index */ - if (zend_hash_index_find(ht2, p1->h, &pData2)==FAILURE) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return 1; - } - } else { /* string index */ - if (zend_hash_find(ht2, p1->arKey, p1->nKeyLength, &pData2)==FAILURE) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return 1; - } - } - } - result = compar(p1->pData, pData2 TSRMLS_CC); - if (result!=0) { - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return result; - } - p1 = p1->pListNext; - if (ordered) { - p2 = p2->pListNext; - } - } - - HASH_UNPROTECT_RECURSION(ht1); - HASH_UNPROTECT_RECURSION(ht2); - return 0; -} - - -ZEND_API int zend_hash_minmax(HashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC) -{ - Bucket *p, *res; - - IS_CONSISTENT(ht); - - if (ht->nNumOfElements == 0 ) { - *pData=NULL; - return FAILURE; - } - - res = p = ht->pListHead; - while ((p = p->pListNext)) { - if (flag) { - if (compar(&res, &p TSRMLS_CC) < 0) { /* max */ - res = p; - } - } else { - if (compar(&res, &p TSRMLS_CC) > 0) { /* min */ - res = p; - } - } - } - *pData = res->pData; - return SUCCESS; -} - -ZEND_API ulong zend_hash_next_free_element(HashTable *ht) -{ - IS_CONSISTENT(ht); - - return ht->nNextFreeElement; - -} - - -#if ZEND_DEBUG -void zend_hash_display_pListTail(HashTable *ht) -{ - Bucket *p; - - p = ht->pListTail; - while (p != NULL) { - zend_output_debug_string(0, "pListTail has key %s\n", p->arKey); - p = p->pListLast; - } -} - -void zend_hash_display(HashTable *ht) -{ - Bucket *p; - uint i; - - for (i = 0; i < ht->nTableSize; i++) { - p = ht->arBuckets[i]; - while (p != NULL) { - zend_output_debug_string(0, "%s <==> 0x%X\n", p->arKey, p->h); - p = p->pNext; - } - } - - p = ht->pListTail; - while (p != NULL) { - zend_output_debug_string(0, "%s <==> 0x%X\n", p->arKey, p->h); - p = p->pListLast; - } -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h deleted file mode 100644 index 85a9b9a48fd..00000000000 --- a/Zend/zend_hash.h +++ /dev/null @@ -1,219 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#ifndef ZEND_HASH_H -#define ZEND_HASH_H - -#include - -#define HASH_KEY_IS_STRING 1 -#define HASH_KEY_IS_LONG 2 -#define HASH_KEY_NON_EXISTANT 3 - -#define HASH_UPDATE (1<<0) -#define HASH_ADD (1<<1) -#define HASH_NEXT_INSERT (1<<2) - -#define HASH_DEL_KEY 0 -#define HASH_DEL_INDEX 1 - -typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength); -typedef int (*compare_func_t)(const void *, const void * TSRMLS_DC); -typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t TSRMLS_DC); -typedef void (*dtor_func_t)(void *pDest); -typedef void (*copy_ctor_func_t)(void *pElement); - -struct _hashtable; - -typedef struct bucket { - ulong h; /* Used for numeric indexing */ - uint nKeyLength; - void *pData; - void *pDataPtr; - struct bucket *pListNext; - struct bucket *pListLast; - struct bucket *pNext; - struct bucket *pLast; - char arKey[1]; /* Must be last element */ -} Bucket; - -typedef struct _hashtable { - uint nTableSize; - uint nTableMask; - uint nNumOfElements; - ulong nNextFreeElement; - Bucket *pInternalPointer; /* Used for element traversal */ - Bucket *pListHead; - Bucket *pListTail; - Bucket **arBuckets; - dtor_func_t pDestructor; - zend_bool persistent; - unsigned char nApplyCount; - zend_bool bApplyProtection; -#if ZEND_DEBUG - int inconsistent; -#endif -} HashTable; - -typedef Bucket* HashPosition; - -BEGIN_EXTERN_C() - -/* startup/shutdown */ -ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent); -ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection); -ZEND_API void zend_hash_destroy(HashTable *ht); -ZEND_API void zend_hash_clean(HashTable *ht); - -/* additions/updates/changes */ -ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag); -#define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE) -#define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD) - -ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag); -#define zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE) -#define zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD) - -ZEND_API int zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag); -#define zend_hash_index_update(ht, h, pData, nDataSize, pDest) \ - zend_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE) -#define zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \ - zend_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT) - -ZEND_API int zend_hash_add_empty_element(HashTable *ht, char *arKey, uint nKeyLength); - - -#define ZEND_HASH_APPLY_KEEP 0 -#define ZEND_HASH_APPLY_REMOVE 1<<0 -#define ZEND_HASH_APPLY_STOP 1<<1 - -typedef struct _zend_hash_key { - char *arKey; - uint nKeyLength; - ulong h; -} zend_hash_key; - - -typedef int (*apply_func_t)(void *pDest TSRMLS_DC); -typedef int (*apply_func_arg_t)(void *pDest, void *argument TSRMLS_DC); -typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); - -ZEND_API void zend_hash_graceful_destroy(HashTable *ht); -ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC); -ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC); -ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...); - -/* This function should be used with special care (in other words, - * it should usually not be used). When used with the ZEND_HASH_APPLY_STOP - * return value, it assumes things about the order of the elements in the hash. - * Also, it does not provide the same kind of reentrancy protection that - * the standard apply functions do. - */ -ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC); - - -/* Deletes */ -ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); -#define zend_hash_del(ht, arKey, nKeyLength) \ - zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) -#define zend_hash_index_del(ht, h) \ - zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) - -ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength); - -/* Data retreival */ -ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData); -ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData); -ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData); - -/* Misc */ -ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength); -ZEND_API int zend_hash_index_exists(HashTable *ht, ulong h); -ZEND_API ulong zend_hash_next_free_element(HashTable *ht); - -/* traversing */ -ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos); -ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos); -ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos); -ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos); -ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos); -ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos); -ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos); - -#define zend_hash_move_forward(ht) \ - zend_hash_move_forward_ex(ht, NULL) -#define zend_hash_move_backwards(ht) \ - zend_hash_move_backwards_ex(ht, NULL) -#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \ - zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, duplicate, NULL) -#define zend_hash_get_current_key_type(ht) \ - zend_hash_get_current_key_type_ex(ht, NULL) -#define zend_hash_get_current_data(ht, pData) \ - zend_hash_get_current_data_ex(ht, pData, NULL) -#define zend_hash_internal_pointer_reset(ht) \ - zend_hash_internal_pointer_reset_ex(ht, NULL) -#define zend_hash_internal_pointer_end(ht) \ - zend_hash_internal_pointer_end_ex(ht, NULL) - -/* Copying, merging and sorting */ -ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size); -ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite); -ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new)); -ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC); -ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC); -ZEND_API int zend_hash_minmax(HashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC); - -ZEND_API int zend_hash_num_elements(HashTable *ht); - -ZEND_API int zend_hash_rehash(HashTable *ht); - -static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength) -{ - ulong h = 5381; - char *arEnd = arKey + nKeyLength; - - while (arKey < arEnd) { - h += (h << 5); - h ^= (ulong) *arKey++; - } - return h; -} - -ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength); - -#if ZEND_DEBUG -/* debug */ -void zend_hash_display_pListTail(HashTable *ht); -void zend_hash_display(HashTable *ht); -#endif - -END_EXTERN_C() - -#define ZEND_INIT_SYMTABLE(ht) \ - ZEND_INIT_SYMTABLE_EX(ht, 2, 0) - -#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ - zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) - - -#endif /* ZEND_HASH_H */ diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c deleted file mode 100644 index 276d8f81fba..00000000000 --- a/Zend/zend_highlight.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_language_parser.h" -#include "zend_compile.h" -#include "zend_highlight.h" -#include "zend_ptr_stack.h" -#include "zend_globals.h" - -ZEND_API void zend_html_putc(char c) -{ - switch (c) { - case '\n': - ZEND_PUTS("
"); - break; - case '<': - ZEND_PUTS("<"); - break; - case '>': - ZEND_PUTS(">"); - break; - case '&': - ZEND_PUTS("&"); - break; - case ' ': - ZEND_PUTS(" "); - break; - case '\t': - ZEND_PUTS("    "); - break; - default: - ZEND_PUTC(c); - break; - } -} - - -ZEND_API void zend_html_puts(char *s, uint len) -{ - register char *ptr=s, *end=s+len; - - while (ptr1 - && !(((ptr+1)>=end) || (*(ptr+1)==' ')) /* next is not a space */ - && !((ptr==s) || (*(ptr-1)==' '))) /* last is not a space */ { - char c = *ptr++; - - ZEND_PUTC(c); - continue; - } - zend_html_putc(*ptr++); - } -} - - - -ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) -{ - zval token; - int token_type; - char *last_color = syntax_highlighter_ini->highlight_html; - char *next_color; - int in_string=0; - - zend_printf(""); - zend_printf("\n", last_color); - /* highlight stuff coming back from zendlex() */ - token.type = 0; - while ((token_type=lex_scan(&token TSRMLS_CC))) { - switch (token_type) { - case T_INLINE_HTML: - next_color = syntax_highlighter_ini->highlight_html; - break; - case T_COMMENT: - next_color = syntax_highlighter_ini->highlight_comment; - break; - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - next_color = syntax_highlighter_ini->highlight_default; - break; - case T_CLOSE_TAG: - next_color = syntax_highlighter_ini->highlight_default; - break; - case T_CONSTANT_ENCAPSED_STRING: - next_color = syntax_highlighter_ini->highlight_string; - break; - case '"': - next_color = syntax_highlighter_ini->highlight_string; - in_string = !in_string; - break; - case T_WHITESPACE: - zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); /* no color needed */ - token.type = 0; - continue; - break; - default: - if (token.type==0) { - next_color = syntax_highlighter_ini->highlight_keyword; - } else { - if (in_string) { - next_color = syntax_highlighter_ini->highlight_string; - } else { - next_color = syntax_highlighter_ini->highlight_default; - } - } - break; - } - - if (last_color != next_color) { - if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf(""); - } - last_color = next_color; - if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf("", last_color); - } - } - switch (token_type) { - case T_END_HEREDOC: - zend_html_puts(token.value.str.val, token.value.str.len); - break; - default: - zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - break; - } - - if (token.type == IS_STRING) { - switch (token_type) { - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_CLOSE_TAG: - case T_WHITESPACE: - case T_COMMENT: - break; - default: - efree(token.value.str.val); - break; - } - } else if (token_type == T_END_HEREDOC) { - zend_bool has_semicolon=(strchr(token.value.str.val, ';')?1:0); - - efree(token.value.str.val); - if (has_semicolon) { - /* the following semicolon was unput(), ignore it */ - lex_scan(&token TSRMLS_CC); - } - } - token.type = 0; - } - if (last_color != syntax_highlighter_ini->highlight_html) { - zend_printf("\n"); - } - zend_printf("\n"); - zend_printf(""); -} - - - -ZEND_API void zend_strip(TSRMLS_D) -{ - zval token; - int token_type; - - token.type = 0; - while ((token_type=lex_scan(&token TSRMLS_CC))) { - switch (token_type) { - case T_COMMENT: - token.type = 0; - break; - - case T_WHITESPACE: - if (token.type) { - putchar(' '); - token.type = 0; - } - continue; - } - - switch (token_type) { - case 349: - break; - - default: { - char c, *ptr=LANG_SCNG(yy_text), *end=LANG_SCNG(yy_text)+LANG_SCNG(yy_leng); - while (ptr | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_HIGHLIGHT_H -#define ZEND_HIGHLIGHT_H - -#define HL_COMMENT_COLOR "#FF8000" /* orange */ -#define HL_DEFAULT_COLOR "#0000BB" /* blue */ -#define HL_HTML_COLOR "#000000" /* black */ -#define HL_STRING_COLOR "#DD0000" /* red */ -#define HL_BG_COLOR "#FFFFFF" /* white */ -#define HL_KEYWORD_COLOR "#007700" /* green */ - - -typedef struct _zend_syntax_highlighter_ini { - char *highlight_html; - char *highlight_comment; - char *highlight_default; - char *highlight_string; - char *highlight_keyword; -} zend_syntax_highlighter_ini; - - -BEGIN_EXTERN_C() -ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API void zend_strip(TSRMLS_D); -ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC); -ZEND_API void zend_html_putc(char c); -ZEND_API void zend_html_puts(char *s, uint len); -END_EXTERN_C() - -extern zend_syntax_highlighter_ini syntax_highlighter_ini; - -#endif diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c deleted file mode 100644 index 71f1fb70775..00000000000 --- a/Zend/zend_indent.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -/* This indenter doesn't really work, it's here for no particular reason. */ - - -#include "zend.h" -#include "zend_language_parser.h" -#include "zend_compile.h" -#include "zend_indent.h" - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) - - -static void handle_whitespace(int *emit_whitespace) -{ - unsigned char c; - int i; - - for (c=0; c<128; c++) { - if (emit_whitespace[c]>0) { - for (i=0; i0) { - ZEND_PUTS(" {\n"); - memset(emit_whitespace, 0, sizeof(int)*256); - } else { - ZEND_PUTS("{"); - } - break; - case '}': - nest_level--; - if (emit_whitespace['\n']==0) { - ZEND_PUTS("\n"); - } - for (i=0; i0) { - for (i=0; i | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_INDENT_H -#define ZEND_INDENT_H - -ZEND_API void zend_indent(void); - -#endif /* ZEND_INDENT_H */ diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c deleted file mode 100644 index e15ab704c3f..00000000000 --- a/Zend/zend_ini.c +++ /dev/null @@ -1,487 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include - -#include "zend.h" -#include "zend_qsort.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_alloc.h" -#include "zend_operators.h" - -static HashTable *registered_zend_ini_directives; - - -/* - * hash_apply functions - */ -static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) -{ - if (ini_entry->module_number == *module_number) { - return 1; - } else { - return 0; - } -} - - -static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) -{ - if (ini_entry->modified) { - if (ini_entry->on_modify) { - ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC); - } - efree(ini_entry->value); - ini_entry->value = ini_entry->orig_value; - ini_entry->value_length = ini_entry->orig_value_length; - ini_entry->modified = 0; - ini_entry->orig_value = NULL; - ini_entry->orig_value_length = 0; - } - return 0; -} - -/* - * Startup / shutdown - */ -ZEND_API int zend_ini_startup(TSRMLS_D) -{ - registered_zend_ini_directives = &EG(ini_directives); - if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int zend_ini_shutdown(TSRMLS_D) -{ - zend_hash_destroy(&EG(ini_directives)); - return SUCCESS; -} - - -ZEND_API int zend_ini_deactivate(TSRMLS_D) -{ - zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); - return SUCCESS; -} - - -ZEND_API int zend_copy_ini_directives(TSRMLS_D) -{ - zend_ini_entry ini_entry; - - if (zend_hash_init_ex(&EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - zend_hash_copy(&EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); - zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC); - return SUCCESS; -} - - -static int ini_key_compare(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f; - Bucket *s; - - f = *((Bucket **) a); - s = *((Bucket **) b); - - if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */ - return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength); - } else if (f->nKeyLength==0) { /* f is numeric, s is not */ - return -1; - } else if (s->nKeyLength==0) { /* s is numeric, f is not */ - return 1; - } else { /* both strings */ - return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength); - } -} - - -ZEND_API void zend_ini_sort_entries(TSRMLS_D) -{ - zend_hash_sort(&EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC); -} - -/* - * Registration / unregistration - */ - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) -{ - zend_ini_entry *p = ini_entry; - zend_ini_entry *hashed_ini_entry; - zval default_value; - - while (p->name) { - p->module_number = module_number; - if (zend_hash_add(registered_zend_ini_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) { - zend_unregister_ini_entries(module_number TSRMLS_CC); - return FAILURE; - } - if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) { - if (!hashed_ini_entry->on_modify - || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) { - hashed_ini_entry->value = default_value.value.str.val; - hashed_ini_entry->value_length = default_value.value.str.len; - } - } else { - if (hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); - } - } - p++; - } - return SUCCESS; -} - - -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC); -} - - -static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) -{ - if (p->on_modify) { - p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC); - } - return 0; -} - - -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) -{ - zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC); -} - - -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) -{ - zend_ini_entry *ini_entry; - char *duplicate; - TSRMLS_FETCH(); - - if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - if (!(ini_entry->modifyable & modify_type)) { - return FAILURE; - } - - duplicate = estrndup(new_value, new_value_length); - - if (!ini_entry->on_modify - || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) { - if (!ini_entry->modified) { - ini_entry->orig_value = ini_entry->value; - ini_entry->orig_value_length = ini_entry->value_length; - } else { /* we already changed the value, free the changed value */ - efree(ini_entry->value); - } - ini_entry->value = duplicate; - ini_entry->value_length = new_value_length; - ini_entry->modified = 1; - } else { - efree(duplicate); - } - - return SUCCESS; -} - - -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC); - return SUCCESS; -} - - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) -{ - zend_ini_entry *ini_entry; - - if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - ini_entry->displayer = displayer; - return SUCCESS; -} - - - -/* - * Data retrieval - */ - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0); - } else if (ini_entry->value) { - return strtol(ini_entry->value, NULL, 0); - } - } - - return 0; -} - - -ZEND_API double zend_ini_double(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (double) (ini_entry->orig_value ? strtod(ini_entry->orig_value, NULL) : 0.0); - } else if (ini_entry->value) { - return (double) strtod(ini_entry->value, NULL); - } - } - - return 0.0; -} - - -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return ini_entry->orig_value; - } else { - return ini_entry->value; - } - } - - return ""; -} - - -static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - } else { - display_string = "no value"; - display_string_length = sizeof("no value")-1; - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - } else { - display_string = "no value"; - display_string_length = sizeof("no value")-1; - } - ZEND_WRITE(display_string, display_string_length); - } -} - - -ZEND_INI_DISP(zend_ini_boolean_displayer_cb) -{ - int value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = (ini_entry->orig_value ? atoi(ini_entry->orig_value) : 0); - } else if (ini_entry->value) { - value = atoi(ini_entry->value); - } else { - value = 0; - } - if (value) { - ZEND_PUTS("On"); - } else { - ZEND_PUTS("Off"); - } -} - - -ZEND_INI_DISP(zend_ini_color_displayer_cb) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - if (value) { - zend_printf("%s", value, value); - } else { - ZEND_PUTS("no value;"); - } -} - - -ZEND_INI_DISP(display_link_numbers) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value)==-1) { - ZEND_PUTS("Unlimited"); - } else { - zend_printf("%s", value); - } - } -} - - -/* Standard message handlers */ - -ZEND_API ZEND_INI_MH(OnUpdateBool) -{ - zend_bool *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (zend_bool *) (base+(size_t) mh_arg1); - - *p = (zend_bool) atoi(new_value); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateInt) -{ - long *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (long *) (base+(size_t) mh_arg1); - - *p = zend_atoi(new_value, new_value_length); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateReal) -{ - double *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (double *) (base+(size_t) mh_arg1); - - *p = strtod(new_value, NULL); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateString) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - if (new_value && !new_value[0]) { - return FAILURE; - } - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h deleted file mode 100644 index b1317a48c41..00000000000 --- a/Zend/zend_ini.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_INI_H -#define ZEND_INI_H - -#define ZEND_INI_USER (1<<0) -#define ZEND_INI_PERDIR (1<<1) -#define ZEND_INI_SYSTEM (1<<2) - -#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) - -#ifndef XtOffsetOf -# if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -# ifdef __STDC__ -# define XtOffset(p_type, field) _Offsetof(p_type, field) -# else -# ifdef CRAY2 -# define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -# else /* !CRAY2 */ - -# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -# endif /* !CRAY2 */ -# endif /* __STDC__ */ -# else /* ! (CRAY || __arm) */ - -# define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -# endif /* !CRAY */ - -# ifdef offsetof -# define XtOffsetOf(s_type, field) offsetof(s_type, field) -# else -# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -# endif - -#endif - -typedef struct _zend_ini_entry zend_ini_entry; - -#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC) -#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type) - -struct _zend_ini_entry { - int module_number; - int modifyable; - char *name; - uint name_length; - ZEND_INI_MH((*on_modify)); - void *mh_arg1; - void *mh_arg2; - void *mh_arg3; - - char *value; - uint value_length; - - char *orig_value; - uint orig_value_length; - int modified; - - void (*displayer)(zend_ini_entry *ini_entry, int type); -}; - - -ZEND_API int zend_ini_startup(TSRMLS_D); -ZEND_API int zend_ini_shutdown(TSRMLS_D); -ZEND_API int zend_ini_deactivate(TSRMLS_D); - -ZEND_API int zend_copy_ini_directives(TSRMLS_D); - -ZEND_API void zend_ini_sort_entries(TSRMLS_D); - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC); -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC); -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC); -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage); -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage); -ZEND_API void display_ini_entries(zend_module_entry *module); - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig); -ZEND_API double zend_ini_double(char *name, uint name_length, int orig); -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig); - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)); - -ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb); -ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb); -ZEND_API ZEND_INI_DISP(display_link_numbers); - -#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = { -#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } }; - -#define ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, displayer) \ - { 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer }, - -#define ZEND_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, NULL) - -#define ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL, displayer) - -#define ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, arg1, arg2) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL) - -#define ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY1(name, default_value, modifyable, on_modify, arg1) \ - ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, NULL) - -#define ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, NULL, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY(name, default_value, modifyable, on_modify) \ - ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, NULL) - -#ifdef ZTS -#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb) -#else -#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb) -#endif - -#define INI_INT(name) zend_ini_long((name), sizeof(name), 0) -#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0) -#define INI_STR(name) zend_ini_string((name), sizeof(name), 0) -#define INI_BOOL(name) ((zend_bool) INI_INT(name)) - -#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1) -#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1) -#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1) -#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name)) - - -#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC) -#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC) -#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module) - -#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer) -#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) - -/* Standard message handlers */ -ZEND_API ZEND_INI_MH(OnUpdateBool); -ZEND_API ZEND_INI_MH(OnUpdateInt); -ZEND_API ZEND_INI_MH(OnUpdateReal); -ZEND_API ZEND_INI_MH(OnUpdateString); -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); - - -#define ZEND_INI_DISPLAY_ORIG 1 -#define ZEND_INI_DISPLAY_ACTIVE 2 - -#define ZEND_INI_STAGE_STARTUP (1<<0) -#define ZEND_INI_STAGE_SHUTDOWN (1<<1) -#define ZEND_INI_STAGE_ACTIVATE (1<<2) -#define ZEND_INI_STAGE_DEACTIVATE (1<<3) -#define ZEND_INI_STAGE_RUNTIME (1<<4) - -/* INI parsing engine */ -typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg); -int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -#define ZEND_INI_PARSER_ENTRY 1 -#define ZEND_INI_PARSER_SECTION 2 - -typedef struct _zend_ini_parser_param { - zend_ini_parser_cb_t ini_parser_cb; - void *arg; -} zend_ini_parser_param; - -#endif /* ZEND_INI_H */ diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y deleted file mode 100644 index 23f4054e096..00000000000 --- a/Zend/zend_ini_parser.y +++ /dev/null @@ -1,236 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -/* $Id$ */ - -#define DEBUG_CFG_PARSER 0 -#include "zend.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_constants.h" -#include "zend_ini_scanner.h" -#include "zend_extensions.h" - - -#if WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -#endif - -#define YYSTYPE zval - -#ifdef ZTS -#define YYPARSE_PARAM tsrm_ls -#define YYLEX_PARAM tsrm_ls -#endif - -#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb -#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg - -int ini_lex(zval *ini_lval TSRMLS_DC); -#ifdef ZTS -int ini_parse(void *arg); -#else -int ini_parse(void); -#endif - -zval yylval; - -#ifndef ZTS -extern int ini_lex(zval *ini_lval TSRMLS_DC); -extern FILE *ini_in; -extern int ini_lineno; -extern void init_cfg_scanner(void); -#endif - -void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2) -{ - int i_result; - int i_op1, i_op2; - char str_result[MAX_LENGTH_OF_LONG]; - - i_op1 = atoi(op1->value.str.val); - free(op1->value.str.val); - if (op2) { - i_op2 = atoi(op2->value.str.val); - free(op2->value.str.val); - } else { - i_op2 = 0; - } - - switch (type) { - case '|': - i_result = i_op1 | i_op2; - break; - case '&': - i_result = i_op1 & i_op2; - break; - case '~': - i_result = ~i_op1; - break; - case '!': - i_result = !i_op1; - break; - default: - i_result = 0; - break; - } - - result->value.str.len = zend_sprintf(str_result, "%d", i_result); - result->value.str.val = (char *) malloc(result->value.str.len+1); - memcpy(result->value.str.val, str_result, result->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; -} - - -void zend_ini_get_constant(zval *result, zval *name) -{ - zval z_constant; - TSRMLS_FETCH(); - - if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) { - /* z_constant is emalloc()'d */ - convert_to_string(&z_constant); - result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len); - result->value.str.len = z_constant.value.str.len; - result->type = z_constant.type; - zval_dtor(&z_constant); - free(name->value.str.val); - } else { - *result = *name; - } -} - - -static void ini_error(char *str) -{ - char *error_buf; - int error_buf_len; - char *currently_parsed_filename; - TSRMLS_FETCH(); - - currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C); - error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */ - error_buf = (char *) emalloc(error_buf_len); - - sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C)); - - if (CG(ini_parser_unbuffered_errors)) { -#ifdef PHP_WIN32 - MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L); -#else - fprintf(stderr, "PHP: %s", error_buf); -#endif - } else { - zend_error(E_CORE_WARNING, error_buf); - } - efree(error_buf); -} - - -int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - int retval; - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_open_file_for_scanning(fh TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - retval = ini_parse(TSRMLS_C); - - zend_ini_close_file(fh TSRMLS_CC); - - if (retval==0) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -%} - -%pure_parser -%token TC_STRING -%token TC_ENCAPSULATED_STRING -%token SECTION -%token CFG_TRUE -%token CFG_FALSE -%left '|' '&' -%right '~' '!' - -%% - -statement_list: - statement_list statement - | /* empty */ -; - -statement: - TC_STRING '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val); -#endif - ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($3.value.str.val); - } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | '\n' -; - - -string_or_value: - expr { $$ = $1; } - | TC_ENCAPSULATED_STRING { $$ = $1; } - | CFG_TRUE { $$ = $1; } - | CFG_FALSE { $$ = $1; } - | '\n' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; } - | '\0' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; } -; - -expr: - constant_string { $$ = $1; } - | expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); } - | expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); } - | '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); } - | '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); } - | '(' expr ')' { $$ = $2; } -; - -constant_string: - TC_STRING { zend_ini_get_constant(&$$, &$1); } -; -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h deleted file mode 100644 index c683f0b33cb..00000000000 --- a/Zend/zend_ini_scanner.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ZEND_INI_SCANNER_H -#define _ZEND_INI_SCANNER_H - -BEGIN_EXTERN_C() -int zend_ini_scanner_get_lineno(TSRMLS_D); -char *zend_ini_scanner_get_filename(TSRMLS_D); -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC); -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC); -int ini_lex(zval *ini_lval TSRMLS_DC); -END_EXTERN_C() - -#endif /* _ZEND_INI_SCANNER_H */ diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l deleted file mode 100644 index 707a27415c2..00000000000 --- a/Zend/zend_ini_scanner.l +++ /dev/null @@ -1,228 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -#include -#include "zend.h" -#include "zend_globals.h" -#include "zend_ini_parser.h" -#include "zend_ini_scanner.h" - -#undef YYSTYPE -#define YYSTYPE zval - -#define YY_DECL int ini_lex(zval *ini_lval TSRMLS_DC) - -/* Globals Macros */ -#define SCNG INI_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -ZEND_API zend_scanner_globals ini_scanner_globals; -#endif - - -static char *ini_filename; - -void init_ini_scanner() -{ - ini_lineno=1; -} - - -int zend_ini_scanner_get_lineno(TSRMLS_D) -{ - return ini_lineno; -} - - -char *zend_ini_scanner_get_filename(TSRMLS_D) -{ - return ini_filename; -} - - -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) -{ - FILE *fp; - - switch (fh->type) { - case ZEND_HANDLE_FP: - fp = fh->handle.fp; - break; - case ZEND_HANDLE_FILENAME: - fp = zend_fopen(fh->filename, NULL); - fh->type = ZEND_HANDLE_FP; - break; - default: - return FAILURE; - } - - init_ini_scanner(); - yyin = fp; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - ini_filename = fh->filename; - return SUCCESS; -} - - -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) -{ - switch (fh->type) { - case ZEND_HANDLE_FP: - fclose(fh->handle.fp); - break; - } -} - -%} - -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyywrap -%option yylineno - -%% - - -[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1", 1); - ini_lval->value.str.len = 1; - ini_lval->type = IS_STRING; - return CFG_TRUE; -} - - -[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("", 0); - ini_lval->value.str.len = 0; - ini_lval->type = IS_STRING; - return CFG_FALSE; -} - -[[][^[]+[\]]{NEWLINE}? { - /* SECTION */ - - /* eat trailng ] */ - while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']')) { - yyleng--; - yytext[yyleng]=0; - } - - /* eat leading [ */ - yytext++; - yyleng--; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return SECTION; -} - - -["][^\n\r"]*["] { - /* ENCAPSULATED TC_STRING */ - - /* eat trailing " */ - yytext[yyleng-1]=0; - - /* eat leading " */ - yytext++; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2); - ini_lval->value.str.len = yyleng - 2; - ini_lval->type = IS_STRING; - return TC_ENCAPSULATED_STRING; -} - -[&|~()!] { - return yytext[0]; -} - - -[^=\n\r\t;|&~()!"]+ { - /* STRING */ - register int i; - - /* eat trailing whitespace */ - for (i=yyleng-1; i>=0; i--) { - if (yytext[i]==' ' || yytext[i]=='\t') { - yytext[i]=0; - yyleng--; - } else { - break; - } - } - /* eat leading whitespace */ - while (yytext[0]) { - if (yytext[0]==' ' || yytext[0]=='\t') { - yytext++; - yyleng--; - } else { - break; - } - } - if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return TC_STRING; - } else { - /* whitespace */ - } -} - - - -[=\n] { - return yytext[0]; -} - -{NEWLINE} { - return '\n'; -} - -[;][^\r\n]*{NEWLINE}? { - /* comment */ - return '\n'; -} - -[ \t] { - /* eat whitespace */ -} - -. { -#if DEBUG - php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n", yylineno, yytext, yytext[0]); -#endif -} - -<> { - yy_delete_buffer(YY_CURRENT_BUFFER TSRMLS_CC); - yyterminate(); -} diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h deleted file mode 100644 index 00b65b37938..00000000000 --- a/Zend/zend_istdiostream.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _ZEND_STDIOSTREAM -#define _ZEND_STDIOSTREAM - -#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM) -class istdiostream : public istream -{ -private: - stdiobuf _file; -public: - istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); } - stdiobuf* rdbuf()/* const */ { return &_file; } -}; -#endif - -#endif diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y deleted file mode 100644 index 0e36bc02a51..00000000000 --- a/Zend/zend_language_parser.y +++ /dev/null @@ -1,831 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* - * LALR shift/reduce conflicts and how they are resolved: - * - * - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift. - * - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift. - * - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift. - * - */ - - -#include "zend_compile.h" -#include "zend.h" -#include "zend_list.h" -#include "zend_globals.h" -#include "zend_API.h" - -#define YYERROR_VERBOSE -#define YYSTYPE znode -#ifdef ZTS -# define YYPARSE_PARAM tsrm_ls -# define YYLEX_PARAM tsrm_ls -#endif - - -%} - -%pure_parser -%expect 4 - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL -%left '?' ':' -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right '[' -%nonassoc T_NEW T_DELETE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_OLD_FUNCTION -%token T_FUNCTION -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_THROW -%token T_USE -%token T_GLOBAL -%token T_STATIC -%token T_PRIVATE -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_CLASS -%token T_EXTENDS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_ML_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_IMPORT T_FROM - -%% /* Rules */ - -start: - top_statement_list -; - -top_statement_list: - top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -top_statement: - statement - | declaration_statement { zend_do_early_binding(TSRMLS_C); } -; - - -inner_statement_list: - inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -inner_statement: - statement - | declaration_statement -; - - -statement: - unticked_statement { zend_do_ticks(TSRMLS_C); } -; - - -unticked_statement: - '{' inner_statement_list '}' - | T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } statement { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } elseif_list else_single { zend_do_if_end(TSRMLS_C); } - | T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(TSRMLS_C); } - | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); } - | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); } - | T_FOR - '(' - for_expr - ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); } - for_expr - ';' { zend_do_extended_info(TSRMLS_C); zend_do_for_cond(&$6, &$7 TSRMLS_CC); } - for_expr - ')' { zend_do_free(&$9 TSRMLS_CC); zend_do_for_before_statement(&$4, &$7 TSRMLS_CC); } - for_statement { zend_do_for_end(&$7 TSRMLS_CC); } - | T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 TSRMLS_CC); } switch_case_list { zend_do_switch_end(&$6 TSRMLS_CC); } - | T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL TSRMLS_CC); } - | T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 TSRMLS_CC); } - | T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL TSRMLS_CC); } - | T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 TSRMLS_CC); } - | T_RETURN ';' { zend_do_return(NULL, 0 TSRMLS_CC); } - | T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 TSRMLS_CC); } - | T_RETURN cvar ';' { zend_do_return(&$2, 1 TSRMLS_CC); } - | T_GLOBAL global_var_list ';' - | T_STATIC static_var_list ';' - | T_ECHO echo_expr_list ';' - | T_INLINE_HTML { zend_do_echo(&$1 TSRMLS_CC); } - | expr ';' { zend_do_free(&$1 TSRMLS_CC); } - | T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); } - | T_UNSET '(' unset_variables ')' ';' - | T_FOREACH '(' cvar T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 1 TSRMLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 TSRMLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 TSRMLS_CC); } - | T_FOREACH '(' expr_without_variable T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 0 TSRMLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 TSRMLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 TSRMLS_CC); } - | T_DECLARE { zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(TSRMLS_C); } - | ';' /* empty statement */ - | T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}' - T_CATCH '(' catch_or_import_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$8, &$9, 1 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } - additional_catches - | T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); } - | T_DELETE cvar ';' { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1, ZEND_UNSET_OBJ TSRMLS_CC); } - | T_IMPORT { zend_do_begin_import(TSRMLS_C); } import_rule T_FROM catch_or_import_class_entry { zend_do_end_import(&$5 TSRMLS_CC); } ';' -; - - -import_rule: - '*' { zend_do_import(T_FUNCTION, NULL TSRMLS_CC); zend_do_import(T_CLASS, NULL TSRMLS_CC); zend_do_import(T_CONST, NULL TSRMLS_CC); } - | import_commands -; - -import_commands: - import_commands ',' import_command - | import_command -; - -import_command: - T_FUNCTION T_STRING { zend_do_import(T_FUNCTION, &$2 TSRMLS_CC); } - | T_CLASS T_STRING { zend_do_import(T_CLASS, &$2 TSRMLS_CC); } - | T_CONST T_STRING { zend_do_import(T_CONST, &$2 TSRMLS_CC); } - | T_FUNCTION '*' { zend_do_import(T_FUNCTION, NULL TSRMLS_CC); } - | T_CLASS '*' { zend_do_import(T_CLASS, NULL TSRMLS_CC); } - | T_CONST '*' { zend_do_import(T_CONST, NULL TSRMLS_CC); } -; - -additional_catches: - non_empty_additional_catches - | /* empty */ -; - -non_empty_additional_catches: - non_empty_additional_catches T_CATCH '(' catch_or_import_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); } - | T_CATCH '(' catch_or_import_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$4, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } -; - - -unset_variables: - unset_variable - | unset_variables ',' unset_variable -; - -unset_variable: - cvar { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1, ZEND_UNSET_REG TSRMLS_CC); } -; - -use_filename: - T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; } -; - - -declaration_statement: - unticked_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - - -unticked_declaration_statement: - T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type TSRMLS_CC); } - '(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } - | T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type TSRMLS_CC); } - parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } - | T_CLASS decleration_class_name { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); } - | T_CLASS T_STRING T_EXTENDS T_STRING { zend_do_begin_class_declaration(&$1, &$2, &$4 TSRMLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); } -; - -decleration_class_name: - | parse_class_name_entry T_STRING { do_fetch_class_name(&$$, &$1, &$2, 0 TSRMLS_CC); } - | T_STRING { $$ = $1; zend_str_tolower($$.u.constant.value.str.val, $$.u.constant.value.str.len); } -; - -foreach_optional_arg: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_DOUBLE_ARROW w_cvar { $$ = $2; } -; - - -for_statement: - statement - | ':' inner_statement_list T_ENDFOR ';' -; - - -foreach_statement: - statement - | ':' inner_statement_list T_ENDFOREACH ';' -; - - -declare_statement: - statement - | ':' inner_statement_list T_ENDDECLARE ';' -; - - -declare_list: - T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 TSRMLS_CC); } - | declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 TSRMLS_CC); } -; - - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - - -case_list: - /* empty */ { $$.op_type = IS_UNUSED; } - | case_list T_CASE expr case_separator { zend_do_extended_info(TSRMLS_C); zend_do_case_before_statement(&$1, &$2, &$3 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } - | case_list T_DEFAULT case_separator { zend_do_extended_info(TSRMLS_C); zend_do_default_before_statement(&$1, &$2 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } -; - - -case_separator: - ':' - | ';' -; - - -while_statement: - statement - | ':' inner_statement_list T_ENDWHILE ';' -; - - - -elseif_list: - /* empty */ - | elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } statement { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -new_elseif_list: - /* empty */ - | new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -else_single: - /* empty */ - | T_ELSE statement -; - - -new_else_single: - /* empty */ - | T_ELSE ':' inner_statement_list -; - - -parameter_list: - non_empty_parameter_list - | /* empty */ -; - - -non_empty_parameter_list: - T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE TSRMLS_CC); } - | '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE TSRMLS_CC); } - | '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, BYREF_FORCE TSRMLS_CC); } - | T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 TSRMLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE TSRMLS_CC); } - | non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE TSRMLS_CC); } - | non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE TSRMLS_CC); } - | non_empty_parameter_list ',' '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, BYREF_FORCE TSRMLS_CC); } - | non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE TSRMLS_CC); } - | non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE TSRMLS_CC); } -; - - -function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } - | /* empty */ { $$.u.constant.value.lval = 0; } -; - - -non_empty_function_call_parameter_list: - expr_without_variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval TSRMLS_CC); } - | cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval TSRMLS_CC); } - | '&' w_cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval TSRMLS_CC); } -; - -global_var_list: - global_var_list ',' global_var { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL TSRMLS_CC); } - | global_var { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL TSRMLS_CC); } -; - - -global_var: - T_VARIABLE { $$ = $1; } - | '$' r_cvar { $$ = $2; } - | '$' '{' expr '}' { $$ = $3; } -; - - -static_var_list: - static_var_list ',' T_VARIABLE { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); } - -; - - -class_statement_list: - class_statement_list class_statement - | /* empty */ -; - - -class_statement: - class_variable_decleration ';' - | class_constant_decleration ';' - | T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type TSRMLS_CC); } '(' - parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } - | T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type TSRMLS_CC); } - parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } - | T_CLASS T_STRING { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); } - | T_CLASS T_STRING T_EXTENDS T_STRING { zend_do_begin_class_declaration(&$1, &$2, &$4 TSRMLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); } -; - -is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } - -class_variable_decleration: - class_variable_decleration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, $1.op_type TSRMLS_CC); } - | class_variable_decleration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5, $1.op_type TSRMLS_CC); } - | class_decleration_type T_VARIABLE { $$ = $1; zend_do_declare_property(&$2, NULL, $1.op_type TSRMLS_CC); } - | class_decleration_type T_VARIABLE '=' static_scalar { $$ = $1; zend_do_declare_property(&$2, &$4, $1.op_type TSRMLS_CC); } -; - -class_decleration_type: - T_VAR { $$.op_type = T_VAR; } - | T_STATIC { $$.op_type = T_STATIC; } - | T_PRIVATE { $$.op_type = T_PRIVATE; } -; - -class_constant_decleration: - | T_CONST ',' T_STRING '=' static_scalar { zend_do_declare_property(&$3, &$5, T_CONST TSRMLS_CC); } - | T_CONST T_STRING '=' static_scalar { zend_do_declare_property(&$2, &$4, T_CONST TSRMLS_CC); } -; - -echo_expr_list: - | echo_expr_list ',' expr { zend_do_echo(&$3 TSRMLS_CC); } - | expr { zend_do_echo(&$1 TSRMLS_CC); } -; - - -for_expr: - /* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; } - | non_empty_for_expr { $$ = $1; } -; - -non_empty_for_expr: - non_empty_for_expr ',' { zend_do_free(&$1 TSRMLS_CC); } expr { $$ = $4; } - | expr { $$ = $1; } -; - -expr_without_variable: - T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); } - | cvar '=' expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); } - | cvar '=' '&' w_cvar { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); } - | cvar '=' '&' T_NEW new_class_entry { zend_check_writable_variable(&$$); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); } - | T_NEW new_class_entry { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | cvar T_PLUS_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_MINUS_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_MUL_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_DIV_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_CONCAT_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_MOD_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_AND_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_OR_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_XOR_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_SL_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 TSRMLS_CC); } - | cvar T_SR_EQUAL expr { zend_check_writable_variable(&$$); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 TSRMLS_CC); } - | rw_cvar T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC TSRMLS_CC); } - | T_INC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC TSRMLS_CC); } - | rw_cvar T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC TSRMLS_CC); } - | T_DEC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC TSRMLS_CC); } - | expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '.' expr { zend_do_binary_op(ZEND_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); } - | '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } - | '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } - | '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); } - | '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); } - | expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 TSRMLS_CC); } - | '(' expr ')' { $$ = $2; } - | expr '?' { zend_do_begin_qm_op(&$1, &$2 TSRMLS_CC); } - expr ':' { zend_do_qm_true(&$4, &$2, &$5 TSRMLS_CC); } - expr { zend_do_qm_false(&$$, &$7, &$2, &$5 TSRMLS_CC); } - | internal_functions_in_yacc { $$ = $1; } - | T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); } - | T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); } - | T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); } - | T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); } - | T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); } - | T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); } - | T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); } - | T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); } - | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; } - | scalar { $$ = $1; } - | T_ARRAY '(' array_pair_list ')' { $$ = $3; } - | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); } - | T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); } -; - -function_call: - T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); } - | parse_class_entry static_or_variable_string '(' { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_class_member_function_call(&$1, &$2 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(&$2, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | cvar_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} -; - -parse_class_entry: - parse_class_entry T_STRING T_PAAMAYIM_NEKUDOTAYIM { do_fetch_class(&$$, &$1, &$2 TSRMLS_CC); } - | T_STRING T_PAAMAYIM_NEKUDOTAYIM { do_fetch_class(&$$, NULL, &$1 TSRMLS_CC); } -; - -parse_class_name_entry: - parse_class_name_entry T_STRING T_PAAMAYIM_NEKUDOTAYIM { do_fetch_class_name(&$$, &$1, &$2, 0 TSRMLS_CC); } - | T_STRING T_PAAMAYIM_NEKUDOTAYIM { $$ = $1; zend_str_tolower($$.u.constant.value.str.val, $$.u.constant.value.str.len); } -; - -catch_or_import_class_entry: - parse_class_entry T_STRING { do_fetch_class(&$$, &$1, &$2 TSRMLS_CC); } - | T_STRING { do_fetch_class(&$$, NULL, &$1 TSRMLS_CC); } -; - -new_class_entry: - parse_class_entry T_STRING { do_fetch_class(&$$, &$1, &$2 TSRMLS_CC); } - | static_or_variable_string { do_fetch_class(&$$, NULL, &$1 TSRMLS_CC); } -; - -static_or_variable_string: - T_STRING { $$ = $1; } - | r_cvar_without_static_member { $$ = $1; } -; - - -exit_expr: - /* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' expr ')' { $$ = $2; } -; - - -ctor_arguments: - /* empty */ { $$.u.constant.value.lval=0; } - | '(' function_call_parameter_list ')' { $$ = $2; } -; - - -common_scalar: - T_LNUMBER { $$ = $1; } - | T_DNUMBER { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | T_LINE { $$ = $1; } - | T_FILE { $$ = $1; } -; - - -static_scalar: /* compile-time evaluated scalars */ - common_scalar { $$ = $1; } - | T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $1; } - | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; } - | parse_class_name_entry T_STRING { zend_do_fetch_constant(&$$, &$1, &$2, ZEND_CT TSRMLS_CC); } -; - - -scalar: - T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT TSRMLS_CC); } - | T_STRING_VARNAME { $$ = $1; } - | parse_class_entry T_STRING { zend_do_fetch_constant(&$$, &$1, &$2, ZEND_RT TSRMLS_CC); } - | common_scalar { $$ = $1; } - | '"' encaps_list '"' { $$ = $2; } - | '\'' encaps_list '\'' { $$ = $2; } - | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; zend_do_end_heredoc(TSRMLS_C); } -; - - -static_array_pair_list: - /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); } - | non_empty_static_array_pair_list possible_comma { $$ = $1; } -; - -possible_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); } - | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); } - | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); } - | static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); } -; - -expr: - r_cvar { $$ = $1; } - | expr_without_variable { $$ = $1; } -; - - -r_cvar: - cvar { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); $$ = $1; } -; - - -w_cvar: - cvar { zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$$); } -; - -rw_cvar: - cvar { zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$$); } -; - -r_cvar_without_static_member: - cvar_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); $$ = $1; } -; - - -cvar: - base_cvar_without_objects T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); } method_or_not variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = $1.u.EA.type | ($7.u.EA.type ? $7.u.EA.type : $6.u.EA.type); } - | base_cvar_without_objects { $$ = $1; } -; - - -variable_properties: - variable_properties variable_property { $$.u.EA.type = $2.u.EA.type; } - | /* empty */ { $$.u.EA.type = 0; } -; - - -variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.u.EA.type = $4.u.EA.type; } -; - -method_or_not: - '(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); - zend_do_push_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_METHOD_CALL; } - | /* empty */ { $$.u.EA.type = ZEND_PARSED_MEMBER; } -; - -cvar_without_objects: - reference_variable { $$ = $1; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); } -; - -static_member: - parse_class_entry cvar_without_objects { $$ = $2; zend_do_fetch_static_member(&$1 TSRMLS_CC); } -; - - -base_cvar_without_objects: - reference_variable { $$ = $1; $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | static_member { $$ = $1; $$.u.EA.type = ZEND_PARSED_STATIC_MEMBER; } - | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.u.EA.type = ZEND_PARSED_FUNCTION_CALL; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | compound_variable { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -compound_variable: - T_VARIABLE { $$ = $1; } - | '$' '{' expr '}' { $$ = $3; } -; - -dim_offset: - /* empty */ { $$.op_type = IS_UNUSED; } - | expr { $$ = $1; } -; - - -object_property: - object_dim_list { $$ = $1; } - | cvar_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -object_dim_list: - object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -variable_name: - T_STRING { $$ = $1; } - | '{' expr '}' { $$ = $2; } -; - -simple_indirect_reference: - '$' { $$.u.constant.value.lval = 1; } - | simple_indirect_reference '$' { $$.u.constant.value.lval++; } -; - -assignment_list: - assignment_list ',' assignment_list_element - | assignment_list_element -; - - -assignment_list_element: - cvar { zend_do_add_list_element(&$1 TSRMLS_CC); } - | T_LIST '(' { zend_do_new_list_begin(TSRMLS_C); } assignment_list ')' { zend_do_new_list_end(TSRMLS_C); } - | /* empty */ { zend_do_add_list_element(NULL TSRMLS_CC); } -; - - -array_pair_list: - /* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list possible_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 TSRMLS_CC); } - | expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 TSRMLS_CC); } - | expr { zend_do_init_array(&$$, &$1, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { zend_do_add_array_element(&$$, &$6, &$3, 1 TSRMLS_CC); } - | non_empty_array_pair_list ',' '&' w_cvar { zend_do_add_array_element(&$$, &$4, NULL, 1 TSRMLS_CC); } - | expr T_DOUBLE_ARROW '&' w_cvar { zend_do_init_array(&$$, &$4, &$1, 1 TSRMLS_CC); } - | '&' w_cvar { zend_do_init_array(&$$, &$2, NULL, 1 TSRMLS_CC); } -; - -encaps_list: - encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_add_variable(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_NUM_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_CHARACTER { zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_BAD_CHARACTER { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '[' { $2.u.constant.value.lval = (long) '['; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list ']' { $2.u.constant.value.lval = (long) ']'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '{' { $2.u.constant.value.lval = (long) '{'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '}' { $2.u.constant.value.lval = (long) '}'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 TSRMLS_CC); $2.u.constant.value.lval = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 TSRMLS_CC); } - | /* empty */ { zend_do_init_string(&$$ TSRMLS_CC); } - -; - - - -encaps_var: - T_VARIABLE { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } - | T_VARIABLE '[' { zend_do_begin_variable_parse(TSRMLS_C); } encaps_var_offset ']' { fetch_array_begin(&$$, &$1, &$4 TSRMLS_CC); } - | T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$2, &$1, 1 TSRMLS_CC); zend_do_fetch_property(&$$, &$2, &$3 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$2, 1 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_begin(&$$, &$2, &$4 TSRMLS_CC); } - | T_CURLY_OPEN cvar '}' { $$ = $2; } -; - - -encaps_var_offset: - T_STRING { $$ = $1; } - | T_NUM_STRING { $$ = $1; } - | T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -internal_functions_in_yacc: - T_ISSET '(' isset_variables ')' { $$ = $3; } - | T_EMPTY '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); } - | T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); } - | T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); } - | T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); } - | T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 TSRMLS_CC); } - | T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 TSRMLS_CC); } -; - -isset_variables: - cvar { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } cvar { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 TSRMLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 TSRMLS_CC); } -; - -%% - diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h deleted file mode 100644 index ced224d518f..00000000000 --- a/Zend/zend_language_scanner.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_SCANNER_H -#define ZEND_SCANNER_H - -typedef struct _zend_lex_state { - YY_BUFFER_STATE buffer_state; - int state; - FILE *in; - uint lineno; - char *filename; -} zend_lex_state; - - -void zend_fatal_scanner_error(char *); -BEGIN_EXTERN_C() -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2); -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); -END_EXTERN_C() - -#endif diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l deleted file mode 100644 index d3b2f03c4ed..00000000000 --- a/Zend/zend_language_scanner.l +++ /dev/null @@ -1,1480 +0,0 @@ -%{ - -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -%} - -%x ST_IN_SCRIPTING -%x ST_DOUBLE_QUOTES -%x ST_SINGLE_QUOTE -%x ST_BACKQUOTE -%x ST_HEREDOC -%x ST_LOOKING_FOR_PROPERTY -%x ST_LOOKING_FOR_VARNAME -%x ST_COMMENT -%x ST_ONE_LINE_COMMENT -%option stack - -%{ - -#ifdef ZEND_WIN32 -#include -#endif - -#include -#include "zend.h" -#include "zend_alloc.h" -#include "zend_language_parser.h" -#include "zend_compile.h" -#include "zend_language_scanner.h" -#include "zend_highlight.h" -#include "zend_constants.h" -#include "zend_variables.h" -#include "zend_operators.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#define YY_DECL int lex_scan(zval *zendlval TSRMLS_DC) - -#define ECHO { ZEND_WRITE( yytext, yyleng ); } - -#ifdef ZTS -# define MY_INPUT yyinput -#else -# define MY_INPUT input -#endif - - -/* Globals Macros */ -#define SCNG LANG_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id language_scanner_globals_id; -#else -ZEND_API zend_scanner_globals language_scanner_globals; -#endif - - -#define YY_FATAL_ERROR zend_fatal_scanner_error - -#define HANDLE_NEWLINES(s, l) \ -do { \ - char *p = (s), *boundary = p+(l); \ - \ - while (p='0' && (c)<='7') -#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F')) - - -void zend_fatal_scanner_error(char *message) -{ - zend_error(E_COMPILE_ERROR, message); -} - -BEGIN_EXTERN_C() -void startup_scanner(TSRMLS_D) -{ - CG(heredoc) = NULL; - CG(heredoc_len)=0; -} - - -void shutdown_scanner(TSRMLS_D) -{ - if (CG(heredoc)) { - efree(CG(heredoc)); - CG(heredoc_len)=0; - } -} -END_EXTERN_C() - - -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE)); - lex_state->in = SCNG(yy_in); - lex_state->state = YYSTATE; - lex_state->filename = zend_get_compiled_filename(TSRMLS_C); - lex_state->lineno = CG(zend_lineno); -} - - -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - YY_BUFFER_STATE original_buffer_state = YY_CURRENT_BUFFER; - - if (lex_state->buffer_state) { - yy_switch_to_buffer(lex_state->buffer_state TSRMLS_CC); - } else { - YY_CURRENT_BUFFER = NULL; - } - - yy_delete_buffer(original_buffer_state TSRMLS_CC); - SCNG(yy_in) = lex_state->in; - BEGIN(lex_state->state); - CG(zend_lineno) = lex_state->lineno; - zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); -} - - -BEGIN_EXTERN_C() - - -ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) -{ - switch (fh->type) { - case ZEND_HANDLE_FP: - fclose(fh->handle.fp); - break; - case ZEND_HANDLE_FILENAME: - /* We're only supposed to get here when destructing the used_files hash, - * which doesn't really contain open files, but references to their names/paths - */ - break; - } - if (fh->opened_path) { - efree(fh->opened_path); - } - if (fh->free_filename && fh->filename) { - efree(fh->filename); - } -} - - -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2) -{ - if (fh1->type != fh2->type) { - return 0; - } - switch (fh1->type) { - case ZEND_HANDLE_FP: - return fh1->handle.fp==fh2->handle.fp; - break; - } - return 0; -} - - -ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) -{ - zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles); -} - - -ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) -{ - char *file_path=NULL; - - switch (file_handle->type) { - case ZEND_HANDLE_FILENAME: - file_handle->handle.fp = zend_fopen(file_handle->filename, &file_handle->opened_path); - break; - case ZEND_HANDLE_FD: - file_handle->handle.fp = fdopen(file_handle->handle.fd, "r"); - break; - case ZEND_HANDLE_FP: - file_handle->handle.fp = file_handle->handle.fp; - break; - } - if (!file_handle->handle.fp) { - return FAILURE; - } - - file_handle->type = ZEND_HANDLE_FP; - if (file_handle->handle.fp != stdin) { - zend_llist_add_element(&CG(open_files), file_handle); - } - /* Reset the scanner for scanning the new file */ - SCNG(yy_in) = file_handle->handle.fp; - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - BEGIN(INITIAL); - - if (file_handle->opened_path) { - file_path = file_handle->opened_path; - } else { - file_path = file_handle->filename; - } - - zend_set_compiled_filename(file_path TSRMLS_CC); - CG(zend_lineno) = 1; - CG(increment_lineno) = 0; - return SUCCESS; -} -END_EXTERN_C() - - -ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval=NULL; - int compiler_result; - zend_bool compilation_successful=0; - znode retval_znode; - zend_bool original_in_compilation = CG(in_compilation); - - retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - retval_znode.u.constant.is_ref = 0; - retval_znode.u.constant.refcount = 1; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - retval = op_array; /* success oriented */ - - if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { - if (type==ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); - zend_bailout(); - } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); - } - compilation_successful=0; - } else { - init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(in_compilation) = 1; - CG(active_op_array) = op_array; - compiler_result = zendparse(TSRMLS_C); - zend_do_return(&retval_znode, 0 TSRMLS_CC); - CG(in_compilation) = original_in_compilation; - if (compiler_result==1) { /* parser error */ - CG(unclean_shutdown) = 1; - retval = NULL; - } - compilation_successful=1; - } - - if (retval) { - CG(active_op_array) = original_active_op_array; - if (compilation_successful) { - pass_two(op_array TSRMLS_CC); - } else { - efree(op_array); - retval = NULL; - } - } - if (compilation_successful) { - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - return retval; -} - - -zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) -{ - zend_file_handle file_handle; - zval tmp; - zend_op_array *retval; - - if (filename->type != IS_STRING) { - tmp = *filename; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - filename = &tmp; - } - file_handle.filename = filename->value.str.val; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - - - retval = zend_compile_file(&file_handle, type TSRMLS_CC); - if (retval && file_handle.opened_path) { - int dummy = 1; - zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); - } - zend_destroy_file_handle(&file_handle TSRMLS_CC); - - if (filename==&tmp) { - zval_dtor(&tmp); - } - return retval; -} - -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC) -{ - /* enforce two trailing NULLs for flex... */ - STR_REALLOC(str->value.str.val, str->value.str.len+2); - - str->value.str.val[str->value.str.len+1]=0; - - SCNG(yy_in)=NULL; - yy_scan_buffer(str->value.str.val, str->value.str.len+2 TSRMLS_CC); - - zend_set_compiled_filename(filename TSRMLS_CC); - CG(zend_lineno) = 1; - CG(increment_lineno) = 0; - return SUCCESS; -} - - -zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval; - zval tmp; - int compiler_result; - zend_bool original_in_compilation = CG(in_compilation); - - if (source_string->value.str.len==0) { - efree(op_array); - return NULL; - } - - CG(in_compilation) = 1; - - tmp = *source_string; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - source_string = &tmp; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) { - efree(op_array); - retval = NULL; - } else { - init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(active_op_array) = op_array; - BEGIN(ST_IN_SCRIPTING); - compiler_result = zendparse(TSRMLS_C); - - if (compiler_result==1) { - CG(active_op_array) = original_active_op_array; - CG(unclean_shutdown)=1; - retval = NULL; - } else { - zend_do_return(NULL, 0 TSRMLS_CC); - CG(active_op_array) = original_active_op_array; - pass_two(op_array TSRMLS_CC); - retval = op_array; - } - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - zval_dtor(&tmp); - CG(in_compilation) = original_in_compilation; - return retval; -} - - -BEGIN_EXTERN_C() -int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) { - zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename); - return FAILURE; - } - zend_highlight(syntax_highlighter_ini TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - return SUCCESS; -} - -int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zval tmp = *str; - - str = &tmp; - zval_copy_ctor(str); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { - return FAILURE; - } - zend_highlight(syntax_highlighter_ini TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(str); - return SUCCESS; -} -END_EXTERN_C() - -%} - -LNUM [0-9]+ -DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*) -EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM}) -HNUM "0x"[0-9a-fA-F]+ -LABEL [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* -WHITESPACE [ \n\r\t]+ -TABS_AND_SPACES [ \t]* -TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@] -ENCAPSED_TOKENS [\[\]{}$] -ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+ -ANY_CHAR (.|[\n]) -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyylineno -%option noyywrap -%% - -"exit" { - return T_EXIT; -} - -"die" { - return T_EXIT; -} - -"old_function" { - return T_OLD_FUNCTION; -} - -"function"|"cfunction" { - return T_FUNCTION; -} - -"const" { - return T_CONST; -} - -"return" { - return T_RETURN; -} - -"try" { - return T_TRY; -} - -"catch" { - return T_CATCH; -} - -"throw" { - return T_THROW; -} - -"if" { - return T_IF; -} - -"elseif" { - return T_ELSEIF; -} - -"endif" { - return T_ENDIF; -} - -"else" { - return T_ELSE; -} - -"while" { - return T_WHILE; -} - -"endwhile" { - return T_ENDWHILE; -} - -"do" { - return T_DO; -} - -"for" { - return T_FOR; -} - -"endfor" { - return T_ENDFOR; -} - -"foreach" { - return T_FOREACH; -} - -"endforeach" { - return T_ENDFOREACH; -} - -"declare" { - return T_DECLARE; -} - -"enddeclare" { - return T_ENDDECLARE; -} - -"as" { - return T_AS; -} - -"switch" { - return T_SWITCH; -} - -"endswitch" { - return T_ENDSWITCH; -} - -"case" { - return T_CASE; -} - -"default" { - return T_DEFAULT; -} - -"break" { - return T_BREAK; -} - -"continue" { - return T_CONTINUE; -} - -"echo" { - return T_ECHO; -} - -"print" { - return T_PRINT; -} - -"class" { - return T_CLASS; -} - -"extends" { - return T_EXTENDS; -} - -"->" { - yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); - return T_OBJECT_OPERATOR; -} - -{LABEL} { - yy_pop_state(TSRMLS_C); - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_STRING; -} - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); -} - -"::" { - return T_PAAMAYIM_NEKUDOTAYIM; -} - -"new" { - return T_NEW; -} - -"delete" { - return T_DELETE; -} - -"var" { - return T_VAR; -} - -"("{TABS_AND_SPACES}("int"|"integer"){TABS_AND_SPACES}")" { - return T_INT_CAST; -} - -"("{TABS_AND_SPACES}("real"|"double"|"float"){TABS_AND_SPACES}")" { - return T_DOUBLE_CAST; -} - -"("{TABS_AND_SPACES}"string"{TABS_AND_SPACES}")" { - return T_STRING_CAST; -} - -"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" { - return T_ARRAY_CAST; -} - -"("{TABS_AND_SPACES}"object"{TABS_AND_SPACES}")" { - return T_OBJECT_CAST; -} - -"("{TABS_AND_SPACES}("bool"|"boolean"){TABS_AND_SPACES}")" { - return T_BOOL_CAST; -} - -"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" { - return T_UNSET_CAST; -} - -"eval" { - return T_EVAL; -} - -"include" { - return T_INCLUDE; -} - -"import" { - return T_IMPORT; -} - -"from" { - return T_FROM; -} - -"include_once" { - return T_INCLUDE_ONCE; -} - -"require" { - return T_REQUIRE; -} - -"require_once" { - return T_REQUIRE_ONCE; -} - -"use" { - return T_USE; -} - -"global" { - return T_GLOBAL; -} - -"isset" { - return T_ISSET; -} - -"empty" { - return T_EMPTY; -} - -"static" { - return T_STATIC; -} - -"private" { - return T_PRIVATE; -} - -"unset" { - return T_UNSET; -} - -"=>" { - return T_DOUBLE_ARROW; -} - -"list" { - return T_LIST; -} - -"array" { - return T_ARRAY; -} - -"++" { - return T_INC; -} - -"--" { - return T_DEC; -} - -"===" { - return T_IS_IDENTICAL; -} - -"!==" { - return T_IS_NOT_IDENTICAL; -} - -"==" { - return T_IS_EQUAL; -} - -"!="|"<>" { - return T_IS_NOT_EQUAL; -} - -"<=" { - return T_IS_SMALLER_OR_EQUAL; -} - -">=" { - return T_IS_GREATER_OR_EQUAL; -} - -"+=" { - return T_PLUS_EQUAL; -} - -"-=" { - return T_MINUS_EQUAL; -} - -"*=" { - return T_MUL_EQUAL; -} - -"/=" { - return T_DIV_EQUAL; -} - -".=" { - return T_CONCAT_EQUAL; -} - -"%=" { - return T_MOD_EQUAL; -} - -"<<=" { - return T_SL_EQUAL; -} - -">>=" { - return T_SR_EQUAL; -} - -"&=" { - return T_AND_EQUAL; -} - -"|=" { - return T_OR_EQUAL; -} - -"^=" { - return T_XOR_EQUAL; -} - -"||" { - return T_BOOLEAN_OR; -} - -"&&" { - return T_BOOLEAN_AND; -} - -"OR" { - return T_LOGICAL_OR; -} - -"AND" { - return T_LOGICAL_AND; -} - -"XOR" { - return T_LOGICAL_XOR; -} - -"<<" { - return T_SL; -} - -">>" { - return T_SR; -} - -{TOKENS} { - return yytext[0]; -} - - -"{" { - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return '{'; -} - - -"${" { - yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); - return T_DOLLAR_OPEN_CURLY_BRACES; -} - - -"}" { - /* This is a temporary fix which is dependant on flex and it's implementation */ - if (yy_start_stack_ptr) { - yy_pop_state(TSRMLS_C); - } - return '}'; -} - - -{LABEL} { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return T_STRING_VARNAME; -} - - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); -} - - -{LNUM} { - errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); - if (errno == ERANGE) { /* overflow */ - zendlval->value.dval = strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } else { - zendlval->type = IS_LONG; - return T_LNUMBER; - } -} - -{HNUM} { - errno = 0; - zendlval->value.lval = strtoul(yytext, NULL, 16); - if (errno == ERANGE) { /* overflow */ - /* not trying strtod - it returns trash on 0x-es */ - zendlval->value.lval = LONG_MAX; /* maximal long */ - zend_error(E_NOTICE,"Hex number is too big: %s", yytext); - } else { - if (zendlval->value.lval < 0) { - /* maintain consistency with the old way */ - zendlval->value.dval = (unsigned long) zendlval->value.lval; - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } - zendlval->type = IS_LONG; - } - zendlval->type = IS_LONG; - return T_LNUMBER; -} - -{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_NUM_STRING; -} - -{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; -} - -"__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; - return T_LINE; -} - -"__FILE__" { - char *filename = zend_get_compiled_filename(TSRMLS_C); - - if (!filename) { - filename = ""; - } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FILE; -} - - -(([^<]|"<"[^?%s<]){1,400})|"value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_INLINE_HTML; -} - -"" { - HANDLE_NEWLINES(yytext, yyleng); - if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%="|"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG_WITH_ECHO; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%" { - if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINE(yytext[yyleng-1]); - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; -} - - -""{NEWLINE}? { - zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead"); - HANDLE_NEWLINE(yytext[yyleng-1]); - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; -} - -"$"{LABEL} { - zendlval->value.str.val = (char *)estrndup(yytext+1, yyleng-1); - zendlval->value.str.len = yyleng-1; - zendlval->type = IS_STRING; - return T_VARIABLE; -} - - -{LABEL} { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_STRING; -} - - -{LABEL} { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_STRING; -} - - -{WHITESPACE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_WHITESPACE; -} - - -"#"|"//" { - BEGIN(ST_ONE_LINE_COMMENT); - yymore(); -} - -"?"|"%"|">" { - yymore(); -} - -[^\n\r?%>]+ { - yymore(); -} - -{NEWLINE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - CG(zend_lineno)++; - return T_COMMENT; -} - -"?>"|"%>" { - if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - yyless(yyleng-2); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } else { - yymore(); - } -} - -"/*" { - CG(comment_start_line) = CG(zend_lineno); - BEGIN(ST_COMMENT); - yymore(); -} - - -[^*]+ { - yymore(); -} - -"*/" { - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; -} - -"*" { - yymore(); -} - -("?>"|""){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ -} - - -"%>"{NEWLINE}? { - if (CG(asp_tags)) { - BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ - } else { - yyless(1); - return yytext[0]; - } -} - - -(["]([^$"\\]|("\\".))*["]) { - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case 'n': - *t++ = '\n'; - zendlval->value.str.len--; - break; - case 'r': - *t++ = '\r'; - zendlval->value.str.len--; - break; - case 't': - *t++ = '\t'; - zendlval->value.str.len--; - break; - case '\\': - case '$': - case '"': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - /* check for an octal */ - if (ZEND_IS_OCT(*s)) { - char octal_buf[4] = { 0, 0, 0, 0 }; - - octal_buf[0] = *s; - zendlval->value.str.len--; - if ((s+1)value.str.len--; - if ((s+1)value.str.len--; - } - } - *t++ = (char) strtol(octal_buf, NULL, 8); - } else if (*s=='x' && (s+1)value.str.len--; /* for the 'x' */ - - hex_buf[0] = *(++s); - zendlval->value.str.len--; - if ((s+1)value.str.len--; - } - *t++ = (char) strtol(hex_buf, NULL, 16); - } else { - *t++ = '\\'; - *t++ = *s; - } - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - - -([']([^'\\]|("\\".))*[']) { - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case '\\': - case '\'': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - *t++ = '\\'; - *t++ = *s; - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - - return T_CONSTANT_ENCAPSED_STRING; -} - - -["] { - BEGIN(ST_DOUBLE_QUOTES); - return '\"'; -} - - -"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { - char *s; - CG(zend_lineno)++; - CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0); - s = yytext+3; - while ((*s == ' ') || (*s == '\t')) { - s++; - CG(heredoc_len)--; - } - CG(heredoc) = estrndup(s, CG(heredoc_len)); - BEGIN(ST_HEREDOC); - return T_START_HEREDOC; -} - - -[`] { - BEGIN(ST_BACKQUOTE); - return '`'; -} - - -['] { - BEGIN(ST_SINGLE_QUOTE); - return '\''; -} - - -^{LABEL}(";")?{NEWLINE} { - int label_len; - unsigned char unput_semicolon; - - CG(zend_lineno)++; - if (yytext[yyleng-2]=='\r') { - label_len = yyleng-2; - } else { - label_len = yyleng-1; - } - - if (yytext[label_len-1]==';') { - label_len--; - unput_semicolon=1; - } else{ - unput_semicolon=0; - } - - if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) { - zendlval->value.str.val = estrndup(yytext, yyleng); /* unput destroys yytext */ - zendlval->value.str.len = yyleng; - if (unput_semicolon) { - unput(';'); - } - efree(CG(heredoc)); - CG(heredoc)=NULL; - CG(heredoc_len)=0; - BEGIN(ST_IN_SCRIPTING); - return T_END_HEREDOC; - } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_STRING; - } -} - - -{ESCAPED_AND_WHITESPACE} { - HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - -([^'\\]|\\[^'\\])+ { - HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -[`]+ { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -["]+ { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -"$"[^a-zA-Z_\x7f-\xff{] { - zendlval->value.lval = (long) yytext[0]; - if (yyleng == 2) { - yyless(1); - } - return T_CHARACTER; -} - - -{ENCAPSED_TOKENS} { - zendlval->value.lval = (long) yytext[0]; - return yytext[0]; -} - -"{$" { - zendlval->value.lval = (long) yytext[0]; - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); - return T_CURLY_OPEN; -} - - -"\\'" { - zendlval->value.lval = (long) '\''; - return T_CHARACTER; -} - -"\\\\" { - zendlval->value.lval = (long)'\\'; - return T_CHARACTER; -} - -"\\\"" { - zendlval->value.lval = (long) '"'; - return T_CHARACTER; -} - -"\\`" { - zendlval->value.lval = (long) '`'; - return T_CHARACTER; -} - -"\\"[0-7]{1,3} { - zendlval->value.lval = strtol(yytext+1, NULL, 8); - return T_CHARACTER; -} - -"\\x"[0-9A-Fa-f]{1,2} { - zendlval->value.lval = strtol (yytext+2, NULL, 16); - return T_CHARACTER; -} - -"\\"{ANY_CHAR} { - switch (yytext[1]) { - case 'n': - zendlval->value.lval = (long) '\n'; - break; - case 't': - zendlval->value.lval = (long) '\t'; - break; - case 'r': - zendlval->value.lval = (long) '\r'; - break; - case '\\': - zendlval->value.lval = (long) '\\'; - break; - case '$': - zendlval->value.lval = (long) yytext[1]; - break; - case '{': - zendlval->value.lval = (long) yytext[1]; - break; - default: - zendlval->value.str.val = estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_BAD_CHARACTER; - break; - } - return T_CHARACTER; -} - - -["'`]+ { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -["] { - BEGIN(ST_IN_SCRIPTING); - return '\"'; -} - - -[`] { - BEGIN(ST_IN_SCRIPTING); - return '`'; -} - - -['] { - BEGIN(ST_IN_SCRIPTING); - return '\''; -} - - -<> { - return 0; -} - -<> { - zend_error(E_COMPILE_WARNING,"Unterminated comment starting line %d", CG(comment_start_line)); - return 0; -} - - - -{ANY_CHAR} { - zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); -} diff --git a/Zend/zend_list.c b/Zend/zend_list.c deleted file mode 100644 index 4f33c8c3449..00000000000 --- a/Zend/zend_list.c +++ /dev/null @@ -1,391 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -/* resource lists */ - -#include "zend.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_globals.h" - -ZEND_API int le_index_ptr; - -/* true global */ -static HashTable list_destructors; - - -ZEND_API int zend_list_insert(void *ptr, int type) -{ - int index; - zend_rsrc_list_entry le; - TSRMLS_FETCH(); - - le.ptr=ptr; - le.type=type; - le.refcount=1; - - index = zend_hash_next_free_element(&EG(regular_list)); - zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL); - return index; -} - -ZEND_API int _zend_list_delete(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */ - if (--le->refcount<=0) { - return zend_hash_index_del(&EG(regular_list), id); - } else { - return SUCCESS; - } - } else { - return FAILURE; - } -} - - -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { - *type = le->type; - return le->ptr; - } else { - *type = -1; - return NULL; - } -} - - -ZEND_API int _zend_list_addref(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */ - le->refcount++; - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type) -{ - int rsrc_id; - - rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type); - - if (rsrc_result) { - rsrc_result->value.lval = rsrc_id; - rsrc_result->type = IS_RESOURCE; - } - - return rsrc_id; -} - - -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...) -{ - int id; - int actual_resource_type; - void *resource; - va_list resource_types; - int i; - - if (default_id==-1) { /* use id */ - if (!passed_id) { - if (resource_type_name) { - zend_error(E_WARNING, "%s(): no %s resource supplied", get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } else if ((*passed_id)->type != IS_RESOURCE) { - if (resource_type_name) { - zend_error(E_WARNING, "%s(): supplied argument is not a valid %s resource", get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } - id = (*passed_id)->value.lval; - } else { - id = default_id; - } - - resource = zend_list_find(id, &actual_resource_type); - if (!resource) { - if (resource_type_name) { - zend_error(E_WARNING, "%s(): %d is not a valid %s resource", get_active_function_name(TSRMLS_C), id, resource_type_name); - } - return NULL; - } - - va_start(resource_types, num_resource_types); - for (i=0; itype, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->list_dtor) { - (ld->list_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->list_dtor_ex) { - ld->list_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type); - } -} - - -void plist_entry_destructor(void *ptr) -{ - zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr; - zend_rsrc_list_dtors_entry *ld; - TSRMLS_FETCH(); - - if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->plist_dtor) { - (ld->plist_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->plist_dtor_ex) { - ld->plist_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type); - } -} - - -int zend_init_rsrc_list(TSRMLS_D) -{ - if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) { - EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */ - return SUCCESS; - } else { - return FAILURE; - } -} - - -int zend_init_rsrc_plist(TSRMLS_D) -{ - return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0); -} - - -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC) -{ - Bucket *p, *q; - - while (1) { - p = ht->pListTail; - if (!p) { - break; - } - q = p->pListLast; - if (q) { - q->pListNext = NULL; - } - ht->pListTail = q; - - if (ht->pDestructor) { - zend_try { - ht->pDestructor(p->pData); - } zend_end_try(); - } - if (!p->pDataPtr && p->pData) { - pefree(p->pData, ht->persistent); - } - pefree(p, ht->persistent); - } - pefree(ht->arBuckets, ht->persistent); -} - - -static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC) -{ - if (le->type == *resource_id) { - return 1; - } else { - return 0; - } -} - - -static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC) -{ - if (ld->module_number == *module_number) { - zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - return 1; - } else { - return 0; - } -} - - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC); -} - - -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor=(void (*)(void *)) ld; - lde.plist_dtor=(void (*)(void *)) pld; - lde.list_dtor_ex = lde.plist_dtor_ex = NULL; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_STD; - lde.type_name = NULL; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - - -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor = NULL; - lde.plist_dtor = NULL; - lde.list_dtor_ex = ld; - lde.plist_dtor_ex = pld; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_EX; - lde.type_name = type_name; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - -ZEND_API int zend_fetch_list_dtor_id(char *type_name) -{ - zend_rsrc_list_dtors_entry *lde; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(&list_destructors, &pos); - while(zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) { - if(strcmp(type_name, lde->type_name) == 0) { -#if 0 - printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name); -#endif - return lde->resource_id; - } - zend_hash_move_forward_ex(&list_destructors, &pos); - } - - return 0; -} - -int zend_init_rsrc_list_dtors(void) -{ - int retval; - - retval = zend_hash_init(&list_destructors, 50, NULL, NULL, 1); - list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */ - - return retval; -} - - -void zend_destroy_rsrc_list_dtors(void) -{ - zend_hash_destroy(&list_destructors); -} - - -char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) -{ - zend_rsrc_list_dtors_entry *lde; - int rsrc_type; - - if (!zend_list_find(resource, &rsrc_type)) - return NULL; - - if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) { - return lde->type_name; - } else { - return NULL; - } -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_list.h b/Zend/zend_list.h deleted file mode 100644 index 0b1054a263f..00000000000 --- a/Zend/zend_list.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_LIST_H -#define ZEND_LIST_H - -#include "zend_hash.h" -#include "zend_globals.h" - - -#define ZEND_RESOURCE_LIST_TYPE_STD 1 -#define ZEND_RESOURCE_LIST_TYPE_EX 2 - -typedef struct _zend_rsrc_list_entry { - void *ptr; - int type; - int refcount; -} zend_rsrc_list_entry; - -typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC); -#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc TSRMLS_DC) - -typedef struct _zend_rsrc_list_dtors_entry { - /* old style destructors */ - void (*list_dtor)(void *); - void (*plist_dtor)(void *); - - /* new style destructors */ - rsrc_dtor_func_t list_dtor_ex; - rsrc_dtor_func_t plist_dtor_ex; - - char *type_name; - - int module_number; - int resource_id; - unsigned char type; -} zend_rsrc_list_dtors_entry; - - -#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number); -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number); -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number); - -void list_entry_destructor(void *ptr); -void plist_entry_destructor(void *ptr); - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC); -int zend_init_rsrc_list(TSRMLS_D); -int zend_init_rsrc_plist(TSRMLS_D); -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC); -int zend_init_rsrc_list_dtors(void); -void zend_destroy_rsrc_list_dtors(void); - -ZEND_API int zend_list_insert(void *ptr, int type); -ZEND_API int _zend_list_addref(int id TSRMLS_DC); -ZEND_API int _zend_list_delete(int id TSRMLS_DC); -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); - -#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) -#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) -#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC) - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); - -ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); -ZEND_API int zend_fetch_list_dtor_id(char *type_name); - -extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ - -#define ZEND_VERIFY_RESOURCE(rsrc) \ - if (!rsrc) { \ - RETURN_NULL(); \ - } - -#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \ - zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type); - -#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \ - if (le_id == 0) { \ - le_id = zend_fetch_list_dtor_id(le_type_name); \ - } - -#endif diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c deleted file mode 100644 index d729c89c995..00000000000 --- a/Zend/zend_llist.c +++ /dev/null @@ -1,305 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_llist.h" -#include "zend_qsort.h" - -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent) -{ - l->head = NULL; - l->tail = NULL; - l->count = 0; - l->size = size; - l->dtor = dtor; - l->persistent = persistent; -} - - -ZEND_API void zend_llist_add_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->prev = l->tail; - tmp->next = NULL; - if (l->tail) { - l->tail->next = tmp; - } else { - l->head = tmp; - } - l->tail = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->next = l->head; - tmp->prev = NULL; - if (l->head) { - l->head->prev = tmp; - } else { - l->tail = tmp; - } - l->head = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -#define DEL_LLIST_ELEMENT(current, l) \ - if ((current)->prev) {\ - (current)->prev->next = (current)->next;\ - } else {\ - (l)->head = (current)->next;\ - }\ - if ((current)->next) {\ - (current)->next->prev = (current)->prev;\ - } else {\ - (l)->tail = (current)->prev;\ - }\ - if ((l)->dtor) {\ - (l)->dtor((current)->data);\ - pefree((current), (l)->persistent);\ - }\ - --l->count; - - -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)) -{ - zend_llist_element *current=l->head; - zend_llist_element *next; - - while (current) { - next = current->next; - if (compare(current->data, element)) { - DEL_LLIST_ELEMENT(current, l); - break; - } - current = next; - } -} - - -ZEND_API void zend_llist_destroy(zend_llist *l) -{ - zend_llist_element *current=l->head, *next; - - while (current) { - next = current->next; - if (l->dtor) { - l->dtor(current->data); - } - pefree(current, l->persistent); - current = next; - } - - l->count = 0; -} - - -ZEND_API void zend_llist_clean(zend_llist *l) -{ - zend_llist_destroy(l); - l->head = l->tail = NULL; -} - - -ZEND_API void *zend_llist_remove_tail(zend_llist *l) -{ - zend_llist_element *old_tail; - void *data; - - if ((old_tail = l->tail)) { - if (l->tail->prev) { - l->tail->prev->next = NULL; - } - - data = old_tail->data; - - l->tail = l->tail->prev; - pefree(old_tail, l->persistent); - - --l->count; - - return data; - } - - return NULL; -} - - -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src) -{ - zend_llist_element *ptr; - - zend_llist_init(dst, src->size, src->dtor, src->persistent); - ptr = src->head; - while (ptr) { - zend_llist_add_element(dst, ptr->data); - ptr = ptr->next; - } -} - - -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)) -{ - zend_llist_element *element, *next; - - element=l->head; - while (element) { - next = element->next; - if (func(element->data)) { - DEL_LLIST_ELEMENT(element, l); - } - element = next; - } -} - - -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data TSRMLS_CC); - } -} - -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC) -{ - size_t i; - - zend_llist_element **elements; - zend_llist_element *element, **ptr; - - if (l->count <= 0) { - return; - } - - elements = (zend_llist_element **) emalloc(l->count * sizeof(zend_llist_element *)); - - ptr = &elements[0]; - - for (element=l->head; element; element=element->next) { - *ptr++ = element; - } - - zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func TSRMLS_CC); - - l->head = elements[0]; - elements[0]->prev = NULL; - - for (i = 1; i < l->count; i++) { - elements[i]->prev = elements[i-1]; - elements[i-1]->next = elements[i]; - } - elements[i-1]->next = NULL; - l->tail = elements[i-1]; - efree(elements); -} - - -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data, arg TSRMLS_CC); - } -} - - -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...) -{ - zend_llist_element *element; - va_list args; - - va_start(args, num_args); - for (element=l->head; element; element=element->next) { - func(element->data, num_args, args TSRMLS_CC); - } - va_end(args); -} - - -ZEND_API int zend_llist_count(zend_llist *l) -{ - return l->count; -} - - -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->head; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->tail; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->next; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - - -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->prev; - if (*current) { - return (*current)->data; - } - } - return NULL; -} diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h deleted file mode 100644 index 075c9cd83f8..00000000000 --- a/Zend/zend_llist.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_LLIST_H -#define ZEND_LLIST_H - -#include - -typedef struct _zend_llist_element { - struct _zend_llist_element *next; - struct _zend_llist_element *prev; - char data[1]; /* Needs to always be last in the struct */ -} zend_llist_element; - -typedef void (*llist_dtor_func_t)(void *); -typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element * TSRMLS_DC); -typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC); -typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC); -typedef void (*llist_apply_func_t)(void * TSRMLS_DC); - -typedef struct _zend_llist { - zend_llist_element *head; - zend_llist_element *tail; - size_t count; - size_t size; - llist_dtor_func_t dtor; - unsigned char persistent; - zend_llist_element *traverse_ptr; -} zend_llist; - -typedef zend_llist_element* zend_llist_position; - -BEGIN_EXTERN_C() -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent); -ZEND_API void zend_llist_add_element(zend_llist *l, void *element); -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element); -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); -ZEND_API void zend_llist_destroy(zend_llist *l); -ZEND_API void zend_llist_clean(zend_llist *l); -ZEND_API void *zend_llist_remove_tail(zend_llist *l); -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC); -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC); -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...); -ZEND_API int zend_llist_count(zend_llist *l); -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC); - -/* traversal */ -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos); - -#define zend_llist_get_first(l) zend_llist_get_first_ex(l, NULL) -#define zend_llist_get_last(l) zend_llist_get_last_ex(l, NULL) -#define zend_llist_get_next(l) zend_llist_get_next_ex(l, NULL) -#define zend_llist_get_prev(l) zend_llist_get_prev_ex(l, NULL) - -END_EXTERN_C() - -#endif /* ZEND_LLIST_H */ diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h deleted file mode 100644 index ae295f983a1..00000000000 --- a/Zend/zend_modules.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef MODULES_H -#define MODULES_H - -#include "zend.h" - -#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC -#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC -#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC -#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC - -ZEND_API extern unsigned char first_arg_force_ref[]; -ZEND_API extern unsigned char second_arg_force_ref[]; -ZEND_API extern unsigned char third_arg_force_ref[]; - -#define ZEND_MODULE_API_NO 20010927 -#ifdef ZTS -#define USING_ZTS 1 -#else -#define USING_ZTS 0 -#endif - -#define STANDARD_MODULE_HEADER sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS - -#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0 - -#define STANDARD_MODULE_PROPERTIES \ - NULL, NULL, STANDARD_MODULE_PROPERTIES_EX - -#define NO_VERSION_YET NULL - -#define MODULE_PERSISTENT 1 -#define MODULE_TEMPORARY 2 - -typedef struct _zend_module_entry zend_module_entry; - -struct _zend_module_entry { - unsigned short size; - unsigned int zend_api; - unsigned char zend_debug; - unsigned char zts; - char *name; - zend_function_entry *functions; - int (*module_startup_func)(INIT_FUNC_ARGS); - int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); - int (*request_startup_func)(INIT_FUNC_ARGS); - int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); - void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); - char *version; - int (*global_startup_func)(void); - int (*global_shutdown_func)(void); - int globals_id; - int module_started; - unsigned char type; - void *handle; - int module_number; -}; - - -extern ZEND_API HashTable module_registry; - -void module_destructor(zend_module_entry *module); -int module_registry_cleanup(zend_module_entry *module TSRMLS_DC); -int module_registry_request_startup(zend_module_entry *module TSRMLS_DC); - -#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor -#endif diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c deleted file mode 100644 index a2a7a5665c7..00000000000 --- a/Zend/zend_object_handlers.c +++ /dev/null @@ -1,259 +0,0 @@ -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects.h" -#include "zend_object_handlers.h" - -#define DEBUG_OBJECT_HANDLERS 0 - -static HashTable *zend_std_get_properties(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_GET_OBJ(object); - return zobj->properties; -} - -zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **retval; - - zobj = Z_GET_OBJ(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - if (zend_hash_find(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - zend_error(E_NOTICE,"Undefined property: %s", Z_STRVAL_P(member)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined property: %s", Z_STRVAL_P(member)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - - } - } - if (member == &tmp_member) { - zval_dtor(member); - } - return *retval; -} - -static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **variable_ptr; - - zobj = Z_GET_OBJ(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - if (zend_hash_find(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member), (void **) &variable_ptr) == SUCCESS) { - if (*variable_ptr == EG(error_zval_ptr) || member == EG(error_zval_ptr)) { - /* variable_ptr = EG(uninitialized_zval_ptr); */ -/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ - } else if (*variable_ptr != value) { - (*variable_ptr)->refcount--; - if ((*variable_ptr)->refcount == 0) { - zendi_zval_dtor(**variable_ptr); - FREE_ZVAL(*variable_ptr); - } - } - } - - value->refcount++; - zend_hash_update(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, &value, sizeof(zval *), NULL); - if (member == &tmp_member) { - zval_dtor(member); - } -} - -static zval **zend_std_get_property_ptr(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **retval; - - zobj = Z_GET_OBJ(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - if (zend_hash_find(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &retval) == FAILURE) { - zval *new_zval = &EG(uninitialized_zval); - - zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); - new_zval->refcount++; - zend_hash_update(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, &new_zval, sizeof(zval *), (void **) &retval); - } - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - -static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - - zobj = Z_GET_OBJ(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - zend_hash_del(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1); - if (member == &tmp_member) { - zval_dtor(member); - } -} - -static union _zend_function *zend_std_get_method(zval *object, char *method_name, int method_len TSRMLS_DC) -{ - zend_object *zobj; - zend_function *func_method; - - zobj = Z_GET_OBJ(object); - if(zend_hash_find(&zobj->ce->function_table, method_name, method_len+1, (void **)&func_method) == FAILURE) { - zend_error(E_ERROR, "Call to undefined function %s()", method_name); - } - - return func_method; -} - -static union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC) -{ - zend_object *zobj; - - zobj = Z_GET_OBJ(object); - return zobj->ce->constructor; -} - -static int zend_std_get_class(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - zend_object *zobj; - zend_class_entry *ce; - - zobj = Z_GET_OBJ(object); - if(parent) { - ce = zobj->ce->parent; - } else { - ce = zobj->ce; - } - if(!ce) { - return FAILURE; - } - - *class_name = zobj->ce->name; - *class_name_len = zobj->ce->name_length; - return SUCCESS; -} - -int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC); - -static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) -{ - zend_object *zobj1, *zobj2; - - zobj1 = Z_GET_OBJ(o1); - zobj2 = Z_GET_OBJ(o2); - - if(zobj1->ce != zobj2->ce) { - return 1; /* different classes */ - } - return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); -} - -static int zend_std_has_property(zval *object, zval *member, int check_empty TSRMLS_DC) -{ - zend_object *zobj; - int result; - zval **value; - zval tmp_member; - - zobj = Z_GET_OBJ(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - - if(zend_hash_find(zobj->properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **)&value) == SUCCESS) { - if(check_empty) { - result = zend_is_true(*value); - } else { - result = (Z_TYPE_PP(value) != IS_NULL); - } - } else { - result = 0; - } - - if (member == &tmp_member) { - zval_dtor(member); - } - return result; -} - -zend_object_handlers std_object_handlers = { - zend_objects_add_ref, /* add_ref */ - zend_objects_del_ref, /* del_ref */ - zend_objects_delete_obj, /* delete_obj */ - zend_objects_clone_obj, /* clone_obj */ - - zend_std_read_property, /* read_property */ - zend_std_write_property, /* write_property */ - zend_std_get_property_ptr, /* get_property_ptr */ - zend_std_get_property_ptr, /* get_property_zval_ptr */ - NULL, /* get */ - NULL, /* set */ - zend_std_has_property, /* has_property */ - zend_std_unset_property, /* unset_property */ - zend_std_get_properties, /* get_properties */ - zend_std_get_method, /* get_method */ - NULL, /* call_method */ - zend_std_get_constructor, /* get_constructor */ - zend_std_get_class, /* get_class */ - zend_std_compare_objects /* compare_objects */ -}; - diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h deleted file mode 100644 index 62db6248463..00000000000 --- a/Zend/zend_object_handlers.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef ZEND_OBJECT_HANDLERS_H -#define ZEND_OBJECT_HANDLERS_H - -union _zend_function; - -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC); -/* Used to fetch property from the object, read-only */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); -/* Used to set property of the object */ - -typedef zval **(*zend_object_get_property_ptr_t)(zval *object, zval *member TSRMLS_DC); -/* Used to create pointer to the property of the object, for future r/w access via get/set */ -typedef zval **(*zend_object_get_property_zval_ptr_t)(zval *object, zval *member TSRMLS_DC); -/* Used to create pointer to the property of the object, for future direct r/w access */ -typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); -/* Used to set object value (most probably used in combination with -typedef the result of the get_property_ptr) */ -typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); -/* Used to get object value (most probably used in combination with -the result of the get_property_ptr or when converting object value to -one of the basic types) */ - -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int check_empty TSRMLS_DC); -/* Used to check if a property of the object exists */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); -/* Used to remove a property of the object */ - -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); -/* Used to get hash of the properties of the object, as hash of zval's */ - -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); -/* Used to call methods */ -/* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback fror this. -*/ -typedef union _zend_function *(*zend_object_get_method_t)(zval *object, char *method, int method_len TSRMLS_DC); -typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); -/* Get method parameter mask - by value/by reference, etc. */ - -/* Object maintenance/destruction */ -typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC); -typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); - -typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); -typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); - -typedef struct _zend_object_handlers { - /* general object functions */ - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_delete_obj_t delete_obj; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_get_property_ptr_t get_property_ptr; - zend_object_get_property_zval_ptr_t get_property_zval_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; -} zend_object_handlers; - -extern zend_object_handlers std_object_handlers; - -#define IS_ZEND_STD_OBJECT(z) ((z).type == IS_OBJECT && Z_OBJ_HT(z) == &std_object_handlers) - -#endif diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c deleted file mode 100644 index a019c9bcc47..00000000000 --- a/Zend/zend_objects.c +++ /dev/null @@ -1,257 +0,0 @@ -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" - -#define ZEND_DEBUG_OBJECTS 0 - -void zend_objects_init(zend_objects *objects, zend_uint init_size) -{ - objects->object_buckets = (zend_object_bucket *) emalloc(init_size * sizeof(zend_object_bucket)); - objects->top = 1; /* Skip 0 so that handles are true */ - objects->size = init_size; - objects->free_list_head = -1; -} - -void zend_objects_destroy(zend_objects *objects) -{ - efree(objects->object_buckets); -} - -static inline void zend_objects_call_destructor(zend_object *object, zend_object_handle handle TSRMLS_DC) -{ - if (object->ce->destructor) { - zval *obj; - zval *destructor_func_name; - zval *retval_ptr; - HashTable symbol_table; - - MAKE_STD_ZVAL(obj); - obj->type = IS_OBJECT; - obj->value.obj.handle = handle; - obj->value.obj.handlers = &std_object_handlers; - zval_copy_ctor(obj); - - - /* FIXME: Optimize this so that we use the old_object->ce->destructor function pointer instead of the name */ - MAKE_STD_ZVAL(destructor_func_name); - destructor_func_name->type = IS_STRING; - destructor_func_name->value.str.val = estrndup("__destruct", sizeof("__destruct")-1); - destructor_func_name->value.str.len = sizeof("__destruct")-1; - - ZEND_INIT_SYMTABLE(&symbol_table); - - call_user_function_ex(NULL, &obj, destructor_func_name, &retval_ptr, 0, NULL, 0, &symbol_table TSRMLS_CC); - - zend_hash_destroy(&symbol_table); - zval_ptr_dtor(&obj); - zval_ptr_dtor(&destructor_func_name); - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - } -} - - -static inline void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC) -{ - zend_objects_call_destructor(object, handle TSRMLS_CC); - /* Nuke the object */ - zend_hash_destroy(object->properties); - efree(object->properties); - -} - - -void zend_objects_call_destructors(zend_objects *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (EG(objects).object_buckets[i].valid) { - EG(objects).object_buckets[i].constructor_called = 1; - zend_objects_destroy_object(&EG(objects).object_buckets[i].bucket.obj.object, i TSRMLS_CC); - EG(objects).object_buckets[i].valid = 0; - } - } -} - - -zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type) -{ - zend_object_handle handle; - zend_object_value retval; - - TSRMLS_FETCH(); - - if (EG(objects).free_list_head != -1) { - handle = EG(objects).free_list_head; - EG(objects).free_list_head = EG(objects).object_buckets[handle].bucket.free_list.next; - } else { - if (EG(objects).top == EG(objects).size) { - EG(objects).size <<= 1; - EG(objects).object_buckets = (zend_object_bucket *) erealloc(EG(objects).object_buckets, EG(objects).size * sizeof(zend_object_bucket)); - } - handle = EG(objects).top++; - } - EG(objects).object_buckets[handle].valid = 1; - EG(objects).object_buckets[handle].constructor_called = 0; - EG(objects).object_buckets[handle].bucket.obj.refcount = 1; - - *object = &EG(objects).object_buckets[handle].bucket.obj.object; - - (*object)->ce = class_type; - - retval.handle = handle; - retval.handlers = &std_object_handlers; -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Allocated object id #%d\n", handle); -#endif - return retval; -} - -zend_object *zend_objects_get_address(zval *zobject) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - TSRMLS_FETCH(); - - if (!EG(objects).object_buckets[handle].valid) { - zend_error(E_ERROR, "Trying to access invalid object"); - } - return &EG(objects).object_buckets[handle].bucket.obj.object; -} - -void zend_objects_add_ref(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - if (!EG(objects).object_buckets[handle].valid) { - zend_error(E_ERROR, "Trying to add reference to invalid object"); - } - - EG(objects).object_buckets[handle].bucket.obj.refcount++; -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Increased refcount of object id #%d\n", handle); -#endif -} - -void zend_objects_delete_obj(zval *zobject TSRMLS_DC) -{ - zend_object *object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - if (!EG(objects).object_buckets[handle].valid) { - zend_error(E_ERROR, "Trying to delete invalid object"); - } - - object = &EG(objects).object_buckets[handle].bucket.obj.object; - - if (!EG(objects).object_buckets[handle].constructor_called) { - EG(objects).object_buckets[handle].constructor_called = 1; - zend_objects_destroy_object(object, handle TSRMLS_CC); - } - - EG(objects).object_buckets[handle].valid = 0; - -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Deleted object id #%d\n", handle); -#endif - -} - -#define ZEND_OBJECTS_ADD_TO_FREE_LIST() \ - EG(objects).object_buckets[handle].bucket.free_list.next = EG(objects).free_list_head; \ - EG(objects).free_list_head = handle; \ - EG(objects).object_buckets[handle].valid = 0; - -void zend_objects_del_ref(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - if (--EG(objects).object_buckets[handle].bucket.obj.refcount == 0) { - zend_object *object; - do { - if (EG(objects).object_buckets[handle].valid) { - if (!EG(objects).object_buckets[handle].constructor_called) { - object = &EG(objects).object_buckets[handle].bucket.obj.object; - EG(objects).object_buckets[handle].constructor_called = 1; - zend_objects_destroy_object(object, handle TSRMLS_CC); - if (EG(objects).object_buckets[handle].bucket.obj.refcount == 0) { - ZEND_OBJECTS_ADD_TO_FREE_LIST(); - } - break; - } - } - ZEND_OBJECTS_ADD_TO_FREE_LIST(); - } while (0); - -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Deallocated object id #%d\n", handle); -#endif - } -#if ZEND_DEBUG_OBJECTS - else { - fprintf(stderr, "Decreased refcount of object id #%d\n", handle); - } -#endif -} - -zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - - if (!EG(objects).object_buckets[handle].valid) { - zend_error(E_ERROR, "Trying to clone invalid object"); - } - - old_object = &EG(objects).object_buckets[handle].bucket.obj.object; - retval = zend_objects_new(&new_object, old_object->ce); - - if (old_object->ce->clone) { - zval *old_obj; - zval *new_obj; - zval *clone_func_name; - zval *retval_ptr; - HashTable symbol_table; - - MAKE_STD_ZVAL(new_obj); - new_obj->type = IS_OBJECT; - new_obj->value.obj = retval; - zval_copy_ctor(new_obj); - - MAKE_STD_ZVAL(old_obj); - old_obj->type = IS_OBJECT; - old_obj->value.obj.handle = handle; - old_obj->value.obj.handlers = &std_object_handlers; /* If we reached here than the handlers are standrd */ - zval_copy_ctor(old_obj); - - /* FIXME: Optimize this so that we use the old_object->ce->clone function pointer instead of the name */ - MAKE_STD_ZVAL(clone_func_name); - clone_func_name->type = IS_STRING; - clone_func_name->value.str.val = estrndup("__clone", sizeof("__clone")-1); - clone_func_name->value.str.len = sizeof("__clone")-1; - - ALLOC_HASHTABLE(new_object->properties); - zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - ZEND_INIT_SYMTABLE(&symbol_table); - ZEND_SET_SYMBOL(&symbol_table, "clone", old_obj); - - call_user_function_ex(NULL, &new_obj, clone_func_name, &retval_ptr, 0, NULL, 0, &symbol_table TSRMLS_CC); - - zend_hash_destroy(&symbol_table); - zval_ptr_dtor(&new_obj); - zval_ptr_dtor(&clone_func_name); - zval_ptr_dtor(&retval_ptr); - } else { - ALLOC_HASHTABLE(new_object->properties); - zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } - - return retval; -} diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h deleted file mode 100644 index 27e3dca8ddc..00000000000 --- a/Zend/zend_objects.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ZEND_OBJECTS_H -#define ZEND_OBJECTS_H - -#include "zend.h" - -typedef struct _zend_object_bucket { - zend_bool valid; - zend_bool constructor_called; - union _bucket { - struct { - zend_object object; - zend_uint refcount; - } obj; - struct { - int next; - } free_list; - } bucket; -} zend_object_bucket; - -typedef struct _zend_objects { - zend_object_bucket *object_buckets; - zend_uint top; - zend_uint size; - int free_list_head; -} zend_objects; - -void zend_objects_init(zend_objects *objects, zend_uint init_size); -void zend_objects_call_destructors(zend_objects *objects TSRMLS_DC); -void zend_objects_destroy(zend_objects *objects); -zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type); - -zend_object *zend_objects_get_address(zval *object); - -void zend_objects_add_ref(zval *object TSRMLS_DC); -void zend_objects_del_ref(zval *object TSRMLS_DC); -void zend_objects_delete_obj(zval *object TSRMLS_DC); -zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC); - -#define Z_GET_OBJ(object_zval) zend_objects_get_address(object_zval) - -#endif /* ZEND_OBJECTS_H */ diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c deleted file mode 100644 index 221dee43ae5..00000000000 --- a/Zend/zend_opcode.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include - -#include "zend.h" -#include "zend_alloc.h" -#include "zend_compile.h" -#include "zend_extensions.h" -#include "zend_API.h" - - -static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_ctor) { - extension->op_array_ctor(op_array); - } -} - - -static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_dtor) { - extension->op_array_dtor(op_array); - } -} - - -static void op_array_alloc_ops(zend_op_array *op_array) -{ - op_array->opcodes = erealloc(op_array->opcodes, (op_array->size)*sizeof(zend_op)); -} - - - -void init_op_array(zend_op_array *op_array, int type, int initial_ops_size TSRMLS_DC) -{ - op_array->type = type; - - op_array->backpatch_count = 0; - if (CG(interactive)) { - /* We must avoid a realloc() on the op_array in interactive mode, since pointers to constants - * will become invalid - */ - initial_ops_size = 8192; - } - - op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint)); - *op_array->refcount = 1; - op_array->size = initial_ops_size; - op_array->last = 0; - op_array->opcodes = NULL; - op_array_alloc_ops(op_array); - - op_array->T = 0; - - op_array->function_name = NULL; - op_array->filename = zend_get_compiled_filename(TSRMLS_C); - - op_array->arg_types = NULL; - - op_array->scope = NULL; - - op_array->brk_cont_array = NULL; - op_array->last_brk_cont = 0; - op_array->current_brk_cont = -1; - - op_array->static_variables = NULL; - - op_array->return_reference = 0; - op_array->done_pass_two = 0; - - op_array->uses_this = 0; - - op_array->start_op = NULL; - - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC); -} - - -ZEND_API void destroy_zend_function(zend_function *function) -{ - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function); - break; - case ZEND_INTERNAL_FUNCTION: - /* do nothing */ - break; - } -} - - -ZEND_API void destroy_zend_class(zend_class_entry **pce) -{ - zend_class_entry *ce = *pce; - - if (--ce->refcount > 0) { - return; - } - switch (ce->type) { - case ZEND_USER_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->private_properties); - zend_hash_destroy(ce->static_members); - efree(ce->name); - zend_hash_destroy(&ce->function_table); - FREE_HASHTABLE(ce->static_members); - zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); - efree(ce); - break; - case ZEND_INTERNAL_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->private_properties); - zend_hash_destroy(ce->static_members); - free(ce->name); - zend_hash_destroy(&ce->function_table); - free(ce->static_members); - zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); - free(ce); - break; - } -} - - -void zend_class_add_ref(zend_class_entry **ce) -{ - (*ce)->refcount++; -} - - -ZEND_API void destroy_op_array(zend_op_array *op_array) -{ - zend_op *opline = op_array->opcodes; - zend_op *end = op_array->opcodes+op_array->last; - TSRMLS_FETCH(); - - if (op_array->static_variables) { - zend_hash_destroy(op_array->static_variables); - FREE_HASHTABLE(op_array->static_variables); - } - - if (--(*op_array->refcount)>0) { - return; - } - - efree(op_array->refcount); - - while (oplineop1.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op1.u.constant); -#endif - zval_dtor(&opline->op1.u.constant); - } - if (opline->op2.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op2.u.constant); -#endif - zval_dtor(&opline->op2.u.constant); - } - opline++; - } - efree(op_array->opcodes); - if (op_array->function_name) { - efree(op_array->function_name); - } - if (op_array->arg_types) { - efree(op_array->arg_types); - } - if (op_array->brk_cont_array) { - efree(op_array->brk_cont_array); - } - if (op_array->done_pass_two) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC); - } -} - - -void init_op(zend_op *op TSRMLS_DC) -{ - memset(&op->result, 0, sizeof(znode)); - op->lineno = CG(zend_lineno); - SET_UNUSED(op->result); - op->extended_value = 0; - memset(&op->op1, 0, sizeof(znode)); - memset(&op->op2, 0, sizeof(znode)); -} - -zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC) -{ - zend_uint next_op_num = op_array->last++; - zend_op *next_op; - - if (next_op_num >= op_array->size) { - if (CG(interactive)) { - /* we messed up */ - zend_printf("Ran out of opcode space!\n" - "You should probably consider writing this huge script into a file!\n"); - zend_bailout(); - } - op_array->size *= 4; - op_array_alloc_ops(op_array); - } - - next_op = &(op_array->opcodes[next_op_num]); - - init_op(next_op TSRMLS_CC); - - return next_op; -} - - -int get_next_op_number(zend_op_array *op_array) -{ - return op_array->last; -} - - - - -zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array) -{ - op_array->last_brk_cont++; - op_array->brk_cont_array = erealloc(op_array->brk_cont_array, sizeof(zend_brk_cont_element)*op_array->last_brk_cont); - return &op_array->brk_cont_array[op_array->last_brk_cont-1]; -} - - -static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes, *end=opline+op_array->last; - - while (oplineopcode == ZEND_EXT_STMT) { - if (opline+1opcode == ZEND_EXT_STMT) { - opline->opcode = ZEND_NOP; - opline++; - continue; - } - if (opline+1lineno = (opline+1)->lineno; - } - } else { - opline->opcode = ZEND_NOP; - } - } - opline++; - } -} - - - -static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_handler) { - extension->op_array_handler(op_array); - } -} - - -int pass_two(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline, *end; - - if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { - return 0; - } - if (CG(extended_info)) { - zend_update_extended_info(op_array TSRMLS_CC); - } - if (CG(handle_op_arrays)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC); - } - - opline = op_array->opcodes; - end = opline + op_array->last; - while (opline < end) { - if (opline->op1.op_type == IS_CONST) { - opline->op1.u.constant.is_ref = 1; - opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ - } - if (opline->op2.op_type == IS_CONST) { - opline->op2.u.constant.is_ref = 1; - opline->op2.u.constant.refcount = 2; - } - opline++; - } - op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last); - op_array->size = op_array->last; - op_array->done_pass_two = 1; - return 0; -} - - -int print_class(zend_class_entry *class_entry TSRMLS_DC) -{ - printf("Class %s:\n", class_entry->name); - zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC); - printf("End of class %s.\n\n", class_entry->name); - return 0; -} - -ZEND_API unary_op_type get_unary_op(int opcode) -{ - switch(opcode) { - case ZEND_BW_NOT: - return (unary_op_type) bitwise_not_function; - break; - case ZEND_BOOL_NOT: - return (unary_op_type) boolean_not_function; - break; - default: - return (unary_op_type) NULL; - break; - } -} - - -ZEND_API void *get_binary_op(int opcode) -{ - switch (opcode) { - case ZEND_ADD: - case ZEND_ASSIGN_ADD: - return (void *) add_function; - break; - case ZEND_SUB: - case ZEND_ASSIGN_SUB: - return (void *) sub_function; - break; - case ZEND_MUL: - case ZEND_ASSIGN_MUL: - return (void *) mul_function; - break; - case ZEND_DIV: - case ZEND_ASSIGN_DIV: - return (void *) div_function; - break; - case ZEND_MOD: - case ZEND_ASSIGN_MOD: - return (void *) mod_function; - break; - case ZEND_SL: - case ZEND_ASSIGN_SL: - return (void *) shift_left_function; - break; - case ZEND_SR: - case ZEND_ASSIGN_SR: - return (void *) shift_right_function; - break; - case ZEND_CONCAT: - case ZEND_ASSIGN_CONCAT: - return (void *) concat_function; - break; - case ZEND_IS_IDENTICAL: - return (void *) is_identical_function; - break; - case ZEND_IS_NOT_IDENTICAL: - return (void *) is_not_identical_function; - break; - case ZEND_IS_EQUAL: - return (void *) is_equal_function; - break; - case ZEND_IS_NOT_EQUAL: - return (void *) is_not_equal_function; - break; - case ZEND_IS_SMALLER: - return (void *) is_smaller_function; - break; - case ZEND_IS_SMALLER_OR_EQUAL: - return (void *) is_smaller_or_equal_function; - break; - case ZEND_BW_OR: - case ZEND_ASSIGN_BW_OR: - return (void *) bitwise_or_function; - break; - case ZEND_BW_AND: - case ZEND_ASSIGN_BW_AND: - return (void *) bitwise_and_function; - break; - case ZEND_BW_XOR: - case ZEND_ASSIGN_BW_XOR: - return (void *) bitwise_xor_function; - break; - default: - return (void *) NULL; - break; - } -} diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c deleted file mode 100644 index a74be6b6a33..00000000000 --- a/Zend/zend_operators.c +++ /dev/null @@ -1,1750 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include -#include -#include -#include -#include - -#include "zend.h" -#include "zend_operators.h" -#include "zend_variables.h" -#include "zend_globals.h" -#include "zend_list.h" -#include "zend_fast_cache.h" -#include "zend_API.h" - -#if 0&&WITH_BCMATH -#include "ext/bcmath/number.h" -#endif - -ZEND_API int zend_atoi(const char *str, int str_len) -{ - int retval; - - if (!str_len) { - str_len = strlen(str); - } - retval = atoi(str); - if (str_len>0) { - switch (str[str_len-1]) { - case 'k': - case 'K': - retval *= 1024; - break; - case 'm': - case 'M': - retval *= 1048576; - break; - } - } - return retval; -} - - -ZEND_API double zend_string_to_double(const char *number, zend_uint length) -{ - double divisor = 10.0; - double result = 0.0; - double exponent; - const char *end = number+length; - const char *digit = number; - - if (!length) { - return result; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result *= 10; - result += *digit - '0'; - } else if (*digit == '.') { - digit++; - break; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result += (*digit - '0') / divisor; - divisor *= 10; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - return result; -} - - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) -{ - switch (op->type) { - case IS_STRING: - { - char *strval; - - strval = op->value.str.val; - switch ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval, 1))) { - case IS_DOUBLE: - case IS_LONG: - break; -#if 0 && WITH_BCMATH - case FLAG_IS_BC: - op->type = IS_DOUBLE; /* may have lost significant digits */ - break; -#endif - default: - op->value.lval = strtol(op->value.str.val, NULL, 10); - op->type = IS_LONG; - break; - } - STR_FREE(strval); - break; - } - case IS_BOOL: - op->type = IS_LONG; - break; - case IS_RESOURCE: - zend_list_delete(op->value.lval); - op->type = IS_LONG; - break; - case IS_NULL: - op->type = IS_LONG; - op->value.lval = 0; - break; - } -} - -#define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ - convert_scalar_to_number(op TSRMLS_CC); \ - } else { \ - switch ((op)->type) { \ - case IS_STRING: \ - { \ - switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval, 1))) { \ - case IS_DOUBLE: \ - case IS_LONG: \ - break; \ - case FLAG_IS_BC: \ - (holder).type = IS_DOUBLE; /* may have lost significant digits */ \ - break; \ - default: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - (holder).type = IS_LONG; \ - break; \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_NULL: \ - (holder).value.lval = 0; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - } \ - } - - -#define DVAL_TO_LVAL(d, l) (l) = (d) > LONG_MAX ? (unsigned long) (d) : (long) (d) - -#define zendi_convert_to_long(op, holder, result) \ - if (op==result) { \ - convert_to_long(op); \ - } else if ((op)->type != IS_LONG) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_DOUBLE: \ - DVAL_TO_LVAL((op)->value.dval, (holder).value.lval); \ - break; \ - case IS_STRING: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder).value.lval = 1; /* TBI!! */ \ - break; \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - break; \ - default: \ - zend_error(E_WARNING, "Cannot convert to ordinal value"); \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - } - - -#define zendi_convert_to_boolean(op, holder, result) \ - if (op==result) { \ - convert_to_boolean(op); \ - } else if ((op)->type != IS_BOOL) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_RESOURCE: \ - case IS_LONG: \ - (holder).value.lval = ((op)->value.lval ? 1 : 0); \ - break; \ - case IS_DOUBLE: \ - (holder).value.lval = ((op)->value.dval ? 1 : 0); \ - break; \ - case IS_STRING: \ - if ((op)->value.str.len == 0 \ - || ((op)->value.str.len==1 && (op)->value.str.val[0]=='0')) { \ - (holder).value.lval = 0; \ - } else { \ - (holder).value.lval = 1; \ - } \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder).value.lval = 1; /* TBI!! */ \ - break; \ - default: \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_BOOL; \ - (op) = &(holder); \ - } - - -ZEND_API void convert_to_long(zval *op) -{ - convert_to_long_base(op, 10); -} - - -ZEND_API void convert_to_long_base(zval *op, int base) -{ - char *strval; - long tmp; - - switch (op->type) { - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - break; - case IS_DOUBLE: - DVAL_TO_LVAL(op->value.dval, op->value.lval); - break; - case IS_STRING: - strval = op->value.str.val; - op->value.lval = strtol(strval, NULL, base); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - zval_dtor(op); - op->value.lval = 1; /* TBI!! */ - break; - default: - zend_error(E_WARNING, "Cannot convert to ordinal value"); - zval_dtor(op); - op->value.lval = 0; - break; - } - - op->type = IS_LONG; -} - - -ZEND_API void convert_to_double(zval *op) -{ - char *strval; - double tmp; - - switch (op->type) { - case IS_NULL: - op->value.dval = 0.0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - op->value.dval = (double) op->value.lval; - break; - case IS_DOUBLE: - break; - case IS_STRING: - strval = op->value.str.val; - - op->value.dval = strtod(strval, NULL); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.dval = tmp; - break; - case IS_OBJECT: - zval_dtor(op); - op->value.dval = 1; /* TBI!! */ - break; - default: - zend_error(E_WARNING, "Cannot convert to real value (type=%d)", op->type); - zval_dtor(op); - op->value.dval = 0; - break; - } - op->type = IS_DOUBLE; -} - - -ZEND_API void convert_to_null(zval *op) -{ - zval_dtor(op); - op->type = IS_NULL; -} - - -ZEND_API void convert_to_boolean(zval *op) -{ - char *strval; - int tmp; - - switch (op->type) { - case IS_BOOL: - break; - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_LONG: - op->value.lval = (op->value.lval ? 1 : 0); - break; - case IS_DOUBLE: - op->value.lval = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - strval = op->value.str.val; - - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - op->value.lval = 0; - } else { - op->value.lval = 1; - } - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - zval_dtor(op); - op->value.lval = 1; /* TBI!! */ - break; - default: - zval_dtor(op); - op->value.lval = 0; - break; - } - op->type = IS_BOOL; -} - - -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) -{ - long lval; - double dval; - TSRMLS_FETCH(); - - switch (op->type) { - case IS_NULL: - op->value.str.val = empty_string; - op->value.str.len = 0; - break; - case IS_STRING: - break; - case IS_BOOL: - if (op->value.lval) { - op->value.str.val = estrndup_rel("1", 1); - op->value.str.len = 1; - } else { - op->value.str.val = empty_string; - op->value.str.len = 0; - } - break; - case IS_RESOURCE: { - long tmp = op->value.lval; - - zend_list_delete(op->value.lval); - op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG); - op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp); - break; - } - case IS_LONG: - lval = op->value.lval; - - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_LONG + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%ld", lval); /* SAFE */ - break; - case IS_DOUBLE: { - dval = op->value.dval; - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); /* SAFE */ - /* %G already handles removing trailing zeros from the fractional part, yay */ - break; - } - case IS_ARRAY: - zval_dtor(op); - op->value.str.val = estrndup_rel("Array", sizeof("Array")-1); - op->value.str.len = sizeof("Array")-1; - zend_error(E_NOTICE, "Array to string conversion"); - break; - case IS_OBJECT: - zval_dtor(op); - op->value.str.val = estrndup_rel("Object", sizeof("Object")-1); - op->value.str.len = sizeof("Object")-1; - zend_error(E_NOTICE, "Object to string conversion"); - break; - default: - zval_dtor(op); - ZVAL_BOOL(op, 0); - break; - } - op->type = IS_STRING; -} - - -static void convert_scalar_to_array(zval *op, int type) -{ - zval *entry; - - ALLOC_ZVAL(entry); - *entry = *op; - INIT_PZVAL(entry); - - switch (type) { - case IS_ARRAY: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_index_update(op->value.ht, 0, (void *) &entry, sizeof(zval *), NULL); - op->type = IS_ARRAY; - break; - case IS_OBJECT: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - zend_hash_update(Z_OBJPROP_P(op), "scalar", sizeof("scalar"), (void *) &entry, sizeof(zval *), NULL); - } - break; - } -} - - -ZEND_API void convert_to_array(zval *op) -{ - TSRMLS_FETCH(); - - switch(op->type) { - case IS_ARRAY: - return; - break; -/* OBJECTS_OPTIMIZE */ - case IS_OBJECT: - { - zval *tmp; - HashTable *ht; - - ALLOC_HASHTABLE(ht); - zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); - if(Z_OBJ_HT_P(op)->get_properties) { - zend_hash_copy(ht, Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - zval_dtor(op); - op->type = IS_ARRAY; - op->value.ht = ht; - } - return; - case IS_NULL: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - op->type = IS_ARRAY; - break; - default: - convert_scalar_to_array(op, IS_ARRAY); - break; - } -} - - -ZEND_API void convert_to_object(zval *op) -{ - switch(op->type) { - case IS_ARRAY: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_and_properties_init(op, zend_standard_class_def, op->value.ht); - return; - break; - } - case IS_OBJECT: - return; - case IS_NULL: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - break; - } - default: - convert_scalar_to_array(op, IS_OBJECT); - break; - } -} - -ZEND_API void multi_convert_to_long_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_long_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_double_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_double_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_string_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_string_ex(arg); - } - - va_end(ap); -} - -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) { - zval *tmp; - - if ((result == op1) && (result == op2)) { - /* $a += $a */ - return SUCCESS; - } - if (result != op1) { - *result = *op1; - zval_copy_ctor(result); - } - zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - return SUCCESS; - } - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - double dval = (double) op1->value.lval + (double) op2->value.lval; - - if ((dval > (double) LONG_MAX) || (dval < (double) LONG_MIN)) { - result->value.dval = dval; - result->type = IS_DOUBLE; - } else { - result->value.lval = op1->value.lval + op2->value.lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) + op2->value.dval) : - (op1->value.dval + ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval + op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - double dval = (double) op1->value.lval - (double) op2->value.lval; - - if ((dval < (double) LONG_MIN) || (dval > (double) LONG_MAX)) { - result->value.dval = dval; - result->type = IS_DOUBLE; - } else { - result->value.lval = op1->value.lval - op2->value.lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) - op2->value.dval) : - (op1->value.dval - ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval - op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - double dval = (double) op1->value.lval * (double) op2->value.lval; - - if ((dval > (double) LONG_MAX) || (dval < (double) LONG_MIN)) { - result->value.dval = dval; - result->type = IS_DOUBLE; - } else { - result->value.lval = op1->value.lval * op2->value.lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) * op2->value.dval) : - (op1->value.dval * ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval * op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* division by zero */ - } - if (op1->type == IS_LONG && op2->type == IS_LONG) { - if (op1->value.lval % op2->value.lval == 0) { /* integer */ - result->type = IS_LONG; - result->value.lval = op1->value.lval / op2->value.lval; - } else { - result->type = IS_DOUBLE; - result->value.dval = ((double) op1->value.lval) / op2->value.lval; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) / op2->value.dval) : - (op1->value.dval / ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval / op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - if (op2->value.lval == 0) { - ZVAL_BOOL(result, 0); - return FAILURE; /* modulus by zero */ - } - - result->type = IS_LONG; - result->value.lval = op1->value.lval % op2->value.lval; - return SUCCESS; -} - - - -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - result->type = IS_BOOL; - - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy; - - zendi_convert_to_boolean(op1, op1_copy, result); - - result->type = IS_BOOL; - result->value.lval = !op1->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy = *op1; - - op1 = &op1_copy; - - if (op1->type == IS_DOUBLE) { - op1->value.lval = (long) op1->value.dval; - op1->type = IS_LONG; - } - if (op1->type == IS_LONG) { - result->value.lval = ~op1->value.lval; - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type == IS_STRING) { - int i; - - result->type = IS_STRING; - result->value.str.val = estrndup(op1->value.str.val, op1->value.str.len); - result->value.str.len = op1->value.str.len; - for (i = 0; i < op1->value.str.len; i++) { - result->value.str.val[i] = ~op1->value.str.val[i]; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = longer->value.str.len; - result_str = estrndup(longer->value.str.val, longer->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] |= shorter->value.str.val[i]; - } - if (result==op1) { - efree(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval | op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] &= longer->value.str.val[i]; - } - if (result==op1) { - efree(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval & op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] ^= longer->value.str.val[i]; - } - if (result==op1) { - efree(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval << op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval >> op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - - -/* must support result==op1 */ -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2) -{ - result->value.str.len = op1->value.str.len + 1; - result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1); - result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval; - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - return SUCCESS; -} - - -/* must support result==op1 */ -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; - if (op1->value.str.val == empty_string) { - result->value.str.val = (char *) emalloc(length+1); - } else { - result->value.str.val = (char *) erealloc(op1->value.str.val, length+1); - } - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; - return SUCCESS; -} - - -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - if (result==op1) { /* special case, perform operations on result */ - uint res_len = op1->value.str.len + op2->value.str.len; - - if (result->value.str.len == 0) { /* handle empty_string */ - STR_FREE(result->value.str.val); - result->value.str.val = emalloc(res_len+1); - } else { - result->value.str.val = erealloc(result->value.str.val, res_len+1); - } - memcpy(result->value.str.val+result->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[res_len]=0; - result->value.str.len = res_len; - } else { - result->value.str.len = op1->value.str.len + op2->value.str.len; - result->value.str.val = (char *) emalloc(result->value.str.len + 1); - memcpy(result->value.str.val, op1->value.str.val, op1->value.str.len); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - } - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - - -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = zend_binary_zval_strcmp(op1, op2); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - op1_copy = *op1; - zval_copy_ctor(&op1_copy); - - op2_copy = *op2; - zval_copy_ctor(&op2_copy); - - convert_to_double(&op1_copy); - convert_to_double(&op2_copy); - - result->value.lval = ZEND_NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval); - result->type = IS_LONG; - - return SUCCESS; -} - - -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if ((op1->type == IS_NULL && op2->type == IS_STRING) - || (op2->type == IS_NULL && op1->type == IS_STRING)) { - if (op1->type == IS_NULL) { - result->type = IS_LONG; - result->value.lval = zend_binary_strcmp("", 0, op2->value.str.val, op2->value.str.len); - return SUCCESS; - } else { - result->type = IS_LONG; - result->value.lval = zend_binary_strcmp(op1->value.str.val, op1->value.str.len, "", 0); - return SUCCESS; - } - } - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zendi_smart_strcmp(result, op1, op2); - return SUCCESS; - } - - if (op1->type == IS_BOOL || op2->type == IS_BOOL - || op1->type == IS_NULL || op2->type == IS_NULL) { - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->type = IS_LONG; - result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval); - return SUCCESS; - } - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - result->type = IS_LONG; - result->value.lval = op1->value.lval>op2->value.lval?1:(op1->value.lvalvalue.lval?-1:0); - return SUCCESS; - } - if ((op1->type == IS_DOUBLE || op1->type == IS_LONG) - && (op2->type == IS_DOUBLE || op2->type == IS_LONG)) { - result->value.dval = (op1->type == IS_LONG ? (double) op1->value.lval : op1->value.dval) - (op2->type == IS_LONG ? (double) op2->value.lval : op2->value.dval); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) { - zend_compare_arrays(result, op1, op2 TSRMLS_CC); - return SUCCESS; - } - - if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) { - zend_compare_objects(result, op1, op2 TSRMLS_CC); - return SUCCESS; - } - - if (op1->type==IS_ARRAY) { - result->value.lval = 1; - result->type = IS_LONG; - return SUCCESS; - } - if (op2->type==IS_ARRAY) { - result->value.lval = -1; - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type==IS_OBJECT) { - result->value.lval = 1; - result->type = IS_LONG; - return SUCCESS; - } - if (op2->type==IS_OBJECT) { - result->value.lval = -1; - result->type = IS_LONG; - return SUCCESS; - } - - ZVAL_BOOL(result, 0); - return FAILURE; -} - - -static int hash_zval_identical_function(const zval **z1, const zval **z2) -{ - zval result; - TSRMLS_FETCH(); - - /* is_identical_function() returns 1 in case of identity and 0 in case - * of a difference; - * whereas this comparison function is expected to return 0 on identity, - * and non zero otherwise. - */ - if (is_identical_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return !result.value.lval; -} - - -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (op1->type != op2->type) { - result->value.lval = 0; - return SUCCESS; - } - switch (op1->type) { - case IS_NULL: - result->value.lval = (op2->type==IS_NULL); - break; - case IS_BOOL: - case IS_LONG: - case IS_RESOURCE: - result->value.lval = (op1->value.lval == op2->value.lval); - break; - case IS_DOUBLE: - result->value.lval = (op1->value.dval == op2->value.dval); - break; - case IS_STRING: - if ((op1->value.str.len == op2->value.str.len) - && (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_ARRAY: - if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_OBJECT: - if(Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2) && Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - default: - ZVAL_BOOL(result, 0); - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - result->value.lval = !result->value.lval; - return SUCCESS; -} - - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval == 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -#define LOWER_CASE 1 -#define UPPER_CASE 2 -#define NUMERIC 3 - - -static void increment_string(zval *str) -{ - int carry=0; - int pos=str->value.str.len-1; - char *s=str->value.str.val; - char *t; - int last=0; /* Shut up the compiler warning */ - int ch; - - if (str->value.str.len == 0) { - STR_FREE(str->value.str.val); - str->value.str.val = estrndup("1", sizeof("1")-1); - str->value.str.len = 1; - return; - } - - while (pos >= 0) { - ch = s[pos]; - if (ch >= 'a' && ch <= 'z') { - if (ch == 'z') { - s[pos] = 'a'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=LOWER_CASE; - } else if (ch >= 'A' && ch <= 'Z') { - if (ch == 'Z') { - s[pos] = 'A'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=UPPER_CASE; - } else if (ch >= '0' && ch <= '9') { - if (ch == '9') { - s[pos] = '0'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last = NUMERIC; - } else { - carry=0; - break; - } - if (carry == 0) { - break; - } - pos--; - } - - if (carry) { - t = (char *) emalloc(str->value.str.len+1+1); - memcpy(t+1, str->value.str.val, str->value.str.len); - str->value.str.len++; - t[str->value.str.len] = '\0'; - switch (last) { - case NUMERIC: - t[0] = '1'; - break; - case UPPER_CASE: - t[0] = 'A'; - break; - case LOWER_CASE: - t[0] = 'a'; - break; - } - STR_FREE(str->value.str.val); - str->value.str.val = t; - } -} - - -ZEND_API int increment_function(zval *op1) -{ - switch (op1->type) { - case IS_LONG: - if(op1->value.lval == LONG_MAX) { - /* switch to double */ - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval++; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval + 1; - break; - case IS_NULL: - op1->value.lval = 1; - op1->type = IS_LONG; - break; - case IS_STRING: { - long lval; - double dval; - char *strval = op1->value.str.val; - - switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - if(lval == LONG_MAX) { - /* switch to double */ - double d = (double)lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval = lval+1; - op1->type = IS_LONG; - } - efree(strval); - break; - case IS_DOUBLE: - op1->value.dval = dval+1; - op1->type = IS_DOUBLE; - efree(strval); - break; -#if 0 - case FLAG_IS_BC: - /* Not implemented */ -#endif - default: - /* Perl style string increment */ - increment_string(op1); - break; - } - } - break; - default: - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int decrement_function(zval *op1) -{ - long lval; - - switch (op1->type) { - case IS_LONG: - if(op1->value.lval == LONG_MIN) { - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval--; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval - 1; - break; - case IS_STRING: /* Like perl we only support string increment */ - if (op1->value.str.len == 0) { /* consider as 0 */ - STR_FREE(op1->value.str.val); - op1->value.lval = -1; - op1->type = IS_LONG; - break; - } else if (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, NULL, 0)==IS_LONG) { /* long */ - STR_FREE(op1->value.str.val); - if(lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; - } - break; - default: - return FAILURE; - } - - return SUCCESS; -} - - -ZEND_API int zval_is_true(zval *op) -{ - convert_to_boolean(op); - return (op->value.lval ? 1 : 0); -} - - -ZEND_API void zend_str_tolower(char *str, unsigned int length) -{ - register char *p=str, *end=p+length; - - while (pvalue.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2) -{ - return zend_binary_strcasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - - -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) -{ - int ret1, ret2; - long lval1, lval2; - double dval1, dval2; - - if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) && - (ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) { -#if 0&&WITH_BCMATH - if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) { - bc_num first, second; - - /* use the BC math library to compare the numbers */ - init_num(&first); - init_num(&second); - str2num(&first, s1->value.str.val, 100); /* this scale should do */ - str2num(&second, s2->value.str.val, 100); /* ditto */ - result->value.lval = bc_compare(first, second); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - free_num(&first); - free_num(&second); - } else -#endif - if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) { - if (ret1!=IS_DOUBLE) { - dval1 = strtod(s1->value.str.val, NULL); - } else if (ret2!=IS_DOUBLE) { - dval2 = strtod(s2->value.str.val, NULL); - } - result->value.dval = dval1 - dval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - } else { /* they both have to be long's */ - result->value.lval = lval1 - lval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - } else { - result->value.lval = zend_binary_zval_strcmp(s1, s2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - return; -} - - -static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC) -{ - zval result; - - if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return result.value.lval; -} - -ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - - -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - result->type = IS_LONG; - result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) -{ - zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht TSRMLS_CC); -} - - -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) -{ - result->type = IS_LONG; - if (Z_OBJ_HT_P(o1) != Z_OBJ_HT_P(o2)) { - result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */ - return; - } - - if(Z_OBJ_HT_P(o1)->compare_objects == NULL) { - if(Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { - result->value.lval = 0; - } else { - result->value.lval = 1; - } - return; - } else { - result->value.lval = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC); - } -} diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h deleted file mode 100644 index b7e5b878bd0..00000000000 --- a/Zend/zend_operators.h +++ /dev/null @@ -1,272 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_OPERATORS_H -#define ZEND_OPERATORS_H - -#include -#include - -#ifdef HAVE_IEEEFP_H -#include -#endif - - -#if 0&&WITH_BCMATH -#include "ext/bcmath/libbcmath/src/bcmath.h" -#endif - -#define MAX_LENGTH_OF_LONG 18 -#define MAX_LENGTH_OF_DOUBLE 32 - -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -static inline int is_numeric_string(char *str, int length, long *lval, double *dval, zend_bool allow_errors) -{ - long local_lval; - double local_dval; - char *end_ptr_long, *end_ptr_double; - int conv_base=10; - - if (!length) { - return 0; - } - - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - errno=0; - local_lval = strtol(str, &end_ptr_long, conv_base); - if (errno!=ERANGE) { - if (end_ptr_long == str+length) { /* integer string */ - if (lval) { - *lval = local_lval; - } - return IS_LONG; - } - } else { - end_ptr_long=NULL; - } - - if (conv_base==16) { /* hex string, under UNIX strtod() messes it up */ - return 0; - } - - errno=0; - local_dval = strtod(str, &end_ptr_double); - if (errno!=ERANGE) { - if (end_ptr_double == str+length) { /* floating point string */ - if (! zend_finite(local_dval)) { - /* "inf","nan" and maybe other weird ones */ - return 0; - } - - if (dval) { - *dval = local_dval; - } -#if 0&&WITH_BCMATH - if (length>16) { - register char *ptr=str, *end=str+length; - - while (ptrend_ptr_long && dval) { - *dval = local_dval; - return IS_DOUBLE; - } else if (end_ptr_long && lval) { - *lval = local_lval; - return IS_LONG; - } - } - return 0; -} - -ZEND_API int increment_function(zval *op1); -ZEND_API int decrement_function(zval *op2); - -BEGIN_EXTERN_C() -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC); -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC); -ZEND_API void convert_to_long(zval *op); -ZEND_API void convert_to_double(zval *op); -ZEND_API void convert_to_long_base(zval *op, int base); -ZEND_API void convert_to_null(zval *op); -ZEND_API void convert_to_boolean(zval *op); -ZEND_API void convert_to_array(zval *op); -ZEND_API void convert_to_object(zval *op); -ZEND_API void multi_convert_to_long_ex(int argc, ...); -ZEND_API void multi_convert_to_double_ex(int argc, ...); -ZEND_API void multi_convert_to_string_ex(int argc, ...); -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2); -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2); -#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC) - -ZEND_API double zend_string_to_double(const char *number, zend_uint length); -END_EXTERN_C() - -ZEND_API int zval_is_true(zval *op); -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API void zend_str_tolower(char *str, unsigned int length); -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length); -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length); - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2); -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC); -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC); -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC); - -ZEND_API int zend_atoi(const char *str, int str_len); - -#define convert_to_ex_master(ppzv, lower_type, upper_type) \ - if ((*ppzv)->type!=IS_##upper_type) { \ - if (!(*ppzv)->is_ref) { \ - SEPARATE_ZVAL(ppzv); \ - } \ - convert_to_##lower_type(*ppzv); \ - } - -#define convert_to_writable_ex_master(ppzv, lower_type, upper_type) \ - if ((*ppzv)->type!=IS_##upper_type) { \ - SEPARATE_ZVAL(ppzv); \ - convert_to_##lower_type(*ppzv); \ - } - - -#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL) -#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG) -#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE) -#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING) -#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY) -#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT) -#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL) - -#define convert_to_writable_boolean_ex(ppzv) convert_to_writable_ex_master(ppzv, boolean, BOOL) -#define convert_to_writable_long_ex(ppzv) convert_to_writable_ex_master(ppzv, long, LONG) -#define convert_to_writable_double_ex(ppzv) convert_to_writable_ex_master(ppzv, double, DOUBLE) -#define convert_to_writable_string_ex(ppzv) convert_to_writable_ex_master(ppzv, string, STRING) -#define convert_to_writable_array_ex(ppzv) convert_to_writable_ex_master(ppzv, array, ARRAY) -#define convert_to_writable_object_ex(ppzv) convert_to_writable_ex_master(ppzv, object, OBJECT) -#define convert_to_writable_null_ex(ppzv) convert_to_writable_ex_master(ppzv, null, NULL) - - -#define convert_scalar_to_number_ex(ppzv) \ - if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \ - if (!(*ppzv)->is_ref) { \ - SEPARATE_ZVAL(ppzv); \ - } \ - convert_scalar_to_number(*ppzv TSRMLS_CC); \ - } - - -#define Z_LVAL(zval) (zval).value.lval -#define Z_BVAL(zval) ((zend_bool)(zval).value.lval) -#define Z_DVAL(zval) (zval).value.dval -#define Z_STRVAL(zval) (zval).value.str.val -#define Z_STRLEN(zval) (zval).value.str.len -#define Z_ARRVAL(zval) (zval).value.ht -#define Z_OBJ_HANDLE(zval) (zval).value.obj.handle -#define Z_OBJ_HT(zval) (zval).value.obj.handlers -#define Z_OBJ(zval) zend_objects_get_address(&(zval)) -#define Z_OBJPROP(zval) Z_OBJ(zval)->properties -#define Z_OBJCE(zval) Z_OBJ(zval)->ce -#define Z_RESVAL(zval) (zval).value.lval - -#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) -#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) -#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p) -#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p) -#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p) -#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p) -#define Z_OBJ_P(zval_p) Z_OBJ(*zval_p) -#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p) -#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p) -#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p) -#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p) -#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p) - -#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp) -#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp) -#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp) -#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp) -#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp) -#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp) -#define Z_OBJ_PP(zval_pp) Z_OBJ(**zval_pp) -#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp) -#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp) -#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp) -#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p) -#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p) - -#define Z_TYPE(zval) (zval).type -#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p) -#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp) - -#endif diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c deleted file mode 100644 index b50ac7510c9..00000000000 --- a/Zend/zend_ptr_stack.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_ptr_stack.h" -#ifdef HAVE_STDARG_H -# include -#endif - -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) -{ - stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*PTR_STACK_BLOCK_SIZE); - stack->max = PTR_STACK_BLOCK_SIZE; - stack->top = 0; -} - - -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void *elem; - - if (stack->top+count > stack->max) { /* we need to allocate more memory */ - stack->max *= 2; - stack->max += count; - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); - stack->top_element = stack->elements+stack->top; - } - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void *); - stack->top++; - *(stack->top_element++) = elem; - count--; - } - va_end(ptr); -} - - -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void **elem; - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void **); - *elem = *(--stack->top_element); - stack->top--; - count--; - } - va_end(ptr); -} - - - -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) -{ - if (stack->elements) { - efree(stack->elements); - } -} - - -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) -{ - int i = stack->top; - - while (--i >= 0) { - func(stack->elements[i]); - } -} - - -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements) -{ - zend_ptr_stack_apply(stack, func); - if (free_elements) { - int i = stack->top; - - while (--i >= 0) { - efree(stack->elements[i]); - } - } - stack->top = 0; - stack->top_element = stack->elements; -} - - -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) -{ - return stack->top; -} diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h deleted file mode 100644 index 5bfb91ab3ad..00000000000 --- a/Zend/zend_ptr_stack.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_PTR_STACK_H -#define ZEND_PTR_STACK_H - -typedef struct _zend_ptr_stack { - int top, max; - void **elements; - void **top_element; -} zend_ptr_stack; - - -#define PTR_STACK_BLOCK_SIZE 64 - -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements); -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); - -static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max *= 2 ))); - stack->top_element = stack->elements+stack->top; - } - stack->top++; - *(stack->top_element++) = ptr; -} - -static inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) -{ - stack->top--; - return *(--stack->top_element); -} - - -#endif /* ZEND_PTR_STACK_H */ diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c deleted file mode 100644 index eba5b55d9a7..00000000000 --- a/Zend/zend_qsort.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -#include "zend.h" - -#include - -#define QSORT_STACK_SIZE (sizeof(size_t) * CHAR_BIT) - -static void _zend_qsort_swap(void *a, void *b, size_t siz) -{ - register size_t i; - register int t_i; - register char t_c; - - for (i = sizeof(int); i <= siz; i += sizeof(int)) { - t_i = *(int *) a; - *((int *) a)++ = *(int *) b; - *((int *) b)++ = t_i; - } - - for (i = i - sizeof(int) + 1; i <= siz; ++i) { - t_c = *(char *) a; - *((char *) a)++ = *(char *) b; - *((char *) b)++ = t_c; - } -} - -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC) -{ - void *begin_stack[QSORT_STACK_SIZE]; - void *end_stack[QSORT_STACK_SIZE]; - register char *begin; - register char *end; - register char *seg1; - register char *seg2; - register char *seg2p; - register int loop; - uint offset; - - begin_stack[0] = (char *) base; - end_stack[0] = (char *) base + ((nmemb - 1) * siz); - - for (loop = 0; loop >= 0; --loop) { - begin = begin_stack[loop]; - end = end_stack[loop]; - - while (begin < end) { - offset = (end - begin) >> 1; - _zend_qsort_swap(begin, begin + (offset - (offset % siz)), siz); - - seg1 = begin + siz; - seg2 = end; - - while (1) { - for (; seg1 < seg2 && compare(begin, seg1 TSRMLS_CC) > 0; - seg1 += siz); - - for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0; - seg2 -= siz); - - if (seg1 >= seg2) - break; - - _zend_qsort_swap(seg1, seg2, siz); - - seg1 += siz; - seg2 -= siz; - } - - _zend_qsort_swap(begin, seg2, siz); - - seg2p = seg2; - - if ((seg2p - begin) <= (end - seg2p)) { - if ((seg2p + siz) < end) { - begin_stack[loop] = seg2p + siz; - end_stack[loop++] = end; - } - end = seg2p - siz; - } - else { - if ((seg2p - siz) > begin) { - begin_stack[loop] = begin; - end_stack[loop++] = seg2p - siz; - } - begin = seg2p + siz; - } - } - } -} diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h deleted file mode 100644 index b432014663b..00000000000 --- a/Zend/zend_qsort.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -#ifndef ZEND_QSORT_H -#define ZEND_QSORT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_QSORT_H */ diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c deleted file mode 100644 index bf28c82e8a1..00000000000 --- a/Zend/zend_sprintf.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include - -#include "zend.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#if ZEND_BROKEN_SPRINTF -int zend_sprintf(char *buffer, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vsprintf(buffer, format, args); - va_end(args); - - return strlen(buffer); -} -#endif diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c deleted file mode 100644 index 5bc941fa4a0..00000000000 --- a/Zend/zend_stack.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include "zend.h" -#include "zend_stack.h" - -ZEND_API int zend_stack_init(zend_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} - -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} - - -ZEND_API int zend_stack_top(zend_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} - - -ZEND_API int zend_stack_del_top(zend_stack *stack) -{ - if (stack->top > 0) { - efree(stack->elements[--stack->top]); - } - return SUCCESS; -} - - -ZEND_API int zend_stack_int_top(zend_stack *stack) -{ - int *e; - - if (zend_stack_top(stack, (void **) &e) == FAILURE) { - return FAILURE; /* this must be a negative number, since negative numbers can't be address numbers */ - } else { - return *e; - } -} - - -ZEND_API int zend_stack_is_empty(zend_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} - - -ZEND_API int zend_stack_destroy(zend_stack *stack) -{ - register int i; - - for (i = 0; i < stack->top; i++) { - efree(stack->elements[i]); - } - - if (stack->elements) { - efree(stack->elements); - } - return SUCCESS; -} - - -ZEND_API void **zend_stack_base(zend_stack *stack) -{ - return stack->elements; -} - - -ZEND_API int zend_stack_count(zend_stack *stack) -{ - return stack->top; -} - - -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - } -} - - -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - } -} diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h deleted file mode 100644 index 71ba0132303..00000000000 --- a/Zend/zend_stack.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_STACK_H -#define ZEND_STACK_H - -typedef struct _zend_stack { - int top, max; - void **elements; -} zend_stack; - - -#define STACK_BLOCK_SIZE 64 - -ZEND_API int zend_stack_init(zend_stack *stack); -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size); -ZEND_API int zend_stack_top(zend_stack *stack, void **element); -ZEND_API int zend_stack_del_top(zend_stack *stack); -ZEND_API int zend_stack_int_top(zend_stack *stack); -ZEND_API int zend_stack_is_empty(zend_stack *stack); -ZEND_API int zend_stack_destroy(zend_stack *stack); -ZEND_API void **zend_stack_base(zend_stack *stack); -ZEND_API int zend_stack_count(zend_stack *stack); -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg); - -#define ZEND_STACK_APPLY_TOPDOWN 1 -#define ZEND_STACK_APPLY_BOTTOMUP 2 - -#endif /* ZEND_STACK_H */ diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c deleted file mode 100644 index afa0cc08bcf..00000000000 --- a/Zend/zend_static_allocator.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -#include - -#include "zend_static_allocator.h" - -/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ - -inline static void block_init(Block *block, zend_uint block_size) -{ - block->pos = block->bp = (char *) emalloc(block_size); - block->end = block->bp + block_size; -} - -inline static char *block_allocate(Block *block, zend_uint size) -{ - char *retval = block->pos; - if ((block->pos += size) >= block->end) { - return (char *)NULL; - } - return retval; -} - -inline static void block_destroy(Block *block) -{ - efree(block->bp); -} - -void static_allocator_init(StaticAllocator *sa) -{ - sa->Blocks = (Block *) emalloc(sizeof(Block)); - block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); - sa->num_blocks = 1; - sa->current_block = 0; -} - -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) -{ - char *retval; - - retval = block_allocate(&sa->Blocks[sa->current_block], size); - if (retval) { - return retval; - } - sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); - sa->current_block++; - block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE); - retval = block_allocate(&sa->Blocks[sa->current_block], size); - return retval; -} - -void static_allocator_destroy(StaticAllocator *sa) -{ - zend_uint i; - - for (i=0; inum_blocks; i++) { - block_free(&sa->Blocks[i]); - } - efree(sa->Blocks); -} diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h deleted file mode 100644 index 8ae4ecca5d3..00000000000 --- a/Zend/zend_static_allocator.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -#ifndef ZEND_STATIC_ALLOCATOR_H -#define ZEND_STATIC_ALLOCATOR_H - -#define ALLOCATOR_BLOCK_SIZE 400000 - -/* Temporary */ -typedef unsigned int zend_uint; -#define emalloc(s) malloc(s) -#define efree(p) free(p) - -typedef struct _Block { - char *bp; - char *pos; - char *end; -} Block; - -typedef struct _StaticAllocator { - Block *Blocks; - zend_uint num_blocks; - zend_uint current_block; -} StaticAllocator; - -void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size); -void static_allocator_destroy(StaticAllocator *sa); - -#endif /* ZEND_STATIC_ALLOCATOR_H */ diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c deleted file mode 100644 index f8001502049..00000000000 --- a/Zend/zend_variables.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#include -#include "zend.h" -#include "zend_API.h" -#include "zend_globals.h" -#include "zend_constants.h" -#include "zend_list.h" - -ZEND_API char *empty_string = ""; /* in order to save emalloc() and efree() time for - * empty strings (usually used to denote empty - * return values in failed functions). - * The macro STR_FREE() will not efree() it. - */ - - -ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type==IS_LONG) { - return; - } - switch(zvalue->type) { - case IS_STRING: - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - TSRMLS_FETCH(); - - if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { - zend_hash_destroy(zvalue->value.ht); - FREE_HASHTABLE(zvalue->value.ht); - } - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - - Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); - } - break; - case IS_RESOURCE: - { - TSRMLS_FETCH(); - - /* destroy resource */ - zend_list_delete(zvalue->value.lval); - } - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - return; - break; - } -} - - -ZEND_API void zval_add_ref(zval **p) -{ - (*p)->refcount++; -} - - -ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type) { - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_addref(zvalue->value.lval); - } - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: - case IS_STRING: - if (zvalue->value.str.val) { - if (zvalue->value.str.len==0) { - zvalue->value.str.val = empty_string; - return SUCCESS; - } - } - CHECK_ZVAL_STRING_REL(zvalue); - zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - zval *tmp; - HashTable *original_ht = zvalue->value.ht; - TSRMLS_FETCH(); - - if (zvalue->value.ht == &EG(symbol_table)) { - return SUCCESS; /* do nothing */ - } - ALLOC_HASHTABLE_REL(zvalue->value.ht); - zend_hash_init(zvalue->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(zvalue->value.ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); -#if 0 - zvalue->value.obj = zvalue->value.obj.handlers->clone_obj(zvalue->value.obj.handle); -#else - Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC); -#endif - } - break; - } - return SUCCESS; -} - - -ZEND_API int zval_persist(zval *zvalue TSRMLS_DC) -{ - switch (zvalue->type) { - case IS_OBJECT: - case IS_RESOURCE: - return FAILURE; /* resources and objects cannot be persisted */ - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: - case IS_STRING: - if (zvalue->value.str.val) { - if (zvalue->value.str.len==0) { - zvalue->value.str.val = empty_string; - return SUCCESS; - } - } - persist_alloc(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - persist_alloc(zvalue->value.ht); - zend_hash_apply(zvalue->value.ht, (apply_func_t) zval_persist TSRMLS_CC); - break; - } - return SUCCESS; -} - - -ZEND_API int zend_print_variable(zval *var) -{ - return zend_print_zval(var, 0); -} - - -#if ZEND_DEBUG -ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue) -{ - return zval_copy_ctor(zvalue); -} - - -ZEND_API void _zval_dtor_wrapper(zval *zvalue) -{ - zval_dtor(zvalue); -} - - - -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_ptr_dtor(zval_ptr); -} -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h deleted file mode 100644 index e83f3aa397c..00000000000 --- a/Zend/zend_variables.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2002 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - - -#ifndef ZEND_VARIABLES_H -#define ZEND_VARIABLES_H - - -ZEND_API int zend_print_variable(zval *var); - -BEGIN_EXTERN_C() -ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC); -ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC); -ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC); -#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC) -#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC) - -ZEND_API int zval_persist(zval *zvalue TSRMLS_DC); - -#if ZEND_DEBUG -ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue); -ZEND_API void _zval_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr); -#define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper -#define zval_dtor_wrapper _zval_dtor_wrapper -#define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper -#else -#define zval_copy_ctor_wrapper _zval_copy_ctor -#define zval_dtor_wrapper _zval_dtor -#define zval_ptr_dtor_wrapper _zval_ptr_dtor -#endif - -END_EXTERN_C() - - -ZEND_API void zval_add_ref(zval **p); - -#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper -#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper -#define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper - -#endif diff --git a/acconfig.h.in b/acconfig.h.in deleted file mode 100644 index f87979c2fdb..00000000000 --- a/acconfig.h.in +++ /dev/null @@ -1 +0,0 @@ -/* Leave this file alone */ diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 2ade4c8482f..00000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,1342 +0,0 @@ -dnl $Id$ -dnl -dnl This file contains local autoconf functions. - -dnl PHP_ADD_MAKEFILE_FRAGMENT([srcfile[, ext_srcdir[, ext_builddir]]]) -dnl -dnl Processes a file called Makefile.frag in the source directory -dnl of the most recently added extension. $(srcdir) and $(builddir) -dnl are substituted with the proper paths. Can be used to supply -dnl custom rules and/or additional targets. -dnl -AC_DEFUN(PHP_ADD_MAKEFILE_FRAGMENT,[ - ifelse($1,,src=$ext_srcdir/Makefile.frag,src=$1) - ifelse($2,,ac_srcdir=$ext_srcdir,ac_srcdir=$2) - ifelse($3,,ac_builddir=$ext_builddir,ac_builddir=$3) - sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments -]) - - -dnl PHP_DEFINE(what[, value]) -dnl -dnl Creates builddir/include/what.h and in there #define what value -dnl -AC_DEFUN(PHP_DEFINE,[ - echo "#define $1 $2" > include/$1.h -]) - -dnl PHP_INIT_BUILD_SYSTEM -dnl -AC_DEFUN(PHP_INIT_BUILD_SYSTEM,[ -mkdir include >/dev/null 2>&1 -> Makefile.objects -> Makefile.fragments -]) - -dnl PHP_GEN_GLOBAL_MAKEFILE -dnl -dnl Generates the global makefile. -dnl -AC_DEFUN(PHP_GEN_GLOBAL_MAKEFILE,[ - cat >Makefile <> Makefile - done - - cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile -]) - -dnl PHP_ADD_SOURCES(source-path, sources[, special-flags[, type]]) -dnl -dnl Adds sources which are located relative to source-path to the -dnl array of type type. Sources are processed with optional -dnl special-flags which are passed to the compiler. Sources -dnl can be either written in C or C++ (filenames shall end in .c -dnl or .cpp, respectively). -dnl -dnl Note: If source-path begins with a "/", the "/" is removed and -dnl the path is interpreted relative to the top build-directory. -dnl -dnl which array to append to? -AC_DEFUN(PHP_ADD_SOURCES,[ - PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS))) -]) - -dnl PHP_ASSIGN_BUILD_VARS(type) -dnl Internal macro, should/can be exploded manually -AC_DEFUN(PHP_ASSIGN_BUILD_VARS,[ - for acx in pre meta post; do for acy in c cxx; do eval b_${acy}_$acx=[\$]$1_${acy}_$acx; done; done - b_lo=[$]$1_lo -]) - -dnl PHP_ADD_SOURCES_X(source-path, sources[, special-flags[, target-var[, shared[, special-post-flags]]]]) -dnl -dnl Additional to PHP_ADD_SOURCES (see above), this lets you set the -dnl name of the array target-var directly, as well as whether -dnl shared objects will be built from the sources. Should not be -dnl used directly. -dnl -AC_DEFUN(PHP_ADD_SOURCES_X,[ -dnl relative to source- or build-directory? - case $1 in - /*[)] ac_srcdir=`echo $ac_n "$1$ac_c"|cut -c 2-`; ac_bdir=$ac_srcdir ;; - *[)] ac_srcdir="$abs_srcdir/$1"; ac_bdir=$1 ;; - esac - -dnl how to build .. shared or static? - ifelse($5,yes,PHP_ASSIGN_BUILD_VARS(shared),PHP_ASSIGN_BUILD_VARS(php)) - -dnl iterate over the sources - old_IFS=[$]IFS - for ac_src in $2; do - -dnl remove the suffix - IFS=. - set $ac_src - ac_obj=[$]1 - IFS=$old_IFS - -dnl append to the array which has been dynamically chosen - $4="[$]$4 [$]ac_bdir/[$]ac_obj.lo" - -dnl choose the right compiler/flags/etc. for the source-file - case $ac_src in - *.c[)] ac_comp="$b_c_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_c_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_c_post" ;; - *.cpp[)] ac_comp="$b_cxx_pre $3 -I$abs_srcdir/$ac_bdir -I$abs_builddir/$ac_bdir $b_cxx_meta -c $ac_srcdir/$ac_src -o $ac_bdir/$ac_obj.$b_lo $6$b_cxx_post" ;; - esac - -dnl create a rule for the object/source combo - cat >>Makefile.objects<]) - fi - - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$OPENSSL_INC - AC_MSG_CHECKING([for OpenSSL version]) - AC_EGREP_CPP(yes,[ - #include - #if OPENSSL_VERSION_NUMBER >= 0x0090500fL - yes - #endif - ],[ - AC_MSG_RESULT([>= 0.9.5]) - ],[ - AC_MSG_ERROR([OpenSSL version 0.9.5 or greater required.]) - ]) - CPPFLAGS=$old_CPPFLAGS - - PHP_ADD_LIBPATH($OPENSSL_DIR/lib) - - AC_CHECK_LIB(crypto, CRYPTO_free, [ - PHP_ADD_LIBRARY(crypto) - ],[ - AC_MSG_ERROR([libcrypto not found!]) - ]) - - AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [ - PHP_ADD_LIBRARY(ssl) - ],[ - AC_MSG_ERROR([libssl not found!]) - ]) - PHP_ADD_INCLUDE($OPENSSL_INC) -]) - -dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) -dnl -dnl Use this macro, if you need to add libraries and or library search -dnl paths to the PHP build system which are only given in compiler -dnl notation. -dnl -AC_DEFUN(PHP_EVAL_LIBLINE,[ - for ac_i in $1; do - case $ac_i in - -l*) - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBRARY($ac_ii,,$2) - ;; - -L*) - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_LIBPATH($ac_ii,$2) - ;; - esac - done -]) - -dnl PHP_EVAL_INCLINE(LINE) -dnl -dnl Use this macro, if you need to add header search paths to the PHP -dnl build system which are only given in compiler notation. -dnl -AC_DEFUN(PHP_EVAL_INCLINE,[ - for ac_i in $1; do - case $ac_i in - -I*) - ac_ii=`echo $ac_i|cut -c 3-` - PHP_ADD_INCLUDE($ac_ii) - ;; - esac - done -]) - -AC_DEFUN(PHP_READDIR_R_TYPE,[ - dnl HAVE_READDIR_R is also defined by libmysql - AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) - if test "$ac_cv_func_readdir_r" = "yes"; then - AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ - AC_TRY_RUN([ -#define _REENTRANT -#include -#include - -#ifndef PATH_MAX -#define PATH_MAX 1024 -#endif - -main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; - - dir = opendir("/"); - if (!dir) - exit(1); - if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) - exit(0); - exit(1); -} - ],[ - ac_cv_what_readdir_r=POSIX - ],[ - AC_TRY_CPP([ -#define _REENTRANT -#include -#include -int readdir_r(DIR *, struct dirent *); - ],[ - ac_cv_what_readdir_r=old-style - ],[ - ac_cv_what_readdir_r=none - ]) - ],[ - ac_cv_what_readdir_r=none - ]) - ]) - case $ac_cv_what_readdir_r in - POSIX) - AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; - old-style) - AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; - esac - fi -]) - -AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[ - PHP_SUBST(SHLIB_SUFFIX_NAME) - SHLIB_SUFFIX_NAME=so - case $host_alias in - *hpux*) - SHLIB_SUFFIX_NAME=sl - ;; - *darwin*) - SHLIB_SUFFIX_NAME=dylib - ;; - esac -]) - -AC_DEFUN(PHP_DEBUG_MACRO,[ - DEBUG_LOG=$1 - cat >$1 <conftest.$ac_ext <>$1 2>&1 - rm -fr conftest* -]) - -AC_DEFUN(PHP_MISSING_PREAD_DECL,[ - AC_CACHE_CHECK(whether pread works without custom declaration,ac_cv_pread,[ - AC_TRY_COMPILE([#include ],[size_t (*func)() = pread],[ - ac_cv_pread=yes - ],[ - echo test > conftest_in - AC_TRY_RUN([ -#include -#include -#include - main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } - ],[ - ac_cv_pread=yes - ],[ - echo test > conftest_in - AC_TRY_RUN([ -#include -#include -#include -#include - ssize_t pread(int, void *, size_t, off64_t); - main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } - ],[ - ac_cv_pread=64 - ],[ - ac_cv_pread=no - ]) - ],[ - ac_cv_pread=no - ]) - ]) - ]) - case $ac_cv_pread in - no) ac_cv_func_pread=no;; - 64) AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]);; - esac -]) - -AC_DEFUN(PHP_MISSING_PWRITE_DECL,[ - AC_CACHE_CHECK(whether pwrite works without custom declaration,ac_cv_pwrite,[ - AC_TRY_COMPILE([#include ],[size_t (*func)() = pwrite],[ - ac_cv_pwrite=yes - ],[ - AC_TRY_RUN([ -#include -#include -#include - main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } - ],[ - ac_cv_pwrite=yes - ],[ - AC_TRY_RUN([ -#include -#include -#include -#include - ssize_t pwrite(int, void *, size_t, off64_t); - main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } - ],[ - ac_cv_pwrite=64 - ],[ - ac_cv_pwrite=no - ]) - ],[ - ac_cv_pwrite=no - ]) - ]) - ]) - case $ac_cv_pwrite in - no) ac_cv_func_pwrite=no;; - 64) AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]);; - esac -]) - -AC_DEFUN(PHP_MISSING_TIME_R_DECL,[ - AC_MSG_CHECKING([for missing declarations of reentrant functions]) - AC_TRY_COMPILE([#include ],[struct tm *(*func)() = localtime_r],[ - : - ],[ - AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[struct tm *(*func)() = gmtime_r],[ - : - ],[ - AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = asctime_r],[ - : - ],[ - AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = ctime_r],[ - : - ],[ - AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) - ]) - AC_TRY_COMPILE([#include ],[char *(*func)() = strtok_r],[ - : - ],[ - AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) - ]) - AC_MSG_RESULT([done]) -]) - -dnl -dnl PHP_LIBGCC_LIBPATH(gcc) -dnl Stores the location of libgcc in libgcc_libpath -dnl -AC_DEFUN(PHP_LIBGCC_LIBPATH,[ - changequote({,}) - libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` - changequote([,]) -]) - -AC_DEFUN(PHP_ARG_ANALYZE_EX,[ -ext_output="yes, shared" -ext_shared=yes -case [$]$1 in -shared,*) - $1=`echo "[$]$1"|sed 's/^shared,//'` - ;; -shared) - $1=yes - ;; -no) - ext_output=no - ext_shared=no - ;; -*) - ext_output=yes - ext_shared=no - ;; -esac - -PHP_ALWAYS_SHARED([$1]) -]) - -AC_DEFUN(PHP_ARG_ANALYZE,[ -PHP_ARG_ANALYZE_EX([$1]) -ifelse([$2],,,[AC_MSG_RESULT([$ext_output])]) -]) - -dnl -dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl -AC_DEFUN(PHP_ARG_WITH,[ -PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_)) -]) - -AC_DEFUN(PHP_REAL_ARG_WITH,[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4)) -PHP_ARG_ANALYZE($5,[$2]) -]) - -dnl -dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val]) -dnl Sets PHP_ARG_NAME either to the user value or to the default value. -dnl default-val defaults to no. This will also set the variable ext_shared, -dnl and will overwrite any previous variable of that name. -dnl -AC_DEFUN(PHP_ARG_ENABLE,[ -PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_)) -]) - -AC_DEFUN(PHP_REAL_ARG_ENABLE,[ -ifelse([$2],,,[AC_MSG_CHECKING([$2])]) -AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4)) -PHP_ARG_ANALYZE($5,[$2]) -]) - -AC_DEFUN(PHP_MODULE_PTR,[ - EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1," -]) - -AC_DEFUN(PHP_CONFIG_NICE,[ - rm -f $1 - cat >$1<> $1 - fi - done - - for arg in [$]0 "[$]@"; do - echo "'[$]arg' \\" >> $1 - done - echo '"[$]@"' >> $1 - chmod +x $1 -]) - -AC_DEFUN(PHP_TIME_R_TYPE,[ -AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ -AC_TRY_RUN([ -#include - -main() { -char buf[27]; -struct tm t; -time_t old = 0; -int r, s; - -s = gmtime_r(&old, &t); -r = (int) asctime_r(&t, buf, 26); -if (r == s && s == 0) return (0); -return (1); -} -],[ - ac_cv_time_r_type=hpux -],[ - AC_TRY_RUN([ -#include -main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; - - s = gmtime_r(&old, &t); - p = asctime_r(&t, buf, 26); - if (p == buf && s == &t) return (0); - return (1); -} - ],[ - ac_cv_time_r_type=irix - ],[ - ac_cv_time_r_type=POSIX - ]) -],[ - ac_cv_time_r_type=POSIX -]) -]) - case $ac_cv_time_r_type in - hpux) AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; - irix) AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; - esac -]) - -AC_DEFUN(PHP_SUBST,[ - PHP_VAR_SUBST="$PHP_VAR_SUBST $1" -]) - -AC_DEFUN(PHP_SUBST_OLD,[ - PHP_SUBST($1) - AC_SUBST($1) -]) - -AC_DEFUN(PHP_MKDIR_P_CHECK,[ - AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[ - test -d conftestdir && rm -rf conftestdir - mkdir -p conftestdir/somedir >/dev/null 2>&1 -dnl `mkdir -p' must be quiet about creating existing directories - mkdir -p conftestdir/somedir >/dev/null 2>&1 - if test "$?" = "0" && test -d conftestdir/somedir; then - ac_cv_mkdir_p=yes - else - ac_cv_mkdir_p=no - fi - rm -rf conftestdir - ]) -]) - -AC_DEFUN(PHP_TM_GMTOFF,[ -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include -#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], - ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) - -if test "$ac_cv_struct_tm_gmtoff" = yes; then - AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) -fi -]) - -dnl PHP_CONFIGURE_PART(MESSAGE) -dnl Idea borrowed from mm -AC_DEFUN(PHP_CONFIGURE_PART,[ - AC_MSG_RESULT() - AC_MSG_RESULT([${T_MD}$1${T_ME}]) -]) - -AC_DEFUN(PHP_PROG_SENDMAIL,[ -AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib) -if test -n "$PROG_SENDMAIL"; then - AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) -fi -]) - -AC_DEFUN(PHP_RUNPATH_SWITCH,[ -dnl check for -R, etc. switch -AC_MSG_CHECKING([if compiler supports -R]) -AC_CACHE_VAL(php_cv_cc_dashr,[ - SAVE_LIBS=$LIBS - LIBS="-R /usr/lib $LIBS" - AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) - LIBS=$SAVE_LIBS]) -AC_MSG_RESULT([$php_cv_cc_dashr]) -if test $php_cv_cc_dashr = "yes"; then - ld_runpath_switch=-R -else - AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) - AC_CACHE_VAL(php_cv_cc_rpath,[ - SAVE_LIBS=$LIBS - LIBS="-Wl,-rpath,/usr/lib $LIBS" - AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) - LIBS=$SAVE_LIBS]) - AC_MSG_RESULT([$php_cv_cc_rpath]) - if test $php_cv_cc_rpath = "yes"; then - ld_runpath_switch=-Wl,-rpath, - else - dnl something innocuous - ld_runpath_switch=-L - fi -fi -]) - -AC_DEFUN(PHP_STRUCT_FLOCK,[ -AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, - AC_TRY_COMPILE([ -#include -#include - ], - [struct flock x;], - [ - ac_cv_struct_flock=yes - ],[ - ac_cv_struct_flock=no - ]) -) -if test "$ac_cv_struct_flock" = "yes" ; then - AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) -fi -]) - -AC_DEFUN(PHP_SOCKLEN_T,[ -AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, - AC_TRY_COMPILE([ -#include -#include -],[ -socklen_t x; -],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -])) -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - -dnl -dnl PHP_SET_SYM_FILE(path) -dnl -dnl set the path of the file which contains the symbol export list -dnl -AC_DEFUN(PHP_SET_SYM_FILE, -[ - PHP_SYM_FILE=$1 -]) - -dnl -dnl PHP_BUILD_THREAD_SAFE -dnl -AC_DEFUN(PHP_BUILD_THREAD_SAFE,[ - enable_experimental_zts=yes - if test "$pthreads_working" != "yes"; then - AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) - fi -]) - -AC_DEFUN(PHP_REQUIRE_CXX,[ - if test -z "$php_cxx_done"; then - AC_PROG_CXX - AC_PROG_CXXCPP - php_cxx_done=yes - fi -]) - -dnl -dnl PHP_BUILD_SHARED -dnl -AC_DEFUN(PHP_BUILD_SHARED,[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp4.la - php_build_target=shared - - php_c_pre=$shared_c_pre - php_c_meta=$shared_c_meta - php_c_post=$shared_c_post - php_cxx_pre=$shared_cxx_pre - php_cxx_meta=$shared_cxx_meta - php_cxx_post=$shared_cxx_post - php_lo=$shared_lo -]) - -dnl -dnl PHP_BUILD_STATIC -dnl -AC_DEFUN(PHP_BUILD_STATIC,[ - PHP_BUILD_PROGRAM - OVERALL_TARGET=libphp4.la - php_build_target=static -]) - -dnl -dnl PHP_BUILD_PROGRAM -dnl -AC_DEFUN(PHP_BUILD_PROGRAM,[ - OVERALL_TARGET=php - php_c_pre='$(CC)' - php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' - php_c_post=' && echo > $[@]' - php_cxx_pre='$(CXX)' - php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' - php_cxx_post=' && echo > $[@]' - php_lo=o - - shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' - shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-pic' - shared_c_post= - shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' - shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-pic' - shared_cxx_post= - shared_lo=lo - - php_build_target=program -]) - -dnl -dnl AC_PHP_ONCE(namespace, variable, code) -dnl -dnl execute code, if variable is not set in namespace -dnl -AC_DEFUN(AC_PHP_ONCE,[ - changequote({,}) - unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` - changequote([,]) - cmd="echo $ac_n \"\$$1$unique$ac_c\"" - if test -n "$unique" && test "`eval $cmd`" = "" ; then - eval "$1$unique=set" - $3 - fi -]) - -dnl -dnl PHP_EXPAND_PATH(path, variable) -dnl -dnl expands path to an absolute path and assigns it to variable -dnl -AC_DEFUN(PHP_EXPAND_PATH,[ - if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then - $2=$1 - else - changequote({,}) - ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" - changequote([,]) - ep_realdir="`(cd \"$ep_dir\" && pwd)`" - $2="$ep_realdir/`basename \"$1\"`" - fi -]) - -dnl -dnl PHP_ADD_LIBPATH(path[, shared-libadd]) -dnl -dnl add a library to linkpath/runpath -dnl -AC_DEFUN(PHP_ADD_LIBPATH,[ - if test "$1" != "/usr/lib"; then - PHP_EXPAND_PATH($1, ai_p) - if test "$ext_shared" = "yes" && test -n "$2"; then - $2="-R$1 -L$1 [$]$2" - else - AC_PHP_ONCE(LIBPATH, $ai_p, [ - test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" - LDFLAGS="$LDFLAGS -L$ai_p" - PHP_RPATHS="$PHP_RPATHS $ai_p" - ]) - fi - fi -]) - -dnl -dnl PHP_BUILD_RPATH() -dnl -dnl builds RPATH from PHP_RPATHS -dnl -AC_DEFUN(PHP_BUILD_RPATH,[ - if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then - OLD_RPATHS=$PHP_RPATHS - unset PHP_RPATHS - for i in $OLD_RPATHS; do - PHP_LDFLAGS="$PHP_LDFLAGS -L$i" - PHP_RPATHS="$PHP_RPATHS -R $i" - NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" - done - fi -]) - -dnl -dnl PHP_ADD_INCLUDE(path [,before]) -dnl -dnl add an include path. -dnl if before is 1, add in the beginning of INCLUDES. -dnl -AC_DEFUN(PHP_ADD_INCLUDE,[ - if test "$1" != "/usr/include"; then - PHP_EXPAND_PATH($1, ai_p) - AC_PHP_ONCE(INCLUDEPATH, $ai_p, [ - if test "$2"; then - INCLUDES="-I$ai_p $INCLUDES" - else - INCLUDES="$INCLUDES -I$ai_p" - fi - ]) - fi -]) - -AC_DEFUN(PHP_X_ADD_LIBRARY,[ - ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") -]) - -dnl -dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) -dnl -dnl add a library to the link line -dnl -AC_DEFUN(PHP_ADD_LIBRARY,[ - case $1 in - c|c_r|pthread*) ;; - *) -ifelse($3,,[ - PHP_X_ADD_LIBRARY($1,$2,LIBS) -],[ - if test "$ext_shared" = "yes"; then - PHP_X_ADD_LIBRARY($1,$2,$3) - else - PHP_ADD_LIBRARY($1,$2) - fi -]) - ;; - esac -]) - -dnl -dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) -dnl -dnl add a library to the link line (deferred) -dnl -AC_DEFUN(PHP_ADD_LIBRARY_DEFER,[ - case $1 in - c|c_r|pthread*) ;; - *) -ifelse($3,,[ - PHP_X_ADD_LIBRARY($1,$2,DLIBS) -],[ - if test "$ext_shared" = "yes"; then - PHP_X_ADD_LIBRARY($1,$2,$3) - else - PHP_ADD_LIBRARY_DEFER($1,$2) - fi -]) - ;; - esac -]) - -dnl -dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd]) -dnl -dnl add a library to the link line and path to linkpath/runpath. -dnl if shared-libadd is not empty and $ext_shared is yes, -dnl shared-libadd will be assigned the library information -dnl -AC_DEFUN(PHP_ADD_LIBRARY_WITH_PATH,[ -ifelse($3,,[ - if test -n "$2"; then - PHP_ADD_LIBPATH($2) - fi - PHP_ADD_LIBRARY($1) -],[ - if test "$ext_shared" = "yes"; then - $3="-l$1 [$]$3" - if test -n "$2"; then - PHP_ADD_LIBPATH($2,$3) - fi - else - PHP_ADD_LIBRARY_WITH_PATH($1,$2) - fi -]) -]) - -dnl -dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path) -dnl -dnl add a library to the link line (deferred) -dnl and path to linkpath/runpath (not deferred) -dnl -AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[ - PHP_ADD_LIBPATH($2) - PHP_ADD_LIBRARY_DEFER($1) -]) - -dnl -dnl Set libtool variable -dnl -AC_DEFUN(PHP_SET_LIBTOOL_VARIABLE,[ - LIBTOOL='$(SHELL) libtool $1' -]) - -dnl -dnl Check for cc option -dnl -AC_DEFUN(PHP_CHECK_CC_OPTION,[ - echo "main(){return 0;}" > conftest.$ac_ext - opt=$1 - changequote({,}) - var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` - changequote([,]) - AC_MSG_CHECKING([if compiler supports -$1 really]) - ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" - if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then - eval php_cc_$var=no - AC_MSG_RESULT([no]) - else - if eval ./conftest 2>/dev/null ; then - eval php_cc_$var=yes - AC_MSG_RESULT([yes]) - else - eval php_cc_$var=no - AC_MSG_RESULT([no]) - fi - fi -]) - -AC_DEFUN(PHP_REGEX,[ - -if test "$REGEX_TYPE" = "php"; then - AC_DEFINE(HSREGEX,1,[ ]) - AC_DEFINE(REGEX,1,[ ]) - PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c) -elif test "$REGEX_TYPE" = "system"; then - AC_DEFINE(REGEX,0,[ ]) -fi - -AC_MSG_CHECKING([which regex library to use]) -AC_MSG_RESULT([$REGEX_TYPE]) -]) - -dnl -dnl See if we have broken header files like SunOS has. -dnl -AC_DEFUN(PHP_MISSING_FCLOSE_DECL,[ - AC_MSG_CHECKING([for fclose declaration]) - AC_TRY_COMPILE([#include ],[int (*func)() = fclose],[ - AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) - AC_MSG_RESULT([ok]) - ],[ - AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) - AC_MSG_RESULT([missing]) - ]) -]) - -dnl -dnl Check for broken sprintf() -dnl -AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ - AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes - ],[ - ac_cv_broken_sprintf=no - ]) - ]) - if test "$ac_cv_broken_sprintf" = "yes"; then - AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ]) - else - AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ]) - fi -]) - -dnl PHP_SHARED_MODULE(module-name, object-var, build-dir) -dnl -dnl Basically sets up the link-stage for building module-name -dnl from object_var in build-dir. -dnl -AC_DEFUN(PHP_SHARED_MODULE,[ - PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.la" - PHP_SUBST($2) - cat >>Makefile.objects</dev/null` - case $os in - "SunOS 5.6"|"SunOS 5.7") - case $CC in - gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; - *) CFLAGS="$CFLAGS -fpic";; - esac - AC_MSG_RESULT([yes]);; - *) - AC_MSG_RESULT([no]);; - esac - else - AC_MSG_RESULT([no]) - fi -]) - -dnl -dnl Checks whether $withval is "shared" or starts with "shared,XXX" -dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff -dnl from $withval. -dnl -AC_DEFUN(PHP_WITH_SHARED,[ - PHP_ARG_ANALYZE_EX(withval) - shared=$ext_shared - unset ext_shared ext_output -]) - -dnl The problem is that the default compilation flags in Solaris 2.6 won't -dnl let programs access large files; you need to tell the compiler that -dnl you actually want your programs to work on large files. For more -dnl details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -AC_DEFUN(PHP_SYS_LFS, -[dnl - # If available, prefer support for large files unless the user specified - # one of the CPPFLAGS, LDFLAGS, or LIBS variables. - AC_MSG_CHECKING([whether large file support needs explicit enabling]) - ac_getconfs='' - ac_result=yes - ac_set='' - ac_shellvars='CPPFLAGS LDFLAGS LIBS' - for ac_shellvar in $ac_shellvars; do - case $ac_shellvar in - CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; - *) ac_lfsvar=LFS_$ac_shellvar ;; - esac - eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar - (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } - ac_getconf=`getconf $ac_lfsvar` - ac_getconfs=$ac_getconfs$ac_getconf - eval ac_test_$ac_shellvar=\$ac_getconf - done - case "$ac_result$ac_getconfs" in - yes) ac_result=no ;; - esac - case "$ac_result$ac_set" in - yes?*) ac_result="yes, but $ac_set is already set, so use its settings" - esac - AC_MSG_RESULT([$ac_result]) - case $ac_result in - yes) - for ac_shellvar in $ac_shellvars; do - eval $ac_shellvar=\$ac_test_$ac_shellvar - done ;; - esac -]) - -AC_DEFUN(PHP_SOCKADDR_SA_LEN,[ - AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ - AC_TRY_COMPILE([#include -#include ], - [struct sockaddr s; s.sa_len;], - [ac_cv_sockaddr_sa_len=yes - AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])], - [ac_cv_sockaddr_sa_len=no]) - ]) -]) - - -dnl ## PHP_OUTPUT(file) -dnl ## adds "file" to the list of files generated by AC_OUTPUT -dnl ## This macro can be used several times. -AC_DEFUN(PHP_OUTPUT,[ - PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" -]) - -AC_DEFUN(PHP_DECLARED_TIMEZONE,[ - AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ - AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -],[ - time_t foo = (time_t) timezone; -],[ - ac_cv_declared_timezone=yes -],[ - ac_cv_declared_timezone=no -])]) - if test "$ac_cv_declared_timezone" = "yes"; then - AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) - fi -]) - -AC_DEFUN(PHP_EBCDIC,[ - AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ - AC_TRY_RUN( [ -int main(void) { - return (unsigned char)'A' != (unsigned char)0xC1; -} -],[ - ac_cv_ebcdic=yes -],[ - ac_cv_ebcdic=no -],[ - ac_cv_ebcdic=no -])]) - if test "$ac_cv_ebcdic" = "yes"; then - AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) - fi -]) - -AC_DEFUN(PHP_FOPENCOOKIE,[ - AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) - - if test "$have_glibc_fopencookie" = "yes" ; then - dnl this comes in two flavors: - dnl newer glibcs (since 2.1.2 ? ) - dnl have a type called cookie_io_functions_t - AC_TRY_COMPILE([ #define _GNU_SOURCE - #include - ], - [ cookie_io_functions_t cookie; ], - [ have_cookie_io_functions_t=yes ], - [] ) - - if test "$have_cookie_io_functions_t" = "yes" ; then - cookie_io_functions_t=cookie_io_functions_t - have_fopen_cookie=yes - else - dnl older glibc versions (up to 2.1.2 ?) - dnl call it _IO_cookie_io_functions_t - AC_TRY_COMPILE([ #define _GNU_SOURCE - #include - ], - [ _IO_cookie_io_functions_t cookie; ], - [ have_IO_cookie_io_functions_t=yes ], - [] ) - if test "$have_cookie_io_functions_t" = "yes" ; then - cookie_io_functions_t=_IO_cookie_io_functions_t - have_fopen_cookie=yes - fi - fi - - if test "$have_fopen_cookie" = "yes" ; then - AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) - AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) - fi - - fi -]) - - -dnl -dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]]) -dnl -dnl Wrapper for AC_CHECK_LIB -dnl -AC_DEFUN(PHP_CHECK_LIBRARY, [ - save_old_LDFLAGS=$LDFLAGS - LDFLAGS="$5 $LDFLAGS" - AC_CHECK_LIB([$1],[$2],[ - LDFLAGS=$save_old_LDFLAGS - $3 - ],[ - LDFLAGS=$save_old_LDFLAGS - $4 - ])dnl -]) - - - diff --git a/apidoc-zend.txt b/apidoc-zend.txt deleted file mode 100644 index 0add45301b1..00000000000 --- a/apidoc-zend.txt +++ /dev/null @@ -1,280 +0,0 @@ -Following is a merge of two letters I sent to php4beta@lists.php.net, -describing the changes in API between PHP 3.0 and PHP 4.0 (Zend). -This file is by no means thorough documentation of the PHP API, -and is intended for developers who are familiar with the PHP 3.0 API, -and want to port their code to PHP 4.0, or take advantage of its new -features. For highlights about the PHP 3.0 API, consult apidoc.txt. - -Zeev - --------------------------------------------------------------------------- - -I'm going to try to list the important changes in API and programming -techniques that are involved in developing modules for PHP4/Zend, as -opposed to PHP3. Listing the whole PHP4 API is way beyond my scope here, -it's mostly a 'diff' from the apidoc.txt, which you're all pretty familiar -with. -An important note that I neglected to mention yesterday - the php4 tree is -based on the php 3.0.5 tree, plus all 3.0.6 patches hand-patched into it. -Notably, it does NOT include any 3.0.7 patches. All of those have to be -reapplied, with extreme care - modules should be safe to patch (mostly), -but anything that touches the core or main.c will almost definitely require -changes in order to work properly. - -[1] Symbol Tables - -One of the major changes in Zend involves changing the way symbols tables -work. Zend enforces reference counting on all values and resources. This -required changes in the semantics of the hash tables that implement symbol -tables. Instead of storing pval in the hashes, we now store pval *. All -of the API functions in Zend were changed in a way that this change is -completely transparent. However, if you've used 'low level' hash functions -to access or update elements in symbol tables, your code will require -changes. Following are two simple examples, one demonstrates the -difference between PHP3 and Zend when reading a symbol's value, and the -other demonstrates the difference when writing a value. - -php3_read() -{ - pval *foo; - - _php3_hash_find(ht, "foo", sizeof("foo"), &foo); - /* foo->type is the type and foo->value is the value */ -} - - -php4_read() -{ - pval **foo; - - _php3_hash_find(ht, "foo", sizeof("foo"), &foo); - /* (*foo)->type is the type and (*foo)->value is the value */ -} - ---- - -php3_write() -{ - pval newval; - - newval.type = ...; - newval.value = ...; - _php3_hash_update(ht, "bar", sizeof("bar"), &newval, sizeof(pval), NULL); -} - -php4_write() -{ - pval *newval = ALLOC_ZVAL(); - - newval->refcount=1; - newval->is_ref=0; - newval->type = ...; - newval->value = ...; - _php3_hash_update(ht, "bar", sizeof("bar"), &newval, sizeof(pval *), NULL); -} - - -[2] Resources - -One of the 'cute' things about the reference counting support is that it -completely eliminates the problem of resource leaking. A simple loop that -included '$result = mysql_query(...)' in PHP leaked unless the user -remembered to run mysql_free($result) at the end of the loop body, and -nobody really did. In order to take advantage of the automatic resource -deallocation upon destruction, there's virtually one small change you need -to conduct. Change the result type of a resource that you want to destroy -itself as soon as its no longer referenced (just about any resource I can -think of) as IS_RESOURCE, instead of as IS_LONG. The rest is magic. - -A special treatment is required for SQL modules that follow MySQL's -approach for having the link handle as an optional argument. Modules that -follow the MySQL module model, store the last opened link in a global -variable, that they use in case the user neglects to explicitly specify a -link handle. Due to the way referenec counting works, this global -reference is just like any other reference, and must increase that SQL link -resource's reference count (otherwise, it will be closed prematurely). -Simply, when you set the default link to a certain link, increase that -link's reference count by calling zend_list_addref(). -As always, the MySQL module is the one used to demonstrate 'new -technology'. You can look around it and look for IS_RESOURCE, as well as -zend_list_addref(), to see a clear example of how the new API should be used. - - -[3] Thread safety issues - -I'm not going to say that Zend was designed with thread safety in mind, but -from some point, we've decided upon several guidelines that would make the -move to thread safety much, much easier. Generally, we've followed the PHP -3.1 approach of moving global variables to a structure, and encapsulating -all global variable references within macros. There are three main -differences: -1. We grouped related globals in a single structure, instead of grouping -all globals in one structure. -2. We've used much, much shorter macro names to increase the readability -of the source code. -3. Regardless of whether we're compiling in thread safe mode or not, all -global variables are *always* stored in a structure. For example, you -would never have a global variable 'foo', instead, it'll be a property of a -global structure, for example, compiler_globals.foo. That makes -development much, much easier, since your code will simply not compile -unless you remember to put the necessary macro around foo. - -To write code that'll be thread safe in the future (when we release our -thread safe memory manager and work on integrating it), you can take a look -at zend_globals.h. Essentially, two sets of macros are defined, one for -thread safe mode, and one for thread unsafe mode. All global references -are encapsulated within ???G(varname), where ??? is the appropriate prefix -for your structure (for example, so far we have CG(), EG() and AG(), which -stand for the compiler, executor and memory allocator, respectively). -When compiling with thread safety enabled, each function that makes use of -a ???G() macro, must obtain the pointer to its copy of the structure. It -can do so in one of two forms: -1. It can receive it as an argument. -2. It can fetch it. - -Obviously, the first method is preferable since it's much quicker. -However, it's not always possible to send the structure all the way to a -particular function, or it may simply bloat the code too much in some -cases. Functions that receive the globals as an argument, should look like -this: - -rettype functioname(???LS_D) <-- a function with no arguments -rettype functioname(type arg1, ..., type argn ???LS_DC) <-- a funciton with -arguments - -Calls to such functions should look like this: -functionname(???LS_C) <-- a function with no arguments -functionname(arg1, ..., argn ???LS_CC) <-- a function with arguments - -LS stands for 'Local Storage', _C stands for Call and _CC stands for Call -Comma, _D stands for Declaration and _DC stands for Declaration Comma. -Note that there's NO comma between the last argument and ???LS_DC or ???LS_CC. - -If you do not pass the structure as an argument you can always fetch it by -using the appropriate ???LS_FETCH() macros within a functions variable -declarations. - -In general, every module that makes use of globals should use this approach -if it plans to be thread safe. - - -[4] Generalized INI support - -The code comes to solve several issues: - -a. The ugly long block of code in main.c that reads values from the -cfg_hash into php3_ini. -b. Get rid of php3_ini. The performance penalty of copying it around all -the time in the Apache module probably wasn't too high, but -psychologically, it annoyed me :) -c. Get rid of the ugly code in mod_php4.c, that also reads values from -Apache directives and puts them into the php3_ini structure. -d. Generalize all the code so that you only have to add an entry in one -single place and get it automatically supported in php3.ini, Apache, Win32 -registry, runtime function ini_get() and ini_alter() and any future method -we might have. -e. Allow users to easily override *ANY* php3.ini value, except for ones -they're not supposed to, of course. - -I'm happy to say that I think I pretty much reached all goals. php_ini.c -implements a mechanism that lets you add your INI entry in a single place, -with a default value in case there's no php3.ini value. What you get by -using this mechanism: - -1. Automatic initialization from php3.ini if available, or from the -default value if not. -2. Automatic support in ini_alter(). That means a user can change the -value for this INI entry at runtime, without you having to add in a single -line of code, and definitely no additional function (for example, in PHP3, -we had to add in special dedicated functions, like -set_magic_quotes_runtime() or the likes - no need for that anymore). -3. Automatic support in Apache .conf files. -4. No need for a global php3_ini-like variable that'll store all that -info. You can directly access each INI entry by name, in runtime. 'Sure, -that's not revolutionary, it's just slow' is probably what some of you -think - which is true, but, you can also register a callback function that -is called each time your INI entry is changed, if you wish to store it in a -cached location for intensive use. -5. Ability to access the current active value for a given INI entry, and -the 'master' value. - -Of course, (2) and (3) are only applicable in some cases. Some entries -shouldn't be overriden by users in runtime or through Apache .conf files - -you can, of course, mark them as such. - - -So, enough hype, how does it work. - -Essentially: - -static PHP_INI_MH(OnChangeBar); /* declare a message handler for a change -in "bar" */ - -PHP_INI_BEGIN() - PHP_INI_ENTRY("foo", "1", PHP_INI_ALL, NULL, NULL) - PHP_INI_ENTRY("bar", "bah", PHP_INI_SYSTEM, OnChangeBar, NULL) -PHP_INI_END() - -static PHP_INI_MH(OnChangeBar) -{ - a_global_var_for_bar = new_value; - return SUCCESS; -} - -int whatever_minit(INIT_FUNC_ARGS) -{ - ... - REGISTER_INI_ENTRIES(); - ... -} - - -int whatever_mshutdown(SHUTDOWN_FUNC_ARGS) -{ - ... - UNREGISTER_INI_ENTRIES(); - ... -} - - -and that's it. Here's what it does. As you can probably guess, this code -registers two INI entries - "foo" and "bar". They're given defaults "1" -and "bah" respectively - note that all defaults are always given as -strings. That doesn't reduce your ability to use integer values, simply -specify them as strings. "foo" is marked so that it can be changed by -anyone at any time (PHP_INI_ALL), whereas "bar" is marked so it can be -changed only at startup in the php3.ini only, presumably, by the system -administrator (PHP_INI_SYSTEM). -When "foo" changes, no function is called. Access to it is done using the -macros INI_INT("foo"), INI_FLT("foo") or INI_STR("foo"), which return a -long, double or char * respectively (strings that are returned aren't -duplicated - if they're manipulated, you must duplicate them first). You -can also access the original value (the 'master' value, in case one of them -was overriden by a user) using another pair of macros: -INI_ORIG_INT("foo"), INI_ORIG_FLT("foo") and INI_ORIG_STR("foo"). - -When "bar" changes, a special message handler is called, OnBarChange(). -Always declare those message handlers using PHP_INI_MH(), as they might -change in the future. Message handlers are called as soon as an ini entry -initializes or changes, and allow you to cache a certain INI value in a -quick C structure. In this example, whenever "bar" changes, the new value -is stored in a_global_var_for_bar, which is a global char * pointer, -quickly accessible from other functions. Things get a bit more complicated -when you want to implement a thread-safe module, but it's doable as well. -Message handlers may return SUCCESS to acknowledge the new value, or -FAILURE to reject it. That enables you to reject invalid values for some -INI entries if you want. Finally, you can have a pointer passed to your -message handler - that's the fifth argument to PHP_INI_ENTRY(). It is -passed as mh_arg to the message handler. - -Remember that for certain values, there's really no reason to mess with a -callback function. A perfect example for this are the syntax highlight -colors, which no longer have a dedicated global C slot that stores them, -but instead, are fetched from the php_ini hash on demand. - -"As always", for a perfect working example of this mechanism, consult -functions/mysql.c. This module uses the new INI entry mechanism, and was -also converted to be thread safe in general, and in its php_ini support in -particular. Converting your modules to look like this for thread safety -isn't a bad idea (not necessarily now, but in the long run). - diff --git a/apidoc.txt b/apidoc.txt deleted file mode 100644 index 34eac2896c4..00000000000 --- a/apidoc.txt +++ /dev/null @@ -1,492 +0,0 @@ -PHP Version 3.0 API Documentation - -Table of Contents ------------------ - 1. Function Prototype - 2. Function Arguments - 3. Variable number of function arguments - 4. Using the function arguments - 5. Memory management in functions - 6. Setting variables in the symbol table - 7. Returning values from functions - 8. Returning 'complex' values from functions (arrays or objects) - 9. Using the resource list -10. Using the persistent resource table -11. Adding runtime configuration directives ------------------ - -1. Function Prototype - - All functions look like this: - - PHP_FUNCTION(foo) { - - } - - Even if your function doesn't take any arguments, this is how it is - called. - ------------------ - -2. Function Arguments - - Arguments are always of type pval. This type contains a union which - has the actual type of the argument. So, if your function takes two - arguments, you would do something like the following at the top of your - function: - - pval *arg1, *arg2; - if (ARG_COUNT(ht) != 2 || getParameters(ht,2,&arg1,&arg2)==FAILURE) { - WRONG_PARAM_COUNT; - } - - NOTE: Arguments can be passed either by value or by reference. In both - cases you will need to pass &(pval *) to getParameters. If you want to - check if the n'th parameter was sent to you by reference or not, you can - use the function, ParameterPassedByReference(ht,n). It will return either - 1 or 0. - - When you change any of the passed parameters, whether they are sent by - reference or by value, you can either start over with the parameter by - calling pval_destructor on it, or if it's an ARRAY you want to add to, - you can use functions similar to the ones in internal_functions.h which - manipulate return_value as an ARRAY. - - Also if you change a parameter to IS_STRING make sure you first assign - the new estrdup'ed string and the string length, and only later change the - type to IS_STRING. If you change the string of a parameter which already - IS_STRING or IS_ARRAY you should run pval_destructor on it first. - ------------------ - -3. Variable number of function arguments - - A function can take a variable number of arguments. If your function can - take either 2 or 3 arguments, use the following: - - pval *arg1, *arg2, *arg3; - int arg_count = ARG_COUNT(ht); - - if (arg_count<2 || arg_count>3 || - getParameters(ht,arg_count,&arg1,&arg2,&arg3)==FAILURE) { - WRONG_PARAM_COUNT; - } - ------------------- - -4. Using the function arguments - - The type of each argument is stored in the pval type field: - - - This type can be any of the following: - - IS_STRING String - IS_DOUBLE Double-precision floating point - IS_LONG Long - IS_ARRAY Array - - IS_EMPTY ?? - IS_USER_FUNCTION ?? - IS_INTERNAL_FUNCTION ?? (if some of these cannot be passed to a - function - delete) - IS_CLASS ?? - IS_OBJECT ?? - - If you get an argument of one type and would like to use it as another, - or if you just want to force the argument to be of a certain type, you - can use one of the following conversion functions: - - convert_to_long(arg1); - convert_to_double(arg1); - convert_to_string(arg1); - convert_to_boolean_long(arg1); If the string is "" or "0" it - becomes 0, 1 otherwise - convert_string_to_number(arg1); Converts string to either LONG or - DOUBLE depending on string - - These function all do in-place conversion. They do not return anything. - - The actual argument is stored in a union. - - For type IS_STRING, use arg1->value.str.val - IS_LONG arg1->value.lval - IS_DOUBLE arg1->value.dval - -------------------- - -5. Memory management in functions - - Any memory needed by a function should be allocated with either emalloc() - or estrdup(). These are memory handling abstraction functions that look - and smell like the normal malloc() and strdup() functions. Memory should - be freed with efree(). - - There are two kinds of memory in this program. Memory which is returned - to the parser in a variable and memory which you need for temporary - storage in your internal function. When you assign a string to a - variable which is returned to the parser you need to make sure you first - allocate the memory with either emalloc or estrdup. This memory - should NEVER be freed by you, unless you later, in the same function - overwrite your original assignment (this kind of programming practice is - not good though). - - For any temporary/permanent memory you need in your functions/library you - should use the three emalloc(), estrdup(), and efree() functions. They - behave EXACTLY like their counterpart functions. Anything you emalloc() - or estrdup() you have to efree() at some point or another, unless it's - supposed to stick around until the end of the program, otherwise there - will be a memory leak. The meaning of "the functions behave exactly like - their counterparts" is if you efree() something which was not - emalloc()'ed nor estrdup()'ed you might get a segmentation fault. So - please take care and free all of your wasted memory. One of the biggest - improvements in PHP 3.0 will hopefully be the memory management. - - If you compile with "-DDEBUG", PHP3 will print out a list of all - memory that was allocated using emalloc() and estrdup() but never - freed with efree() when it is done running the specified script. - -------------------- - -6. Setting variables in the symbol table - - A number of macros are available which make it easier to set a variable - in the symbol table: - - SET_VAR_STRING(name,value) ** - SET_VAR_DOUBLE(name,value) - SET_VAR_LONG(name,value) - - ** Be careful here. The value part must be malloc'ed manually because - the memory management code will try to free this pointer later. Do - not pass statically allocated memory into a SET_VAR_STRING - - Symbol tables in PHP 3.0 are implemented as hash tables. At any given time, - &symbol_table is a pointer to the 'main' symbol table, and active_symbol_table - points to the currently active symbol table (these may be identical like in - startup, or different, if you're inside a function). - - The following examples use 'active_symbol_table'. You should replace it with - &symbol_table if you specifically want to work with the 'main' symbol table. - Also, the same funcions may be applied to arrays, as explained below. - - * To check whether a variable named $foo already exists in a symbol table: - if (hash_exists(active_symbol_table,"foo",sizeof("foo"))) { exists... } - else { doesn't exist } - - * If you also need to get the type of the variable, you can use: - hash_find(active_symbol_table,"foo",sizeof("foo"),&pvalue); - check(pvalue.type); - - Arrays in PHP 3.0 are implemented using the same hashtables as symbol tables. - This means the two above functions can also be used to check variables - inside arrays. - - If you want to define a new array in a symbol table, you should do this: - - 1. Possibly check it exists and abort, using hash_exists() - or hash_find(). - 2. Code: - - pval arr; - - if (array_init(&arr) == FAILURE) { failed... }; - hash_update(active_symbol_table,"foo",sizeof("foo"),&arr,sizeof(pval),NULL); - - This code declares a new array, named $foo, in the active symbol table. - This array is empty. - - Here's how to add new entries to it: - - pval entry; - - entry.type = IS_LONG; - entry.value.lval = 5; - - hash_update(arr.value.ht,"bar",sizeof("bar"),&entry,sizeof(pval),NULL); /* defines $foo["bar"] = 5 */ - hash_index_update(arr.value.ht,7,&entry,sizeof(pval),NULL); /* defines $foo[7] = 5 */ - hash_next_index_insert(arr.value.ht,&entry,sizeof(pval),NULL); /* defines the next free place in $foo[], - * $foo[8], to be 5 (works like php2) - */ - - If you'd like to modify a value that you inserted to a hash, you must first retreive it from the hash. To - prevent that overhead, you can supply a pval ** to the hash add function, and it'll be updated with the - pval * address of the inserted element inside the hash. If that value is NULL (like in all of the - above examples) - that parameter is ignored. - - hash_next_index_insert() works more or less using the same logic - "$foo[] = bar;" works in PHP 2.0. - - If you are building an array to return from a function, you can initialize - the array just like above by doing: - - if (array_init(return_value) == FAILURE) { failed...; } - - and then adding values with the helper functions: - - add_next_index_long(return_value,long_value); - add_next_index_double(return_value,double_value); - add_next_index_string(return_value,estrdup(string_value)); - - Of course, if the adding isn't done right after the array - initialization, you'd probably have to look for the array first: - - pval *arr; - - if (hash_find(active_symbol_table,"foo",sizeof("foo"),(void **)&arr)==FAILURE) { can't find... } - else { use arr->value.ht... } - - Note that hash_find receives a pointer to a pval pointer, and - not a pval pointer. - - Just about any hash function returns SUCCESS or FAILURE (except for - hash_exists() that returns a boolean truth value). - -------------------- - -7. Returning 'simple' values from functions (integers, floats or strings) - - A number of macros are available to make it easier to return things from - functions: - - These set the return value and return from the function: - - RETURN_FALSE - RETURN_TRUE - RETURN_LONG(l) - RETURN_STRING(s,dup) If dup is true, duplicates the string - RETURN_STRINGL(s,l,dup) Return string (s) specifying length (l). - RETURN_DOUBLE(d) - - These only set the return value: - - RETVAL_FALSE - RETVAL_TRUE - RETVAL_LONG(l) - RETVAL_STRING(s,dup) If dup is true, duplicates the string - RETVAL_STRINGL(s,l,dup) Return string (s) specifying length (l). - RETVAL_DOUBLE(d) - - The string macros above will all estrdup() the passed 's' argument, - so you can safely free the argument after calling the macro, or - alternatively use statically allocated memory. - - If your function returns boolean success/error responses, always use - RETURN_TRUE and RETURN_FALSE respectively. - -------------------- - -8. Returning 'complex' values from functions (arrays or objects) - - Your function can also return a complex data type such as an object - or an array. - - Returning an object: - - 1. Call object_init(return_value). - 2. Fill it up with values: - - add_property_long(return_value,property_name,l) Add a property named 'property_name', of type long, equals to 'l' - add_property_double(return_value,property_name,d) Same, only a double - add_property_string(return_value,property_name,str) Same, only a string - add_property_stringl(return_value,property_name,str,l) Add a property named 'property_name', of type string, string is 'str' with length 'l' - - 3. Possibly, register functions for this object. In order to - obtain values from the object, the function would have to fetch - "this" from the active_symbol_table. Its type should be IS_OBJECT, - and it's basically a regular hash table (i.e., you can use regular - hash functions on .value.ht). The actual registration of the - function can be done using: - - add_method(return_value,function_name,function_ptr) - - - Returning an array: - - 1. Call array_init(return_value). - 2. Fill it up with values: - - add_assoc_long(return_value,key,l) add associative entry with key 'key' and long value 'l' - add_assoc_double(return_value,key,d) - add_assoc_string(return_value,key,str) - add_assoc_stringl(return_value,key,str,length) specify the string length - - add_index_long(return_value,index,l) add entry in index 'index' with long value 'l' - add_index_double(return_value,index,d) - add_index_string(return_value,index,str) - add_index_stringl(return_value,index,str,length) specify the string length - - add_next_index_long(return_value,l) add an array entry in the next free offset with long value 'l' - add_next_index_double(return_value,d) - add_next_index_string(return_value,str) - add_next_index_stringl(return_value,str,length) specify the string length - -------------------- - -9. Using the resource list - - PHP 3.0 has a standard way of dealing with various types of resources, - that replaces all of the local linked lists in PHP 2.0. - - Available functions: - - php3_list_insert(ptr, type) returns the 'id' of the newly inserted resource - php3_list_delete(id) delete the resource with the specified id - php3_list_find(id,*type) returns the pointer of the resource with the specified id, updates 'type' to the resource's type - - Typically, these functions are used for SQL drivers but they can be - used for anything else, and are used, for instance, for maintaining - file descriptors. - - Typical list code would look like this: - - Adding a new resource: - - RESOURCE *resource; - - ...allocate memory for resource and acquire resource... - /* add a new resource to the list */ - return_value->value.lval = php3_list_insert((void *) resource, LE_RESOURCE_TYPE); - return_value->type = IS_LONG; - - Using an existing resource: - - pval *resource_id; - RESOURCE *resource; - int type; - - convert_to_long(resource_id); - resource = php3_list_find(resource_id->value.lval, &type); - if (type != LE_RESOURCE_TYPE) { - php3_error(E_WARNING,"resource index %d has the wrong type",resource_id->value.lval); - RETURN_FALSE; - } - ...use resource... - - Deleting an existing resource: - - pval *resource_id; - RESOURCE *resource; - int type; - - convert_to_long(resource_id); - php3_list_delete(resource_id->value.lval); - - - The resource types should be registered in php3_list.h, in enum - list_entry_type. In addition, one should add shutdown code for any - new resource type defined, in list.c's list_entry_destructor() (even if - you don't have anything to do on shutdown, you must add an empty case). - -------------------- - -10. Using the persistent resource table - - PHP 3.0 has a standard way of storing persistent resources (i.e., - resources that are kept in between hits). The first module to use - this feature was the MySQL module, and mSQL followed it, so one can - get the general impression of how a persistent resource should be - used by reading mysql.c. The functions you should look at are: - php3_mysql_do_connect() - php3_mysql_connect() - php3_mysql_pconnect() - - The general idea of persistence modules is this: - 1. Code all of your module to work with the regular resource list - mentioned in section (9). - 2. Code extra connect functions that check if the resource already - exists in the persistent resource list. If it does, register it - as in the regular resource list as a pointer to the persistent - resource list (because of 1., the rest of the code - should work immediately). If it doesn't, then create it, add it - to the persistent resource list AND add a pointer to it from the - regular resource list, so all of the code would work since it's - in the regular resource list, but on the next connect, the - resource would be found in the persistent resource list and be - used without having to recreate it. - You should register these resources with a different type (e.g. - LE_MYSQL_LINK for non-persistent link and LE_MYSQL_PLINK for - a persistent link). - - If you read mysql.c, you'll notice that except for the more complex - connect function, nothing in the rest of the module has to be changed. - - The very same interface exists for the regular resource list and the - persistent resource list, only 'list' is replaced with 'plist': - - php3_plist_insert(ptr, type) returns the 'id' of the newly inserted resource - php3_plist_delete(id) delete the resource with the specified id - php3_plist_find(id,*type) returns the pointer of the resource with the specified id, updates 'type' to the resource's type - - However, it's more than likely that these functions would prove - to be useless for you when trying to implement a persistent module. - Typically, one would want to use the fact that the persistent resource - list is really a hash table. For instance, in the MySQL/mSQL modules, - when there's a pconnect() call (persistent connect), the function - builds a string out of the host/user/passwd that were passed to the - function, and hashes the SQL link with this string as a key. The next - time someone calls a pconnect() with the same host/user/passwd, the - same key would be generated, and the function would find the SQL link - in the persistent list. - - Until further documented, you should look at mysql.c or msql.c to - see how one should use the plist's hash table abilities. - - One important thing to note: resources going into the persistent - resource list must *NOT* be allocated with PHP's memory manager, i.e., - they should NOT be created with emalloc(), estrdup(), etc. Rather, - one should use the regular malloc(), strdup(), etc. The reason for - this is simple - at the end of the request (end of the hit), every - memory chunk that was allocated using PHP's memory manager is deleted. - Since the persistent list isn't supposed to be erased at the end - of a request, one mustn't use PHP's memory manager for allocating - resources that go to it. - - Shutting down persistent resources: - - When you register resource that's going to be in the persistent list, - you should add destructors to it both in the non-persistent list - and in the persistent list. - The destructor in the non-persistent list destructor shouldn't do anything. - The one in the persistent list destructor should properly free any - resources obtained by that type (e.g. memory, SQL links, etc). Just like - with the non-persistent resources, you *MUST* add destructors for every - resource, even it requires no destructotion and the destructor would - be empty. - Remember, since emalloc() and friends aren't to be used in conjunction - with the persistent list, you mustn't use efree() here either. - -------------------- - -11. Adding runtime configuration directives - -Many of the features of PHP3 can be configured at runtime. These -configuration directives can appear in either the designated php3.ini -file, or in the case of the Apache module version in the Apache .conf -files. The advantage of having them in the Apache .conf files is that -they can be configured on a per-directory basis. This means that one -directory may have a certain safemodeexecdir for example, while another -directory may have another. This configuration granularity is especially -handy when a server supports multiple virtual hosts. - -The steps required to add a new directive: - - 1. Add directive to php3_ini_structure struct in mod_php4.h. - - 2. In main.c, edit the php3_module_startup function and add the - appropriate cfg_get_string() or cfg_get_long() call. - - 3. Add the directive, restrictions and a comment to the php3_commands - structure in mod_php4.c. Note the restrictions part. RSRC_CONF are - directives that can only be present in the actual Apache .conf files. - Any OR_OPTIONS directives can be present anywhere, include normal - .htaccess files. - - 4. In either php3take1handler() or php3flaghandler() add the appropriate - entry for your directive. - - 5. In the configuration section of the _php3_info() function in - functions/info.c you need to add your new directive. - - 6. And last, you of course have to use your new directive somewhere. - It will be addressable as php3_ini.directive diff --git a/build/build.mk b/build/build.mk deleted file mode 100644 index 30ccf8ea843..00000000000 --- a/build/build.mk +++ /dev/null @@ -1,71 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# -# Makefile to generate build tools -# - -SUBDIRS = Zend TSRM - -STAMP = buildmk.stamp - -ALWAYS = generated_lists - -all: $(STAMP) $(ALWAYS) - @$(MAKE) AMFLAGS=$(AMFLAGS) -s -f build/build2.mk - -generated_lists: - @echo makefile_am_files = Zend/Makefile.am \ - TSRM/Makefile.am > $@ - @echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@ - @echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \ - Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@ - -$(STAMP): build/buildcheck.sh - @build/buildcheck.sh && touch $(STAMP) - -snapshot: - distname='$(DISTNAME)'; \ - if test -z "$$distname"; then \ - distname='php4-snapshot'; \ - fi; \ - myname=`basename \`pwd\`` ; \ - cd .. && cp -rp $$myname $$distname; \ - cd $$distname; \ - rm -f $(SUBDIRS) 2>/dev/null || true; \ - for i in $(SUBDIRS); do \ - test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \ - done; \ - find . -type l -exec rm {} \; ; \ - $(MAKE) AMFLAGS=--copy -f build/build.mk; \ - cd ..; \ - tar cf $$distname.tar $$distname; \ - rm -rf $$distname $$distname.tar.*; \ - bzip2 -9 $$distname.tar; \ - md5sum $$distname.tar.bz2; \ - sync; sleep 2; \ - md5sum $$distname.tar.bz2; \ - bzip2 -t $$distname.tar.bz2 - -cvsclean: - @for i in `find . -name .cvsignore`; do \ - (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \ - done - @rm -f $(SUBDIRS) 2>/dev/null || true - -.PHONY: $(ALWAYS) snapshot cvsclean diff --git a/build/build2.mk b/build/build2.mk deleted file mode 100644 index 8ec12e44ae3..00000000000 --- a/build/build2.mk +++ /dev/null @@ -1,59 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include generated_lists - -TOUCH_FILES = mkinstalldirs install-sh missing - -LT_TARGETS = ltmain.sh config.guess config.sub - -makefile_in_files = $(makefile_am_files:.am=.in) -makefile_files = $(makefile_am_files:e.am=e) - -config_h_in = main/php_config.h.in - -acconfig_h_SOURCES = acconfig.h.in $(config_h_files) - -targets = $(TOUCH_FILES) configure $(config_h_in) - - -all: $(targets) - -acconfig.h: $(acconfig_h_SOURCES) - @echo rebuilding $@ - cat $(acconfig_h_SOURCES) > $@ - -SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before AC_PROG_CC)'||true) - -$(config_h_in): configure acconfig.h -# explicitly remove target since autoheader does not seem to work -# correctly otherwise (timestamps are not updated) - @echo rebuilding $@ - @rm -f $@ - @autoheader 2>&1 | $(SUPPRESS_WARNINGS) - -$(TOUCH_FILES): - touch $(TOUCH_FILES) - -aclocal.m4: configure.in acinclude.m4 - aclocal 2>&1 | $(SUPPRESS_WARNINGS) - -configure: aclocal.m4 configure.in $(config_m4_files) - @echo rebuilding $@ - @autoconf 2>&1 | $(SUPPRESS_WARNINGS) diff --git a/build/buildcheck.sh b/build/buildcheck.sh deleted file mode 100755 index 3d075646f1b..00000000000 --- a/build/buildcheck.sh +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Authors: Stig Bakken | -# | Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id: buildcheck.sh,v 1.16 2002-03-04 08:28:57 sas Exp $ -# - -echo "buildconf: checking installation..." - -# autoconf 2.13 or newer -ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then -echo "buildconf: autoconf not found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then -echo "buildconf: autoconf version $ac_version found." -echo " You need autoconf version 2.13 or newer installed" -echo " to build PHP from CVS." -exit 1 -else -echo "buildconf: autoconf version $ac_version (ok)" -fi - - -# automake 1.4 or newer -am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -am_version_clean=`echo $am_version|sed -e 's/-p[0-9]*$//'` -if test "$am_version" = ""; then -echo "buildconf: automake not found." -echo " You need automake version 1.4 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -IFS=.; set $am_version_clean; IFS=' ' -if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then -echo "buildconf: automake version $am_version found." -echo " You need automake version 1.4 or newer installed" -echo " to build PHP from CVS." -exit 1 -else -echo "buildconf: automake version $am_version (ok)" -fi - -# libtool 1.4 or newer -libtool=`which libtool` -if test ! -f "$libtool"; then libtool=`which glibtool`; fi -lt_pversion=`$libtool --version 2>/dev/null|sed -n -e 's/^[^0-9]*//' -e 1's/[- ].*//p'` -if test "$lt_pversion" = ""; then -echo "buildconf: libtool not found." -echo " You need libtool version 1.4 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'` -IFS=.; set $lt_version; IFS=' ' - -if test "$1" -gt "1" || test "$2" -ge "4"; -then -echo "buildconf: libtool version $lt_pversion (ok)" -else -echo "buildconf: libtool version $lt_pversion found." -echo " You need libtool version 1.4 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi - -am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'` -lt_prefix=`echo $libtool | sed -e 's#/[^/]*/[^/]*$##'` -if test "$am_prefix" != "$lt_prefix"; then - echo "WARNING: automake and libtool are installed in different" - echo " directories. This may cause aclocal to fail." - echo " continuing anyway" -fi - -exit 0 diff --git a/build/genif.sh b/build/genif.sh deleted file mode 100644 index 947ec2ffaab..00000000000 --- a/build/genif.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/sh - -# $Id: genif.sh,v 1.2 2001-03-30 14:02:20 sas Exp $ -# replacement for genif.pl - -infile="$1" -shift -srcdir="$1" -shift -extra_module_ptrs="$1" -shift -awk="$1" -shift - -if test "$infile" = "" -o "$srcdir" = ""; then - echo "please supply infile and srcdir" - exit 1 -fi - -module_ptrs="$extra_module_ptrs" -header_list="" -olddir=`pwd` -cd $srcdir - -for ext in ${1+"$@"} ; do - module_ptrs=" phpext_${ext}_ptr,@NEWLINE@$module_ptrs" - header_list="$header_list ext/$ext/*.h" -done - -includes=`$awk -f ./build/print_include.awk $header_list` - -cd $olddir - -cat $infile | \ - sed \ - -e "s'@EXT_INCLUDE_CODE@'$includes'" \ - -e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \ - -e 's/@NEWLINE@/\ -/g' - - diff --git a/build/mkdep.awk b/build/mkdep.awk deleted file mode 100644 index a83f5f6c902..00000000000 --- a/build/mkdep.awk +++ /dev/null @@ -1,75 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 2000 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# -# Usage: -# -# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \ -# awk -f mkdep.awk > dependencies - - -{ - top_srcdir=$1 - top_builddir=$2 - srcdir=$3 - cmd=$4 - - for (i = 5; i <= NF; i++) { - if (match($i, "^-[A-Z]") == 0) - break; - cmd=cmd " " $i - } - - dif=i-1 - - for (; i <= NF; i++) - filenames[i-dif]=$i - - no_files=NF-dif - - for(i = 1; i <= no_files; i++) { - if (system("test -r " filenames[i]) != 0) - continue - - target=filenames[i] - sub(srcdir "/", "", target) - target2=target - sub("\.(c|cpp)$", ".lo", target); - sub("\.(c|cpp)$", ".slo", target2); - - for (e in used) - delete used[e] - - cmdx=cmd " " filenames[i] - done=0 - while ((cmdx | getline) > 0) { - if (match($0, "^# [0-9]* \".*\.h\"") != 0) { - if (sub(top_srcdir, "$(top_srcdir)", $3) == 0) - sub(top_builddir, "$(top_builddir)", $3) - if (substr($3,2,1) != "/" && used[$3] != 1) { - if (done == 0) - printf(target " " target2 ":") - done=1 - printf(" \\\n\t" substr($3,2,length($3)-2)) - used[$3] = 1; - } - } - } - if (done == 1) - print "\n" - } -} diff --git a/build/print_include.awk b/build/print_include.awk deleted file mode 100644 index a4919fae873..00000000000 --- a/build/print_include.awk +++ /dev/null @@ -1,6 +0,0 @@ -/phpext_/ { - if (old_filename != FILENAME) { - printf "#include \"" FILENAME "\"@NEWLINE@" - old_filename = FILENAME - } -} diff --git a/build/program.mk b/build/program.mk deleted file mode 100644 index 5e2341d94b1..00000000000 --- a/build/program.mk +++ /dev/null @@ -1,23 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -PROGRAM_OBJECTS = $(PROGRAM_SOURCES:.c=.lo) - -$(PROGRAM_NAME): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS) - $(LINK_CLEAN) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD) diff --git a/build/rules.mk b/build/rules.mk deleted file mode 100644 index 96448914b0f..00000000000 --- a/build/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include $(top_srcdir)/build/rules_common.mk - -all: all-recursive -install: install-recursive - -distclean-recursive depend-recursive clean-recursive all-recursive install-recursive: - @otarget=`echo $@|sed s/-recursive//`; \ - list='$(SUBDIRS)'; for i in $$list; do \ - target="$$otarget"; \ - echo "Making $$target in $$i"; \ - if test "$$i" = "."; then \ - ok=yes; \ - target="$$target-p"; \ - fi; \ - (cd $$i && $(MAKE) $$target) || exit 1; \ - done; \ - if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \ - if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi - -all-p: $(targets) -install-p: $(targets) $(install_targets) -distclean-p depend-p clean-p: - -depend: depend-recursive - @echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true - -clean: clean-recursive clean-x - -clean-x: - rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES) - rm -rf .libs - -distclean: distclean-recursive clean-x - rm -f config.cache config.log config.status config_vars.mk libtool \ - php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module - -test: $(top_builddir)/sapi/cli/php - @if test "$(TESTS)" = ""; then \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(srcdir); \ - else \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(TESTS); \ - fi - -include $(builddir)/.deps - -.PHONY: all-recursive clean-recursive install-recursive \ -$(install_targets) install all clean depend depend-recursive shared \ -distclean-recursive distclean clean-x all-p install-p distclean-p \ -depend-p clean-p diff --git a/build/rules_common.mk b/build/rules_common.mk deleted file mode 100644 index 0ecff41ccb4..00000000000 --- a/build/rules_common.mk +++ /dev/null @@ -1,77 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include $(top_builddir)/config_vars.mk - -COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) -COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) - -SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) -prefer-pic $(EXTRA_CFLAGS) -c $< && touch $@ -CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) -prefer-pic $(EXTRA_CXXFLAGS) -c $< && touch $@ - -LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -LINK_CLEAN = $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ - -mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p -INSTALL = $(top_srcdir)/build/shtool install -c -INSTALL_DATA = $(INSTALL) -m 644 - -DEFS = -I. -I$(srcdir) -I$(top_builddir)/main -I$(top_srcdir) - -moduledir = $(EXTENSION_DIR) - -CXX_SUFFIX = .cpp - -.SUFFIXES: -.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l - -.c.o: - $(COMPILE) -c $< - -$(CXX_SUFFIX).o: - $(CXX_COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.c.lo: - $(PHP_COMPILE) - -$(CXX_SUFFIX).lo: - $(CXX_PHP_COMPILE) - -.s.lo: - $(PHP_COMPILE) - -.c.slo: - $(SHARED_COMPILE) - -$(CXX_SUFFIX).slo: - $(CXX_SHARED_COMPILE) - -.y.c: - $(YACC) $(YFLAGS) $< && mv y.tab.c $*.c - if test -f y.tab.h; then \ - if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \ - else :; fi - -.l.c: - $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ - diff --git a/build/rules_pear.mk b/build/rules_pear.mk deleted file mode 100644 index 27aa3f32219..00000000000 --- a/build/rules_pear.mk +++ /dev/null @@ -1,76 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available at through the world-wide-web at | -# | http://www.php.net/license/2_02.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -include $(top_srcdir)/build/rules_common.mk - -install_targets = install-modules - -all: all-recursive -install: install-recursive - -distclean-recursive depend-recursive clean-recursive all-recursive install-recursive: - @otarget=`echo $@|sed s/-recursive//`; \ - list='$(SUBDIRS)'; for i in $$list; do \ - target="$$otarget"; \ - echo "Making $$target in $$i"; \ - if test "$$i" = "."; then \ - ok=yes; \ - target="$$target-p"; \ - fi; \ - (cd $$i && $(MAKE) $$target) || exit 1; \ - done; \ - if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \ - if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi - -all-p: $(targets) -install-p: $(targets) $(install_targets) -distclean-p depend-p clean-p: - -depend: depend-recursive - @echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true - -clean: clean-recursive clean-x - -clean-x: - rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES) - rm -rf .libs - -distclean: distclean-recursive clean-x - rm -f config.cache config.log config.status config_vars.mk libtool \ - config.h stamp-h Makefile build-defs.h php4.spec libphp4.module - -cvsclean: - @for i in `find . -name .cvsignore`; do \ - (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \ - done - @rm -f $(SUBDIRS) 2>/dev/null || true - -install-modules: - @test -d modules && \ - $(mkinstalldirs) $(moduledir) && \ - echo "installing shared modules into $(moduledir)" && \ - rm -f modules/*.la && \ - cp modules/* $(moduledir) || true - -include $(builddir)/.deps - -.PHONY: all-recursive clean-recursive install-recursive \ -$(install_targets) install all clean depend depend-recursive shared \ -distclean-recursive distclean clean-x all-p install-p distclean-p \ -depend-p clean-p diff --git a/build/shtool b/build/shtool deleted file mode 100755 index 391f5a83c2b..00000000000 --- a/build/shtool +++ /dev/null @@ -1,787 +0,0 @@ -#!/bin/sh -## -## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2001 Ralf S. Engelschall -## -## See http://www.gnu.org/software/shtool/ for more information. -## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. -## -## Version: 1.5.4 (14-Jun-2001) -## Contents: 3/17 available modules -## - -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -## USA, or contact Ralf S. Engelschall . -## -## NOTICE: Given that you include this file verbatim into your own -## source tree, you are justified in saying that it remains separate -## from your package, and that this way you are simply just using GNU -## shtool. So, in this situation, there is no requirement that your -## package itself is licensed under the GNU General Public License in -## order to take advantage of GNU shtool. -## - -## -## Usage: shtool [] [ [] []] -## -## Available commands: -## echo Print string with optional construct expansion -## install Install a program, script or datafile -## mkdir Make one or more directories -## -## Not available commands (because module was not built-in): -## mdate Pretty-print modification time of a file or dir -## table Pretty-print a field-separated list as a table -## prop Display progress with a running propeller -## move Move files with simultaneous substitution -## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree through symbolic links -## fixperm Fix file permissions inside a source tree -## tarball Roll distribution tarballs -## guessos Simple operating system guesser -## arx Extended archive command -## slo Separate linker options by library class -## scpp Sharing C Pre-Processor -## version Maintain a version information file -## path Deal with program paths -## - -if [ $# -eq 0 ]; then - echo "$0:Error: invalid command line" 1>&2 - echo "$0:Hint: run \`$0 -h' for usage" 1>&2 - exit 1 -fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is GNU shtool, version 1.5.4 (14-Jun-2001)" - echo "Copyright (c) 1994-2001 Ralf S. Engelschall " - echo "Report bugs to " - echo '' - echo "Usage: shtool [] [ [] []]" - echo '' - echo 'Available global :' - echo ' -v, --version display shtool version information' - echo ' -h, --help display shtool usage help page (this one)' - echo ' -d, --debug display shell trace information' - echo ' -r, --recreate recreate this shtool script via shtoolize' - echo '' - echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] [ ...] ' - echo ' mkdir [-t] [-f] [-p] [-m]
[ ...]' - echo '' - echo 'Not available (because module was not built-in):' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' fixperm [-v] [-t] [ ...]' - echo ' tarball [-t] [-v] [-o] [-c] [-d] [-u]' - echo ' [-g] [-e] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo [-p] -- -L -l [-L -l ...]' - echo ' scpp [-v] [-p] [-f] [-o] [-t] [-M]' - echo ' [-D] [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-e]' - echo ' [-i] [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' - echo '' - exit 0 -fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.5.4 (14-Jun-2001)" - exit 0 -fi -if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then - shtoolize -ofoo echo install mkdir - exit 0 -fi -if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then - shift - set -x -fi -name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` -case "$name" in - echo|install|mkdir ) - # implicit tool command selection - tool="$name" - ;; - * ) - # explicit tool command selection - tool="$1" - shift - ;; -esac -arg_spec="" -opt_spec="" -gen_tmpfile=no - -## -## DISPATCH INTO SCRIPT PROLOG -## - -case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="n.e." - opt_n=no - opt_e=no - ;; - install ) - str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] [ ...] " - arg_spec="2+" - opt_spec="v.t.c.C.s.m:o:g:e+" - opt_v=no - opt_t=no - opt_c=no - opt_C=no - opt_s=no - opt_m="0755" - opt_o="" - opt_g="" - opt_e="" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="t.f.p.m:" - opt_t=no - opt_f=no - opt_p=no - opt_m="" - ;; - -* ) - echo "$0:Error: unknown option \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; - * ) - echo "$0:Error: unknown command \`$tool'" 2>&1 - echo "$0:Hint: run \`$0 -h' for usage" 2>&1 - exit 1 - ;; -esac - -## -## COMMON UTILITY CODE -## - -# determine name of tool -if [ ".$tool" != . ]; then - # used inside shtool script - toolcmd="$0 $tool" - toolcmdhelp="shtool $tool" - msgprefix="shtool:$tool" -else - # used as standalone script - toolcmd="$0" - toolcmdhelp="sh $0" - msgprefix="$str_tool" -fi - -# parse argument specification string -eval `echo $arg_spec |\ - sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` - -# parse option specification string -eval `echo h.$opt_spec |\ - sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` - -# interate over argument line -opt_PREV='' -while [ $# -gt 0 ]; do - # special option stops processing - if [ ".$1" = ".--" ]; then - shift - break - fi - - # determine option and argument - opt_ARG_OK=no - if [ ".$opt_PREV" != . ]; then - # merge previous seen option with argument - opt_OPT="$opt_PREV" - opt_ARG="$1" - opt_ARG_OK=yes - opt_PREV='' - else - # split argument into option and argument - case "$1" in - -[a-zA-Z0-9]*) - eval `echo "x$1" |\ - sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ - -e 's/";\(.*\)$/"; opt_ARG="\1"/'` - ;; - -[a-zA-Z0-9]) - opt_OPT=`echo "x$1" | cut -c3-` - opt_ARG='' - ;; - *) - break - ;; - esac - fi - - # eat up option - shift - - # determine whether option needs an argument - eval "opt_MODE=\$opt_MODE_${opt_OPT}" - if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then - if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then - opt_PREV="$opt_OPT" - continue - fi - fi - - # process option - case $opt_MODE in - '.' ) - # boolean option - eval "opt_${opt_OPT}=yes" - ;; - ':' ) - # option with argument (multiple occurances override) - eval "opt_${opt_OPT}=\"\$opt_ARG\"" - ;; - '+' ) - # option with argument (multiple occurances append) - eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\"" - ;; - * ) - echo "$msgprefix:Error: unknown option: \`-$opt_OPT'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 - ;; - esac -done -if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:Error: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 - exit 1 -fi - -# process help option -if [ ".$opt_h" = .yes ]; then - echo "Usage: $toolcmdhelp $str_usage" - exit 0 -fi - -# complain about incorrect number of arguments -case $arg_MODE in - '=' ) - if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; - '+' ) - if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 - exit 1 - fi - ;; -esac - -# establish a temporary file on request -if [ ".$gen_tmpfile" = .yes ]; then - if [ ".$TMPDIR" != . ]; then - tmpdir="$TMPDIR" - elif [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - else - tmpdir="/tmp" - fi - tmpfile="$tmpdir/.shtool.$$" - rm -f $tmpfile >/dev/null 2>&1 - touch $tmpfile - chmod 600 $tmpfile -fi - -## -## DISPATCH INTO SCRIPT BODY -## - -case $tool in - -echo ) - ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2001 Ralf S. Engelschall - ## Originally written for WML as buildinfo - ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - case $TERM in - # for the most important terminal types we directly know the sequences - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - # for all others, we try to use a possibly existing `tput' or `tcout' utility - * ) - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # 'smso' is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - ;; - esac - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine (primary) group id - groupid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then - groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$groupid" = . ]; then - groupid='?' - fi - fi - fi - - # determine (primary) group name - groupname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then - groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname=`(ypcat group) 2>/dev/null | \ - egrep "^[^:]*:[^:]*:${groupid}:" | \ - sed -e 's/:.*$//'` - if [ ".$groupname" = . ]; then - groupname='?' - fi - fi - fi - - # determine host and domain name - hostname='' - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi - fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi - fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac - fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%g/${groupname}/g" \ - -e "s/%G/${groupid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo "$text" - else - # the harder part: echo -n is best, because - # awk may complain about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn "$text" - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" - fi - fi - ;; - -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-2001 Ralf S. Engelschall - ## Originally written for shtool - ## - - # determine source(s) and destination - argc=$# - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dstpath="$1" - - # type check for destination - dstisdir=0 - if [ -d $dstpath ]; then - dstpath=`echo "$dstpath" | sed -e 's:/$::'` - dstisdir=1 - fi - - # consistency check for destination - if [ $argc -gt 2 -a $dstisdir = 0 ]; then - echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 - exit 1 - fi - - # iterate over all source(s) - for src in $srcs; do - dst=$dstpath - - # if destination is a directory, append the input filename - if [ $dstisdir = 1 ]; then - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 - continue - fi - if [ -d "$src" ]; then - echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 - continue - fi - - # make a temp file name in the destination directory - dsttmp=`echo $dst |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ - -e "s;\$;/#INST@$$#;"` - - # verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # adjust the target file - if [ ".$opt_e" != . ]; then - sed='sed' - for e in $opt_e; do - sed="$sed -e '$e'" - done - cp $dsttmp $dsttmp.old - eval "$sed <$dsttmp.old >$dsttmp" || exit $? - rm -f $dsttmp.old - fi - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 - fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != ".-" ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 - fi - chmod $opt_m $dsttmp || exit $? - fi - - # determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes - fi - fi - fi - - # finally, install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 - fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 - fi - rm -f $dst && mv $dsttmp $dst - fi - done - ;; - -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2001 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # if the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then - echo "$msgprefix:Error: directory already exists: $p" 1>&2 - errstatus=1 - break - else - continue - fi - fi - # if the directory has to be created... - if [ ".$opt_p" = .no ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 - fi - mkdir $p || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $p" 1>&2 - fi - chmod $opt_m $p || errstatus=$? - fi - else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp='' - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done - fi - done - exit $errstatus - ;; - -esac - -exit 0 - -##EOF## diff --git a/buildconf b/buildconf deleted file mode 100755 index c3530e86146..00000000000 --- a/buildconf +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# $Id$ - -supplied_flag=$1 - -if test "$supplied_flag" = "--copy"; then - automake_flags=--copy -fi - -## build.mk does not check aclocal exit status yet -## -#mv aclocal.m4 aclocal.m4.old 2>/dev/null -#aclocal -#if test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then -# echo "buildconf: ERROR: aclocal failed, probably because automake and" -# echo " libtool are installed with different prefixes;" -# echo " automake is installed in $am_prefix, but libtool in $lt_prefix." -# echo " Please re-install automake and/or libtool with a common prefix" -# echo " and try again." -# exit 1 -#fi - -if test "$supplied_flag" = "--local"; then - subdirs='SUBDIRS=' -else - subdirs='' -fi - -rm -f generated_lists - -case "`uname`" in -*BSD/OS*) - ./build/bsd_makefile;; -esac - -${MAKE:-make} -s -f build/build.mk AMFLAGS="$automake_flags" diff --git a/config.guess b/config.guess deleted file mode 100644 index 28fcc5e22c7..00000000000 --- a/config.guess +++ /dev/null @@ -1,1308 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. - -timestamp='2001-11-08' - -# 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 . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -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 - - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; - for c in cc gcc c89 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - rm -f $dummy.c $dummy.o $dummy.rel ; - 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. - # Determine the machine/vendor (is the vendor relevant). - case "${UNAME_MACHINE}" in - amiga) machine=m68k-unknown ;; - arm32) machine=arm-unknown ;; - atari*) machine=m68k-atari ;; - sun3*) machine=m68k-sun ;; - mac68k) machine=m68k-apple ;; - macppc) machine=powerpc-apple ;; - hp3[0-9][05]) machine=m68k-hp ;; - ibmrt|romp-ibm) machine=romp-ibm ;; - sparc*) machine=`uname -p`-unknown ;; - *) machine=${UNAME_MACHINE}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE}" in - i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) - 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 - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # 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 ;; - 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 - # 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. - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - 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 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - 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 ;; - 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=`(head -1 /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 /* 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 $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-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 - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - 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 | head -1 | 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 - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; - esac - 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 - 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 $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - 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*X-MP:*:*:*) - echo xmp-cray-unicos - 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*T3D:*:*:*) - echo alpha-cray-unicosmk${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 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - 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 ;; - 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:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - 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 ;; - 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 i386-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:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in - big) echo mips-unknown-linux-gnu && exit 0 ;; - little) echo mipsel-unknown-linux-gnu && exit 0 ;; - esac - ;; - 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 ;; - 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. - ld_supported_targets=`cd /; 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 - cat >$dummy.c < -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-pc-linux-gnu\n", argv[1]); -# else - printf ("%s-pc-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-pc-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-pc-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - 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:*: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' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - 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 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*: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 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - 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 - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # 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 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - if test "${UNAME_MACHINE}" = "x86pc"; then - UNAME_MACHINE=pc - fi - echo `uname -p`-${UNAME_MACHINE}-nto-qnx - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[KW]: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 ;; - 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 ;; - *: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 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - 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 < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# 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 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/config.sub b/config.sub deleted file mode 100644 index 24794696d38..00000000000 --- a/config.sub +++ /dev/null @@ -1,1417 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. - -timestamp='2001-11-08' - -# 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 . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -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* | storm-chaos* | os2-emx* | windows32-*) - 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] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dsp16xx \ - | fr30 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 \ - | mn10200 | mn10300 \ - | ns16k | ns32k \ - | openrisc \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle \ - | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic80 | tron \ - | v850 \ - | we32k \ - | x86 | xscale | xstormy16 \ - | 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]-* \ - | alphapca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ - | clipper-* | cray2-* | cydra-* \ - | d10v-* | d30v-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | m32r-* \ - | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ - | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ - | v850-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ - | 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 - ;; - 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 - ;; - 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 | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [cjt]90) - basic_machine=${basic_machine}-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 - ;; - 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 - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - 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 - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - 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) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i686-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-*) - basic_machine=i686-`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 - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - 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=t3e-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - 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 - ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - 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 - ;; - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - 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 | sh3eb | sh4eb) - basic_machine=sh-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 - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *-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* | -netbsd* | -openbsd* | -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* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto*) - os=-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*) - 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 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -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 - ;; - -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 - ;; - 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 - ;; - *-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 - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - 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/configure.in b/configure.in deleted file mode 100644 index a507735cf22..00000000000 --- a/configure.in +++ /dev/null @@ -1,1264 +0,0 @@ -dnl ## $Id$ -*- sh -*- -dnl ## Process this file with autoconf to produce a configure script. - -divert(1) - -dnl ## Diversion 1 is the autoconf + automake setup phase. We also -dnl ## set the PHP version, deal with platform-specific compile -dnl ## options and check for the basic compile tools. - -dnl ## Diversion 2 is the initial checking of OS features, programs, -dnl ## libraries and so on. - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - -dnl ## In diversion 4 we check user-configurable general settings. - -dnl ## In diversion 5 we check which extensions should be compiled. -dnl ## All of these are normally in the extension directories. -dnl ## Diversion 5 is the last one. Here we generate files and clean up. - - -dnl Basic autoconf + automake initialization, generation of config.nice. -dnl ------------------------------------------------------------------------- - -AC_INIT(README.CVS-RULES) - -PHP_CONFIG_NICE(config.nice) -for arg in $0 "$@"; do - CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'" -done - -AC_CANONICAL_HOST -AC_CONFIG_HEADER(main/php_config.h) - -VERSION="4.2.1-dev" - -dnl Define where extension directories are located in the configure context -AC_DEFUN(PHP_EXT_BUILDDIR,[ext/$1])dnl -AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir/ext/$1])dnl -AC_DEFUN(PHP_ALWAYS_SHARED,[])dnl - -dnl Setting up the PHP version based on the information above. -dnl ------------------------------------------------------------------------- - -PHP_VERSION=$VERSION -echo "/* automatically generated by configure */" > php_version.h.new -echo "/* edit configure.in to change version number */" >> php_version.h.new -echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new -cmp php_version.h.new php_version.h >/dev/null 2>&1 -if test $? -ne 0 ; then - rm -f php_version.h && mv php_version.h.new php_version.h && \ - echo 'Updated php_version.h' -else - rm -f php_version.h.new -fi - - - -dnl Catch common errors here to save a few seconds of our users' time -dnl ------------------------------------------------------------------------- - -if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then - AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the documentation for using APXS]) -fi - -if test -n "$with_apache" && test -n "$with_apxs"; then - AC_MSG_ERROR([--with-apache and --with-apxs cannot be used together]) -fi - - - -dnl Platform-specific compile settings. -dnl ------------------------------------------------------------------------- - -dnl if host_alias is empty, ac_cv_host_alias may still have the info -if test -z "$host_alias"; then - host_alias=$ac_cv_host_alias -fi - -BSD_MAKEFILE=no - -case $host_alias in -*solaris*) - CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" - if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then - enable_libgcc=yes - fi - ;; -*dgux*) - CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";; -*darwin*|*rhapsody*) - CPPFLAGS="$CPPFLAGS -no-cpp-precomp";; -*bsdi*) - BSD_MAKEFILE=yes;; -*beos*) - beos_threads=1 - LIBS="$LIBS -lbe -lroot";; -*mips*) - CPPFLAGS="$CPPFLAGS -D_XPG_IV";; -esac - - - -dnl Settings we want to make before the checks. -dnl ------------------------------------------------------------------------- - -cwd=`pwd` - -PHP_INIT_BUILD_SYSTEM - -php_shtool=$srcdir/build/shtool -T_MD=`$php_shtool echo -n -e %B` -T_ME=`$php_shtool echo -n -e %b` - -dnl We want this one before the checks, so the checks can modify CFLAGS. -test -z "$CFLAGS" && auto_cflags=1 - -dnl AC_AIX needs to be before any macros that run the C compiler. -AC_AIX - -abs_srcdir=`(cd $srcdir; pwd)` -abs_builddir=`pwd` - -dnl Because ``make install'' is often performed by the superuser, -dnl we create the libs subdirectory as the user who configures PHP. -dnl Otherwise, the current user will not be able to delete libs -dnl or the contents of libs. - -$php_shtool mkdir -p libs -rm -f libs/* - -dnl Checks for programs. -dnl ------------------------------------------------------------------------- - -AC_PROG_CC -AC_PROG_CC_C_O -dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf -dnl AC_PROG_CC_STDC -AC_PROG_CPP -dnl AC_PROG_CXX -dnl AC_PROG_CXXCPP -dnl check for -R, etc. switch -AC_MSG_CHECKING([whether compiler supports -R]) -AC_CACHE_VAL(php_cv_cc_dashr,[ - SAVE_LIBS=$LIBS - LIBS="-R /usr/lib $LIBS" - AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) - LIBS=$SAVE_LIBS]) -AC_MSG_RESULT([$php_cv_cc_dashr]) -if test $php_cv_cc_dashr = "yes"; then - ld_runpath_switch=-R -else - AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,]) - AC_CACHE_VAL(php_cv_cc_rpath,[ - SAVE_LIBS=$LIBS - LIBS="-Wl,-rpath,/usr/lib $LIBS" - AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) - LIBS=$SAVE_LIBS]) - AC_MSG_RESULT([$php_cv_cc_rpath]) - if test $php_cv_cc_rpath = "yes"; then - ld_runpath_switch=-Wl,-rpath, - else - dnl something innocuous - ld_runpath_switch=-L - fi -fi -AC_PROG_RANLIB -AC_PROG_LN_S -AC_PROG_AWK -AC_PROG_YACC -if test "$YACC" != "bison -y"; then - AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.]) -else - AC_MSG_CHECKING([bison version]) - set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'` - if test "${1}" = "1" -a "${2}" -lt "28"; then - AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).) - fi - AC_MSG_RESULT(${1}.${2} (ok)) -fi -AC_PROG_LEX -if test -n "$LEX"; then - AC_DECL_YYTEXT - : -fi -dnl ## Make flex scanners use const if they can, even if __STDC__ is not -dnl ## true, for compilers like Sun's that only set __STDC__ true in -dnl ## "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode -AC_C_CONST -if test "$ac_cv_c_const" = "yes" ; then - LEX_CFLAGS="-DYY_USE_CONST" -fi - - - -dnl Include Zend and TSRM configurations. -dnl ------------------------------------------------------------------------- - -sinclude(Zend/acinclude.m4) -sinclude(Zend/Zend.m4) -sinclude(TSRM/tsrm.m4) - - - -divert(2) - -dnl ## Diversion 2 is where we set PHP-specific options and come up -dnl ## with reasonable default values for them. We check for pthreads here -dnl ## because the information is needed by the SAPI configuration. -dnl ## This is also where an SAPI interface is selected (choosing between -dnl ## Apache module, CGI etc.) - -dnl . -dnl ------------------------------------------------------------------------- - -PTHREADS_CHECK -PHP_HELP_SEPARATOR([SAPI modules:]) -PHP_SHLIB_SUFFIX_NAME -PHP_SAPI=default -PHP_BUILD_PROGRAM - - - -dnl SAPI configuration. -dnl ------------------------------------------------------------------------- - -dnl paths to the targets are relative to the build directory -SAPI_PROGRAM=php -SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME -SAPI_STATIC=libs/libphp4.a -SAPI_LIBTOOL=libphp4.la - -PHP_CONFIGURE_PART(Configuring SAPI modules) - -esyscmd(./scripts/config-stubs sapi) - -if test "$PHP_SAPI" = "default"; then - PHP_SELECT_SAPI(cgi, program, cgi_main.c getopt.c) -fi - -AC_MSG_CHECKING([for chosen SAPI module]) -AC_MSG_RESULT([$PHP_SAPI]) - -if test "$enable_experimental_zts" = "yes"; then - PTHREADS_ASSIGN_VARS - PTHREADS_FLAGS -fi - - -divert(3) - -dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. - - - -dnl Starting system checks. -dnl ------------------------------------------------------------------------- - -PHP_CONFIGURE_PART(Running system checks) - -PHP_MISSING_TIME_R_DECL -PHP_PROG_SENDMAIL -dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset -PHP_EBCDIC -dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary -dnl and source packages. This should be harmless on other OSs. -if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then - CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" - LDFLAGS="$LDFLAGS -L/usr/pkg/lib" -fi -INCLUDES="$INCLUDES -I\$(top_builddir)/Zend" -test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib) - - -dnl First, library checks. -dnl ------------------------------------------------------------------------- - -AC_CHECK_LIB(socket, socket, [ - PHP_ADD_LIBRARY(socket) - AC_DEFINE(HAVE_LIBSOCKET,1,[ ]) ], [ - AC_CHECK_LIB(socket, htonl, [ - PHP_ADD_LIBRARY(socket) - ])]) - -dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try -dnl to avoid -lnsl checks, if we already have the functions which -dnl are usually in libnsl - -unset ac_cv_func_yp_get_default_domain -AC_CHECK_FUNC(yp_get_default_domain, - [php_no_nsl_checks=yes],[]) -unset ac_cv_func_yp_get_default_domain - -if test "$php_no_nsl_checks" != "yes"; then - -AC_CHECK_LIB(nsl, gethostname, [ - PHP_ADD_LIBRARY(nsl) - AC_DEFINE(HAVE_LIBNSL,1,[ ]) ],[ - AC_CHECK_LIB(nsl, gethostbyaddr, [ - PHP_ADD_LIBRARY(nsl) - AC_DEFINE(HAVE_LIBNSL,1,[ ]) ], []) -]) - -fi - -AC_CHECK_LIB(dl, dlopen,[PHP_ADD_LIBRARY(dl)]) - -dnl The sin may be in a library which need not be specifed -dnl as well as res_search resides in libsocket -AC_CHECK_LIB(m, sin) - -dnl Only include libbind if inet_aton is not found in -dnl libresolv. -AC_CHECK_LIB(resolv, inet_aton, [], [ - AC_CHECK_LIB(bind, inet_aton, [], [ - AC_CHECK_LIB(bind, __inet_aton) - ]) -]) - -dnl The res_search may be in libsocket as well, and if it is -dnl make sure to check for dn_skipname in libresolv, or if res_search -dnl is in neither of these libs, still check for dn_skipname in libresolv -AC_CHECK_LIB(socket, res_search, [ - AC_CHECK_LIB(resolv, dn_skipname) - AC_CHECK_LIB(resolv, __dn_skipname) - LIBS="$LIBS -lsocket" - AC_DEFINE(HAVE_LIBSOCKET,1,[ ]) ], [ - AC_CHECK_LIB(resolv, res_search, [ - LIBS="$LIBS -lresolv" - AC_DEFINE(HAVE_LIBRESOLV,1,[ ]) - ], [ - AC_CHECK_LIB(resolv, dn_skipname) - AC_CHECK_LIB(resolv, __dn_skipname) - ]) -]) - - - -dnl Then headers. -dnl ------------------------------------------------------------------------- - -dnl Checks for header files. -AC_HEADER_STDC - -dnl In QNX opendir resides in libc but dirent.h is still required -if test "`uname -s 2>/dev/null`" != "QNX"; then - AC_HEADER_DIRENT -else - AC_CHECK_HEADERS(dirent.h) -fi -PHP_MISSING_FCLOSE_DECL -dnl QNX requires unix.h to allow functions in libunix to work properly -AC_CHECK_HEADERS( -ApplicationServices/ApplicationServices.h \ -alloca.h \ -arpa/inet.h \ -arpa/nameser.h \ -assert.h \ -crypt.h \ -fcntl.h \ -grp.h \ -ieeefp.h \ -langinfo.h \ -limits.h \ -locale.h \ -netinet/in.h \ -pwd.h \ -resolv.h \ -signal.h \ -stdarg.h \ -stdlib.h \ -string.h \ -syslog.h \ -sysexits.h \ -sys/file.h \ -sys/mman.h \ -sys/mount.h \ -sys/resource.h \ -sys/select.h \ -sys/socket.h \ -sys/statfs.h \ -sys/statvfs.h \ -sys/vfs.h \ -sys/sysexits.h \ -sys/time.h \ -sys/types.h \ -sys/varargs.h \ -sys/wait.h \ -unistd.h \ -unix.h \ -utime.h \ -) - - - -dnl Checks for typedefs, structures, and compiler characteristics. -dnl ------------------------------------------------------------------------- - -AC_STRUCT_TM -AC_STRUCT_TIMEZONE - -PHP_TM_GMTOFF -PHP_STRUCT_FLOCK -PHP_SOCKLEN_T - -AC_CHECK_SIZEOF(long, 8) -AC_CHECK_SIZEOF(int, 4) - -dnl Check for members of the stat structure -AC_STRUCT_ST_BLKSIZE -dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists -dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument -if test "`uname -s 2>/dev/null`" != "QNX"; then - AC_STRUCT_ST_BLOCKS -else - AC_MSG_WARN([warnings level for cc set to 0]) - WARNING_LEVEL=0 -fi -AC_STRUCT_ST_RDEV - -dnl Checks for types -AC_TYPE_SIZE_T -AC_TYPE_UID_T - -dnl Check for struct sockaddr_storage -AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage, -[AC_TRY_COMPILE([ #include -#include ], [struct sockaddr_storage s; s], - ac_cv_sockaddr_storage=yes, ac_cv_sockaddr_storage=no)]) -if test "$ac_cv_sockaddr_storage" = yes; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[Whether you have struct sockaddr_storage]) -fi - -dnl Check for IPv6 support -AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support, -[AC_TRY_COMPILE([ #include -#include -#include ], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s], - ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)]) -if test "$ac_cv_ipv6_support" = yes; then - AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support]) -fi - - - -dnl Checks for library functions. -dnl ------------------------------------------------------------------------- - -AC_FUNC_VPRINTF -AC_CHECK_FUNCS( -asctime_r \ -chroot \ -ctime_r \ -cuserid \ -crypt \ -flock \ -gai_strerror \ -gcvt \ -getlogin \ -gethostbyaddr \ -getprotobyname \ -getprotobynumber \ -getservbyname \ -getservbyport \ -getrusage \ -gettimeofday \ -gmtime_r \ -inet_aton \ -isascii \ -link \ -localtime_r \ -lockf \ -lrand48 \ -memcpy \ -memmove \ -mkstemp \ -mmap \ -nl_langinfo \ -putenv \ -realpath \ -random \ -rand_r \ -regcomp \ -res_search \ -setitimer \ -setlocale \ -localeconv \ -setsockopt \ -setvbuf \ -shutdown \ -sin \ -snprintf \ -srand48 \ -srandom \ -statfs \ -statvfs \ -std_syslog \ -strcasecmp \ -strcoll \ -strdup \ -strerror \ -strftime \ -strstr \ -strtok_r \ -symlink \ -tempnam \ -tzset \ -unsetenv \ -usleep \ -utime \ -vsnprintf \ -) - -dnl Check for getaddrinfo, should be a better way, but... -AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo, -[AC_TRY_COMPILE([#include ], - [struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);], - ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)]) -if test "$ac_cv_func_getaddrinfo" = yes; then - AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function]) -fi - -AC_REPLACE_FUNCS(strlcat strlcpy getopt) -AC_FUNC_UTIME_NULL -AC_FUNC_ALLOCA -PHP_AC_BROKEN_SPRINTF -PHP_DECLARED_TIMEZONE -PHP_TIME_R_TYPE -PHP_READDIR_R_TYPE - -dnl AIX keeps in_addr_t in /usr/include/netinet/in.h -dnl AC_MSG_CHECKING([for in_addr_t]) -AC_CACHE_VAL(ac_cv_type_$1, -[AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<>dnl -changequote([,]), [#include -#if STDC_HEADERS -#include -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl - -dnl AC_MSG_RESULT([$ac_cv_type_in_addr_t]) -if test $ac_cv_type_in_addr_t = no; then - AC_DEFINE(in_addr_t, u_int, [ ]) -fi - - - -divert(4) - -dnl ## In diversion 4 we check user-configurable general settings. - -dnl General settings. -dnl ------------------------------------------------------------------------- - - -PHP_HELP_SEPARATOR([General settings:]) - -PHP_ARG_ENABLE(debug, whether to include debugging symbols, -[ --enable-debug Compile with debugging symbols.], no) - -if test "$PHP_DEBUG" = "yes"; then - PHP_DEBUG=1 - ZEND_DEBUG=yes -else - PHP_DEBUG=0 - ZEND_DEBUG=no -fi - -PHP_ARG_WITH(layout,[layout of installed files], -[ --with-layout=TYPE Sets how installed files will be laid out. Type is - one of "PHP" (default) or "GNU"], PHP) - -case $PHP_LAYOUT in - GNU) - oldstyleextdir=no - ;; - *) - oldstyleextdir=yes - ;; -esac - -PHP_ARG_WITH(config-file-path,[path to configuration file], -[ --with-config-file-path=PATH - Sets the path in which to look for php.ini, - defaults to PREFIX/lib], DEFAULT) - -if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then - case $PHP_LAYOUT in - GNU) - PHP_CONFIG_FILE_PATH=$sysconfdir - ;; - *) - PHP_CONFIG_FILE_PATH=$libdir - ;; - esac -fi - -# compatibility -if test -z "$with_pear" && test "$enable_pear" = "no"; then - with_pear=no -fi - -PHP_ARG_WITH(pear, [whether to install PEAR, and where], -[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php) - --without-pear Do not install PEAR], DEFAULT) - -if test "$PHP_PEAR" != "no"; then - install_pear="install-pear install-build install-headers install-programs" - PEAR_INSTALLDIR=$PHP_PEAR -fi - -if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then - case $PHP_LAYOUT in - GNU) PEAR_INSTALLDIR=$datadir/pear;; - *) PEAR_INSTALLDIR=$libdir/php;; - esac -fi - -test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" - -PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default, -[ --enable-safe-mode Enable safe mode by default.]) - -if test "$PHP_SAFE_MODE" = "yes"; then - AC_DEFINE(PHP_SAFE_MODE,1,[ ]) -else - AC_DEFINE(PHP_SAFE_MODE,0,[ ]) -fi - -AC_MSG_CHECKING([for safe mode exec dir]) -AC_ARG_WITH(exec-dir, -[ --with-exec-dir[=DIR] Only allow executables in DIR when in safe mode - defaults to /usr/local/php/bin], -[ - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) - else - AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ]) - AC_MSG_RESULT([$withval]) - fi - else - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) - fi -],[ - AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ]) - AC_MSG_RESULT([/usr/local/php/bin]) -]) - -PHP_ARG_WITH(openssl,for OpenSSL support, -[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ]) -if test "$PHP_OPENSSL" = "yes"; then - PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl" -fi - -if test "$PHP_OPENSSL" != "no"; then - PHP_SETUP_OPENSSL -fi - -PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler, -[ --enable-sigchild Enable PHP's own SIGCHLD handler.],no) - -if test "$PHP_SIGCHILD" = "yes"; then - AC_DEFINE(PHP_SIGCHILD, 1, [ ]) -else - AC_DEFINE(PHP_SIGCHILD, 0, [ ]) -fi - -PHP_ARG_ENABLE(magic-quotes,whether to enable magic quotes by default, -[ --enable-magic-quotes Enable magic quotes by default.]) - -if test "$PHP_MAGIC_QUOTES" = "yes"; then - AC_DEFINE(MAGIC_QUOTES, 1, [ ]) -else - AC_DEFINE(MAGIC_QUOTES, 0, [ ]) -fi - -PHP_ARG_ENABLE(rpath, whether to enable runpaths, -[ --disable-rpath Disable passing additional runtime library - search paths], yes) - -PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc, -[ --enable-libgcc Enable explicitly linking against libgcc]) - -if test "$PHP_LIBGCC" = "yes"; then - PHP_LIBGCC_LIBPATH(gcc) - if test -z "$libgcc_libpath"; then - AC_MSG_ERROR([Cannot locate libgcc. Make sure that gcc is in your path]) - fi - PHP_ADD_LIBPATH($libgcc_libpath) - PHP_ADD_LIBRARY(gcc, yes) -fi - -PHP_ARG_ENABLE(short-tags,whether to enable short tags by default, -[ --disable-short-tags Disable the short-form meta_ccld< $srcdir/ext/bcmath/number.c - echo "creating number.h" - echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h -fi - -################################################################ -# Create configuration headers -# - -test -d TSRM || mkdir TSRM -echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h - -test -d Zend || mkdir Zend - -cat >Zend/zend_config.h </dev/null - sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c - - echo "creating main/internal_functions_cli.c" - cli_extensions="$EXT_CLI_STATIC" - sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c - -dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then -dnl echo "main/internal_functions.c is unchanged" -dnl mv main/internal_functions.c.old main/internal_functions.c -dnl else -dnl rm -f main/internal_functions.c.old -dnl fi - - if test -n "$PHP_APXS_BROKEN"; then - echo "+--------------------------------------------------------------------+" - echo "| WARNING: Your $APXS script is most likely broken." - echo "| |" - echo "| Please go read http://www.php.net/manual/en/faq.build.php#AEN61338 |" - echo "| and make the changes described there and try again. |" - fi - - # Warn about CGI version with no extra security options. - if test "$PHP_SAPI" = "cgi"; then - if test "$REDIRECT" = "0"; then - if test "$DISCARD_PATH" = "0"; then - echo "+--------------------------------------------------------------------+" - echo "| *** WARNING *** |" - echo "| |" - echo "| You will be compiling the CGI version of PHP without any |" - echo "| redirection checking. By putting this cgi binary somewhere in |" - echo "| your web space, users may be able to circumvent existing .htaccess |" - echo "| security by loading files directly through the parser. See |" - echo "| http://www.php.net/manual/security.php for more details. |" - fi - fi - fi - - - if test -n "$DEBUG_LOG"; then - rm -f config.cache -cat < processes when using a local Oracle-DB | -| please recompile PHP and specify --enable-sigchild when configuring| -| (This problem has been reported under Linux using Oracle >= 8.1.5) | -X - fi - fi - -cat< | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#ifdef COMPILE_DL_ASPELL -#include "phpdl.h" -#endif -#include -#include -#include - -#if HAVE_ASPELL - -#include "php_aspell.h" -#include -#include "ext/standard/info.h" - -/* {{{ aspell_functions[] - */ -function_entry aspell_functions[] = { - PHP_FE(aspell_new, NULL) - PHP_FE(aspell_check, NULL) - PHP_FE(aspell_check_raw, NULL) - PHP_FE(aspell_suggest, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -static int le_aspell; - -zend_module_entry aspell_module_entry = { - STANDARD_MODULE_HEADER, - "aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_ASPELL -ZEND_GET_MODULE(aspell) -#endif - -/* {{{ php_aspell_close - */ -static void php_aspell_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - aspell *sc = (aspell *)rsrc->ptr; - - aspell_free(sc); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(aspell) -{ - le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ proto int aspell_new(string master [, string personal]) - Load a dictionary */ -PHP_FUNCTION(aspell_new) -{ - pval **master, **personal; - int argc; - aspell *sc; - int ind; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &master, &personal) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(master); - if(argc==2) - { - convert_to_string_ex(personal) ; - sc=aspell_new(Z_STRVAL_PP(master), Z_STRVAL_PP(personal)); - } - else - sc=aspell_new(Z_STRVAL_PP(master), ""); - - ind = zend_list_insert(sc, le_aspell); - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto array aspell_suggest(aspell int, string word) - Return array of Suggestions */ -PHP_FUNCTION(aspell_suggest) -{ - pval **scin, **word; - int argc; - aspell *sc; - int ind, type; - aspellSuggestions *sug; - size_t i; - - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scin); - convert_to_string_ex(word); - sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type); - if(!sc) - { - php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin)); - RETURN_FALSE; - } - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - sug = aspell_suggest(sc, Z_STRVAL_PP(word)); - for (i = 0; i != sug->size; ++i) { - add_next_index_string(return_value, (char *)sug->data[i], 1); - } - aspell_free_suggestions(sug); -} -/* }}} */ - -/* {{{ proto int aspell_check(aspell int, string word) - Return if word is valid */ -PHP_FUNCTION(aspell_check) -{ - int type; - pval **scin, **word; - aspell *sc; - - int argc; - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scin); - convert_to_string_ex(word); - sc= (aspell *) zend_list_find(Z_LVAL_PP(scin), &type); - if(!sc) - { - php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin)); - RETURN_FALSE; - } - if (aspell_check(sc, Z_STRVAL_PP(word))) - { - RETURN_TRUE; - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int aspell_check_raw(aspell int, string word) - Return if word is valid, ignoring case or trying to trim it in any way */ -PHP_FUNCTION(aspell_check_raw) -{ - pval **scin, **word; - int type; - int argc; - aspell *sc; - - argc = ZEND_NUM_ARGS(); - if (argc != 2 || zend_get_parameters_ex(argc, &scin, &word) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scin); - convert_to_string_ex(word); - sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type); - if(!sc) - { - php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin)); - RETURN_FALSE; - } - if (aspell_check_raw(sc, Z_STRVAL_PP(word))) - { - RETURN_TRUE; - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(aspell) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ASpell Support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/aspell/config.m4 b/ext/aspell/config.m4 deleted file mode 100644 index a82ad6ca021..00000000000 --- a/ext/aspell/config.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for ASPELL support) -AC_ARG_WITH(aspell, -[ --with-aspell[=DIR] Include ASPELL support.], -[ - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - ASPELL_DIR=/usr/local - else - ASPELL_DIR=$withval - fi - - PHP_ADD_INCLUDE($ASPELL_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(aspell, $ASPELL_DIR/lib) - - if test ! -f "$ASPELL_DIR/include/aspell-c.h"; then - AC_MSG_ERROR(Could not find aspell-c.h in $ASPELL_DIR/include - please copy it manually from the aspell sources to $ASPELL_DIR/include) - fi - AC_DEFINE(HAVE_ASPELL,1,[Whether you have aspell]) - AC_MSG_RESULT(yes) - PHP_NEW_EXTENSION(aspell, aspell.c) - else - AC_MSG_RESULT(no) - fi -],[ - AC_MSG_RESULT(no) -]) diff --git a/ext/aspell/php_aspell.h b/ext/aspell/php_aspell.h deleted file mode 100644 index 15461960e26..00000000000 --- a/ext/aspell/php_aspell.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ASPELL_H -#define PHP_ASPELL_H -#if HAVE_ASPELL -extern zend_module_entry aspell_module_entry; -#define aspell_module_ptr &aspell_module_entry - -PHP_MINIT_FUNCTION(aspell); -PHP_MINFO_FUNCTION(aspell); - -PHP_FUNCTION(aspell_new); -PHP_FUNCTION(aspell_check); -PHP_FUNCTION(aspell_check_raw); -PHP_FUNCTION(aspell_suggest); - -#else -#define aspell_module_ptr NULL -#endif - -#define phpext_aspell_ptr aspell_module_ptr - -#endif /* PHP_ASPELL_H */ diff --git a/ext/bcmath/CREDITS b/ext/bcmath/CREDITS deleted file mode 100644 index 7b4083ea138..00000000000 --- a/ext/bcmath/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -BC Math -Andi Gutmans diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c deleted file mode 100644 index c999478da88..00000000000 --- a/ext/bcmath/bcmath.c +++ /dev/null @@ -1,506 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if WITH_BCMATH - -#include "ext/standard/info.h" -#include "php_bcmath.h" -#include "ext/bcmath/libbcmath/src/bcmath.h" - -function_entry bcmath_functions[] = { - PHP_FE(bcadd, NULL) - PHP_FE(bcsub, NULL) - PHP_FE(bcmul, NULL) - PHP_FE(bcdiv, NULL) - PHP_FE(bcmod, NULL) - PHP_FE(bcpow, NULL) - PHP_FE(bcsqrt, NULL) - PHP_FE(bcscale, NULL) - PHP_FE(bccomp, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry bcmath_module_entry = { - STANDARD_MODULE_HEADER, - "bcmath", - bcmath_functions, - PHP_MINIT(bcmath), - PHP_MSHUTDOWN(bcmath), - PHP_RINIT(bcmath), - NULL, - PHP_MINFO(bcmath), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_BCMATH -ZEND_GET_MODULE(bcmath) -#endif - -#ifndef THREAD_SAFE -static long bc_precision; -#endif - -/* Storage used for special numbers. */ -bc_num _zero_; -bc_num _one_; -bc_num _two_; - - -/* Make a copy of a number! Just increments the reference count! */ -bc_num copy_num (bc_num num) -{ - num->n_refs++; - return num; -} - - -/* Initialize a number NUM by making it a copy of zero. */ -void init_num (bc_num *num) -{ - *num = copy_num (_zero_); -} - - -PHP_MINIT_FUNCTION(bcmath) -{ - extern bc_num _zero_; - extern bc_num _one_; - extern bc_num _two_; - - _zero_ = bc_new_num (1, 0); - _one_ = bc_new_num (1, 0); - _one_->n_value[0] = 1; - _two_ = bc_new_num (1, 0); - _two_->n_value[0] = 2; - persist_alloc(_zero_); - persist_alloc(_one_); - persist_alloc(_two_); - persist_alloc(_zero_->n_ptr); - persist_alloc(_one_->n_ptr); - persist_alloc(_two_->n_ptr); - - return SUCCESS; -} - - - -PHP_MSHUTDOWN_FUNCTION(bcmath) -{ - bc_free_num(&_zero_); - bc_free_num(&_one_); - bc_free_num(&_two_); - return SUCCESS; -} - - -PHP_RINIT_FUNCTION(bcmath) -{ - if (cfg_get_long("bcmath.scale", &bc_precision)==FAILURE) { - bc_precision=0; - } - return SUCCESS; -} - - -PHP_MINFO_FUNCTION(bcmath) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "BCMath support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale]) - Returns the sum of two arbitrary precision numbers */ -PHP_FUNCTION(bcadd) -{ - pval **left, **right, **scale_param; - bc_num first, second, result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - bc_add (first, second, &result, scale); - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsub(string left_operand, string right_operand [, int scale]) - Returns the difference between two arbitrary precision numbers */ -PHP_FUNCTION(bcsub) -{ - pval **left, **right, **scale_param; - bc_num first, second, result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - bc_sub (first, second, &result, scale); - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmul(string left_operand, string right_operand [, int scale]) - Returns the multiplication of two arbitrary precision numbers */ -PHP_FUNCTION(bcmul) -{ - pval **left, **right, **scale_param; - bc_num first, second, result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - bc_multiply (first, second, &result, scale); - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale]) - Returns the quotient of two arbitrary precision numbers (division) */ -PHP_FUNCTION(bcdiv) -{ - pval **left, **right, **scale_param; - bc_num first, second, result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - switch (bc_divide (first, second, &result, scale)) { - case 0: /* OK */ - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: /* division by zero */ - php_error(E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcmod(string left_operand, string right_operand) - Returns the modulus of the two arbitrary precision operands */ -PHP_FUNCTION(bcmod) -{ - pval **left, **right; - bc_num first, second, result; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), 0); - bc_str2num(&second, Z_STRVAL_PP(right), 0); - switch (bc_modulo(first, second, &result, 0)) { - case 0: - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - break; - case -1: - php_error(E_WARNING, "Division by zero"); - break; - } - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcpow(string x, string y [, int scale]) - Returns the value of an arbitrary precision number raised to the power of another */ -PHP_FUNCTION(bcpow) -{ - pval **left, **right, **scale_param; - bc_num first, second, result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - bc_init_num(&result); - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - bc_raise (first, second, &result, scale); - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - bc_free_num(&first); - bc_free_num(&second); - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bcsqrt(string operand [, int scale]) - Returns the square root of an arbitray precision number */ -PHP_FUNCTION(bcsqrt) -{ - pval **left, **scale_param; - bc_num result; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &left)== FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (zend_get_parameters_ex(2, &left, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - convert_to_string_ex(left); - bc_init_num(&result); - bc_str2num(&result, Z_STRVAL_PP(left), scale); - if (bc_sqrt (&result, scale) != 0) { - Z_STRVAL_P(return_value) = bc_num2str(result); - Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } else { - php_error(E_WARNING, "Square root of negative number"); - } - bc_free_num(&result); - return; -} -/* }}} */ - -/* {{{ proto string bccomp(string left_operand, string right_operand [, int scale]) - Compares two arbitrary precision numbers */ -PHP_FUNCTION(bccomp) -{ - pval **left, **right, **scale_param; - bc_num first, second; - int scale=bc_precision; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &left, &right) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (zend_get_parameters_ex(3, &left, &right, &scale_param) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(scale_param); - scale = (int) Z_LVAL_PP(scale_param); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(left); - convert_to_string_ex(right); - bc_init_num(&first); - bc_init_num(&second); - - bc_str2num(&first, Z_STRVAL_PP(left), scale); - bc_str2num(&second, Z_STRVAL_PP(right), scale); - Z_LVAL_P(return_value) = bc_compare(first, second); - Z_TYPE_P(return_value) = IS_LONG; - - bc_free_num(&first); - bc_free_num(&second); - return; -} -/* }}} */ - -/* {{{ proto string bcscale(int scale) - Sets default scale parameter for all bc math functions */ -PHP_FUNCTION(bcscale) -{ - pval **new_scale; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &new_scale)==FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(new_scale); - bc_precision = Z_LVAL_PP(new_scale); - RETURN_TRUE; -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4 deleted file mode 100644 index a4fbb600303..00000000000 --- a/ext/bcmath/config.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions, -[ --enable-bcmath Enable bc style precision math functions.]) - -if test "$PHP_BCMATH" != "no"; then - AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath]) - PHP_NEW_EXTENSION(bcmath, bcmath.c number.c \ -libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \ -libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ -libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ -libbcmath/src/rmzero.c libbcmath/src/str2num.c, - $ext_shared,,-I@ext_srcdir@/libbcmath/src) - PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src) -fi diff --git a/ext/bcmath/libbcmath/AUTHORS b/ext/bcmath/libbcmath/AUTHORS deleted file mode 100644 index 982db9dc405..00000000000 --- a/ext/bcmath/libbcmath/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Phil Nelson wrote bcmath library. - - diff --git a/ext/bcmath/libbcmath/COPYING.LIB b/ext/bcmath/libbcmath/COPYING.LIB deleted file mode 100644 index c4792dd27a3..00000000000 --- a/ext/bcmath/libbcmath/COPYING.LIB +++ /dev/null @@ -1,515 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. -^L - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. -^L - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -^L - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -^L - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -^L - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. -^L - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -^L - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS -^L - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper -mail. - -You should also get your employer (if you work as a programmer) or -your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James -Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/ext/bcmath/libbcmath/ChangeLog b/ext/bcmath/libbcmath/ChangeLog deleted file mode 100644 index b8d459a2bbf..00000000000 --- a/ext/bcmath/libbcmath/ChangeLog +++ /dev/null @@ -1,10 +0,0 @@ -Wed Jun 7 09:39:02 2000 Phil Nelson - - * configure.in and many others: version number now at 0.2. - Many other changes/additions for getting a distribution - to work. - -2000-05-21 Phil Nelson - - * Initial setup of bcmath library., calling it version 0.1. - diff --git a/ext/bcmath/libbcmath/FAQ b/ext/bcmath/libbcmath/FAQ deleted file mode 100644 index 6499b1cffb5..00000000000 --- a/ext/bcmath/libbcmath/FAQ +++ /dev/null @@ -1,21 +0,0 @@ -BCMATH FAQ: - -1) Why BCMATH? - -The math routines of GNU bc become more generally useful in a -library form. By separating the BCMATH library from GNU bc, -GNU bc can be under the GPL and BCMATH can be under the LGPL. - -2) Why BCMATH when GMP exists? - -GMP has "integers" (no digits after a decimal), "rational numbers" -(stored as 2 integers) and "floats". None of these will correctly -represent a POSIX BC number. Floats are the closest, but will not -behave correctly for many computations. For example, BC numbers have -a "scale" that represent the number of digits to represent after the -decimal point. The multiplying two of these numbers requires one to -calculate an exact number of digits after the decimal point regardless -of the number of digits in the integer part. GMP floats have a -"fixed, but arbitrary" mantissa and so multiplying two floats will end -up dropping digits BC must calculate. - diff --git a/ext/bcmath/libbcmath/INSTALL b/ext/bcmath/libbcmath/INSTALL deleted file mode 100644 index 8893a078273..00000000000 --- a/ext/bcmath/libbcmath/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -Currently, only libbcmath.a is built. To build and install it, do - - configure - make - make install - -Typical configure parameters are available. (e.g. PREFIX) - -Bugs and comments to philnelson@acm.org. diff --git a/ext/bcmath/libbcmath/Makefile.am b/ext/bcmath/libbcmath/Makefile.am deleted file mode 100644 index e5be8201b31..00000000000 --- a/ext/bcmath/libbcmath/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS= src doc - -MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h.in *~ - -dist-hook: - cp $(srcdir)/doc/bcmath.1 $(distdir)/doc - cp $(srcdir)/src/private.h $(distdir)/src - cp $(srcdir)/FAQ $(distdir) - diff --git a/ext/bcmath/libbcmath/NEWS b/ext/bcmath/libbcmath/NEWS deleted file mode 100644 index 431d7b315d1..00000000000 --- a/ext/bcmath/libbcmath/NEWS +++ /dev/null @@ -1,3 +0,0 @@ -NEWS for bcmath library: - - May 2000: The library is created. diff --git a/ext/bcmath/libbcmath/README b/ext/bcmath/libbcmath/README deleted file mode 100644 index cae5e5dc431..00000000000 --- a/ext/bcmath/libbcmath/README +++ /dev/null @@ -1,9 +0,0 @@ -This is bcmath, a library of arbitrary precision math routines. -These routines, in a different form, are the routines that to -the arbitrary precision calculations for GNU bc and GNU dc. - -This library is provided to make these routines useful in a -larger context with less restrictions on the use of them. - -These routines do not duplicate functionality of the GNU gmp -library. gmp is similar, but the actual computation is different. diff --git a/ext/bcmath/libbcmath/acconfig.h b/ext/bcmath/libbcmath/acconfig.h deleted file mode 100644 index 4d301dcacf2..00000000000 --- a/ext/bcmath/libbcmath/acconfig.h +++ /dev/null @@ -1,9 +0,0 @@ -/* PACKAGE name */ -#undef PACKAGE - -/* Package VERSION number */ -#undef VERSION - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - diff --git a/ext/bcmath/libbcmath/aclocal.m4 b/ext/bcmath/libbcmath/aclocal.m4 deleted file mode 100644 index f23ba2904e1..00000000000 --- a/ext/bcmath/libbcmath/aclocal.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 - -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN(AM_SANITY_CHECK, -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN(AM_MISSING_PROG, -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN(AM_CONFIG_HEADER, -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - diff --git a/ext/bcmath/libbcmath/config.h.in b/ext/bcmath/libbcmath/config.h.in deleted file mode 100644 index 21cfb9255f9..00000000000 --- a/ext/bcmath/libbcmath/config.h.in +++ /dev/null @@ -1,41 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to `size_t' if and don't define. */ -#undef ptrdiff_t - -/* Define if you have the header file. */ -#undef HAVE_LIB_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/ext/bcmath/libbcmath/configure b/ext/bcmath/libbcmath/configure deleted file mode 100644 index 026fd039c78..00000000000 --- a/ext/bcmath/libbcmath/configure +++ /dev/null @@ -1,1859 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=doc/bcmath.1 - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:556: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:609: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE="bcmath" - -VERSION="0.2" - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:712: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:725: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:738: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:751: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:764: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:865: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 908 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:944: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1016: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1071: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1099: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1127: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -for ac_hdr in stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1210: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1247: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1322: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1426: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - -echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:1459: checking for ptrdiff_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_ptrdiff_t=yes -else - rm -rf conftest* - ac_cv_type_ptrdiff_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 -if test $ac_cv_type_ptrdiff_t = no; then - cat >> confdefs.h <<\EOF -#define ptrdiff_t size_t -EOF - -fi - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile src/Makefile doc/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g -s%@CPP@%$CPP%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - diff --git a/ext/bcmath/libbcmath/configure.in b/ext/bcmath/libbcmath/configure.in deleted file mode 100644 index 3da89e949f2..00000000000 --- a/ext/bcmath/libbcmath/configure.in +++ /dev/null @@ -1,18 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(doc/bcmath.1) -AM_INIT_AUTOMAKE("bcmath", "0.2") -AM_CONFIG_HEADER(config.h) - -AC_PROG_CC - -AC_PROG_INSTALL -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h) -AC_C_CONST -AC_TYPE_SIZE_T -AC_CHECK_TYPE(ptrdiff_t, size_t) - -AC_OUTPUT(Makefile src/Makefile doc/Makefile) - diff --git a/ext/bcmath/libbcmath/doc/Makefile.am b/ext/bcmath/libbcmath/doc/Makefile.am deleted file mode 100644 index 3f43f904bef..00000000000 --- a/ext/bcmath/libbcmath/doc/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -# Documentation makefile - -MAINTAINERCLEANFILES= Makefile.in diff --git a/ext/bcmath/libbcmath/doc/Makefile.in b/ext/bcmath/libbcmath/doc/Makefile.in deleted file mode 100644 index fb974f1b4c6..00000000000 --- a/ext/bcmath/libbcmath/doc/Makefile.in +++ /dev/null @@ -1,171 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in 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. - -# Documentation makefile - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -MAKEINFO = @MAKEINFO@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ - -MAINTAINERCLEANFILES = Makefile.in -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps doc/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = doc - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/ext/bcmath/libbcmath/doc/bcmath.1 b/ext/bcmath/libbcmath/doc/bcmath.1 deleted file mode 100644 index 669b73ac588..00000000000 --- a/ext/bcmath/libbcmath/doc/bcmath.1 +++ /dev/null @@ -1 +0,0 @@ -./" bcmath library documentation diff --git a/ext/bcmath/libbcmath/install-sh b/ext/bcmath/libbcmath/install-sh deleted file mode 100644 index ab74c882e92..00000000000 --- a/ext/bcmath/libbcmath/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/ext/bcmath/libbcmath/missing b/ext/bcmath/libbcmath/missing deleted file mode 100644 index e4b838ca924..00000000000 --- a/ext/bcmath/libbcmath/missing +++ /dev/null @@ -1,134 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' - makeinfo touch the output file - yacc touch file \`y.tab.c'" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acinclude.m4' or \`configure.in'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`configure.in'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`acconfig.h' or \`configure.in'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - touch config.h.in - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print \ - | sed 's/^\(.*\).am$/touch \1.in/' \ - | sh - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - your modified any \`.y' file. For being effective, your - modifications might require the \`Bison' package. Grab it from - any GNU archive site." - touch y.tab.c - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. It should be needed only if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/ext/bcmath/libbcmath/mkinstalldirs b/ext/bcmath/libbcmath/mkinstalldirs deleted file mode 100644 index cc8783edce3..00000000000 --- a/ext/bcmath/libbcmath/mkinstalldirs +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? - fi - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/ext/bcmath/libbcmath/src/Makefile.am b/ext/bcmath/libbcmath/src/Makefile.am deleted file mode 100644 index fab37d785e2..00000000000 --- a/ext/bcmath/libbcmath/src/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for bcmath library - -lib_LIBRARIES = libbcmath.a - -include_HEADERS = bcmath.h - -libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \ - init.c int2num.c nearzero.c neg.c num2long.c num2str.c output.c \ - raise.c raisemod.c recmul.c rmzero.c sqrt.c str2num.c sub.c zero.c \ - outofmem.c rt.c - -INCLUDES = -I$(srcdir) -I.. - -CFLAGS = @CFLAGS@ -CPPFLAGS = $(INCLUDES) -Wall - -MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h - -all: $(bin_LIBRARIES) - -clean: - rm -f $(OBJS) $(LIB) *~ diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c deleted file mode 100644 index 3b09af22b25..00000000000 --- a/ext/bcmath/libbcmath/src/add.c +++ /dev/null @@ -1,88 +0,0 @@ -/* add.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full add routine that takes care of negative numbers. - N1 is added to N2 and the result placed into RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_add (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num sum = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign == n2->n_sign) - { - sum = _bc_do_add (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); /* Compare magnitudes. */ - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - sum = _bc_do_sub (n2, n1, scale_min); - sum->n_sign = n2->n_sign; - break; - case 0: - /* They are equal! return zero with the correct scale! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - sum = bc_new_num (1, res_scale); - memset (sum->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - sum = _bc_do_sub (n1, n2, scale_min); - sum->n_sign = n1->n_sign; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = sum; -} - diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h deleted file mode 100644 index a6c7627b6b4..00000000000 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ /dev/null @@ -1,158 +0,0 @@ -/* bcmath.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#ifndef _BCMATH_H_ -#define _BCMATH_H_ - -typedef enum {PLUS, MINUS} sign; - -typedef struct bc_struct *bc_num; - -typedef struct bc_struct - { - sign n_sign; - int n_len; /* The number of digits before the decimal point. */ - int n_scale; /* The number of digits after the decimal point. */ - int n_refs; /* The number of pointers to this number. */ - bc_num n_next; /* Linked list for available list. */ - char *n_ptr; /* The pointer to the actual storage. - If NULL, n_value points to the inside of - another number (bc_multiply...) and should - not be "freed." */ - char *n_value; /* The number. Not zero char terminated. - May not point to the same place as n_ptr as - in the case of leading zeros generated. */ - } bc_struct; - - -/* The base used in storing the numbers in n_value above. - Currently this MUST be 10. */ - -#define BASE 10 - -/* Some useful macros and constants. */ - -#define CH_VAL(c) (c - '0') -#define BCD_CHAR(d) (d + '0') - -#ifdef MIN -#undef MIN -#undef MAX -#endif -#define MAX(a, b) ((a)>(b)?(a):(b)) -#define MIN(a, b) ((a)>(b)?(b):(a)) -#define ODD(a) ((a)&1) - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 0x7ffffff -#endif - - -/* Global numbers. */ -extern bc_num _zero_; -extern bc_num _one_; -extern bc_num _two_; - - -/* Function Prototypes */ - -/* Define the _PROTOTYPE macro if it is needed. */ - -#ifndef _PROTOTYPE -#ifdef __STDC__ -#define _PROTOTYPE(func, args) func args -#else -#define _PROTOTYPE(func, args) func() -#endif -#endif - -_PROTOTYPE(void bc_init_numbers, (void)); - -_PROTOTYPE(bc_num bc_new_num, (int length, int scale)); - -_PROTOTYPE(void bc_free_num, (bc_num *num)); - -_PROTOTYPE(bc_num bc_copy_num, (bc_num num)); - -_PROTOTYPE(void bc_init_num, (bc_num *num)); - -_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale)); - -_PROTOTYPE(char *bc_num2str, (bc_num num)); - -_PROTOTYPE(void bc_int2num, (bc_num *num, int val)); - -_PROTOTYPE(long bc_num2long, (bc_num num)); - -_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2)); - -_PROTOTYPE(char bc_is_zero, (bc_num num)); - -_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale)); - -_PROTOTYPE(char bc_is_neg, (bc_num num)); - -_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min)); - -_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale)); - -_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale)); - -_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result, - int scale)); - -_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot, - bc_num *rem, int scale)); - -_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod, - bc_num *result, int scale)); - -_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result, - int scale)); - -_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale)); - -_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int), - int leading_zero)); - -/* Prototypes needed for external utility routines. */ - -_PROTOTYPE(void bc_rt_warn, (char *mesg ,...)); -_PROTOTYPE(void bc_rt_error, (char *mesg ,...)); -_PROTOTYPE(void bc_out_of_memory, (void)); -#endif diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c deleted file mode 100644 index 2f094a6917b..00000000000 --- a/ext/bcmath/libbcmath/src/compare.c +++ /dev/null @@ -1,161 +0,0 @@ -/* compare.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Compare two bc numbers. Return value is 0 if equal, -1 if N1 is less - than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just - compare the magnitudes. */ - - int -_bc_do_compare (n1, n2, use_sign, ignore_last) - bc_num n1, n2; - int use_sign; - int ignore_last; -{ - char *n1ptr, *n2ptr; - int count; - - /* First, compare signs. */ - if (use_sign && n1->n_sign != n2->n_sign) - { - if (n1->n_sign == PLUS) - return (1); /* Positive N1 > Negative N2 */ - else - return (-1); /* Negative N1 < Positive N1 */ - } - - /* Now compare the magnitude. */ - if (n1->n_len != n2->n_len) - { - if (n1->n_len > n2->n_len) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* If we get here, they have the same number of integer digits. - check the integer part and the equal length part of the fraction. */ - count = n1->n_len + MIN (n1->n_scale, n2->n_scale); - n1ptr = n1->n_value; - n2ptr = n2->n_value; - - while ((count > 0) && (*n1ptr == *n2ptr)) - { - n1ptr++; - n2ptr++; - count--; - } - if (ignore_last && count == 1 && n1->n_scale == n2->n_scale) - return (0); - if (count != 0) - { - if (*n1ptr > *n2ptr) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - else - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - - /* They are equal up to the last part of the equal part of the fraction. */ - if (n1->n_scale != n2->n_scale) - { - if (n1->n_scale > n2->n_scale) - { - for (count = n1->n_scale-n2->n_scale; count>0; count--) - if (*n1ptr++ != 0) - { - /* Magnitude of n1 > n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (1); - else - return (-1); - } - } - else - { - for (count = n2->n_scale-n1->n_scale; count>0; count--) - if (*n2ptr++ != 0) - { - /* Magnitude of n1 < n2. */ - if (!use_sign || n1->n_sign == PLUS) - return (-1); - else - return (1); - } - } - } - - /* They must be equal! */ - return (0); -} - - -/* This is the "user callable" routine to compare numbers N1 and N2. */ - -int -bc_compare (n1, n2) - bc_num n1, n2; -{ - return _bc_do_compare (n1, n2, TRUE, FALSE); -} - diff --git a/ext/bcmath/libbcmath/src/config.h b/ext/bcmath/libbcmath/src/config.h deleted file mode 100644 index 42c42a89489..00000000000 --- a/ext/bcmath/libbcmath/src/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#if PHP_WIN32 -#include "../../../../main/config.w32.h" -#else -#include "php_config.h" -#endif - -#include -#include "zend.h" -#include "zend_alloc.h" diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c deleted file mode 100644 index ac1ee4ada71..00000000000 --- a/ext/bcmath/libbcmath/src/debug.c +++ /dev/null @@ -1,70 +0,0 @@ -/* debug.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* pn prints the number NUM in base 10. */ - -static void -out_char (int c) -{ - putchar(c); -} - - -void -pn (num) - bc_num num; -{ - bc_out_num (num, 10, out_char, 0); - out_char ('\n'); -} - - -/* pv prints a character array as if it was a string of bcd digits. */ -void -pv (name, num, len) - char *name; - unsigned char *num; - int len; -{ - int i; - printf ("%s=", name); - for (i=0; i -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Some utility routines for the divide: First a one digit multiply. - NUM (with SIZE digits) is multiplied by DIGIT and the result is - placed into RESULT. It is written so that NUM and RESULT can be - the same pointers. */ - -static void -_one_mult (num, size, digit, result) - unsigned char *num; - int size, digit; - unsigned char *result; -{ - int carry, value; - unsigned char *nptr, *rptr; - - if (digit == 0) - memset (result, 0, size); - else - { - if (digit == 1) - memcpy (result, num, size); - else - { - /* Initialize */ - nptr = (unsigned char *) (num+size-1); - rptr = (unsigned char *) (result+size-1); - carry = 0; - - while (size-- > 0) - { - value = *nptr-- * digit + carry; - *rptr-- = value % BASE; - carry = value / BASE; - } - - if (carry != 0) *rptr = carry; - } - } -} - - -/* The full division routine. This computes N1 / N2. It returns - 0 if the division is ok and the result is in QUOT. The number of - digits after the decimal point is SCALE. It returns -1 if division - by zero is tried. The algorithm is found in Knuth Vol 2. p237. */ - -int -bc_divide (n1, n2, quot, scale) - bc_num n1, n2, *quot; - int scale; -{ - bc_num qval; - unsigned char *num1, *num2; - unsigned char *ptr1, *ptr2, *n2ptr, *qptr; - int scale1, val; - unsigned int len1, len2, scale2, qdigits, extra, count; - unsigned int qdig, qguess, borrow, carry; - unsigned char *mval; - char zero; - unsigned int norm; - - /* Test for divide by zero. */ - if (bc_is_zero (n2)) return -1; - - /* Test for divide by 1. If it is we must truncate. */ - if (n2->n_scale == 0) - { - if (n2->n_len == 1 && *n2->n_value == 1) - { - qval = bc_new_num (n1->n_len, scale); - qval->n_sign = (n1->n_sign == n2->n_sign ? PLUS : MINUS); - memset (&qval->n_value[n1->n_len],0,scale); - memcpy (qval->n_value, n1->n_value, - n1->n_len + MIN(n1->n_scale,scale)); - bc_free_num (quot); - *quot = qval; - } - } - - /* Set up the divide. Move the decimal point on n1 by n2's scale. - Remember, zeros on the end of num2 are wasted effort for dividing. */ - scale2 = n2->n_scale; - n2ptr = (unsigned char *) n2->n_value+n2->n_len+scale2-1; - while ((scale2 > 0) && (*n2ptr-- == 0)) scale2--; - - len1 = n1->n_len + scale2; - scale1 = n1->n_scale - scale2; - if (scale1 < scale) - extra = scale - scale1; - else - extra = 0; - num1 = (unsigned char *) emalloc (n1->n_len+n1->n_scale+extra+2); - if (num1 == NULL) bc_out_of_memory(); - memset (num1, 0, n1->n_len+n1->n_scale+extra+2); - memcpy (num1+1, n1->n_value, n1->n_len+n1->n_scale); - - len2 = n2->n_len + scale2; - num2 = (unsigned char *) emalloc (len2+1); - if (num2 == NULL) bc_out_of_memory(); - memcpy (num2, n2->n_value, len2); - *(num2+len2) = 0; - n2ptr = num2; - while (*n2ptr == 0) - { - n2ptr++; - len2--; - } - - /* Calculate the number of quotient digits. */ - if (len2 > len1+scale) - { - qdigits = scale+1; - zero = TRUE; - } - else - { - zero = FALSE; - if (len2>len1) - qdigits = scale+1; /* One for the zero integer part. */ - else - qdigits = len1-len2+scale+1; - } - - /* Allocate and zero the storage for the quotient. */ - qval = bc_new_num (qdigits-scale,scale); - memset (qval->n_value, 0, qdigits); - - /* Allocate storage for the temporary storage mval. */ - mval = (unsigned char *) emalloc (len2+1); - if (mval == NULL) bc_out_of_memory (); - - /* Now for the full divide algorithm. */ - if (!zero) - { - /* Normalize */ - norm = 10 / ((int)*n2ptr + 1); - if (norm != 1) - { - _one_mult (num1, len1+scale1+extra+1, norm, num1); - _one_mult (n2ptr, len2, norm, n2ptr); - } - - /* Initialize divide loop. */ - qdig = 0; - if (len2 > len1) - qptr = (unsigned char *) qval->n_value+len2-len1; - else - qptr = (unsigned char *) qval->n_value; - - /* Loop */ - while (qdig <= len1+scale-len2) - { - /* Calculate the quotient digit guess. */ - if (*n2ptr == num1[qdig]) - qguess = 9; - else - qguess = (num1[qdig]*10 + num1[qdig+1]) / *n2ptr; - - /* Test qguess. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - { - qguess--; - /* And again. */ - if (n2ptr[1]*qguess > - (num1[qdig]*10 + num1[qdig+1] - *n2ptr*qguess)*10 - + num1[qdig+2]) - qguess--; - } - - /* Multiply and subtract. */ - borrow = 0; - if (qguess != 0) - { - *mval = 0; - _one_mult (n2ptr, len2, qguess, mval+1); - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) mval+len2; - for (count = 0; count < len2+1; count++) - { - val = (int) *ptr1 - (int) *ptr2-- - borrow; - if (val < 0) - { - val += 10; - borrow = 1; - } - else - borrow = 0; - *ptr1-- = val; - } - } - - /* Test for negative result. */ - if (borrow == 1) - { - qguess--; - ptr1 = (unsigned char *) num1+qdig+len2; - ptr2 = (unsigned char *) n2ptr+len2-1; - carry = 0; - for (count = 0; count < len2; count++) - { - val = (int) *ptr1 + (int) *ptr2-- + carry; - if (val > 9) - { - val -= 10; - carry = 1; - } - else - carry = 0; - *ptr1-- = val; - } - if (carry == 1) *ptr1 = (*ptr1 + 1) % 10; - } - - /* We now know the quotient digit. */ - *qptr++ = qguess; - qdig++; - } - } - - /* Clean up and return the number. */ - qval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - if (bc_is_zero (qval)) qval->n_sign = PLUS; - _bc_rm_leading_zeros (qval); - bc_free_num (quot); - *quot = qval; - - /* Clean up temporary storage. */ - efree (mval); - efree (num1); - efree (num2); - - return 0; /* Everything is OK. */ -} - diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c deleted file mode 100644 index e62817d00b7..00000000000 --- a/ext/bcmath/libbcmath/src/divmod.c +++ /dev/null @@ -1,91 +0,0 @@ -/* divmod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Division *and* modulo for numbers. This computes both NUM1 / NUM2 and - NUM1 % NUM2 and puts the results in QUOT and REM, except that if QUOT - is NULL then that store will be omitted. - */ - -int -bc_divmod (num1, num2, quot, rem, scale) - bc_num num1, num2, *quot, *rem; - int scale; -{ - bc_num quotient = NULL; - bc_num temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero (num2)) return -1; - - /* Calculate final scale. */ - rscale = MAX (num1->n_scale, num2->n_scale+scale); - bc_init_num(&temp); - - /* Calculate it. */ - bc_divide (num1, num2, &temp, scale); - if (quot) - quotient = bc_copy_num (temp); - bc_multiply (temp, num2, &temp, rscale); - bc_sub (num1, temp, rem, rscale); - bc_free_num (&temp); - - if (quot) - { - bc_free_num (quot); - *quot = quotient; - } - - return 0; /* Everything is OK. */ -} - - -/* Modulo for numbers. This computes NUM1 % NUM2 and puts the - result in RESULT. */ - -int -bc_modulo (num1, num2, result, scale) - bc_num num1, num2, *result; - int scale; -{ - return bc_divmod (num1, num2, NULL, result, scale); -} - diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c deleted file mode 100644 index 5458fc5dfc4..00000000000 --- a/ext/bcmath/libbcmath/src/doaddsub.c +++ /dev/null @@ -1,232 +0,0 @@ -/* doaddsub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Perform addition: N1 is added to N2 and the value is - returned. The signs of N1 and N2 are ignored. - SCALE_MIN is to set the minimum scale of the result. */ - - bc_num -_bc_do_add (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num sum; - int sum_scale, sum_digits; - char *n1ptr, *n2ptr, *sumptr; - int carry, n1bytes, n2bytes; - int count; - - /* Prepare sum. */ - sum_scale = MAX (n1->n_scale, n2->n_scale); - sum_digits = MAX (n1->n_len, n2->n_len) + 1; - sum = bc_new_num (sum_digits, MAX(sum_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > sum_scale) - { - sumptr = (char *) (sum->n_value + sum_scale + sum_digits); - for (count = scale_min - sum_scale; count > 0; count--) - *sumptr++ = 0; - } - - /* Start with the fraction part. Initialize the pointers. */ - n1bytes = n1->n_scale; - n2bytes = n2->n_scale; - n1ptr = (char *) (n1->n_value + n1->n_len + n1bytes - 1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2bytes - 1); - sumptr = (char *) (sum->n_value + sum_scale + sum_digits - 1); - - /* Add the fraction part. First copy the longer fraction.*/ - if (n1bytes != n2bytes) - { - if (n1bytes > n2bytes) - while (n1bytes>n2bytes) - { *sumptr-- = *n1ptr--; n1bytes--;} - else - while (n2bytes>n1bytes) - { *sumptr-- = *n2ptr--; n2bytes--;} - } - - /* Now add the remaining fraction part and equal size integer parts. */ - n1bytes += n1->n_len; - n2bytes += n2->n_len; - carry = 0; - while ((n1bytes > 0) && (n2bytes > 0)) - { - *sumptr = *n1ptr-- + *n2ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - n1bytes--; - n2bytes--; - } - - /* Now add carry the longer integer part. */ - if (n1bytes == 0) - { n1bytes = n2bytes; n1ptr = n2ptr; } - while (n1bytes-- > 0) - { - *sumptr = *n1ptr-- + carry; - if (*sumptr > (BASE-1)) - { - carry = 1; - *sumptr -= BASE; - } - else - carry = 0; - sumptr--; - } - - /* Set final carry. */ - if (carry == 1) - *sumptr += 1; - - /* Adjust sum and return. */ - _bc_rm_leading_zeros (sum); - return sum; -} - - -/* Perform subtraction: N2 is subtracted from N1 and the value is - returned. The signs of N1 and N2 are ignored. Also, N1 is - assumed to be larger than N2. SCALE_MIN is the minimum scale - of the result. */ - - bc_num -_bc_do_sub (n1, n2, scale_min) - bc_num n1, n2; - int scale_min; -{ - bc_num diff; - int diff_scale, diff_len; - int min_scale, min_len; - char *n1ptr, *n2ptr, *diffptr; - int borrow, count, val; - - /* Allocate temporary storage. */ - diff_len = MAX (n1->n_len, n2->n_len); - diff_scale = MAX (n1->n_scale, n2->n_scale); - min_len = MIN (n1->n_len, n2->n_len); - min_scale = MIN (n1->n_scale, n2->n_scale); - diff = bc_new_num (diff_len, MAX(diff_scale, scale_min)); - - /* Zero extra digits made by scale_min. */ - if (scale_min > diff_scale) - { - diffptr = (char *) (diff->n_value + diff_len + diff_scale); - for (count = scale_min - diff_scale; count > 0; count--) - *diffptr++ = 0; - } - - /* Initialize the subtract. */ - n1ptr = (char *) (n1->n_value + n1->n_len + n1->n_scale -1); - n2ptr = (char *) (n2->n_value + n2->n_len + n2->n_scale -1); - diffptr = (char *) (diff->n_value + diff_len + diff_scale -1); - - /* Subtract the numbers. */ - borrow = 0; - - /* Take care of the longer scaled number. */ - if (n1->n_scale != min_scale) - { - /* n1 has the longer scale */ - for (count = n1->n_scale - min_scale; count > 0; count--) - *diffptr-- = *n1ptr--; - } - else - { - /* n2 has the longer scale */ - for (count = n2->n_scale - min_scale; count > 0; count--) - { - val = - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Now do the equal length scale and integer parts. */ - - for (count = 0; count < min_len + min_scale; count++) - { - val = *n1ptr-- - *n2ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - - /* If n1 has more digits then n2, we now do that subtract. */ - if (diff_len != min_len) - { - for (count = diff_len - min_len; count > 0; count--) - { - val = *n1ptr-- - borrow; - if (val < 0) - { - val += BASE; - borrow = 1; - } - else - borrow = 0; - *diffptr-- = val; - } - } - - /* Clean up and return. */ - _bc_rm_leading_zeros (diff); - return diff; -} - diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c deleted file mode 100644 index 4ff00b11027..00000000000 --- a/ext/bcmath/libbcmath/src/init.c +++ /dev/null @@ -1,135 +0,0 @@ -/* init.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Storage used for special numbers. */ -bc_num _zero_; -bc_num _one_; -bc_num _two_; - - bc_num _bc_Free_list = NULL; - -/* new_num allocates a number and sets fields to known values. */ - -bc_num -bc_new_num (length, scale) - int length, scale; -{ - bc_num temp; - - /* PHP Change: malloc() -> emalloc(), removed free_list code */ - temp = (bc_num) emalloc (sizeof(bc_struct)+length+scale); -#if 0 - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { - temp = (bc_num) emalloc (sizeof(bc_struct)); - if (temp == NULL) bc_out_of_memory (); - } -#endif - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - /* PHP Change: malloc() -> emalloc() */ - temp->n_ptr = (char *) emalloc (length+scale); - if (temp->n_ptr == NULL) bc_out_of_memory(); - temp->n_value = temp->n_ptr; - memset (temp->n_ptr, 0, length+scale); - return temp; -} - - -/* "Frees" a bc_num NUM. Actually decreases reference count and only - frees the storage if reference count is zero. */ - -void -bc_free_num (num) - bc_num *num; -{ - if (*num == NULL) return; - (*num)->n_refs--; - if ((*num)->n_refs == 0) { - if ((*num)->n_ptr) - /* PHP Change: free() -> efree(), removed free_list code */ - efree ((*num)->n_ptr); - efree(*num); -#if 0 - (*num)->n_next = _bc_Free_list; - _bc_Free_list = *num; -#endif - } - *num = NULL; -} - - -/* Intitialize the number package! */ - -void -bc_init_numbers () -{ - _zero_ = bc_new_num (1,0); - _one_ = bc_new_num (1,0); - _one_->n_value[0] = 1; - _two_ = bc_new_num (1,0); - _two_->n_value[0] = 2; -} - - -/* Make a copy of a number! Just increments the reference count! */ - -bc_num -bc_copy_num (num) - bc_num num; -{ - num->n_refs++; - return num; -} - - -/* Initialize a number NUM by making it a copy of zero. */ - -void -bc_init_num (num) - bc_num *num; -{ - *num = bc_copy_num (_zero_); -} - diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c deleted file mode 100644 index 34419c138f0..00000000000 --- a/ext/bcmath/libbcmath/src/int2num.c +++ /dev/null @@ -1,84 +0,0 @@ -/* int2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Convert an integer VAL to a bc number NUM. */ - -void -bc_int2num (num, val) - bc_num *num; - int val; -{ - char buffer[30]; - char *bptr, *vptr; - int ix = 1; - char neg = 0; - - /* Sign. */ - if (val < 0) - { - neg = 1; - val = -val; - } - - /* Get things going. */ - bptr = buffer; - *bptr++ = val % BASE; - val = val / BASE; - - /* Extract remaining digits. */ - while (val != 0) - { - *bptr++ = val % BASE; - val = val / BASE; - ix++; /* Count the digits. */ - } - - /* Make the number. */ - bc_free_num (num); - *num = bc_new_num (ix, 0); - if (neg) (*num)->n_sign = MINUS; - - /* Assign the digits. */ - vptr = (*num)->n_value; - while (ix-- > 0) - *vptr++ = *--bptr; -} - diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c deleted file mode 100644 index ae16b65d8a6..00000000000 --- a/ext/bcmath/libbcmath/src/nearzero.c +++ /dev/null @@ -1,69 +0,0 @@ -/* nearzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is almost zero. - Specifically, all but the last digit is 0 and the last digit is 1. - Last digit is defined by scale. */ - -char -bc_is_near_zero (num, scale) - bc_num num; - int scale; -{ - int count; - char *nptr; - - /* Error checking */ - if (scale > num->n_scale) - scale = num->n_scale; - - /* Initialize */ - count = num->n_len + scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0 && (count != 1 || *--nptr != 1)) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c deleted file mode 100644 index c864d77f1d9..00000000000 --- a/ext/bcmath/libbcmath/src/neg.c +++ /dev/null @@ -1,49 +0,0 @@ -/* neg.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number is negative. */ - -char -bc_is_neg (num) - bc_num num; -{ - return num->n_sign == MINUS; -} - diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c deleted file mode 100644 index 0a6e0836ad4..00000000000 --- a/ext/bcmath/libbcmath/src/num2long.c +++ /dev/null @@ -1,70 +0,0 @@ -/* num2long.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a number NUM to a long. The function returns only the integer - part of the number. For numbers that are too large to represent as - a long, this function returns a zero. This can be detected by checking - the NUM for zero after having a zero returned. */ - -long -bc_num2long (num) - bc_num num; -{ - long val; - char *nptr; - int index; - - /* Extract the int value, ignore the fraction. */ - val = 0; - nptr = num->n_value; - for (index=num->n_len; (index>0) && (val<=(LONG_MAX/BASE)); index--) - val = val*BASE + *nptr++; - - /* Check for overflow. If overflow, return zero. */ - if (index>0) val = 0; - if (val < 0) val = 0; - - /* Return the value. */ - if (num->n_sign == PLUS) - return (val); - else - return (-val); -} - diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c deleted file mode 100644 index c47ec9bbad5..00000000000 --- a/ext/bcmath/libbcmath/src/num2str.c +++ /dev/null @@ -1,79 +0,0 @@ -/* num2str.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert a numbers to a string. Base 10 only.*/ - -char -*bc_num2str (num) - bc_num num; -{ - char *str, *sptr; - char *nptr; - int index, signch; - - /* Allocate the string memory. */ - signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */ - if (num->n_scale > 0) - str = (char *) emalloc (num->n_len + num->n_scale + 2 + signch); - else - str = (char *) emalloc (num->n_len + 1 + signch); - if (str == NULL) bc_out_of_memory(); - - /* The negative sign if needed. */ - sptr = str; - if (signch) *sptr++ = '-'; - - /* Load the whole number. */ - nptr = num->n_value; - for (index=num->n_len; index>0; index--) - *sptr++ = BCD_CHAR(*nptr++); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - *sptr++ = '.'; - for (index=0; indexn_scale; index++) - *sptr++ = BCD_CHAR(*nptr++); - } - - /* Terminate the string and return it! */ - *sptr = '\0'; - return (str); -} diff --git a/ext/bcmath/libbcmath/src/outofmem.c b/ext/bcmath/libbcmath/src/outofmem.c deleted file mode 100644 index 799a32d2ae6..00000000000 --- a/ext/bcmath/libbcmath/src/outofmem.c +++ /dev/null @@ -1,46 +0,0 @@ -/* outofmem.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_out_of_memory (void) -{ - (void) fprintf (stderr, "bcmath: out of memory!\n"); - exit (1); -} diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c deleted file mode 100644 index e41479d2d33..00000000000 --- a/ext/bcmath/libbcmath/src/output.c +++ /dev/null @@ -1,212 +0,0 @@ -/* output.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* The following routines provide output for bcd numbers package - using the rules of POSIX bc for output. */ - -/* This structure is used for saving digits in the conversion process. */ -typedef struct stk_rec { - long digit; - struct stk_rec *next; -} stk_rec; - -/* The reference string for digits. */ -static char ref_str[] = "0123456789ABCDEF"; - - -/* A special output routine for "multi-character digits." Exactly - SIZE characters must be output for the value VAL. If SPACE is - non-zero, we must output one space before the number. OUT_CHAR - is the actual routine for writing the characters. */ - -void -bc_out_long (val, size, space, out_char) - long val; - int size, space; -#ifdef __STDC__ - void (*out_char)(int); -#else - void (*out_char)(); -#endif -{ - char digits[40]; - int len, ix; - - if (space) (*out_char) (' '); - sprintf (digits, "%ld", val); - len = strlen (digits); - while (size > len) - { - (*out_char) ('0'); - size--; - } - for (ix=0; ix < len; ix++) - (*out_char) (digits[ix]); -} - -/* Output of a bcd number. NUM is written in base O_BASE using OUT_CHAR - as the routine to do the actual output of the characters. */ - -void -bc_out_num (num, o_base, out_char, leading_zero) - bc_num num; - int o_base; -#ifdef __STDC__ - void (*out_char)(int); -#else - void (*out_char)(); -#endif - int leading_zero; -{ - char *nptr; - int index, fdigit, pre_space; - stk_rec *digits, *temp; - bc_num int_part, frac_part, base, cur_dig, t_num, max_o_digit; - - /* The negative sign if needed. */ - if (num->n_sign == MINUS) (*out_char) ('-'); - - /* Output the number. */ - if (bc_is_zero (num)) - (*out_char) ('0'); - else - if (o_base == 10) - { - /* The number is in base 10, do it the fast way. */ - nptr = num->n_value; - if (num->n_len > 1 || *nptr != 0) - for (index=num->n_len; index>0; index--) - (*out_char) (BCD_CHAR(*nptr++)); - else - nptr++; - - if (leading_zero && bc_is_zero (num)) - (*out_char) ('0'); - - /* Now the fraction. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - for (index=0; indexn_scale; index++) - (*out_char) (BCD_CHAR(*nptr++)); - } - } - else - { - /* special case ... */ - if (leading_zero && bc_is_zero (num)) - (*out_char) ('0'); - - /* The number is some other base. */ - digits = NULL; - bc_init_num (&int_part); - bc_divide (num, _one_, &int_part, 0); - bc_init_num (&frac_part); - bc_init_num (&cur_dig); - bc_init_num (&base); - bc_sub (num, int_part, &frac_part, 0); - /* Make the INT_PART and FRAC_PART positive. */ - int_part->n_sign = PLUS; - frac_part->n_sign = PLUS; - bc_int2num (&base, o_base); - bc_init_num (&max_o_digit); - bc_int2num (&max_o_digit, o_base-1); - - - /* Get the digits of the integer part and push them on a stack. */ - while (!bc_is_zero (int_part)) - { - bc_modulo (int_part, base, &cur_dig, 0); - /* PHP Change: malloc() -> emalloc() */ - temp = (stk_rec *) emalloc (sizeof(stk_rec)); - if (temp == NULL) bc_out_of_memory(); - temp->digit = bc_num2long (cur_dig); - temp->next = digits; - digits = temp; - bc_divide (int_part, base, &int_part, 0); - } - - /* Print the digits on the stack. */ - if (digits != NULL) - { - /* Output the digits. */ - while (digits != NULL) - { - temp = digits; - digits = digits->next; - if (o_base <= 16) - (*out_char) (ref_str[ (int) temp->digit]); - else - bc_out_long (temp->digit, max_o_digit->n_len, 1, out_char); - efree (temp); - } - } - - /* Get and print the digits of the fraction part. */ - if (num->n_scale > 0) - { - (*out_char) ('.'); - pre_space = 0; - t_num = bc_copy_num (_one_); - while (t_num->n_len <= num->n_scale) { - bc_multiply (frac_part, base, &frac_part, num->n_scale); - fdigit = bc_num2long (frac_part); - bc_int2num (&int_part, fdigit); - bc_sub (frac_part, int_part, &frac_part, 0); - if (o_base <= 16) - (*out_char) (ref_str[fdigit]); - else { - bc_out_long (fdigit, max_o_digit->n_len, pre_space, out_char); - pre_space = 1; - } - bc_multiply (t_num, base, &t_num, 0); - } - bc_free_num (&t_num); - } - - /* Clean up. */ - bc_free_num (&int_part); - bc_free_num (&frac_part); - bc_free_num (&base); - bc_free_num (&cur_dig); - bc_free_num (&max_o_digit); - } -} diff --git a/ext/bcmath/libbcmath/src/private.h b/ext/bcmath/libbcmath/src/private.h deleted file mode 100644 index eaf4f444b2d..00000000000 --- a/ext/bcmath/libbcmath/src/private.h +++ /dev/null @@ -1,41 +0,0 @@ -/* private.h: bcmath library header. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -/* "Private" routines to bcmath. */ - -/* variables */ -bc_num _bc_Free_list; - -/* routines */ -int _bc_do_compare (bc_num n1, bc_num n2, int use_sign, int ignore_last); -bc_num _bc_do_add (bc_num n1, bc_num n2, int scale_min); -bc_num _bc_do_sub (bc_num n1, bc_num n2, int scale_min); -void _bc_rm_leading_zeros (bc_num num); diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c deleted file mode 100644 index 5f2f03c2082..00000000000 --- a/ext/bcmath/libbcmath/src/raise.c +++ /dev/null @@ -1,126 +0,0 @@ -/* raise.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Raise NUM1 to the NUM2 power. The result is placed in RESULT. - Maximum exponent is LONG_MAX. If a NUM2 is not an integer, - only the integer part is used. */ - -void -bc_raise (num1, num2, result, scale) - bc_num num1, num2, *result; - int scale; -{ - bc_num temp, power; - long exponent; - int rscale; - int pwrscale; - int calcscale; - char neg; - - /* Check the exponent for scale digits and convert to a long. */ - if (num2->n_scale != 0) - bc_rt_warn ("non-zero scale in exponent"); - exponent = bc_num2long (num2); - if (exponent == 0 && (num2->n_len > 1 || num2->n_value[0] != 0)) - bc_rt_error ("exponent too large in raise"); - - /* Special case if exponent is a zero. */ - if (exponent == 0) - { - bc_free_num (result); - *result = bc_copy_num (_one_); - return; - } - - /* Other initializations. */ - if (exponent < 0) - { - neg = TRUE; - exponent = -exponent; - rscale = scale; - } - else - { - neg = FALSE; - rscale = MIN (num1->n_scale*exponent, MAX(scale, num1->n_scale)); - } - - /* Set initial value of temp. */ - power = bc_copy_num (num1); - pwrscale = num1->n_scale; - while ((exponent & 1) == 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale); - exponent = exponent >> 1; - } - temp = bc_copy_num (power); - calcscale = pwrscale; - exponent = exponent >> 1; - - /* Do the calculation. */ - while (exponent > 0) - { - pwrscale = 2*pwrscale; - bc_multiply (power, power, &power, pwrscale); - if ((exponent & 1) == 1) { - calcscale = pwrscale + calcscale; - bc_multiply (temp, power, &temp, calcscale); - } - exponent = exponent >> 1; - } - - /* Assign the value. */ - if (neg) - { - bc_divide (_one_, temp, result, rscale); - bc_free_num (&temp); - } - else - { - bc_free_num (result); - *result = temp; - if ((*result)->n_scale > rscale) - (*result)->n_scale = rscale; - } - bc_free_num (&power); -} - diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c deleted file mode 100644 index cc9dd35a57f..00000000000 --- a/ext/bcmath/libbcmath/src/raisemod.c +++ /dev/null @@ -1,99 +0,0 @@ -/* raisemod.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Raise BASE to the EXPO power, reduced modulo MOD. The result is - placed in RESULT. If a EXPO is not an integer, - only the integer part is used. */ - -int -bc_raisemod (base, expo, mod, result, scale) - bc_num base, expo, mod, *result; - int scale; -{ - bc_num power, exponent, parity, temp; - int rscale; - - /* Check for correct numbers. */ - if (bc_is_zero(mod)) return -1; - if (bc_is_neg(expo)) return -1; - - /* Set initial values. */ - power = bc_copy_num (base); - exponent = bc_copy_num (expo); - temp = bc_copy_num (_one_); - bc_init_num(&parity); - - /* Check the base for scale digits. */ - if (base->n_scale != 0) - bc_rt_warn ("non-zero scale in base"); - - /* Check the exponent for scale digits. */ - if (exponent->n_scale != 0) - { - bc_rt_warn ("non-zero scale in exponent"); - bc_divide (exponent, _one_, &exponent, 0); /*truncate */ - } - - /* Check the modulus for scale digits. */ - if (mod->n_scale != 0) - bc_rt_warn ("non-zero scale in modulus"); - - /* Do the calculation. */ - rscale = MAX(scale, base->n_scale); - while ( !bc_is_zero(exponent) ) - { - (void) bc_divmod (exponent, _two_, &exponent, &parity, 0); - if ( !bc_is_zero(parity) ) - { - bc_multiply (temp, power, &temp, rscale); - (void) bc_modulo (temp, mod, &temp, scale); - } - - bc_multiply (power, power, &power, rscale); - (void) bc_modulo (power, mod, &power, scale); - } - - /* Assign the value. */ - bc_free_num (&power); - bc_free_num (&exponent); - bc_free_num (result); - *result = temp; - return 0; /* Everything is OK. */ -} diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c deleted file mode 100644 index 73f67af574d..00000000000 --- a/ext/bcmath/libbcmath/src/recmul.c +++ /dev/null @@ -1,304 +0,0 @@ -/* recmul.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Recursive vs non-recursive multiply crossover ranges. */ -#if defined(MULDIGITS) -#include "muldigits.h" -#else -#define MUL_BASE_DIGITS 80 -#endif - -int mul_base_digits = MUL_BASE_DIGITS; -#define MUL_SMALL_DIGITS mul_base_digits/4 - -/* Multiply utility routines */ - -static bc_num -new_sub_num (length, scale, value) - int length, scale; - char *value; -{ - bc_num temp; - - if (_bc_Free_list != NULL) { - temp = _bc_Free_list; - _bc_Free_list = temp->n_next; - } else { - temp = (bc_num) emalloc (sizeof(bc_struct)); - if (temp == NULL) bc_out_of_memory (); - } - temp->n_sign = PLUS; - temp->n_len = length; - temp->n_scale = scale; - temp->n_refs = 1; - temp->n_ptr = NULL; - temp->n_value = value; - return temp; -} - -static void -_bc_simp_mul (bc_num n1, int n1len, bc_num n2, int n2len, bc_num *prod, - int full_scale) -{ - char *n1ptr, *n2ptr, *pvptr; - char *n1end, *n2end; /* To the end of n1 and n2. */ - int indx, sum, prodlen; - - prodlen = n1len+n2len+1; - - *prod = bc_new_num (prodlen, 0); - - n1end = (char *) (n1->n_value + n1len - 1); - n2end = (char *) (n2->n_value + n2len - 1); - pvptr = (char *) ((*prod)->n_value + prodlen - 1); - sum = 0; - - /* Here is the loop... */ - for (indx = 0; indx < prodlen-1; indx++) - { - n1ptr = (char *) (n1end - MAX(0, indx-n2len+1)); - n2ptr = (char *) (n2end - MIN(indx, n2len-1)); - while ((n1ptr >= n1->n_value) && (n2ptr <= n2end)) - sum += *n1ptr-- * *n2ptr++; - *pvptr-- = sum % BASE; - sum = sum / BASE; - } - *pvptr = sum; -} - - -/* A special adder/subtractor for the recursive divide and conquer - multiply algorithm. Note: if sub is called, accum must - be larger that what is being subtracted. Also, accum and val - must have n_scale = 0. (e.g. they must look like integers. *) */ -static void -_bc_shift_addsub (bc_num accum, bc_num val, int shift, int sub) -{ - signed char *accp, *valp; - int count, carry; - - count = val->n_len; - if (val->n_value[0] == 0) - count--; - assert (accum->n_len+accum->n_scale >= shift+count); - - /* Set up pointers and others */ - accp = (signed char *)(accum->n_value + - accum->n_len + accum->n_scale - shift - 1); - valp = (signed char *)(val->n_value + val->n_len - 1); - carry = 0; - - if (sub) { - /* Subtraction, carry is really borrow. */ - while (count--) { - *accp -= *valp-- + carry; - if (*accp < 0) { - carry = 1; - *accp-- += BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp -= carry; - if (*accp < 0) - *accp-- += BASE; - else - carry = 0; - } - } else { - /* Addition */ - while (count--) { - *accp += *valp-- + carry; - if (*accp > (BASE-1)) { - carry = 1; - *accp-- -= BASE; - } else { - carry = 0; - accp--; - } - } - while (carry) { - *accp += carry; - if (*accp > (BASE-1)) - *accp-- -= BASE; - else - carry = 0; - } - } -} - -/* Recursive divide and conquer multiply algorithm. - Based on - Let u = u0 + u1*(b^n) - Let v = v0 + v1*(b^n) - Then uv = (B^2n+B^n)*u1*v1 + B^n*(u1-u0)*(v0-v1) + (B^n+1)*u0*v0 - - B is the base of storage, number of digits in u1,u0 close to equal. -*/ -static void -_bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod, - int full_scale) -{ - bc_num u0, u1, v0, v1; - int u0len, v0len; - bc_num m1, m2, m3, d1, d2; - int n, prodlen, m1zero; - int d1len, d2len; - - /* Base case? */ - if ((ulen+vlen) < mul_base_digits - || ulen < MUL_SMALL_DIGITS - || vlen < MUL_SMALL_DIGITS ) { - _bc_simp_mul (u, ulen, v, vlen, prod, full_scale); - return; - } - - /* Calculate n -- the u and v split point in digits. */ - n = (MAX(ulen, vlen)+1) / 2; - - /* Split u and v. */ - if (ulen < n) { - u1 = bc_copy_num (_zero_); - u0 = new_sub_num (ulen,0, u->n_value); - } else { - u1 = new_sub_num (ulen-n, 0, u->n_value); - u0 = new_sub_num (n, 0, u->n_value+ulen-n); - } - if (vlen < n) { - v1 = bc_copy_num (_zero_); - v0 = new_sub_num (vlen,0, v->n_value); - } else { - v1 = new_sub_num (vlen-n, 0, v->n_value); - v0 = new_sub_num (n, 0, v->n_value+vlen-n); - } - _bc_rm_leading_zeros (u1); - _bc_rm_leading_zeros (u0); - u0len = u0->n_len; - _bc_rm_leading_zeros (v1); - _bc_rm_leading_zeros (v0); - v0len = v0->n_len; - - m1zero = bc_is_zero(u1) || bc_is_zero(v1); - - /* Calculate sub results ... */ - - bc_init_num(&d1); - bc_init_num(&d2); - bc_sub (u1, u0, &d1, 0); - d1len = d1->n_len; - bc_sub (v0, v1, &d2, 0); - d2len = d2->n_len; - - - /* Do recursive multiplies and shifted adds. */ - if (m1zero) - m1 = bc_copy_num (_zero_); - else - _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0); - - if (bc_is_zero(d1) || bc_is_zero(d2)) - m2 = bc_copy_num (_zero_); - else - _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0); - - if (bc_is_zero(u0) || bc_is_zero(v0)) - m3 = bc_copy_num (_zero_); - else - _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0); - - /* Initialize product */ - prodlen = ulen+vlen+1; - *prod = bc_new_num(prodlen, 0); - - if (!m1zero) { - _bc_shift_addsub (*prod, m1, 2*n, 0); - _bc_shift_addsub (*prod, m1, n, 0); - } - _bc_shift_addsub (*prod, m3, n, 0); - _bc_shift_addsub (*prod, m3, 0, 0); - _bc_shift_addsub (*prod, m2, n, d1->n_sign != d2->n_sign); - - /* Now clean up! */ - bc_free_num (&u1); - bc_free_num (&u0); - bc_free_num (&v1); - bc_free_num (&m1); - bc_free_num (&v0); - bc_free_num (&m2); - bc_free_num (&m3); - bc_free_num (&d1); - bc_free_num (&d2); -} - -/* The multiply routine. N2 times N1 is put int PROD with the scale of - the result being MIN(N2 scale+N1 scale, MAX (SCALE, N2 scale, N1 scale)). - */ - -void -bc_multiply (n1, n2, prod, scale) - bc_num n1, n2, *prod; - int scale; -{ - bc_num pval; - int len1, len2; - int full_scale, prod_scale; - - /* Initialize things. */ - len1 = n1->n_len + n1->n_scale; - len2 = n2->n_len + n2->n_scale; - full_scale = n1->n_scale + n2->n_scale; - prod_scale = MIN(full_scale,MAX(scale,MAX(n1->n_scale,n2->n_scale))); - - /* Do the multiply */ - _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale); - - /* Assign to prod and clean up the number. */ - pval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS ); - pval->n_value = pval->n_ptr; - pval->n_len = len2 + len1 + 1 - full_scale; - pval->n_scale = prod_scale; - _bc_rm_leading_zeros (pval); - if (bc_is_zero (pval)) - pval->n_sign = PLUS; - bc_free_num (prod); - *prod = pval; -} diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c deleted file mode 100644 index 63f7a0cb79d..00000000000 --- a/ext/bcmath/libbcmath/src/rmzero.c +++ /dev/null @@ -1,55 +0,0 @@ -/* rmzero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* For many things, we may have leading zeros in a number NUM. - _bc_rm_leading_zeros just moves the data "value" pointer to the - correct place and adjusts the length. */ - - void -_bc_rm_leading_zeros (num) - bc_num num; -{ - /* We can move n_value to point to the first non zero digit! */ - while (*num->n_value == 0 && num->n_len > 1) { - num->n_value++; - num->n_len--; - } -} - diff --git a/ext/bcmath/libbcmath/src/rt.c b/ext/bcmath/libbcmath/src/rt.c deleted file mode 100644 index 2479104fe45..00000000000 --- a/ext/bcmath/libbcmath/src/rt.c +++ /dev/null @@ -1,65 +0,0 @@ -/* rt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -void bc_rt_warn (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsprintf (error_mesg, mesg, args); - va_end (args); - - fprintf (stderr, "bc math warning: %s\n", error_mesg); -} - - -void bc_rt_error (char *mesg ,...) -{ - va_list args; - char error_mesg [255]; - - va_start (args, mesg); - vsprintf (error_mesg, mesg, args); - va_end (args); - - fprintf (stderr, "bc math error: %s\n", error_mesg); -} diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c deleted file mode 100644 index 34b95b8898b..00000000000 --- a/ext/bcmath/libbcmath/src/sqrt.c +++ /dev/null @@ -1,131 +0,0 @@ -/* sqrt.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Take the square root NUM and return it in NUM with SCALE digits - after the decimal place. */ - -int -bc_sqrt (num, scale) - bc_num *num; - int scale; -{ - int rscale, cmp_res, done; - int cscale; - bc_num guess, guess1, point5, diff; - - /* Initial checks. */ - cmp_res = bc_compare (*num, _zero_); - if (cmp_res < 0) - return 0; /* error */ - else - { - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (_zero_); - return 1; - } - } - cmp_res = bc_compare (*num, _one_); - if (cmp_res == 0) - { - bc_free_num (num); - *num = bc_copy_num (_one_); - return 1; - } - - /* Initialize the variables. */ - rscale = MAX (scale, (*num)->n_scale); - bc_init_num(&guess); - bc_init_num(&guess1); - bc_init_num(&diff); - point5 = bc_new_num (1,1); - point5->n_value[1] = 5; - - - /* Calculate the initial guess. */ - if (cmp_res < 0) - { - /* The number is between 0 and 1. Guess should start at 1. */ - guess = bc_copy_num (_one_); - cscale = (*num)->n_scale; - } - else - { - /* The number is greater than 1. Guess should start at 10^(exp/2). */ - bc_int2num (&guess,10); - - bc_int2num (&guess1,(*num)->n_len); - bc_multiply (guess1, point5, &guess1, 0); - guess1->n_scale = 0; - bc_raise (guess, guess1, &guess, 0); - bc_free_num (&guess1); - cscale = 3; - } - - /* Find the square root using Newton's algorithm. */ - done = FALSE; - while (!done) - { - bc_free_num (&guess1); - guess1 = bc_copy_num (guess); - bc_divide (*num, guess, &guess, cscale); - bc_add (guess, guess1, &guess, 0); - bc_multiply (guess, point5, &guess, cscale); - bc_sub (guess, guess1, &diff, cscale+1); - if (bc_is_near_zero (diff, cscale)) - { - if (cscale < rscale+1) - cscale = MIN (cscale*3, rscale+1); - else - done = TRUE; - } - } - - /* Assign the number and clean up. */ - bc_free_num (num); - bc_divide (guess,_one_,num,rscale); - bc_free_num (&guess); - bc_free_num (&guess1); - bc_free_num (&point5); - bc_free_num (&diff); - return 1; -} - diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c deleted file mode 100644 index 210a7d89ea0..00000000000 --- a/ext/bcmath/libbcmath/src/str2num.c +++ /dev/null @@ -1,112 +0,0 @@ -/* str2num.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* Convert strings to bc numbers. Base 10 only.*/ - -void -bc_str2num (num, str, scale) - bc_num *num; - char *str; - int scale; -{ - int digits, strscale; - char *ptr, *nptr; - char zero_int; - - /* Prepare num. */ - bc_free_num (num); - - /* Check for valid number and count digits. */ - ptr = str; - digits = 0; - strscale = 0; - zero_int = FALSE; - if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */ - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - while (isdigit((int)*ptr)) ptr++, digits++; /* digits */ - if (*ptr == '.') ptr++; /* decimal point */ - while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */ - if ((*ptr != '\0') || (digits+strscale == 0)) - { - *num = bc_copy_num (_zero_); - return; - } - - /* Adjust numbers and allocate storage and initialize fields. */ - strscale = MIN(strscale, scale); - if (digits == 0) - { - zero_int = TRUE; - digits = 1; - } - *num = bc_new_num (digits, strscale); - - /* Build the whole number. */ - ptr = str; - if (*ptr == '-') - { - (*num)->n_sign = MINUS; - ptr++; - } - else - { - (*num)->n_sign = PLUS; - if (*ptr == '+') ptr++; - } - while (*ptr == '0') ptr++; /* Skip leading zeros. */ - nptr = (*num)->n_value; - if (zero_int) - { - *nptr++ = 0; - digits = 0; - } - for (;digits > 0; digits--) - *nptr++ = CH_VAL(*ptr++); - - - /* Build the fractional part. */ - if (strscale > 0) - { - ptr++; /* skip the decimal point! */ - for (;strscale > 0; strscale--) - *nptr++ = CH_VAL(*ptr++); - } -} - diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c deleted file mode 100644 index 2dd8eb5ecc1..00000000000 --- a/ext/bcmath/libbcmath/src/sub.c +++ /dev/null @@ -1,90 +0,0 @@ -/* sub.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - - -/* Here is the full subtract routine that takes care of negative numbers. - N2 is subtracted from N1 and the result placed in RESULT. SCALE_MIN - is the minimum scale for the result. */ - -void -bc_sub (n1, n2, result, scale_min) - bc_num n1, n2, *result; - int scale_min; -{ - bc_num diff = NULL; - int cmp_res; - int res_scale; - - if (n1->n_sign != n2->n_sign) - { - diff = _bc_do_add (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - } - else - { - /* subtraction must be done. */ - /* Compare magnitudes. */ - cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); - switch (cmp_res) - { - case -1: - /* n1 is less than n2, subtract n1 from n2. */ - diff = _bc_do_sub (n2, n1, scale_min); - diff->n_sign = (n2->n_sign == PLUS ? MINUS : PLUS); - break; - case 0: - /* They are equal! return zero! */ - res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale)); - diff = bc_new_num (1, res_scale); - memset (diff->n_value, 0, res_scale+1); - break; - case 1: - /* n2 is less than n1, subtract n2 from n1. */ - diff = _bc_do_sub (n1, n2, scale_min); - diff->n_sign = n1->n_sign; - break; - } - } - - /* Clean up and return. */ - bc_free_num (result); - *result = diff; -} - diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c deleted file mode 100644 index dce77ba4aa1..00000000000 --- a/ext/bcmath/libbcmath/src/zero.c +++ /dev/null @@ -1,65 +0,0 @@ -/* zero.c: bcmath library file. */ -/* - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - Copyright (C) 2000 Philip A. Nelson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. (COPYING.LIB) - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to: - - The Free Software Foundation, Inc. - 59 Temple Place, Suite 330 - Boston, MA 02111-1307 USA. - - You may contact the author by: - e-mail: philnelson@acm.org - us-mail: Philip A. Nelson - Computer Science Department, 9062 - Western Washington University - Bellingham, WA 98226-9062 - -*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "bcmath.h" -#include "private.h" - -/* In some places we need to check if the number NUM is zero. */ - -char -bc_is_zero (num) - bc_num num; -{ - int count; - char *nptr; - - /* Quick check. */ - if (num == _zero_) return TRUE; - - /* Initialize */ - count = num->n_len + num->n_scale; - nptr = num->n_value; - - /* The check */ - while ((count > 0) && (*nptr++ == 0)) count--; - - if (count != 0) - return FALSE; - else - return TRUE; -} - diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h deleted file mode 100644 index 8ead3253b88..00000000000 --- a/ext/bcmath/php_bcmath.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_BCMATH_H -#define PHP_BCMATH_H - -#if WITH_BCMATH - -extern zend_module_entry bcmath_module_entry; -#define phpext_bcmath_ptr &bcmath_module_entry - -PHP_MINIT_FUNCTION(bcmath); -PHP_MSHUTDOWN_FUNCTION(bcmath); -PHP_RINIT_FUNCTION(bcmath); -PHP_MINFO_FUNCTION(bcmath); - -PHP_FUNCTION(bcadd); -PHP_FUNCTION(bcsub); -PHP_FUNCTION(bcmul); -PHP_FUNCTION(bcdiv); -PHP_FUNCTION(bcmod); -PHP_FUNCTION(bcpow); -PHP_FUNCTION(bcsqrt); -PHP_FUNCTION(bccomp); -PHP_FUNCTION(bcscale); - -#else - -#define phpext_bcmath_ptr NULL - -#endif - -#endif /* PHP_BCMATH_H */ diff --git a/ext/calendar/CREDITS b/ext/calendar/CREDITS deleted file mode 100644 index a2904bd8b21..00000000000 --- a/ext/calendar/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Calendar -Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c deleted file mode 100644 index 46152d1c598..00000000000 --- a/ext/calendar/cal_unix.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -/* {{{ proto int unixtojd([int timestamp]) - Convert UNIX timestamp to Julian Day */ -PHP_FUNCTION(unixtojd) -{ - pval *timestamp; - long jdate; - time_t t; - struct tm *ta, tmbuf; - int myargc=ZEND_NUM_ARGS(); - - if ((myargc > 1) || (zend_get_parameters(ht, myargc, ×tamp) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - if(myargc==1) { - convert_to_long(timestamp); - t = Z_LVAL_P(timestamp); - } else { - t = time(NULL); - } - - if(t < 0) { - RETURN_FALSE; - } - - ta = php_localtime_r(&t, &tmbuf); - jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto int jdtounix(int jday) - Convert Julian Day to UNIX timestamp */ -PHP_FUNCTION(jdtounix) -{ - pval *jday; - long uday; - - if ((ZEND_NUM_ARGS()!= 1) || (zend_get_parameters(ht, 1, &jday) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - convert_to_long(jday); - - uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */; - - if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */ - if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */ - - RETURN_LONG(uday*24*3600); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c deleted file mode 100644 index 000918d7f14..00000000000 --- a/ext/calendar/calendar.c +++ /dev/null @@ -1,546 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - | Wez Furlong | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef PHP_WIN32 -#define _WINNLS_ -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "php_calendar.h" -#include "sdncal.h" - -function_entry calendar_functions[] = { - PHP_FE(jdtogregorian, NULL) - PHP_FE(gregoriantojd, NULL) - PHP_FE(jdtojulian, NULL) - PHP_FE(juliantojd, NULL) - PHP_FE(jdtojewish, NULL) - PHP_FE(jewishtojd, NULL) - PHP_FE(jdtofrench, NULL) - PHP_FE(frenchtojd, NULL) - PHP_FE(jddayofweek, NULL) - PHP_FE(jdmonthname, NULL) - PHP_FE(easter_date, NULL) - PHP_FE(easter_days, NULL) - PHP_FE(unixtojd, NULL) - PHP_FE(jdtounix, NULL) - PHP_FE(cal_to_jd, NULL) - PHP_FE(cal_from_jd, NULL) - PHP_FE(cal_days_in_month, NULL) - PHP_FE(cal_info, NULL) - {NULL, NULL, NULL} -}; - - -zend_module_entry calendar_module_entry = { - STANDARD_MODULE_HEADER, - "calendar", - calendar_functions, - PHP_MINIT(calendar), - NULL, - NULL, - NULL, - PHP_MINFO(calendar), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; - -#ifdef COMPILE_DL_CALENDAR -ZEND_GET_MODULE(calendar) -#endif - -/* this order must match the conversion table below */ -enum cal_name_type_t { - CAL_GREGORIAN = 0, - CAL_JULIAN, - CAL_JEWISH, - CAL_FRENCH, - CAL_NUM_CALS -}; -typedef long int (*cal_to_jd_func_t)(int month, int day, int year); -typedef void (*cal_from_jd_func_t)(long int jd, int* year, int* month, int* day); -typedef char* (*cal_as_string_func_t)(int year, int month, int day); - -struct cal_entry_t { - char * name; - char * symbol; - cal_to_jd_func_t to_jd; - cal_from_jd_func_t from_jd; - int num_months; - int max_days_in_month; - char ** month_name_short; - char ** month_name_long; -}; -static struct cal_entry_t cal_conversion_table[CAL_NUM_CALS] = { - { "Gregorian", "CAL_GREGORIAN", GregorianToSdn, SdnToGregorian, 12, 31, MonthNameShort, MonthNameLong }, - { "Julian", "CAL_JULIAN", JulianToSdn, SdnToJulian, 12, 31, MonthNameShort, MonthNameLong }, - { "Jewish", "CAL_JEWISH", JewishToSdn, SdnToJewish, 13, 30, JewishMonthName, JewishMonthName }, - { "French", "CAL_FRENCH", FrenchToSdn, SdnToFrench, 13, 30, FrenchMonthName, FrenchMonthName } -}; - -/* For jddayofweek */ -enum { CAL_DOW_DAYNO, CAL_DOW_SHORT, CAL_DOW_LONG }; -/* For jdmonthname */ -enum { CAL_MONTH_GREGORIAN_SHORT, CAL_MONTH_GREGORIAN_LONG, - CAL_MONTH_JULIAN_SHORT, CAL_MONTH_JULIAN_LONG, CAL_MONTH_JEWISH, - CAL_MONTH_FRENCH }; - -PHP_MINIT_FUNCTION(calendar) -{ - REGISTER_LONG_CONSTANT("CAL_GREGORIAN", CAL_GREGORIAN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JULIAN", CAL_JULIAN, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_JEWISH", CAL_JEWISH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_FRENCH", CAL_FRENCH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_NUM_CALS", CAL_NUM_CALS, CONST_CS|CONST_PERSISTENT); - /* constants for jddayofweek */ - REGISTER_LONG_CONSTANT("CAL_DOW_DAYNO", CAL_DOW_DAYNO, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_SHORT", CAL_DOW_SHORT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_DOW_LONG", CAL_DOW_LONG, CONST_CS|CONST_PERSISTENT); - /* constants for jdmonthname */ - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_SHORT", CAL_MONTH_GREGORIAN_SHORT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_GREGORIAN_LONG", CAL_MONTH_GREGORIAN_LONG, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_SHORT", CAL_MONTH_JULIAN_SHORT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JULIAN_LONG", CAL_MONTH_JULIAN_LONG, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_JEWISH", CAL_MONTH_JEWISH, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CAL_MONTH_FRENCH", CAL_MONTH_FRENCH, CONST_CS|CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(calendar) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Calendar support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto array cal_info(int calendar) - Returns information about a particular calendar */ -PHP_FUNCTION(cal_info) -{ - zval ** cal; - zval * months, *smonths; - int i; - struct cal_entry_t * calendar; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &cal) != SUCCESS) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(cal); - if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); - RETURN_FALSE; - } - - calendar = &cal_conversion_table[Z_LVAL_PP(cal)]; - array_init(return_value); - - MAKE_STD_ZVAL(months); - MAKE_STD_ZVAL(smonths); - array_init(months); - array_init(smonths); - - for (i=1; i<= calendar->num_months; i++) { - add_index_string(months, i, calendar->month_name_long[i], 1); - add_index_string(smonths, i, calendar->month_name_short[i], 1); - } - add_assoc_zval(return_value, "months", months); - add_assoc_zval(return_value, "abbrevmonths", smonths); - add_assoc_long(return_value, "maxdaysinmonth", calendar->max_days_in_month); - add_assoc_string(return_value, "calname", calendar->name, 1); - add_assoc_string(return_value, "calsymbol", calendar->symbol, 1); - -} -/* }}} */ - -/* {{{ proto int cal_days_in_month(int calendar, int month, int year) - Returns the number of days in a month for a given year and calendar */ -PHP_FUNCTION(cal_days_in_month) -{ - zval ** cal, **month, **year; - struct cal_entry_t * calendar; - long sdn_start, sdn_next; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &cal, &month, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(cal); - convert_to_long_ex(month); - convert_to_long_ex(year); - - if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); - RETURN_FALSE; - } - - calendar = &cal_conversion_table[Z_LVAL_PP(cal)]; - - sdn_start = calendar->to_jd(Z_LVAL_PP(year), Z_LVAL_PP(month), 1); - - sdn_next = calendar->to_jd(Z_LVAL_PP(year), 1 + Z_LVAL_PP(month), 1); - - if (sdn_next == 0) { - /* if invalid, try first month of the next year... */ - sdn_next = calendar->to_jd(Z_LVAL_PP(year) + 1, 1, 1); - } - - RETURN_LONG(sdn_next - sdn_start); -} -/* }}} */ - -/* {{{ proto int cal_to_jd(int calendar, int month, int day, int year) - Converts from a supported calendar to Julian Day Count */ -PHP_FUNCTION(cal_to_jd) -{ - zval ** cal, **month, **day, **year; - long jdate; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &cal, &month, &day, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(cal); - convert_to_long_ex(month); - convert_to_long_ex(day); - convert_to_long_ex(year); - - if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); - RETURN_FALSE; - } - - jdate = cal_conversion_table[Z_LVAL_PP(cal)].to_jd( - Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day)); - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto array cal_from_jd(int jd, int calendar) - Converts from Julian Day Count to a supported calendar and return extended information */ -PHP_FUNCTION(cal_from_jd) -{ - zval ** jd, ** cal; - int month, day, year, dow; - char date[16]; - struct cal_entry_t * calendar; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &jd, &cal) != SUCCESS) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(jd); - convert_to_long_ex(cal); - - if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) { - zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal)); - RETURN_FALSE; - } - calendar = &cal_conversion_table[Z_LVAL_PP(cal)]; - - array_init(return_value); - - calendar->from_jd( - Z_LVAL_PP(jd), - &year, &month, &day); - - sprintf(date, "%i/%i/%i", month, day, year); - add_assoc_string(return_value, "date", date, 1); - - add_assoc_long(return_value, "month", month); - add_assoc_long(return_value, "day", day); - add_assoc_long(return_value, "year", year); - - /* day of week */ - dow = DayOfWeek(Z_LVAL_PP(jd)); - add_assoc_long(return_value, "dow", dow); - add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1); - add_assoc_string(return_value, "dayname", DayNameLong[dow], 1); - /* month name */ - add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month], 1); - add_assoc_string(return_value, "monthname", calendar->month_name_long[month], 1); -} -/* }}} */ - -/* {{{ proto string jdtogregorian(int juliandaycount) - Converts a julian day count to a gregorian calendar date */ -PHP_FUNCTION(jdtogregorian) -{ - pval **julday; - int year, month, day; - char date[10]; - - if (zend_get_parameters_ex(1, &julday) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(julday); - SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int gregoriantojd(int month, int day, int year) - Converts a gregorian calendar date to julian day count */ - PHP_FUNCTION(gregoriantojd) -{ - pval **year, **month, **day; - int jdate; - - if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(month); - convert_to_long_ex(day); - convert_to_long_ex(year); - - jdate = GregorianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day)); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto string jdtojulian(int juliandaycount) - Convert a julian day count to a julian calendar date */ - PHP_FUNCTION(jdtojulian) -{ - pval **julday; - int year, month, day; - char date[10]; - - if (zend_get_parameters_ex(1, &julday) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(julday); - SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int juliantojd(int month, int day, int year) - Converts a julian calendar date to julian day count */ - PHP_FUNCTION(juliantojd) -{ - pval **year, **month, **day; - int jdate; - - if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(month); - convert_to_long_ex(day); - convert_to_long_ex(year); - - jdate = JulianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day)); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto string jdtojewish(int juliandaycount) - Converts a julian day count to a jewish calendar date */ - PHP_FUNCTION(jdtojewish) -{ - pval **julday; - int year, month, day; - char date[10]; - - if (zend_get_parameters_ex(1, &julday) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(julday); - - SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int jewishtojd(int month, int day, int year) - Converts a jewish calendar date to a julian day count */ - PHP_FUNCTION(jewishtojd) -{ - pval **year, **month, **day; - int jdate; - - if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(month); - convert_to_long_ex(day); - convert_to_long_ex(year); - - jdate = JewishToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day)); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto string jdtofrench(int juliandaycount) - Converts a julian day count to a french republic calendar date */ - PHP_FUNCTION(jdtofrench) -{ - pval **julday; - int year, month, day; - char date[10]; - - if (zend_get_parameters_ex(1, &julday) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(julday); - - SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day); - sprintf(date, "%i/%i/%i", month, day, year); - - RETURN_STRING(date, 1); -} -/* }}} */ - -/* {{{ proto int frenchtojd(int month, int day, int year) - Converts a french republic calendar date to julian day count */ - PHP_FUNCTION(frenchtojd) -{ - pval **year, **month, **day; - int jdate; - - if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(month); - convert_to_long_ex(day); - convert_to_long_ex(year); - - jdate = FrenchToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day)); - - RETURN_LONG(jdate); -} -/* }}} */ - -/* {{{ proto mixed jddayofweek(int juliandaycount [, int mode]) - Returns name or number of day of week from julian day count */ - PHP_FUNCTION(jddayofweek) -{ - pval *julday, *mode; - int day; - char *daynamel, *daynames; - int myargc=ZEND_NUM_ARGS(), mymode=0; - - if ((myargc < 1) || (myargc > 2) || (zend_get_parameters(ht, myargc, &julday, &mode) != SUCCESS)) { - WRONG_PARAM_COUNT; - } - - convert_to_long(julday); - if(myargc==2) { - convert_to_long(mode); - mymode = Z_LVAL_P(mode); - } - - day = DayOfWeek(Z_LVAL_P(julday)); - daynamel = DayNameLong[day]; - daynames = DayNameShort[day]; - - switch (mymode) { - case CAL_DOW_SHORT: - RETURN_STRING(daynamel, 1); - break; - case CAL_DOW_LONG: - RETURN_STRING(daynames, 1); - break; - case CAL_DOW_DAYNO: - default: - RETURN_LONG(day); - break; - } -} -/* }}} */ - -/* {{{ proto string jdmonthname(int juliandaycount, int mode) - Returns name of month for julian day count */ - PHP_FUNCTION(jdmonthname) -{ - pval **julday, **mode; - char *monthname = NULL; - int month, day, year; - - if (zend_get_parameters_ex(2, &julday, &mode) != SUCCESS) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(julday); - convert_to_long_ex(mode); - - switch(Z_LVAL_PP(mode)) { - case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */ - SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */ - SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day); - monthname = MonthNameShort[month]; - break; - case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */ - SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day); - monthname = MonthNameLong[month]; - break; - case CAL_MONTH_JEWISH: /* jewish month */ - SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day); - monthname = JewishMonthName[month]; - break; - case CAL_MONTH_FRENCH: /* french month */ - SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day); - monthname = FrenchMonthName[month]; - break; - default: /* default gregorian */ - case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */ - SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day); - monthname = MonthNameShort[month]; - break; - } - - RETURN_STRING(monthname, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/config.m4 b/ext/calendar/config.m4 deleted file mode 100644 index a80101adbb0..00000000000 --- a/ext/calendar/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support, -[ --enable-calendar Enable support for calendar conversion]) - -if test "$PHP_CALENDAR" = "yes"; then - AC_DEFINE(HAVE_CALENDAR,1,[ ]) - PHP_NEW_EXTENSION(calendar, calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c, $ext_shared) -fi diff --git a/ext/calendar/dow.c b/ext/calendar/dow.c deleted file mode 100644 index 64ae008f777..00000000000 --- a/ext/calendar/dow.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * int - * DayOfWeek( - * long int sdn); - * - * Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for - * Sunday, 1 for Monday, etc. and 6 stands for Saturday. - * - * char *DayNameShort[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the abbreviated (three character) name of the day. - * - * char *DayNameLong[7]; - * - * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to - * the name of the day. - * - **************************************************************************/ - -#include "sdncal.h" - -int DayOfWeek( - long int sdn) -{ - int dow; - - dow = (sdn + 1) % 7; - if (dow >= 0) { - return (dow); - } else { - return (dow + 7); - } -} - -char *DayNameShort[7] = -{ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" -}; - -char *DayNameLong[7] = -{ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c deleted file mode 100644 index 0a2121e7517..00000000000 --- a/ext/calendar/easter.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Shane Caraveo | - | Colin Viebrock | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ -/* $Id: */ - -#include "php.h" -#include "php_calendar.h" -#include "sdncal.h" -#include - -static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm) -{ - - /* based on code by Simon Kershaw, */ - - pval *year_arg; - struct tm *ta, te; - time_t the_time; - long year, golden, solar, lunar, pfm, dom, tmp, easter; - - switch(ZEND_NUM_ARGS()) { - case 0: - the_time = time(NULL); - ta = localtime(&the_time); - year = ta->tm_year + 1900; - break; - case 1: - if (getParameters(ht, 1, &year_arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(year_arg); - year = Z_LVAL_P(year_arg); - break; - default: - WRONG_PARAM_COUNT; - } - - if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */ - php3_error(E_WARNING, "easter_date() is only valid for years between 1970 and 2037 inclusive"); - RETURN_FALSE; - } - - golden = (year % 19) + 1; /* the Golden number */ - - if ( year <= 1752 ) { /* JULIAN CALENDAR */ - dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */ - if (dom < 0) { - dom += 7; - } - - pfm = (3 - (11*golden) - 7) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } else { /* GREGORIAN CALENDAR */ - dom = (year + (year/4) - (year/100) + (year/400)) % 7; /* the "Domincal number" */ - if (dom < 0) { - dom += 7; - } - - solar = (year-1600)/100 - (year-1600)/400; /* the solar and lunar corrections */ - lunar = (((year-1400) / 100) * 8) / 25; - - pfm = (3 - (11*golden) + solar - lunar) % 30; /* uncorrected date of the Paschal full moon */ - if (pfm < 0) { - pfm += 30; - } - } - - if ((pfm == 29) || (pfm == 28 && golden > 11)) { /* corrected date of the Paschal full moon */ - pfm--; /* - days after 21st March */ - } - - tmp = (4-pfm-dom) % 7; - if (tmp < 0) { - tmp += 7; - } - - easter = pfm + tmp + 1; /* Easter as the number of days after 21st March */ - - if (gm) { /* return a timestamp */ - te.tm_isdst = -1; - te.tm_year = year-1900; - te.tm_sec = 0; - te.tm_min = 0; - te.tm_hour = 0; - - if (easter < 11) { - te.tm_mon = 2; /* March */ - te.tm_mday = easter+21; - } else { - te.tm_mon = 3; /* April */ - te.tm_mday = easter-10; - } - - Z_LVAL_P(return_value) = mktime(&te); - } else { /* return the days after March 21 */ - Z_LVAL_P(return_value) = easter; - } - - Z_TYPE_P(return_value) = IS_LONG; - -} - -/* {{{ proto int easter_date([int year]) - Return the timestamp of midnight on Easter of a given year (defaults to current year) */ -PHP_FUNCTION(easter_date) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int easter_days([int year]) - Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */ -PHP_FUNCTION(easter_days) -{ - _cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/calendar/french.c b/ext/calendar/french.c deleted file mode 100644 index 5b4dd537506..00000000000 --- a/ext/calendar/french.c +++ /dev/null @@ -1,160 +0,0 @@ -/* $selId: french.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToFrench( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a French republican calendar date. If the input SDN is - * before the first day of year 1 or after the last day of year 14, the - * three output values will all be set to zero, otherwise *pYear will be in - * the range 1 to 14 inclusive; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. If *pMonth is - * 13, the SDN represents one of the holidays at the end of the year and - * *pDay will be in the range 1 to 6 inclusive. - * - * long int - * FrenchToSdn( - * int year, - * int month, - * int day); - * - * Convert a French republican calendar date to a SDN. Zero is returned - * when the input date is detected as invalid or out of the supported - * range. The return value will be > 0 for all valid, supported dates, but - * there are some invalid dates that will return a positive value. To - * verify that a date is valid, convert it to SDN and then back and compare - * with the original. - * - * char *FrenchMonthName[14]; - * - * Convert a French republican month number (1 to 13) to the name of the - * French republican month (null terminated). An index of 13 (for the - * "extra" days at the end of the year) will return the string "Extra". An - * index of zero will return a zero length string. - * - * VALID RANGE - * - * These routines only convert dates in years 1 through 14 (Gregorian - * dates 22 September 1792 through 22 September 1806). This more than - * covers the period when the calendar was in use. - * - * I would support a wider range of dates, but I have not been able to - * find an authoritative definition of when leap years were to have - * occurred. There are suggestions that it was to skip a leap year ever - * 100 years like the Gregorian calendar. - * - * CALENDAR OVERVIEW - * - * The French republican calendar was adopted in October 1793 during - * the French Revolution and was abandoned in January 1806. The intent - * was to create a new calendar system that was based on scientific - * principals, not religious traditions. - * - * The year is divided into 12 months of 30 days each. The remaining 5 - * to 6 days in the year are grouped at the end and are holidays. Each - * month is divided into three decades (instead of weeks) of 10 days - * each. - * - * The epoch (first day of the first year) is 22 September 1792 in the - * Gregorian calendar. Leap years are every fourth year (year 3, 7, - * 11, etc.) - * - * TESTING - * - * This algorithm has been tested from the year 1 to 14. The source - * code of the verification program is included in this package. - * - * REFERENCES - * - * I have found no detailed, authoritative reference on this calendar. - * The algorithms are based on a preponderance of less authoritative - * sources. - * - **************************************************************************/ - -#include "sdncal.h" - -#define FRENCH_SDN_OFFSET 2375474 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_MONTH 30 -#define FIRST_VALID 2375840 -#define LAST_VALID 2380952 - -void SdnToFrench( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int temp; - int dayOfYear; - - if (sdn < FIRST_VALID || sdn > LAST_VALID) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn - FRENCH_SDN_OFFSET) * 4 - 1; - *pYear = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4; - *pMonth = dayOfYear / DAYS_PER_MONTH + 1; - *pDay = dayOfYear % DAYS_PER_MONTH + 1; -} - -long int FrenchToSdn( - int year, - int month, - int day) -{ - /* check for invalid dates */ - if (year < 1 || year > 14 || - month < 1 || month > 13 || - day < 1 || day > 30) { - return (0); - } - return ((year * DAYS_PER_4_YEARS) / 4 - + (month - 1) * DAYS_PER_MONTH - + day - + FRENCH_SDN_OFFSET); -} - -char *FrenchMonthName[14] = -{ - "", - "Vendemiaire", - "Brumaire", - "Frimaire", - "Nivose", - "Pluviose", - "Ventose", - "Germinal", - "Floreal", - "Prairial", - "Messidor", - "Thermidor", - "Fructidor", - "Extra" -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/gregor.c b/ext/calendar/gregor.c deleted file mode 100644 index f48950901a6..00000000000 --- a/ext/calendar/gregor.c +++ /dev/null @@ -1,265 +0,0 @@ -/* $selId: gregor.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToGregorian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Gregorian calendar date. If the input SDN is less - * than 1, the three output values will all be set to zero, otherwise - * *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * GregorianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Gregorian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *MonthNameShort[13]; - * - * Convert a Gregorian month number (1 to 12) to the abbreviated (three - * character) name of the Gregorian month (null terminated). An index of - * zero will return a zero length string. - * - * char *MonthNameLong[13]; - * - * Convert a Gregorian month number (1 to 12) to the name of the Gregorian - * month (null terminated). An index of zero will return a zero length - * string. - * - * VALID RANGE - * - * 4714 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4714 - * B.C., such use may not be meaningful. The Gregorian calendar was - * not instituted until October 15, 1582 (or October 5, 1582 in the - * Julian calendar). Some countries did not accept it until much - * later. For example, Britain converted in 1752, The USSR in 1918 and - * Greece in 1923. Most European countries used the Julian calendar - * prior to the Gregorian. - * - * CALENDAR OVERVIEW - * - * The Gregorian calendar is a modified version of the Julian calendar. - * The only difference being the specification of leap years. The - * Julian calendar specifies that every year that is a multiple of 4 - * will be a leap year. This leads to a year that is 365.25 days long, - * but the current accepted value for the tropical year is 365.242199 - * days. - * - * To correct this error in the length of the year and to bring the - * vernal equinox back to March 21, Pope Gregory XIII issued a papal - * bull declaring that Thursday October 4, 1582 would be followed by - * Friday October 15, 1582 and that centennial years would only be a - * leap year if they were a multiple of 400. This shortened the year - * by 3 days per 400 years, giving a year of 365.2425 days. - * - * Another recently proposed change in the leap year rule is to make - * years that are multiples of 4000 not a leap year, but this has never - * been officially accepted and this rule is not implemented in these - * algorithms. - * - * ALGORITHMS - * - * The calculations are based on three different cycles: a 400 year - * cycle of leap years, a 4 year cycle of leap years and a 5 month - * cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 - * and 31 days, except for three anomalies: both July and August - * have 31 days, both December and January have 31, and February - * is less than 30. Starting with March, the lengths are in a - * cycle of 5 months (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the - * year starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4714 B.C. to 10000 - * A.D. The source code of the verification program is included in - * this package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). - * - **************************************************************************/ - -#include "sdncal.h" - -#define GREGOR_SDN_OFFSET 32045 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 -#define DAYS_PER_400_YEARS 146097 - -void SdnToGregorian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int century; - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1; - - /* Calculate the century (year/100). */ - century = temp / DAYS_PER_400_YEARS; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3; - year = (century * 100) + (temp / DAYS_PER_4_YEARS); - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int GregorianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4714 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Nov 25, 4714 B.C.) */ - if (inputYear == -4714) { - if (inputMonth < 11) { - return (0); - } - if (inputMonth == 11 && inputDay < 25) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return (((year / 100) * DAYS_PER_400_YEARS) / 4 - + ((year % 100) * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - GREGOR_SDN_OFFSET); -} - -char *MonthNameShort[13] = -{ - "", - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" -}; - -char *MonthNameLong[13] = -{ - "", - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" -}; diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c deleted file mode 100644 index 504f3c2d939..00000000000 --- a/ext/calendar/jewish.c +++ /dev/null @@ -1,741 +0,0 @@ -/* $selId: jewish.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJewish( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Jewish calendar date. If the input SDN is before the - * first day of year 1, the three output values will all be set to zero, - * otherwise *pYear will be > 0; *pMonth will be in the range 1 to 13 - * inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar - * II is assigned the month number 7 and Elul is always 13. - * - * long int - * JewishToSdn( - * int year, - * int month, - * int day); - * - * Convert a Jewish calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * char *JewishMonthName[14]; - * - * Convert a Jewish month number (1 to 13) to the name of the Jewish month - * (null terminated). An index of zero will return a zero length string. - * - * VALID RANGE - * - * Although this software can handle dates all the way back to the year - * 1 (3761 B.C.), such use may not be meaningful. - * - * The Jewish calendar has been in use for several thousand years, but - * in the early days there was no formula to determine the start of a - * month. A new month was started when the new moon was first - * observed. - * - * It is not clear when the current rule based calendar replaced the - * observation based calendar. According to the book "Jewish Calendar - * Mystery Dispelled" by George Zinberg, the patriarch Hillel II - * published these rules in 358 A.D. But, according to The - * Encyclopedia Judaica, Hillel II may have only published the 19 year - * rule for determining the occurrence of leap years. - * - * I have yet to find a specific date when the current set of rules - * were known to be in use. - * - * CALENDAR OVERVIEW - * - * The Jewish calendar is based on lunar as well as solar cycles. A - * month always starts on or near a new moon and has either 29 or 30 - * days (a lunar cycle is about 29 1/2 days). Twelve of these - * alternating 29-30 day months gives a year of 354 days, which is - * about 11 1/4 days short of a solar year. - * - * Since a month is defined to be a lunar cycle (new moon to new moon), - * this 11 1/4 day difference cannot be overcome by adding days to a - * month as with the Gregorian calendar, so an entire month is - * periodically added to the year, making some years 13 months long. - * - * For astronomical as well as ceremonial reasons, the start of a new - * year may be delayed until a day or two after the new moon causing - * years to vary in length. Leap years can be from 383 to 385 days and - * common years can be from 353 to 355 days. These are the months of - * the year and their possible lengths: - * - * COMMON YEAR LEAP YEAR - * 1 Tishri 30 30 30 30 30 30 - * 2 Heshvan 29 29 30 29 29 30 (variable) - * 3 Kislev 29 30 30 29 30 30 (variable) - * 4 Tevet 29 29 29 29 29 29 - * 5 Shevat 30 30 30 30 30 30 - * 6 Adar I 29 29 29 30 30 30 (variable) - * 7 Adar II -- -- -- 29 29 29 (optional) - * 8 Nisan 30 30 30 30 30 30 - * 9 Iyyar 29 29 29 29 29 29 - * 10 Sivan 30 30 30 30 30 30 - * 11 Tammuz 29 29 29 29 29 29 - * 12 Av 30 30 30 30 30 30 - * 13 Elul 29 29 29 29 29 29 - * --- --- --- --- --- --- - * 353 354 355 383 384 385 - * - * Note that the month names and other words that appear in this file - * have multiple possible spellings in the Roman character set. I have - * chosen to use the spellings found in the Encyclopedia Judaica. - * - * Adar II, the month added for leap years, is sometimes referred to as - * the 13th month, but I have chosen to assign it the number 7 to keep - * the months in chronological order. This may not be consistent with - * other numbering schemes. - * - * Leap years occur in a fixed pattern of 19 years called the metonic - * cycle. The 3rd, 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. The first metonic cycle starts with Jewish - * year 1, or 3761/60 B.C. This is believed to be the year of - * creation. - * - * To construct the calendar for a year, you must first find the length - * of the year by determining the first day of the year (Tishri 1, or - * Rosh Ha-Shanah) and the first day of the following year. This - * selects one of the six possible month length configurations listed - * above. - * - * Finding the first day of the year is the most difficult part. - * Finding the date and time of the new moon (or molad) is the first - * step. For this purpose, the lunar cycle is assumed to be 29 days 12 - * hours and 793 halakim. A halakim is 1/1080th of an hour or 3 1/3 - * seconds. (This assumed value is only about 1/2 second less than the - * value used by modern astronomers -- not bad for a number that was - * determined so long ago.) The first molad of year 1 occurred on - * Sunday at 11:20:11 P.M. This would actually be Monday, because the - * Jewish day is considered to begin at sunset. - * - * Since sunset varies, the day is assumed to begin at 6:00 P.M. for - * calendar calculation purposes. So, the first molad was 5 hours 793 - * halakim after the start of Tishri 1, 0001 (which was Monday - * September 7, 4761 B.C. by the Gregorian calendar). All subsequent - * molads can be calculated from this starting point by adding the - * length of a lunar cycle. - * - * Once the molad that starts a year is determined the actual start of - * the year (Tishri 1) can be determined. Tishri 1 will be the day of - * the molad unless it is delayed by one of the following four rules - * (called dehiyyot). Each rule can delay the start of the year by one - * day, and since rule #1 can combine with one of the other rules, it - * can be delayed as much as two days. - * - * 1. Tishri 1 must never be Sunday, Wednesday or Friday. (This - * is largely to prevent certain holidays from occurring on the - * day before or after the Sabbath.) - * - * 2. If the molad occurs on or after noon, Tishri 1 must be - * delayed. - * - * 3. If it is a common (not leap) year and the molad occurs on - * Tuesday at or after 3:11:20 A.M., Tishri 1 must be delayed. - * - * 4. If it is the year following a leap year and the molad occurs - * on Monday at or after 9:32:43 and 1/3 sec, Tishri 1 must be - * delayed. - * - * GLOSSARY - * - * dehiyyot The set of 4 rules that determine when the new year - * starts relative to the molad. - * - * halakim 1/1080th of an hour or 3 1/3 seconds. - * - * lunar cycle The period of time between mean conjunctions of the - * sun and moon (new moon to new moon). This is - * assumed to be 29 days 12 hours and 793 halakim for - * calendar purposes. - * - * metonic cycle A 19 year cycle which determines which years are - * leap years and which are common years. The 3rd, - * 6th, 8th, 11th, 14th, 17th and 19th years of this - * cycle are leap years. - * - * molad The date and time of the mean conjunction of the - * sun and moon (new moon). This is the approximate - * beginning of a month. - * - * Rosh Ha-Shanah The first day of the Jewish year (Tishri 1). - * - * Tishri The first month of the Jewish year. - * - * ALGORITHMS - * - * SERIAL DAY NUMBER TO JEWISH DATE - * - * The simplest approach would be to use the rules stated above to find - * the molad of Tishri before and after the given day number. Then use - * the molads to find Tishri 1 of the current and following years. - * From this the length of the year can be determined and thus the - * length of each month. But this method is used as a last resort. - * - * The first 59 days of the year are the same regardless of the length - * of the year. As a result, only the day number of the start of the - * year is required. - * - * Similarly, the last 6 months do not change from year to year. And - * since it can be determined whether the year is a leap year by simple - * division, the lengths of Adar I and II can be easily calculated. In - * fact, all dates after the 3rd month are consistent from year to year - * (once it is known whether it is a leap year). - * - * This means that if the given day number falls in the 3rd month or on - * the 30th day of the 2nd month the length of the year must be found, - * but in no other case. - * - * So, the approach used is to take the given day number and round it - * to the closest molad of Tishri (first new moon of the year). The - * rounding is not really to the *closest* molad, but is such that if - * the day number is before the middle of the 3rd month the molad at - * the start of the year is found, otherwise the molad at the end of - * the year is found. - * - * Only if the day number is actually found to be in the ambiguous - * period of 29 to 31 days is the other molad calculated. - * - * JEWISH DATE TO SERIAL DAY NUMBER - * - * The year number is used to find which 19 year metonic cycle contains - * the date and which year within the cycle (this is a division and - * modulus). This also determines whether it is a leap year. - * - * If the month is 1 or 2, the calculation is simple addition to the - * first of the year. - * - * If the month is 8 (Nisan) or greater, the calculation is simple - * subtraction from beginning of the following year. - * - * If the month is 4 to 7, it is considered whether it is a leap year - * and then simple subtraction from the beginning of the following year - * is used. - * - * Only if it is the 3rd month is both the start and end of the year - * required. - * - * TESTING - * - * This algorithm has been tested in two ways. First, 510 dates from a - * table in "Jewish Calendar Mystery Dispelled" were calculated and - * compared to the table. Second, the calculation algorithm described - * in "Jewish Calendar Mystery Dispelled" was coded and used to verify - * all dates from the year 1 (3761 B.C.) to the year 13760 (10000 - * A.D.). - * - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * The Encyclopedia Judaica, the entry for "Calendar" - * - * The Jewish Encyclopedia - * - * Jewish Calendar Mystery Dispelled by George Zinberg, Vantage Press, - * 1963 - * - * The Comprehensive Hebrew Calendar by Arthur Spier, Behrman House - * - * The Book of Calendars [note that this work contains many typos] - * - **************************************************************************/ - -#include "sdncal.h" - -#define HALAKIM_PER_HOUR 1080 -#define HALAKIM_PER_DAY 25920 -#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753) -#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7)) - -#define JEWISH_SDN_OFFSET 347997 -#define NEW_MOON_OF_CREATION 31524 - -#define SUNDAY 0 -#define MONDAY 1 -#define TUESDAY 2 -#define WEDNESDAY 3 -#define THURSDAY 4 -#define FRIDAY 5 -#define SATURDAY 6 - -#define NOON (18 * HALAKIM_PER_HOUR) -#define AM3_11_20 ((9 * HALAKIM_PER_HOUR) + 204) -#define AM9_32_43 ((15 * HALAKIM_PER_HOUR) + 589) - -static int monthsPerYear[19] = -{ -12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13 -}; - -static int yearOffset[19] = -{ - 0, 12, 24, 37, 49, 61, 74, 86, 99, 111, 123, - 136, 148, 160, 173, 185, 197, 210, 222 -}; - -char *JewishMonthName[14] = -{ - "", - "Tishri", - "Heshvan", - "Kislev", - "Tevet", - "Shevat", - "AdarI", - "AdarII", - "Nisan", - "Iyyar", - "Sivan", - "Tammuz", - "Av", - "Elul" -}; - -/************************************************************************ - * Given the year within the 19 year metonic cycle and the time of a molad - * (new moon) which starts that year, this routine will calculate what day - * will be the actual start of the year (Tishri 1 or Rosh Ha-Shanah). This - * first day of the year will be the day of the molad unless one of 4 rules - * (called dehiyyot) delays it. These 4 rules can delay the start of the - * year by as much as 2 days. - */ -static long int Tishri1( - int metonicYear, - long int moladDay, - long int moladHalakim) -{ - long int tishri1; - int dow; - int leapYear; - int lastWasLeapYear; - - tishri1 = moladDay; - dow = tishri1 % 7; - leapYear = metonicYear == 2 || metonicYear == 5 || metonicYear == 7 - || metonicYear == 10 || metonicYear == 13 || metonicYear == 16 - || metonicYear == 18; - lastWasLeapYear = metonicYear == 3 || metonicYear == 6 - || metonicYear == 8 || metonicYear == 11 || metonicYear == 14 - || metonicYear == 17 || metonicYear == 0; - - /* Apply rules 2, 3 and 4. */ - if ((moladHalakim >= NOON) || - ((!leapYear) && dow == TUESDAY && moladHalakim >= AM3_11_20) || - (lastWasLeapYear && dow == MONDAY && moladHalakim >= AM9_32_43)) { - tishri1++; - dow++; - if (dow == 7) { - dow = 0; - } - } - /* Apply rule 1 after the others because it can cause an additional - * delay of one day. */ - if (dow == WEDNESDAY || dow == FRIDAY || dow == SUNDAY) { - tishri1++; - } - return (tishri1); -} - -/************************************************************************ - * Given a metonic cycle number, calculate the date and time of the molad - * (new moon) that starts that cycle. Since the length of a metonic cycle - * is a constant, this is a simple calculation, except that it requires an - * intermediate value which is bigger that 32 bits. Because this - * intermediate value only needs 36 to 37 bits and the other numbers are - * constants, the process has been reduced to just a few steps. - */ -static void MoladOfMetonicCycle( - int metonicCycle, - long int *pMoladDay, - long int *pMoladHalakim) -{ - register unsigned long int r1, r2, d1, d2; - - /* Start with the time of the first molad after creation. */ - r1 = NEW_MOON_OF_CREATION; - - /* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32 - * bits of the result will be in r2 and the lower 16 bits will be - * in r1. */ - r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF); - r2 = r1 >> 16; - r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF); - - /* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the - * upper 16 bits of the quotient will be in d2 and the lower 16 bits - * will be in d1. */ - d2 = r2 / HALAKIM_PER_DAY; - r2 -= d2 * HALAKIM_PER_DAY; - r1 = (r2 << 16) | (r1 & 0xFFFF); - d1 = r1 / HALAKIM_PER_DAY; - r1 -= d1 * HALAKIM_PER_DAY; - - *pMoladDay = (d2 << 16) | d1; - *pMoladHalakim = r1; -} - -/************************************************************************ - * Given a day number, find the molad of Tishri (the new moon at the start - * of a year) which is closest to that day number. It's not really the - * *closest* molad that we want here. If the input day is in the first two - * months, we want the molad at the start of the year. If the input day is - * in the fourth to last months, we want the molad at the end of the year. - * If the input day is in the third month, it doesn't matter which molad is - * returned, because both will be required. This type of "rounding" allows - * us to avoid calculating the length of the year in most cases. - */ -static void FindTishriMolad( - long int inputDay, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim) -{ - long int moladDay; - long int moladHalakim; - int metonicCycle; - int metonicYear; - - /* Estimate the metonic cycle number. Note that this may be an under - * estimate because there are 6939.6896 days in a metonic cycle not - * 6940, but it will never be an over estimate. The loop below will - * correct for any error in this estimate. */ - metonicCycle = (inputDay + 310) / 6940; - - /* Calculate the time of the starting molad for this metonic cycle. */ - MoladOfMetonicCycle(metonicCycle, &moladDay, &moladHalakim); - - /* If the above was an under estimate, increment the cycle number until - * the correct one is found. For modern dates this loop is about 98.6% - * likely to not execute, even once, because the above estimate is - * really quite close. */ - while (moladDay < inputDay - 6940 + 310) { - metonicCycle++; - moladHalakim += HALAKIM_PER_METONIC_CYCLE; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - /* Find the molad of Tishri closest to this date. */ - for (metonicYear = 0; metonicYear < 18; metonicYear++) { - if (moladDay > inputDay - 74) { - break; - } - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - } - - *pMetonicCycle = metonicCycle; - *pMetonicYear = metonicYear; - *pMoladDay = moladDay; - *pMoladHalakim = moladHalakim; -} - -/************************************************************************ - * Given a year, find the number of the first day of that year and the date - * and time of the starting molad. - */ -static void FindStartOfYear( - int year, - int *pMetonicCycle, - int *pMetonicYear, - long int *pMoladDay, - long int *pMoladHalakim, - int *pTishri1) -{ - *pMetonicCycle = (year - 1) / 19; - *pMetonicYear = (year - 1) % 19; - MoladOfMetonicCycle(*pMetonicCycle, pMoladDay, pMoladHalakim); - - *pMoladHalakim += HALAKIM_PER_LUNAR_CYCLE * yearOffset[*pMetonicYear]; - *pMoladDay += *pMoladHalakim / HALAKIM_PER_DAY; - *pMoladHalakim = *pMoladHalakim % HALAKIM_PER_DAY; - - *pTishri1 = Tishri1(*pMetonicYear, *pMoladDay, *pMoladHalakim); -} - -/************************************************************************ - * Given a serial day number (SDN), find the corresponding year, month and - * day in the Jewish calendar. The three output values will always be - * modified. If the input SDN is before the first day of year 1, they will - * all be set to zero, otherwise *pYear will be > 0; *pMonth will be in the - * range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive. - */ -void SdnToJewish( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - long int inputDay; - long int day; - long int halakim; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - int yearLength; - - if (sdn <= JEWISH_SDN_OFFSET) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - inputDay = sdn - JEWISH_SDN_OFFSET; - - FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - - if (inputDay >= tishri1) { - /* It found Tishri 1 at the start of the year. */ - *pYear = metonicCycle * 19 + metonicYear + 1; - if (inputDay < tishri1 + 59) { - if (inputDay < tishri1 + 30) { - *pMonth = 1; - *pDay = inputDay - tishri1 + 1; - } else { - *pMonth = 2; - *pDay = inputDay - tishri1 - 29; - } - return; - } - /* We need the length of the year to figure this out, so find - * Tishri 1 of the next year. */ - halakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - day += halakim / HALAKIM_PER_DAY; - halakim = halakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, day, halakim); - } else { - /* It found Tishri 1 at the end of the year. */ - *pYear = metonicCycle * 19 + metonicYear; - if (inputDay >= tishri1 - 177) { - /* It is one of the last 6 months of the year. */ - if (inputDay > tishri1 - 30) { - *pMonth = 13; - *pDay = inputDay - tishri1 + 30; - } else if (inputDay > tishri1 - 60) { - *pMonth = 12; - *pDay = inputDay - tishri1 + 60; - } else if (inputDay > tishri1 - 89) { - *pMonth = 11; - *pDay = inputDay - tishri1 + 89; - } else if (inputDay > tishri1 - 119) { - *pMonth = 10; - *pDay = inputDay - tishri1 + 119; - } else if (inputDay > tishri1 - 148) { - *pMonth = 9; - *pDay = inputDay - tishri1 + 148; - } else { - *pMonth = 8; - *pDay = inputDay - tishri1 + 178; - } - return; - } else { - if (monthsPerYear[(*pYear - 1) % 19] == 13) { - *pMonth = 7; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } else { - *pMonth = 6; - *pDay = inputDay - tishri1 + 207; - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 30; - } - if (*pDay > 0) - return; - (*pMonth)--; - (*pDay) += 29; - if (*pDay > 0) - return; - - /* We need the length of the year to figure this out, so find - * Tishri 1 of this year. */ - tishri1After = tishri1; - FindTishriMolad(day - 365, - &metonicCycle, &metonicYear, &day, &halakim); - tishri1 = Tishri1(metonicYear, day, halakim); - } - } - - yearLength = tishri1After - tishri1; - day = inputDay - tishri1 - 29; - if (yearLength == 355 || yearLength == 385) { - /* Heshvan has 30 days */ - if (day <= 30) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 30; - } else { - /* Heshvan has 29 days */ - if (day <= 29) { - *pMonth = 2; - *pDay = day; - return; - } - day -= 29; - } - - /* It has to be Kislev. */ - *pMonth = 3; - *pDay = day; -} - -/************************************************************************ - * Given a year, month and day in the Jewish calendar, find the - * corresponding serial day number (SDN). Zero is returned when the input - * date is detected as invalid. The return value will be > 0 for all valid - * dates, but there are some invalid dates that will return a positive - * value. To verify that a date is valid, convert it to SDN and then back - * and compare with the original. - */ -long int JewishToSdn( - int year, - int month, - int day) -{ - long int sdn; - int metonicCycle; - int metonicYear; - int tishri1; - int tishri1After; - long int moladDay; - long int moladHalakim; - int yearLength; - int lengthOfAdarIAndII; - - if (year <= 0 || day <= 0 || day > 30) { - return (0); - } - switch (month) { - case 1: - case 2: - /* It is Tishri or Heshvan - don't need the year length. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - if (month == 1) { - sdn = tishri1 + day - 1; - } else { - sdn = tishri1 + day + 29; - } - break; - - case 3: - /* It is Kislev - must find the year length. */ - - /* Find the start of the year. */ - FindStartOfYear(year, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1); - - /* Find the end of the year. */ - moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear]; - moladDay += moladHalakim / HALAKIM_PER_DAY; - moladHalakim = moladHalakim % HALAKIM_PER_DAY; - tishri1After = Tishri1((metonicYear + 1) % 19, moladDay, moladHalakim); - - yearLength = tishri1After - tishri1; - - if (yearLength == 355 || yearLength == 385) { - sdn = tishri1 + day + 59; - } else { - sdn = tishri1 + day + 58; - } - break; - - case 4: - case 5: - case 6: - /* It is Tevet, Shevat or Adar I - don't need the year length. */ - - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - if (monthsPerYear[(year - 1) % 19] == 12) { - lengthOfAdarIAndII = 29; - } else { - lengthOfAdarIAndII = 59; - } - - if (month == 4) { - sdn = tishri1After + day - lengthOfAdarIAndII - 237; - } else if (month == 5) { - sdn = tishri1After + day - lengthOfAdarIAndII - 208; - } else { - sdn = tishri1After + day - lengthOfAdarIAndII - 178; - } - break; - - default: - /* It is Adar II or later - don't need the year length. */ - FindStartOfYear(year + 1, &metonicCycle, &metonicYear, - &moladDay, &moladHalakim, &tishri1After); - - switch (month) { - case 7: - sdn = tishri1After + day - 207; - break; - case 8: - sdn = tishri1After + day - 178; - break; - case 9: - sdn = tishri1After + day - 148; - break; - case 10: - sdn = tishri1After + day - 119; - break; - case 11: - sdn = tishri1After + day - 89; - break; - case 12: - sdn = tishri1After + day - 60; - break; - case 13: - sdn = tishri1After + day - 30; - break; - default: - return (0); - } - } - return (sdn + JEWISH_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/julian.c b/ext/calendar/julian.c deleted file mode 100644 index 39bcbc7e655..00000000000 --- a/ext/calendar/julian.c +++ /dev/null @@ -1,249 +0,0 @@ -/* $selId: julian.c,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * These are the externally visible components of this file: - * - * void - * SdnToJulian( - * long int sdn, - * int *pYear, - * int *pMonth, - * int *pDay); - * - * Convert a SDN to a Julian calendar date. If the input SDN is less than - * 1, the three output values will all be set to zero, otherwise *pYear - * will be >= -4713 and != 0; *pMonth will be in the range 1 to 12 - * inclusive; *pDay will be in the range 1 to 31 inclusive. - * - * long int - * JulianToSdn( - * int inputYear, - * int inputMonth, - * int inputDay); - * - * Convert a Julian calendar date to a SDN. Zero is returned when the - * input date is detected as invalid or out of the supported range. The - * return value will be > 0 for all valid, supported dates, but there are - * some invalid dates that will return a positive value. To verify that a - * date is valid, convert it to SDN and then back and compare with the - * original. - * - * VALID RANGE - * - * 4713 B.C. to at least 10000 A.D. - * - * Although this software can handle dates all the way back to 4713 - * B.C., such use may not be meaningful. The calendar was created in - * 46 B.C., but the details did not stabilize until at least 8 A.D., - * and perhaps as late at the 4th century. Also, the beginning of a - * year varied from one culture to another - not all accepted January - * as the first month. - * - * CALENDAR OVERVIEW - * - * Julias Ceasar created the calendar in 46 B.C. as a modified form of - * the old Roman republican calendar which was based on lunar cycles. - * The new Julian calendar set fixed lengths for the months, abandoning - * the lunar cycle. It also specified that there would be exactly 12 - * months per year and 365.25 days per year with every 4th year being a - * leap year. - * - * Note that the current accepted value for the tropical year is - * 365.242199 days, not 365.25. This lead to an 11 day shift in the - * calendar with respect to the seasons by the 16th century when the - * Gregorian calendar was created to replace the Julian calendar. - * - * The difference between the Julian and today's Gregorian calendar is - * that the Gregorian does not make centennial years leap years unless - * they are a multiple of 400, which leads to a year of 365.2425 days. - * In other words, in the Gregorian calendar, 1700, 1800 and 1900 are - * not leap years, but 2000 is. All centennial years are leap years in - * the Julian calendar. - * - * The details are unknown, but the lengths of the months were adjusted - * until they finally stablized in 8 A.D. with their current lengths: - * - * January 31 - * February 28/29 - * March 31 - * April 30 - * May 31 - * June 30 - * Quintilis/July 31 - * Sextilis/August 31 - * September 30 - * October 31 - * November 30 - * December 31 - * - * In the early days of the calendar, the days of the month were not - * numbered as we do today. The numbers ran backwards (decreasing) and - * were counted from the Ides (15th of the month - which in the old - * Roman republican lunar calendar would have been the full moon) or - * from the Nonae (9th day before the Ides) or from the beginning of - * the next month. - * - * In the early years, the beginning of the year varied, sometimes - * based on the ascension of rulers. It was not always the first of - * January. - * - * Also, today's epoch, 1 A.D. or the birth of Jesus Christ, did not - * come into use until several centuries later when Christianity became - * a dominant religion. - * - * ALGORITHMS - * - * The calculations are based on two different cycles: a 4 year cycle - * of leap years and a 5 month cycle of month lengths. - * - * The 5 month cycle is used to account for the varying lengths of - * months. You will notice that the lengths alternate between 30 and - * 31 days, except for three anomalies: both July and August have 31 - * days, both December and January have 31, and February is less than - * 30. Starting with March, the lengths are in a cycle of 5 months - * (31, 30, 31, 30, 31): - * - * Mar 31 days \ - * Apr 30 days | - * May 31 days > First cycle - * Jun 30 days | - * Jul 31 days / - * - * Aug 31 days \ - * Sep 30 days | - * Oct 31 days > Second cycle - * Nov 30 days | - * Dec 31 days / - * - * Jan 31 days \ - * Feb 28/9 days | - * > Third cycle (incomplete) - * - * For this reason the calculations (internally) assume that the year - * starts with March 1. - * - * TESTING - * - * This algorithm has been tested from the year 4713 B.C. to 10000 A.D. - * The source code of the verification program is included in this - * package. - * - * REFERENCES - * - * Conversions Between Calendar Date and Julian Day Number by Robert J. - * Tantzen, Communications of the Association for Computing Machinery - * August 1963. (Also published in Collected Algorithms from CACM, - * algorithm number 199). [Note: the published algorithm is for the - * Gregorian calendar, but was adjusted to use the Julian calendar's - * simpler leap year rule.] - * - **************************************************************************/ - -#include "sdncal.h" - -#define JULIAN_SDN_OFFSET 32083 -#define DAYS_PER_5_MONTHS 153 -#define DAYS_PER_4_YEARS 1461 - -void SdnToJulian( - long int sdn, - int *pYear, - int *pMonth, - int *pDay) -{ - int year; - int month; - int day; - long int temp; - int dayOfYear; - - if (sdn <= 0) { - *pYear = 0; - *pMonth = 0; - *pDay = 0; - return; - } - temp = (sdn + JULIAN_SDN_OFFSET) * 4 - 1; - - /* Calculate the year and day of year (1 <= dayOfYear <= 366). */ - year = temp / DAYS_PER_4_YEARS; - dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - /* Calculate the month and day of month. */ - temp = dayOfYear * 5 - 3; - month = temp / DAYS_PER_5_MONTHS; - day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - /* Convert to the normal beginning of the year. */ - if (month < 10) { - month += 3; - } else { - year += 1; - month -= 9; - } - - /* Adjust to the B.C./A.D. type numbering. */ - year -= 4800; - if (year <= 0) - year--; - - *pYear = year; - *pMonth = month; - *pDay = day; -} - -long int JulianToSdn( - int inputYear, - int inputMonth, - int inputDay) -{ - int year; - int month; - - /* check for invalid dates */ - if (inputYear == 0 || inputYear < -4713 || - inputMonth <= 0 || inputMonth > 12 || - inputDay <= 0 || inputDay > 31) { - return (0); - } - /* check for dates before SDN 1 (Jan 2, 4713 B.C.) */ - if (inputYear == -4713) { - if (inputMonth == 1 && inputDay == 1) { - return (0); - } - } - /* Make year always a positive number. */ - if (inputYear < 0) { - year = inputYear + 4801; - } else { - year = inputYear + 4800; - } - - /* Adjust the start of the year. */ - if (inputMonth > 2) { - month = inputMonth - 3; - } else { - month = inputMonth + 9; - year--; - } - - return ((year * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + inputDay - - JULIAN_SDN_OFFSET); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/calendar/php_calendar.h b/ext/calendar/php_calendar.h deleted file mode 100644 index 73bc96aede6..00000000000 --- a/ext/calendar/php_calendar.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef PHP_CALENDAR_H -#define PHP_CALENDAR_H - -extern zend_module_entry calendar_module_entry; -#define calendar_module_ptr &calendar_module_entry - -/* Functions */ - -PHP_MINIT_FUNCTION(calendar); -PHP_RINIT_FUNCTION(calendar); -PHP_RSHUTDOWN_FUNCTION(calendar); -PHP_MINFO_FUNCTION(calendar); - -PHP_FUNCTION(jdtogregorian); -PHP_FUNCTION(gregoriantojd); -PHP_FUNCTION(jdtojulian); -PHP_FUNCTION(juliantojd); -PHP_FUNCTION(jdtojewish); -PHP_FUNCTION(jewishtojd); -PHP_FUNCTION(jdtofrench); -PHP_FUNCTION(frenchtojd); -PHP_FUNCTION(jddayofweek); -PHP_FUNCTION(jdmonthname); -PHP_FUNCTION(easter_days); -PHP_FUNCTION(easter_date); -PHP_FUNCTION(unixtojd); -PHP_FUNCTION(jdtounix); -PHP_FUNCTION(cal_from_jd); -PHP_FUNCTION(cal_to_jd); -PHP_FUNCTION(cal_days_in_month); -PHP_FUNCTION(cal_info); - -#define phpext_calendar_ptr calendar_module_ptr - -#endif diff --git a/ext/calendar/sdncal.h b/ext/calendar/sdncal.h deleted file mode 100644 index 6621d136823..00000000000 --- a/ext/calendar/sdncal.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef SDNCAL_H -#define SDNCAL_H -/* - * This code has been modified for use with PHP - * by Shane Caraveo shane@caraveo.com - * see below for more details - * - */ - -/* $selId: sdncal.h,v 2.0 1995/10/24 01:13:06 lees Exp $ - * Copyright 1993-1995, Scott E. Lee, all rights reserved. - * Permission granted to use, copy, modify, distribute and sell so long as - * the above copyright and this permission statement are retained in all - * copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK. - */ - -/************************************************************************** - * - * This package defines a set of routines that convert calendar dates to - * and from a serial day number (SDN). The SDN is a serial numbering of - * days where SDN 1 is November 25, 4714 BC in the Gregorian calendar and - * SDN 2447893 is January 1, 1990. This system of day numbering is - * sometimes referred to as Julian days, but to avoid confusion with the - * Julian calendar, it is referred to as serial day numbers here. The term - * Julian days is also used to mean the number of days since the beginning - * of the current year. - * - * The SDN can be used as an intermediate step in converting from one - * calendar system to another (such as Gregorian to Jewish). It can also - * be used for date computations such as easily comparing two dates, - * determining the day of the week, finding the date of yesterday or - * calculating the number of days between two dates. - * - * When using this software on 16 bit systems, be careful to store SDNs in - * a long int, because it will not fit in the 16 bits that some systems - * allocate to an int. - * - * For each calendar, there are two routines provided. One converts dates - * in that calendar to SDN and the other converts SDN to calendar dates. - * The routines are named SdnTo() and ToSdn(), where - * is the name of the calendar system. - * - * SDN values less than one are not supported. If a conversion routine - * returns an SDN of zero, this means that the date given is either invalid - * or is outside the supported range for that calendar. - * - * At least some validity checks are performed on input dates. For - * example, a negative month number will result in the return of zero for - * the SDN. A returned SDN greater than one does not necessarily mean that - * the input date was valid. To determine if the date is valid, convert it - * to SDN, and if the SDN is greater than zero, convert it back to a date - * and compare to the original. For example: - * - * int y1, m1, d1; - * int y2, m2, d2; - * long int sdn; - * ... - * sdn = GregorianToSdn(y1, m1, d1); - * if (sdn > 0) { - * SdnToGregorian(sdn, &y2, &m2, &d2); - * if (y1 == y2 && m1 == m2 && d1 == d2) { - * ... date is valid ... - * } - * } - * - **************************************************************************/ - -/* Gregorian calendar conversions. */ -void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int GregorianToSdn(int year, int month, int day); -extern char *MonthNameShort[13]; -extern char *MonthNameLong[13]; - -/* Julian calendar conversions. */ -void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JulianToSdn(int year, int month, int day); - -/* Jewish calendar conversions. */ -void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay); -long int JewishToSdn(int year, int month, int day); -extern char *JewishMonthName[14]; - -/* French republic calendar conversions. */ -void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay); -long int FrenchToSdn(int inputYear, int inputMonth, int inputDay); -extern char *FrenchMonthName[14]; - -/* Islamic calendar conversions. */ -/* Not implemented yet. */ - -/* Day of week conversion. 0=Sunday, 6=Saturday */ -int DayOfWeek(long int sdn); -extern char *DayNameShort[7]; -extern char *DayNameLong[7]; - -#endif /* SDNCAL_H */ diff --git a/ext/ccvs/CREDITS b/ext/ccvs/CREDITS deleted file mode 100644 index cc90a4653f2..00000000000 --- a/ext/ccvs/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ccvs -Brendan W. McAdams, Doug DeJulio diff --git a/ext/ccvs/TODO b/ext/ccvs/TODO deleted file mode 100644 index ffcd7af4b20..00000000000 --- a/ext/ccvs/TODO +++ /dev/null @@ -1,7 +0,0 @@ -CCVS Module ToDo List -08/14/2000 -Brendan W. McAdams -------------------------------------- -- Return value of the final stats of an authorization should already be split out into a php aware associative - array, instead of having to do this at the PHP level. Right now we are splitting stuff out using text_value; - I'm evaluating the merits of having a seperate function for the 'finishing' of a sale.... diff --git a/ext/ccvs/ccvs.c b/ext/ccvs/ccvs.c deleted file mode 100644 index 8f3ed09e5e1..00000000000 --- a/ext/ccvs/ccvs.c +++ /dev/null @@ -1,607 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Brendan W. McAdams | - | Doug DeJulio | - +----------------------------------------------------------------------+ - */ -/* -* cvvs.c $Revision$ - PHP4 Interface to the RedHat CCVS API -* ------- -* Interfaces RedHat's CCVS [Credit Card Verification System] -* This code is ported from an original php3 interface written by RedHat's Doug DeJulio -* The code was subsequently ported to the Zend API by Brendan W. McAdams -* ------- -*/ - -/* -* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams -* $Revision$ -*/ - -static char const cvsid[] = "$Id$"; - -#include -#include -#include -#include - - - /* - * Create the Zend Internal hash construct to track this modules functions - * - * In case anyone is wondering why we use ccvs_ instead of cv_, - * it's because we are directly importing functions of the actual CCVS, which uses functions that are - * cv_, and we had problems implementing ZEND_NAMED_FE calls (bug in NAMED_FE? investigate - * later). We don't want our PHP calls to conflict with the C calls in the CCVS API. - * - * BWM - 2000.07.27@16.41.EST - Added FALIAS Calls. While I'm of the opinion that naming the - * functions in PHP ccvs_ is much more readable and clear to anyone reading the code than - * cv_, It strikes me that many people coming from php3 -> php4 will need backwards - * compatibility. It was kind of careless to simply change the function calls (There were reasons other - * than readability behind this; the ZEND_NAMED_FE macro was misbehaving) and not provide for - * backwards compatibility - this *IS* an API and should scale with compatibility. - * - */ - - function_entry ccvs_functions[] = { - PHP_FE(ccvs_init, NULL) - PHP_FALIAS(cv_init, ccvs_init, NULL) - PHP_FE(ccvs_done, NULL) - PHP_FALIAS(cv_done, ccvs_done, NULL) - PHP_FE(ccvs_new, NULL) - PHP_FALIAS(cv_new, ccvs_new, NULL) - PHP_FE(ccvs_add, NULL) - PHP_FALIAS(cv_add, ccvs_add, NULL) - PHP_FE(ccvs_delete, NULL) - PHP_FALIAS(cv_delete, ccvs_delete, NULL) - PHP_FE(ccvs_auth, NULL) - PHP_FALIAS(cv_auth, ccvs_auth, NULL) - PHP_FE(ccvs_return, NULL) - PHP_FALIAS(cv_return, ccvs_return, NULL) - PHP_FE(ccvs_reverse, NULL) - PHP_FALIAS(cv_reverse, ccvs_reverse, NULL) - PHP_FE(ccvs_sale, NULL) - PHP_FALIAS(cv_sale, ccvs_sale, NULL) - PHP_FE(ccvs_void, NULL) - PHP_FALIAS(cv_void, ccvs_void, NULL) - PHP_FE(ccvs_status, NULL) - PHP_FALIAS(cv_status, ccvs_status, NULL) - PHP_FE(ccvs_count, NULL) - PHP_FALIAS(cv_count, ccvs_count, NULL) - PHP_FE(ccvs_lookup, NULL) - PHP_FALIAS(cv_lookup, ccvs_lookup, NULL) - PHP_FE(ccvs_report, NULL) - PHP_FALIAS(cv_report, ccvs_report, NULL) - PHP_FE(ccvs_command, NULL) - PHP_FALIAS(cv_command, ccvs_command, NULL) - PHP_FE(ccvs_textvalue, NULL) - PHP_FALIAS(cv_textvalue, ccvs_textvalue, NULL) - {NULL, NULL, NULL} - }; - -/* End function declarations */ - -/* Zend Engine Exports - module information */ - - /* Declare our module to the Zend engine */ - zend_module_entry ccvs_module_entry = { - STANDARD_MODULE_HEADER, - "CCVS", - ccvs_functions, - NULL, NULL, NULL, NULL, - PHP_MINFO(ccvs), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES - }; - -#ifdef COMPILE_DL_CCVS -ZEND_GET_MODULE(ccvs) -#endif - -/* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */ - -/* {{{ proto string ccvs_init(string name) - Initialize CCVS for use */ -PHP_FUNCTION(ccvs_init) /* cv_init() */ -{ - zval **name; - void *vsess; - char *p; - - if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &name) != SUCCESS)) - /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(name); - - vsess = cv_init(Z_STRVAL_PP(name)); - - /* - * -- In the case that we don't run error checking on the return value... -- - * On 32 bit systems a failure of the cv_init call returns 0,0,0,0 ; on 64 bit systems its 0,0,0,0,0,0,0,0 - * This unconsistent error (not to mention a string of comma seperated zeros in and of itself) is hard to - * Trap for in PHP (or any language). However, we can also grab cv_init to return CV_SESS_BAD on - * failure at the C API level, and return a set, fixed error code to the user which the user then knows to - * trap for... e.g. a NULL Value which PHP can then trap by: - * if (!($string = cv_init($config)) { or some such... - */ - - if (vsess == CV_SESS_BAD) /* if the cv_init() call failed... */ - { - - p = ""; /* set p, the value we will return, to NULL */ - - } - else /* we got a valid session returned, which means it worked */ - { - - p = hks_ptr_ptrtostring(vsess); /* Convert the (void*) into a string representation. */ - - } - - RETVAL_STRING(p, 1); - - free(p); - return; -} -/* }}} */ - -/* {{{ proto string ccvs_done(string sess) - Terminate CCVS engine and do cleanup work */ -PHP_FUNCTION(ccvs_done) /* cv_done() */ -{ - zval **sess; - void *vsess; - - if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &sess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(sess); - - /* Convert from the string representation back to a (void*) */ - vsess = hks_ptr_stringtoptr(Z_STRVAL_PP(sess)); - cv_done(vsess); - - RETURN_STRING("OK", 1); -} -/* }}} */ - -/* {{{ proto string ccvs_new(string session, string invoice) - Create a new, blank transaction */ -PHP_FUNCTION(ccvs_new) /* cv_new() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - if (!Z_STRVAL_PP(psess)) { - php_error(E_WARNING, "Invalid session to ccvs_new()"); - RETURN_FALSE; - } - - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - - r = cv_new(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_add(string session, string invoice, string argtype, string argval) - Add data to a transaction */ -PHP_FUNCTION(ccvs_add) /* cv_add() */ -{ - zval **psess; - zval **pinvoice; - zval **pargtype; - zval **pargval; - void *sess; - char *invoice; - int argtype; - char *argval; - register int r; - - if ((ZEND_NUM_ARGS() != 4) || (zend_get_parameters_ex(4, &psess, &pinvoice, &pargtype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - /* Get meaningful arguments. */ - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - convert_to_string_ex(pargtype); - convert_to_string_ex(pargval); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - invoice = Z_STRVAL_PP(pinvoice); - argtype = cv_str2arg(Z_STRVAL_PP(pargtype)); - argval = Z_STRVAL_PP(pargval); - - r = cv_add(sess, invoice, argtype, argval); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* -* cv_create can't be implemented because of vararg limits in PHP3's C API. -* (COMMENT BY DDJ [from original code]) -* -* BWM: I looked into this, checking in on what cv_create was; it is a deprecated function left in for -* backwards compatibility according -* to the CCVS C API ref. I didn't try to implement it for that reason. If anyone needs it, they can add it in -* themselves I'm sure. -*/ - -/* {{{ proto string ccvs_delete(string session, string invoice) - Delete a transaction */ -PHP_FUNCTION(ccvs_delete) /* cv_delete() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_delete(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_auth(string session, string invoice) - Perform credit authorization test on a transaction */ -PHP_FUNCTION(ccvs_auth) /* cv_auth() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_auth(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_return(string session, string invoice) - Transfer funds from the merchant to the credit card holder */ -PHP_FUNCTION(ccvs_return) /* cv_return() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_return(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_reverse(string session, string invoice) - Perform a full reversal on an already-processed authorization */ -PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_reverse(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_sale(string session, string invoice) - Transfer funds from the credit card holder to the merchant */ -PHP_FUNCTION(ccvs_sale) /* cv_sale() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_sale(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_void(string session, string invoice) - Perform a full reversal on a completed transaction */ -PHP_FUNCTION(ccvs_void) /* cv_void() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_void(sess, invoice); - - RETURN_STRING(cv_ret2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_status(string session, string invoice) - Check the status of an invoice */ -PHP_FUNCTION(ccvs_status) /* cv_status() */ -{ - zval **psess; - zval **pinvoice; - void *sess; - char *invoice; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(pinvoice); - invoice = Z_STRVAL_PP(pinvoice); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_status(sess, invoice); - - RETURN_STRING(cv_stat2str(r), 1); -} -/* }}} */ - -/* {{{ proto int ccvs_count(string session, string type) - Find out how many transactions of a given type are stored in the system */ -PHP_FUNCTION(ccvs_count) /* cv_count() */ -{ - zval **psess; - zval **ptype; - void *sess; - int type; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - convert_to_string_ex(ptype); - type = cv_str2stat(Z_STRVAL_PP(ptype)); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - r = cv_count(sess, type); - - RETURN_LONG(r); -} -/* }}} */ - -/* {{{ proto string ccvs_lookup(string session, string invoice, int inum) - Look up an item of a particular type in the database */ -PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */ -{ - zval **psess; - zval **ptype; - zval **pinum; - void *sess; - int type; - long inum; - register int r; - - if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pinum) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - convert_to_string_ex(ptype); - type = cv_str2stat(Z_STRVAL_PP(ptype)); - convert_to_long_ex(pinum); - inum = Z_LVAL_PP(pinum); - - r = cv_lookup(sess, type, inum); - - RETURN_STRING(cv_textvalue(sess), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_report(string session, string type) - Return the status of the background communication process */ -PHP_FUNCTION(ccvs_report) /* cv_report() */ -{ - zval **psess; - zval **ptype; - void *sess; - int type; - long inum; - register int r; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - convert_to_string_ex(ptype); - type = cv_str2rep(Z_STRVAL_PP(ptype)); - - r = cv_report(sess, type); - - RETURN_STRING(cv_stat2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_command(string session, string type, string argval) - Performs a command which is peculiar to a single protocol, and thus is not available in the general CCVS API */ -PHP_FUNCTION(ccvs_command) /* cv_command() */ -{ - zval **psess; - zval **ptype; - zval **pargval; - void *sess; - int type; - register int r; - char *argval; - - if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - convert_to_string_ex(ptype); - type = cv_str2cmd(Z_STRVAL_PP(ptype)); - convert_to_string_ex(pargval); - argval = Z_STRVAL_PP(pargval); - - r = cv_command(sess, type, argval); - - RETURN_STRING(cv_stat2str(r), 1); -} -/* }}} */ - -/* {{{ proto string ccvs_textvalue(string session) - Get text return value for previous function call */ -PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */ -{ - zval **psess; - void *sess; - - if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &psess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */ - { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(psess); - sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess)); - - RETURN_STRING(cv_textvalue(sess), 1); -} -/* }}} */ - -/* -* Our Info Function which reports info on this module out to PHP's phpinfo() function -* Brendan W. McAdams on 2000.07.26@16:22.EST -*/ - -PHP_MINFO_FUNCTION(ccvs) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "RedHat CCVS support", "enabled"); - php_info_print_table_row(2, "CCVS Support by", "Brendan W. McAdams <bmcadams@php.net>
& Doug DeJulio <ddj@redhat.com>"); - php_info_print_table_row(2, "Release ID", cvsid); - php_info_print_table_row(2, "This Release Certified For CCVS Versions", "3.0 and greater"); - php_info_print_table_end(); - - /* DISPLAY_INI_ENTRIES(); */ - - /* - * In the future, we will probably have entries in php.ini for runtime config, in which case we will - * Uncomment the DISPLAY_INI_ENTRIES call... - */ - -} - - -/* - * 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/ccvs/ccvs.h b/ext/ccvs/ccvs.h deleted file mode 100644 index e5d860b5393..00000000000 --- a/ext/ccvs/ccvs.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Brendan W. McAdams | - | Doug DeJulio | - +----------------------------------------------------------------------+ -*/ - - #include - - extern zend_module_entry ccvs_module_entry; - - #define ccvs_module_ptr &ccvs_module_entry - #define phpext_ccvs_ptr ccvs_module_ptr - - /* Declare functions not in cv_api.h but in libccvs.a. */ - char *hks_ptr_ptrtostring(void *vptr); - void *hks_ptr_stringtoptr(char *str); - - /* Declare the Functions this Module Makes Available to Zend */ - - - /* Pre-declarations of functions */ - PHP_FUNCTION(ccvs_init); - PHP_FUNCTION(ccvs_done); - PHP_FUNCTION(ccvs_new); - PHP_FUNCTION(ccvs_add); - PHP_FUNCTION(ccvs_delete); - PHP_FUNCTION(ccvs_auth); - PHP_FUNCTION(ccvs_return); - PHP_FUNCTION(ccvs_reverse); - PHP_FUNCTION(ccvs_sale); - PHP_FUNCTION(ccvs_void); - PHP_FUNCTION(ccvs_status); - PHP_FUNCTION(ccvs_count); - PHP_FUNCTION(ccvs_lookup); - PHP_FUNCTION(ccvs_report); - PHP_FUNCTION(ccvs_command); - PHP_FUNCTION(ccvs_textvalue); - PHP_MINFO_FUNCTION(ccvs); - - /* Declare the information we need to dynamically link this module later */ - #if COMPILE_DL - DLEXPORT zend_module_entry *get_module(void) { return &ccvs_module_entry; } - #endif - - /* End exports */ - diff --git a/ext/ccvs/config.m4 b/ext/ccvs/config.m4 deleted file mode 100644 index 5447a0d9637..00000000000 --- a/ext/ccvs/config.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(ccvs, for CCVS support, -[ --with-ccvs[=DIR] Include CCVS support]) - -if test "$PHP_CCVS" != "no"; then - if test -r $PHP_CCVS/include/cv_api.h; then - CCVS_DIR=$PHP_CCVS - else - for i in /usr /usr/local /usr/local/ccvs ; do - if test -r $i/include/cv_api.h; then - CCVS_DIR=$i - fi - done - fi - - if test -z "$CCVS_DIR"; then - AC_MSG_ERROR(not found. Please check your CCVS installation; cv_api.h should be in /include/) - fi - - PHP_ADD_INCLUDE($CCVS_DIR/include) - PHP_ADD_LIBRARY_WITH_PATH(ccvs, $CCVS_DIR/lib, CCVS_SHARED_LIBADD) - PHP_NEW_EXTENSION(ccvs, ccvs.c, $ext_shared) - PHP_SUBST(CCVS_SHARED_LIBADD) -fi diff --git a/ext/com/COM.c b/ext/com/COM.c deleted file mode 100644 index 854bd6be133..00000000000 --- a/ext/com/COM.c +++ /dev/null @@ -1,1852 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - | Harald Radi | - | Alan Brown | - +----------------------------------------------------------------------+ - */ - -/* - * This module implements support for COM components that support the IDispatch - * interface. Both local (COM) and remote (DCOM) components can be accessed. - * - * Type libraries can be loaded (in order for PHP to recognize automation constants) - * by specifying a typelib_file in the PHP .ini file. That file should contain - * paths to type libraries, one in every line. By default, constants are registered - * as case-sensitive. If you want them to be defined as case-insensitive, add - * #case_insensitive or #cis at the end of the type library path. - * - * This is also the first module to demonstrate Zend's OO syntax overloading - * capabilities. CORBA coders are invited to write a CORBA module as well! - * - * Zeev - */ - -/* - * 28.12.2000 - * unicode conversion fixed by Harald Radi - * - * now all these strange '?'s should be disapeared - */ - -/* - * 28.1.2001 - * VARIANT datatype and pass_by_reference support - */ - -/* - * 03.6.2001 - * Enhanced Typelib support to include a search by name - */ - -#ifdef PHP_WIN32 - -#define _WIN32_DCOM - -#include -#include - -#include "php.h" -#include "php_ini.h" - -#include "php_COM.h" -#include "php_VARIANT.h" - -static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC); -static int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC); -static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC); -static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, int cleanup TSRMLS_DC); -static void php_register_COM_class(TSRMLS_D); -static void php_COM_init(int module_number TSRMLS_DC); - -static int le_comval; -static int codepage; - -#ifdef _DEBUG -int resourcecounter = 1; -#endif - -function_entry COM_functions[] = { - PHP_FE(com_load, NULL) - PHP_FE(com_invoke, NULL) - PHP_FE(com_addref, NULL) - PHP_FE(com_release, NULL) - PHP_FE(com_propget, NULL) - PHP_FE(com_propput, NULL) - PHP_FE(com_load_typelib, NULL) - PHP_FE(com_isenum, NULL) - - PHP_FALIAS(com_get, com_propget, NULL) - PHP_FALIAS(com_propset, com_propput, NULL) - PHP_FALIAS(com_set, com_propput, NULL) - - { NULL, NULL, NULL } -}; - - -static PHP_MINFO_FUNCTION(COM) -{ - DISPLAY_INI_ENTRIES(); -} - - -PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC) -{ - HRESULT hr; - int failed = FALSE; - unsigned int ArgErr; - EXCEPINFO ExceptInfo; - - *ErrString = NULL; - /* @todo use DispInvoke here ? */ - if (C_ISREFD(obj)) { - if (C_HASTLIB(obj)) { - hr = C_TYPEINFO_VT(obj)->Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); - if (FAILED(hr)) { - hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); - if (SUCCEEDED(hr)) { - /* - * ITypLib doesn't work - * Release ITypeLib and fall back to IDispatch - */ - - C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj)); - C_HASTLIB(obj) = FALSE; - } - } - } else { - hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); - } - - if (FAILED(hr)) { - switch (hr) { - case DISP_E_EXCEPTION: { - int srclen=0; - char *src=estrdup(""); - int desclen=0; - char *desc=estrdup(""); - - if (ExceptInfo.bstrSource) - { - src = php_OLECHAR_to_char(ExceptInfo.bstrSource, &srclen, codepage TSRMLS_CC); - SysFreeString(ExceptInfo.bstrSource); - } - if (ExceptInfo.bstrDescription) - { - desc = php_OLECHAR_to_char(ExceptInfo.bstrDescription, &desclen, codepage TSRMLS_CC); - SysFreeString(ExceptInfo.bstrDescription); - } - - *ErrString = pemalloc(srclen+desclen+50, 1); - sprintf(*ErrString, "Source: %s Description: %s", src, desc); - efree(src); - efree(desc); - - if (ExceptInfo.bstrHelpFile) - { - SysFreeString(ExceptInfo.bstrHelpFile); - } - } - case DISP_E_PARAMNOTFOUND: - case DISP_E_TYPEMISMATCH: - *ErrString = pemalloc(25, 1); - sprintf(*ErrString, "Argument: %d", pDispParams->cArgs-ArgErr+1); - break; - } - } - - if (pVarResult && (V_VT(pVarResult) == VT_EMPTY)) { - V_VT(pVarResult) = VT_I4; - V_I4(pVarResult) = hr; - } - - return hr; - } else { - return DISP_E_UNKNOWNINTERFACE; - } -} - - -PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC) -{ - HRESULT hr; - - if (C_ISREFD(obj)) { - if (C_HASTLIB(obj)) { - hr = C_TYPEINFO_VT(obj)->GetIDsOfNames(C_TYPEINFO(obj), rgszNames, 1, rgDispId); - - if (FAILED(hr)) { - hr = C_DISPATCH_VT(obj)->GetIDsOfNames(C_DISPATCH(obj), &IID_NULL, rgszNames, 1, LOCALE_SYSTEM_DEFAULT, rgDispId); - - if (SUCCEEDED(hr)) { - /* - * ITypLib doesn't work - * Release ITypeLib and fall back to IDispatch - */ - - C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj)); - C_HASTLIB(obj) = FALSE; - } - } - } else { - hr = C_DISPATCH_VT(obj)->GetIDsOfNames(C_DISPATCH(obj), &IID_NULL, rgszNames, 1, LOCALE_SYSTEM_DEFAULT, rgDispId); - } - - return hr; - } else { - return DISP_E_UNKNOWNINTERFACE; - } -} - - -PHPAPI HRESULT php_COM_release(comval *obj TSRMLS_DC) -{ - HRESULT hr; - - if (obj->refcount > 1) { - C_RELEASE(obj); - } else if (obj->refcount == 1) { - if (C_HASTLIB(obj)) { - C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj)); - } - if (C_HASENUM(obj)) { - hr = C_ENUMVARIANT_VT(obj)->Release(C_ENUMVARIANT(obj)); - } - hr = C_DISPATCH_VT(obj)->Release(C_DISPATCH(obj)); - C_RELEASE(obj); - } - - return obj->refcount; -} - - -PHPAPI HRESULT php_COM_addref(comval *obj TSRMLS_DC) -{ - if (C_ISREFD(obj)) { - C_ADDREF(obj); - } - - return obj->refcount; -} - - -PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* ppDisp, int cleanup TSRMLS_DC) -{ - HRESULT hr = 1; - DISPPARAMS dispparams; - VARIANT *var_result; - IDispatch FAR* pDisp; - - pDisp = *ppDisp; - if (cleanup) { - *ppDisp = NULL; - } - - C_REFCOUNT(obj) = 1; - C_DISPATCH(obj) = pDisp; - C_HASTLIB(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, LANG_NEUTRAL, &C_TYPEINFO(obj))); - - dispparams.rgvarg = NULL; - dispparams.rgdispidNamedArgs = NULL; - dispparams.cArgs = 0; - dispparams.cNamedArgs = 0; - - ALLOC_VARIANT(var_result); - - if (C_HASENUM(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), DISPID_NEWENUM, &IID_NULL, LOCALE_SYSTEM_DEFAULT, - DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, var_result, NULL, NULL))) { - if (V_VT(var_result) == VT_UNKNOWN) { - C_HASENUM(obj) = SUCCEEDED(V_UNKNOWN(var_result)->lpVtbl->QueryInterface(V_UNKNOWN(var_result), &IID_IEnumVARIANT, - (void**)&C_ENUMVARIANT(obj))); - } else if (V_VT(var_result) == VT_DISPATCH) { - C_HASENUM(obj) = SUCCEEDED(V_DISPATCH(var_result)->lpVtbl->QueryInterface(V_DISPATCH(var_result), &IID_IEnumVARIANT, - (void**)&C_ENUMVARIANT(obj))); - } - } - - FREE_VARIANT(var_result); - - if (!cleanup) { - hr = C_DISPATCH_VT(obj)->AddRef(C_DISPATCH(obj)); - } - -#ifdef _DEBUG - obj->resourceindex = resourcecounter++; -#endif - - return hr; -} - - -PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup TSRMLS_DC) -{ - HRESULT hr; - - C_HASTLIB(obj) = C_HASTLIB(clone); - C_HASENUM(obj) = C_HASENUM(obj); - C_DISPATCH(obj) = C_DISPATCH(clone); - C_TYPEINFO(obj) = C_TYPEINFO(clone); - - if (cleanup || !C_ISREFD(obj)) { - obj->refcount = clone->refcount; - clone->refcount = 0; - } else { - if (C_HASTLIB(obj)) { - C_TYPEINFO_VT(obj)->AddRef(C_TYPEINFO(obj)); - } - if (C_HASENUM(obj)) { - C_ENUMVARIANT_VT(obj)->AddRef(C_ENUMVARIANT(obj)); - } - hr = C_DISPATCH_VT(obj)->AddRef(C_DISPATCH(obj)); - obj->refcount = 1; - } - -#ifdef _DEBUG - obj->resourceindex = resourcecounter++; -#endif - - return hr; -} - - -PHPAPI char *php_COM_error_message(HRESULT hr TSRMLS_DC) -{ - void *pMsgBuf; - - if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, - hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pMsgBuf, 0, NULL)) { - char error_string[] = "No description available"; - - pMsgBuf = LocalAlloc(LMEM_FIXED, sizeof(error_string)); - memcpy(pMsgBuf, error_string, sizeof(error_string)); - } - - return pMsgBuf; -} - - -static char *php_string_from_clsid(const CLSID *clsid TSRMLS_DC) -{ - LPOLESTR ole_clsid; - char *clsid_str; - - StringFromCLSID(clsid, &ole_clsid); - clsid_str = php_OLECHAR_to_char(ole_clsid, NULL, codepage TSRMLS_CC); - LocalFree(ole_clsid); - - return clsid_str; -} - - -PHPAPI HRESULT php_COM_destruct(comval *obj TSRMLS_DC) -{ - HRESULT hr = S_OK; - - if (C_ISREFD(obj)) { - C_REFCOUNT(obj) = 1; - hr = php_COM_release(obj TSRMLS_CC); - } - efree(obj); - - return hr; -} - - -static void php_comval_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_COM_destruct(rsrc->ptr TSRMLS_CC); -} - - -static PHP_INI_MH(OnTypelibFileChange) -{ - FILE *typelib_file; - char *typelib_name_buffer; - char *strtok_buf = NULL; - int interactive; - interactive = CG(interactive); - - if (!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) { - return FAILURE; - } - - if (interactive) { - printf("Loading type libraries..."); - fflush(stdout); - } - - typelib_name_buffer = (char *) emalloc(sizeof(char)*1024); - - while (fgets(typelib_name_buffer, 1024, typelib_file)) { - ITypeLib *pTL; - char *typelib_name; - char *modifier, *ptr; - int mode = CONST_CS | CONST_PERSISTENT; /* CONST_PERSISTENT is ok here */ - - if (typelib_name_buffer[0]==';') { - continue; - } - typelib_name = php_strtok_r(typelib_name_buffer, "\r\n", &strtok_buf); /* get rid of newlines */ - if (typelib_name == NULL) { - continue; - } - typelib_name = php_strtok_r(typelib_name, "#", &strtok_buf); - modifier = php_strtok_r(NULL, "#", &strtok_buf); - if (modifier != NULL) { - if (!strcmp(modifier, "cis") || !strcmp(modifier, "case_insensitive")) { - mode &= ~CONST_CS; - } - } - - /* Remove leading/training white spaces on search_string */ - while (isspace(*typelib_name)) {/* Ends on '\0' in worst case */ - typelib_name ++; - } - ptr = typelib_name + strlen(typelib_name) - 1; - while ((ptr != typelib_name) && isspace(*ptr)) { - *ptr = '\0'; - ptr--; - } - - if (interactive) { - printf("\rLoading %-60s\r", typelib_name); - } - - if ((pTL = php_COM_find_typelib(typelib_name, mode TSRMLS_CC)) != NULL) { - php_COM_load_typelib(pTL, mode TSRMLS_CC); - pTL->lpVtbl->Release(pTL); - } - } - - efree(typelib_name_buffer); - fclose(typelib_file); - - if (interactive) { - printf("\r%70s\r", ""); - } - - return SUCCESS; -} - - -PHP_INI_BEGIN() -PHP_INI_ENTRY_EX("com.allow_dcom", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) -PHP_INI_ENTRY_EX("com.autoregister_typelib", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) -PHP_INI_ENTRY_EX("com.autoregister_verbose", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) -PHP_INI_ENTRY_EX("com.autoregister_casesensitive", "1", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) -PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypelibFileChange) -PHP_INI_END() - - -/* {{{ proto int com_load(string module_name [, string remote_host [, int codepage [, string typelib]]]) - Loads a COM module */ -PHP_FUNCTION(com_load) -{ - pval *module_name, *code_page, *typelib = NULL, *server_name = NULL, *user_name=NULL, *password=NULL, *domain=NULL; - CLSID clsid; - HRESULT hr; - OLECHAR *ProgID; - comval *obj; - char *error_message; - char *clsid_str; - int mode = 0; - ITypeLib *pTL; - CLSCTX flags = CLSCTX_SERVER; - - codepage = CP_ACP; - - switch (ZEND_NUM_ARGS()) { - case 1: - zend_get_parameters(ht, 1, &module_name); - break; - - case 2: - zend_get_parameters(ht, 2, &module_name, &server_name); - break; - - case 3: - zend_get_parameters(ht, 3, &module_name, &server_name, &code_page); - - convert_to_long_ex(&code_page); - codepage = Z_LVAL_P(code_page); - break; - - case 4: - zend_get_parameters(ht, 4, &module_name, &server_name, &code_page, &typelib); - - convert_to_string_ex(&typelib); - convert_to_long_ex(&code_page); - codepage = Z_LVAL_P(code_page); - - break; - - default: - ZEND_WRONG_PARAM_COUNT(); - } - - if (server_name != NULL) { - /* if a server is passed, one obviously wants to instanciate a - * remote server - */ - flags = CLSCTX_REMOTE_SERVER; - - /* What is server name? A String or an array? */ - - if (Z_TYPE_P(server_name) == IS_ARRAY) { - pval **tmp; - /* DAB: 22 Sept 2001 */ - /* Aha - we have a number of possible */ - /* arguments. They are in the hash */ - /* By name: Server, Domain, Username, Password */ - /* Flags. */ - /* This has been crafted to maintian maximum backward */ - /* compatability, If the server name is specified as a */ - /* string, then the function shoule behave as before */ - /* by defaulting username and password and using the */ - /* (I believe) incorrect CLSCTX_SERVER instantiation */ - /* paramter. However if server is specified in this array */ - /* then we use either CLSCTX_REMOTE_SERVER or whatever */ - /* flags are specified in the array */ - HashTable *ht = Z_ARRVAL(*server_name); - if (FAILURE == zend_hash_find(ht, "Server", 7, (void **) &tmp)) { - server_name = NULL; - } else { - server_name = *tmp; - convert_to_string_ex(&server_name); - /* CLSCTX_SERVER includes INPROC and LOCAL */ - /* SERVER. This means that any local server */ - /* will be instantiated BEFORE even looking */ - /* on a remote server. Thus if we have a */ - /* server name, probably we want to access */ - /* a remote machine or we would not have */ - /* bothered specifying it. So it would be */ - /* wrong to to connect locally. Futher, */ - /* unless the name passed is a GUID, there has */ - /* to be something to map the Prog.Id to GUID */ - /* and unless that has been modified to remove */ - /* the information about local instantiation */ - /* CLSCTX_SERVER would force a local instantiation */ - /* This setting can be overridden below if the user */ - /* specifies a flags element */ - flags = CLSCTX_REMOTE_SERVER; - } - if (FAILURE == zend_hash_find(ht, "Username", 9, (void **) &tmp)) { - user_name = NULL; - } else { - user_name = *tmp; - convert_to_string_ex(&user_name); - } - if (FAILURE == zend_hash_find(ht, "Domain", 7, (void **) &tmp)) { - domain = NULL; - } else { - domain = *tmp; - convert_to_string_ex(&domain); - } - if (FAILURE == zend_hash_find(ht, "Password", 9, (void **) &tmp)) { - password=NULL; - } else { - password = *tmp; - convert_to_string_ex(&password); - } - if (SUCCESS == zend_hash_find(ht, "Flags", 6, (void **) &tmp)) { - convert_to_long_ex(tmp); - flags = (CLSCTX) Z_LVAL_PP(tmp); - } - } - if (Z_TYPE_P(server_name) == IS_NULL) { - server_name = NULL; - } else { - if (!INI_INT("com.allow_dcom")) { - php_error(E_WARNING, "DCOM is disabled"); - RETURN_FALSE; - } else { - convert_to_string_ex(&server_name); - } - } - } - - ALLOC_COM(obj); - convert_to_string_ex(&module_name); - ProgID = php_char_to_OLECHAR(Z_STRVAL_P(module_name), Z_STRLEN_P(module_name), codepage TSRMLS_CC); - - /* obtain CLSID */ - if (FAILED(CLSIDFromString(ProgID, &clsid))) { - /* Perhaps this is a Moniker? */ - IBindCtx *pBindCtx; - IMoniker *pMoniker; - ULONG ulEaten; - - /* @todo if (server_name) */ - - if (!server_name) { - /* @todo shouldn't the bind context be fetched on module startup and kept as a global shared instance ? - * all calls to BindToObject would deliver the same instance then (as desired) - * IBindCtx::RegisterObjectBound() should be called then after mkparsedisplayname() - * - * @todo use mkparsedisplaynameex() ? - */ - if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) { - if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) { - hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj)); - pMoniker->lpVtbl->Release(pMoniker); - } - pBindCtx->lpVtbl->Release(pBindCtx); - } - } else { - hr = MK_E_SYNTAX; - } - - efree(ProgID); - - if (FAILED(hr)) { - php_COM_destruct(obj TSRMLS_CC); - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Invalid ProgID, GUID string, or Moniker: %s", error_message); - LocalFree(error_message); - RETURN_FALSE; - } - } else { - efree(ProgID); - /* obtain IDispatch */ - if (!server_name) { - hr = CoCreateInstance(&clsid, NULL, flags, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj)); - } else { - COSERVERINFO server_info; - MULTI_QI pResults; - COAUTHIDENTITY authid; - COAUTHINFO authinfo = {RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, &authid, EOAC_NONE}; - - server_info.dwReserved1=0; - server_info.dwReserved2=0; - server_info.pwszName = php_char_to_OLECHAR(Z_STRVAL_P(server_name), Z_STRLEN_P(server_name), codepage TSRMLS_CC); - if (user_name) { - /* Z_STRVAL_P(user_name); */ - /* Parse Username into domain\username */ - authid.User = (WCHAR *) Z_STRVAL_P(user_name); - authid.UserLength = Z_STRLEN_P(user_name); - if (password) { - authid.Password = (USHORT *) Z_STRVAL_P(password); - authid.PasswordLength = Z_STRLEN_P(password); - } else { - authid.Password = (USHORT *) ""; - authid.PasswordLength = 0; - } - if (domain) { - authid.Domain = (USHORT *) Z_STRVAL_P(domain); - authid.DomainLength = Z_STRLEN_P(domain); - } else { - authid.Domain = (USHORT *) ""; - authid.DomainLength = 0; - } - authid.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; - - server_info.pAuthInfo=&authinfo; - } else { - server_info.pAuthInfo=NULL; - } - - pResults.pIID = &IID_IDispatch; - pResults.pItf = NULL; - pResults.hr = S_OK; - hr=CoCreateInstanceEx(&clsid, NULL, flags, &server_info, 1, &pResults); - if (SUCCEEDED(hr)) { - hr = pResults.hr; - C_DISPATCH(obj) = (IDispatch *) pResults.pItf; - } - efree(server_info.pwszName); - } - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - clsid_str = php_string_from_clsid(&clsid TSRMLS_CC); - php_error(E_WARNING,"Unable to obtain IDispatch interface for CLSID %s: %s",clsid_str,error_message); - LocalFree(error_message); - efree(clsid_str); - php_COM_destruct(obj TSRMLS_CC); - RETURN_FALSE; - } - } - - php_COM_set(obj, &C_DISPATCH(obj), TRUE TSRMLS_CC); - - if (INI_INT("com.autoregister_casesensitive")) { - mode |= CONST_CS; - } - - if (C_HASTLIB(obj)) { - if (INI_INT("com.autoregister_typelib")) { - unsigned int idx; - - /* @todo check if typlib isn't already loaded */ - if (C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &pTL, &idx) == S_OK) { - php_COM_load_typelib(pTL, mode TSRMLS_CC); - pTL->lpVtbl->Release(pTL); - } - } - } else { - if (typelib != NULL) { - ITypeLib *pTL; - - if ((pTL = php_COM_find_typelib(Z_STRVAL_P(typelib), mode TSRMLS_CC)) != NULL) { - C_HASTLIB(obj) = SUCCEEDED(pTL->lpVtbl->GetTypeInfo(pTL, 0, &C_TYPEINFO(obj))); - /* idx 0 should deliver the ITypeInfo for the IDispatch Interface */ - if (INI_INT("com.autoregister_typelib")) { - php_COM_load_typelib(pTL, mode TSRMLS_CC); - } - pTL->lpVtbl->Release(pTL); - } - } - } - - RETURN_LONG(zend_list_insert(obj, IS_COM)); -} -/* }}} */ - - -int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval **arguments, int arg_count TSRMLS_DC) -{ - DISPID dispid; - DISPPARAMS dispparams; - HRESULT hr; - OLECHAR *funcname; - SAFEARRAY *pSA; - SAFEARRAYBOUND rgsabound[1]; - VARIANT *variant_args; - char *error_message; - int current_arg, current_variant; - unsigned long count; - - if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "next")) { - /* Grab one argument off the stack, allocate enough - * VARIANTs - * Get the IEnumVariant interface and call ->Next(); - */ - - switch (arg_count) { - case 0: - count = 1; - break; - - case 1: - convert_to_long_ex(&arguments[0]); - count = Z_LVAL_P(arguments[0]); - break; - - default: - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Next()"); - - return FAILURE; - } - - rgsabound[0].lLbound = 0; - rgsabound[0].cElements = count; - - if ((pSA = SafeArrayCreate(VT_VARIANT, 1, rgsabound)) == NULL) { - VariantInit(var_result); - return FAILURE; - } else { - V_ARRAY(var_result) = pSA; - V_VT(var_result) = VT_VARIANT|VT_ARRAY; - } - - if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Next(C_ENUMVARIANT(obj), count, pSA->pvData, &count))) { - char *error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message); - efree(error_message); - VariantClear(var_result); - return FAILURE; - } - - if (count != rgsabound[0].cElements) { - rgsabound[0].cElements = count; - if (FAILED(SafeArrayRedim(pSA, rgsabound))) { - char *error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message); - efree(error_message); - VariantClear(var_result); - return FAILURE; - } - } - - /* return a single element if next() was called without count */ - if ((arg_count == 0) && (count == 1)) { - long index[] = {0}; - - SafeArrayGetElement(pSA, index, var_result); - SafeArrayDestroy(pSA); - } - - return SUCCESS; - } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "all")) { -#define FETCH_BLOCKSIZE 10 /* fetch blocks of 10 elements */ - - count = FETCH_BLOCKSIZE; - - rgsabound[0].lLbound = 0; - rgsabound[0].cElements = count; - - if ((pSA = SafeArrayCreate(VT_VARIANT, 1, rgsabound)) == NULL) { - VariantInit(var_result); - return FAILURE; - } else { - V_ARRAY(var_result) = pSA; - V_VT(var_result) = VT_VARIANT|VT_ARRAY; - } - - /* blah*/ - - - } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "reset")) { - if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Reset(C_ENUMVARIANT(obj)))) { - char *error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message); - efree(error_message); - return FAILURE; - } - return SUCCESS; - } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "skip")) { - unsigned long count; - - switch (arg_count) { - case 0: - count = 1; - break; - - case 1: - convert_to_long_ex(&arguments[0]); - count = Z_LVAL_P(arguments[0]); - break; - - default: - php_error(E_WARNING,"Wrong argument count to IEnumVariant::Skip()"); - return FAILURE; - } - if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Skip(C_ENUMVARIANT(obj), count))) { - char *error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message); - efree(error_message); - return FAILURE; - } - return SUCCESS; - - } else { - char *ErrString; - - funcname = php_char_to_OLECHAR(Z_STRVAL_P(function_name), Z_STRLEN_P(function_name), codepage TSRMLS_CC); - - hr = php_COM_get_ids_of_names(obj, &funcname, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Unable to lookup %s: %s", Z_STRVAL_P(function_name), error_message); - LocalFree(error_message); - efree(funcname); - return FAILURE; - } - - variant_args = (VARIANT *) emalloc(sizeof(VARIANT) * arg_count); - - for (current_arg=0; current_argIDispatch */ - VariantClear(&variant_args[current_arg]); - } - } - efree(variant_args); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - if (ErrString) { - php_error(E_WARNING,"Invoke() failed: %s %s", error_message, ErrString); - pefree(ErrString, 1); - } else { - php_error(E_WARNING,"Invoke() failed: %s", error_message); - } - LocalFree(error_message); - return FAILURE; - } - } - return SUCCESS; -} - - -/* {{{ proto mixed com_invoke(int module, string handler_name [, mixed arg [, mixed ...]]) - Invokes a COM module */ -PHP_FUNCTION(com_invoke) -{ - pval **arguments; - pval *object, *function_name; - comval *obj; - int type; - int arg_count = ZEND_NUM_ARGS(); - VARIANT *var_result; - - if (arg_count<2) { - ZEND_WRONG_PARAM_COUNT(); - } - arguments = (pval **) emalloc(sizeof(pval *)*arg_count); - if (zend_get_parameters_array(ht, arg_count, arguments) == FAILURE) { - RETURN_FALSE; - } - - object = arguments[0]; - function_name = arguments[1]; - - /* obtain IDispatch interface */ - convert_to_long(object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_STRVAL_P(function_name)); - RETURN_FALSE; - } - - /* obtain property/method handler */ - convert_to_string_ex(&function_name); - - ALLOC_VARIANT(var_result); - - if (do_COM_invoke(obj, function_name, var_result, arguments+2, arg_count-2 TSRMLS_CC)==FAILURE) { - FREE_VARIANT(var_result); - efree(arguments); - - RETURN_FALSE; - } - - RETVAL_VARIANT(var_result); - - efree(arguments); -} -/* }}} */ - - -/* {{{ proto mixed com_release(int module) - Releases a COM object */ -PHP_FUNCTION(com_release) -{ - pval *object; - comval *obj; - int type; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count != 1) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (zend_get_parameters(ht, 1, &object)==FAILURE) { - RETURN_FALSE; - } - - /* obtain IDispatch interface */ - convert_to_long_ex(&object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler"); - RETURN_FALSE; - } - - RETURN_LONG(php_COM_release(obj TSRMLS_CC)) -} -/* }}} */ - - -/* {{{ proto mixed com_addref(int module) - Increases the reference counter on a COM object */ -PHP_FUNCTION(com_addref) -{ - pval *object; - comval *obj; - int type; - int arg_count = ZEND_NUM_ARGS(); - - if (arg_count != 1) { - ZEND_WRONG_PARAM_COUNT(); - } - - if (zend_get_parameters(ht, 1, &object)==FAILURE) { - RETURN_FALSE; - } - - /* obtain IDispatch interface */ - convert_to_long_ex(&object); - obj = (comval *)zend_list_find(Z_LVAL_P(object), &type); - if (!obj || (type != IS_COM)) - { - php_error(E_WARNING,"%d is not a COM object handler"); - RETURN_FALSE; - } - - RETURN_LONG(php_COM_addref(obj TSRMLS_CC)); -} -/* }}} */ - - -static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC) -{ - pval function_name; - int retval; - - ZVAL_STRINGL(&function_name, "Item", 4, 0); - retval = do_COM_invoke(array, &function_name, result, &property, 1 TSRMLS_CC); - if (cleanup) { - php_COM_destruct(array TSRMLS_CC); - } - - return retval; -} - - -static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, int cleanup TSRMLS_DC) -{ - DISPID dispid; - HRESULT hr; - OLECHAR *propname; - char *error_message; - DISPPARAMS dispparams; - char *ErrString; - - /* obtain property handler */ - propname = php_char_to_OLECHAR(Z_STRVAL_P(arg_property), Z_STRLEN_P(arg_property), codepage TSRMLS_CC); - - hr = php_COM_get_ids_of_names(obj, &propname, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Unable to lookup %s: %s", Z_STRVAL_P(arg_property), error_message); - LocalFree(error_message); - efree(propname); - if (cleanup) { - php_COM_destruct(obj TSRMLS_CC); - } - return FAILURE; - } - - dispparams.cArgs = 0; - dispparams.cNamedArgs = 0; - - hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - if (ErrString) { - php_error(E_WARNING,"PropGet() failed: %s %s", error_message, ErrString); - pefree(ErrString, 1); - } else { - php_error(E_WARNING,"PropGet() failed: %s", error_message); - } - LocalFree(error_message); - efree(propname); - if (cleanup) { - php_COM_destruct(obj TSRMLS_CC); - } - return FAILURE; - } - - efree(propname); - if (cleanup) { - php_COM_destruct(obj TSRMLS_CC); - } - return SUCCESS; -} - - -static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, pval *value TSRMLS_DC) -{ - DISPID dispid; - HRESULT hr; - OLECHAR *propname; - char *error_message; - VARIANT *var_result, *new_value; - DISPPARAMS dispparams; - DISPID mydispid = DISPID_PROPERTYPUT; - char *ErrString; - - ALLOC_VARIANT(var_result); - ALLOC_VARIANT(new_value); - - /* obtain property handler */ - propname = php_char_to_OLECHAR(Z_STRVAL_P(arg_property), Z_STRLEN_P(arg_property), codepage TSRMLS_CC); - - hr = php_COM_get_ids_of_names(obj, &propname, &dispid TSRMLS_CC); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Unable to lookup %s: %s", Z_STRVAL_P(arg_property), error_message); - LocalFree(error_message); - efree(propname); - - FREE_VARIANT(var_result); - FREE_VARIANT(new_value); - - RETURN_FALSE; - } - - php_pval_to_variant(value, new_value, codepage TSRMLS_CC); - dispparams.rgvarg = new_value; - dispparams.rgdispidNamedArgs = &mydispid; - dispparams.cArgs = 1; - dispparams.cNamedArgs = 1; - - hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYPUT, &dispparams, NULL, &ErrString TSRMLS_CC); - - if (FAILED(hr)) { - error_message = php_COM_error_message(hr TSRMLS_CC); - if (ErrString) { - php_error(E_WARNING,"PropPut() failed: %s %s", error_message, ErrString); - pefree(ErrString, 1); - } else { - php_error(E_WARNING,"PropPut() failed: %s", error_message); - } - LocalFree(error_message); - efree(propname); - - FREE_VARIANT(var_result); - FREE_VARIANT(new_value); - - RETURN_FALSE; - } - - dispparams.cArgs = 0; - dispparams.cNamedArgs = 0; - - hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC); - - if (SUCCEEDED(hr)) { - php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC); - } else { - *return_value = *value; - zval_copy_ctor(return_value); - } - - if (ErrString) { - pefree(ErrString, 1); - } - - FREE_VARIANT(var_result); - FREE_VARIANT(new_value); - - efree(propname); -} - - -/* {{{ proto mixed com_propget(int module, string property_name) - Gets properties from a COM module */ -PHP_FUNCTION(com_propget) -{ - pval *arg_comval, *arg_property; - int type; - comval *obj; - VARIANT *var_result; - - if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters(ht, 2, &arg_comval, &arg_property) == FAILURE)) { - ZEND_WRONG_PARAM_COUNT(); - } - - /* obtain IDispatch interface */ - convert_to_long(arg_comval); - obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); - RETURN_FALSE; - } - convert_to_string_ex(&arg_property); - - ALLOC_VARIANT(var_result); - - if (do_COM_propget(var_result, obj, arg_property, FALSE TSRMLS_CC) == FAILURE) { - FREE_VARIANT(var_result); - RETURN_FALSE; - } - - RETVAL_VARIANT(var_result); -} -/* }}} */ - - -/* {{{ proto bool com_propput(int module, string property_name, mixed value) - Puts the properties for a module */ -PHP_FUNCTION(com_propput) -{ - pval *arg_comval, *arg_property, *arg_value; - int type; - comval *obj; - - if (ZEND_NUM_ARGS()!=3 || zend_get_parameters(ht, 3, &arg_comval, &arg_property, &arg_value)==FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - /* obtain comval interface */ - convert_to_long(arg_comval); - /* obtain comval interface */ - obj = (comval *)zend_list_find(Z_LVAL_P(arg_comval), &type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING,"%d is not a COM object handler", Z_LVAL_P(arg_comval)); - RETURN_FALSE; - } - convert_to_string_ex(&arg_property); - - do_COM_propput(return_value, obj, arg_property, arg_value TSRMLS_CC); -} -/* }}} */ - - -/* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive]) - Loads a Typelib */ -PHP_FUNCTION(com_load_typelib) -{ - pval *arg_typelib, *arg_cis; - ITypeLib *pTL; - int mode = CONST_CS; - - switch (ZEND_NUM_ARGS()) { - case 1: - zend_get_parameters(ht, 1, &arg_typelib); - break; - - case 2: - zend_get_parameters(ht, 2, &arg_typelib, &arg_cis); - convert_to_boolean_ex(&arg_cis); - if (Z_LVAL_P(arg_cis)) { - mode &= ~CONST_CS; - } - break; - - default: - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(&arg_typelib); - pTL = php_COM_find_typelib(Z_STRVAL_P(arg_typelib), mode TSRMLS_CC); - if (php_COM_load_typelib(pTL, mode TSRMLS_CC) == SUCCESS) { - pTL->lpVtbl->Release(pTL); - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - - -PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference) -{ - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - pval return_value; - pval **comval_handle; - pval *object = property_reference->object; - int type; - comval *obj, *obj_prop; - VARIANT *var_result; - TSRMLS_FETCH(); - - INIT_ZVAL(return_value); - ZVAL_NULL(&return_value); - - /* fetch the IDispatch interface */ - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); - obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type); - if (!obj || (type != IS_COM)) { - return return_value; - } - - ALLOC_COM(obj_prop); - ALLOC_VARIANT(var_result); - - for (element=property_reference->elements_list->head; element; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return return_value; - } - break; - - case OE_IS_OBJECT: - if (do_COM_propget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return return_value; - } - break; - - case OE_IS_METHOD: { - FREE_VARIANT(var_result); - if (obj != obj_prop) { - FREE_COM(obj_prop); - - return_value = *object; - ZVAL_ADDREF(&return_value); - } else { - RETVAL_COM(obj); - } - return return_value; - } - break; - } - - if (V_VT(var_result) == VT_DISPATCH) { - if (V_DISPATCH(var_result) == NULL) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return return_value; - } - - obj = obj_prop; - php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC); - } else { - php_variant_to_pval(var_result, &return_value, codepage TSRMLS_CC); - - FREE_COM(obj_prop); - obj_prop = NULL; - } - - VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed - pval_destructor(&overloaded_property->element); - } - - if (obj_prop != NULL) { - RETVAL_COM(obj); - } - - - FREE_VARIANT(var_result); - - return return_value; -} - - -PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value) -{ - pval result; - zend_overloaded_element *overloaded_property; - zend_llist_element *element; - pval **comval_handle; - pval *object = property_reference->object; - comval *obj, *obj_prop; - int type; - VARIANT *var_result; - TSRMLS_FETCH(); - - /* fetch the IDispatch interface */ - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); - obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); - if (!obj || (type != IS_COM)) { - return FAILURE; - } - - ALLOC_COM(obj_prop); - ALLOC_VARIANT(var_result); - - for (element=property_reference->elements_list->head; element != property_reference->elements_list->tail; element=element->next) { - overloaded_property = (zend_overloaded_element *) element->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return FAILURE; - } - break; - - case OE_IS_OBJECT: - if (do_COM_propget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return FAILURE; - } - break; - - case OE_IS_METHOD: - /* this shouldn't happen */ - return FAILURE; - break; - } - - if (V_VT(var_result) == VT_DISPATCH) { - if (V_DISPATCH(var_result) == NULL) { - FREE_VARIANT(var_result); - FREE_COM(obj_prop); - - return FAILURE; - } - - obj = obj_prop; - php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC); - } else { - FREE_COM(obj_prop); - FREE_VARIANT(var_result); - - return FAILURE; - } - - VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed - pval_destructor(&overloaded_property->element); - } - FREE_VARIANT(var_result); - - overloaded_property = (zend_overloaded_element *) element->data; - do_COM_propput(&result, obj, &overloaded_property->element, value TSRMLS_CC); - FREE_COM(obj_prop); - - pval_destructor(&overloaded_property->element); - - return SUCCESS; -} - - -PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) -{ - pval property, **handle; - pval *object = property_reference->object; - zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data; - comval *obj; - int type; - - if (zend_llist_count(property_reference->elements_list)==1 - && !strcmp(Z_STRVAL(function_name->element), "com")) { - /* constructor */ - pval *object_handle; - - PHP_FN(com_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (!zend_is_true(return_value)) { - ZVAL_FALSE(object); - return; - } - ALLOC_ZVAL(object_handle); - *object_handle = *return_value; - pval_copy_constructor(object_handle); - INIT_PZVAL(object_handle); - zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); - pval_destructor(&function_name->element); - - return; - } - - property = php_COM_get_property_handler(property_reference); - if (Z_TYPE(property) == IS_NULL) { - if (property.refcount == 1) { - pval_destructor(&property); - } - pval_destructor(&function_name->element); - return; - } - zend_hash_index_find(Z_OBJPROP(property), 0, (void **) &handle); - obj = (comval *)zend_list_find(Z_LVAL_PP(handle), &type); - - if (!obj || (type != IS_COM)) { - pval_destructor(&property); - pval_destructor(&function_name->element); - return; - } - - if (zend_llist_count(property_reference->elements_list)==1 - && !strcmp(Z_STRVAL_P(&function_name->element), "release")) { - RETVAL_LONG(php_COM_release(obj TSRMLS_CC)); - } else if (zend_llist_count(property_reference->elements_list)==1 - && !strcmp(Z_STRVAL_P(&function_name->element), "addref")) { - RETVAL_LONG(php_COM_addref(obj TSRMLS_CC)); - } else { - pval **arguments; - VARIANT *var_result; - int arg_count = ZEND_NUM_ARGS(); - - ALLOC_VARIANT(var_result); - - arguments = (pval **) emalloc(sizeof(pval *)*arg_count); - zend_get_parameters_array(ht, arg_count, arguments); - - if (do_COM_invoke(obj , &function_name->element, var_result, arguments, arg_count TSRMLS_CC) == FAILURE) { - RETVAL_FALSE; - } else { - php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC); - } - - FREE_VARIANT(var_result); - efree(arguments); - } - - if (property.refcount == 1) { - pval_destructor(&property); - } - pval_destructor(&function_name->element); -} - - -static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC) -{ - ITypeLib *TypeLib = NULL; - char *strtok_buf, *major, *minor; - CLSID clsid; - OLECHAR *p; - - /* Type Libraries: - * The string we have is either: - * a) a file name - * b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0" - * c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library" - * Searching for the name will be more expensive that the - * other two, so we will do that when both other attempts - * fail. - */ - - search_string = php_strtok_r(search_string, ",", &strtok_buf); - major = php_strtok_r(NULL, ",", &strtok_buf); - minor = php_strtok_r(NULL, ",", &strtok_buf); - - p = php_char_to_OLECHAR(search_string, strlen(search_string), codepage TSRMLS_CC); - /* Is the string a GUID ? */ - - if (!FAILED(CLSIDFromString(p, &clsid))) { - HRESULT hr; - WORD major_i = 1; - WORD minor_i = 0; - - /* We have a valid GUID, check to see if a major/minor */ - /* version was specified otherwise assume 1,0 */ - if ((major != NULL) && (minor != NULL)) { - major_i = (WORD) atoi(major); - minor_i = (WORD) atoi(minor); - } - - /* The GUID will either be a typelibrary or a CLSID */ - hr = LoadRegTypeLib((REFGUID) &clsid, major_i, minor_i, LANG_NEUTRAL, &TypeLib); - - /* If the LoadRegTypeLib fails, let's try to instantiate */ - /* the class itself and then QI for the TypeInfo and */ - /* retrieve the type info from that interface */ - if (FAILED(hr) && (!major || !minor)) { - IDispatch *Dispatch; - ITypeInfo *TypeInfo; - int idx; - - if (FAILED(CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID *) &Dispatch))) { - efree(p); - return NULL; - } - if (FAILED(Dispatch->lpVtbl->GetTypeInfo(Dispatch, 0, LANG_NEUTRAL, &TypeInfo))) { - Dispatch->lpVtbl->Release(Dispatch); - efree(p); - return NULL; - } - Dispatch->lpVtbl->Release(Dispatch); - if (FAILED(TypeInfo->lpVtbl->GetContainingTypeLib(TypeInfo, &TypeLib, &idx))) { - TypeInfo->lpVtbl->Release(TypeInfo); - efree(p); - return NULL; - } - TypeInfo->lpVtbl->Release(TypeInfo); - } - } else { - if (FAILED(LoadTypeLib(p, &TypeLib))) { - /* Walk HKCR/TypeLib looking for the string */ - /* If that succeeds, call ourself recursively */ - /* using the CLSID found, else give up and bail */ - HKEY hkey, hsubkey; - DWORD SubKeys, MaxSubKeyLength; - char *keyname; - register unsigned int ii, jj; - DWORD VersionCount; - char version[20]; /* All the version keys are 1.0, 4.6, ... */ - char *libname; - DWORD libnamelen; - - /* No Need for Unicode version any more */ - efree(p); - - /* Starting at HKEY_CLASSES_ROOT/TypeLib */ - /* Walk all subkeys (Typelib GUIDs) looking */ - /* at each version for a string match to the */ - /* supplied argument */ - - if (ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib",&hkey)) { - /* This is pretty bad - better bail */ - return NULL; - } - if (ERROR_SUCCESS != RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys, &MaxSubKeyLength, NULL, NULL, NULL, NULL, NULL, NULL)) { - RegCloseKey(hkey); - return NULL; - } - MaxSubKeyLength++; /* \0 is not counted */ - keyname = emalloc(MaxSubKeyLength); - libname = emalloc(strlen(search_string)+1); - for (ii=0;iilpVtbl->GetTypeInfoCount(TypeLib); - - TypeLib->lpVtbl->GetTypeComp(TypeLib, &TypeComp); - for (i=0; ilpVtbl->GetTypeInfoType(TypeLib, i, &pTKind); - if (pTKind==TKIND_ENUM) { - ITypeInfo *TypeInfo; - VARDESC *pVarDesc; - UINT NameCount; - int j; -#if 0 - BSTR bstr_EnumId; - char *EnumId; - - TypeLib->lpVtbl->GetDocumentation(TypeLib, i, &bstr_EnumId, NULL, NULL, NULL); - EnumId = php_OLECHAR_to_char(bstr_EnumId, NULL, codepage); - printf("Enumeration %d - %s:\n", i, EnumId); - efree(EnumId); -#endif - - TypeLib->lpVtbl->GetTypeInfo(TypeLib, i, &TypeInfo); - - j=0; - while (SUCCEEDED(TypeInfo->lpVtbl->GetVarDesc(TypeInfo, j, &pVarDesc))) { - BSTR bstr_ids; - zend_constant c; - zval exists, results; - char *const_name; - - TypeInfo->lpVtbl->GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount); - if (NameCount!=1) { - j++; - continue; - } - const_name = php_OLECHAR_to_char(bstr_ids, &c.name_len, codepage TSRMLS_CC); - c.name = zend_strndup(const_name, c.name_len); - efree(const_name); - c.name_len++; /* length should include the NULL */ - SysFreeString(bstr_ids); - - /* Before registering the contsnt, let's see if we can find it */ - if (zend_get_constant(c.name, c.name_len-1, &exists TSRMLS_CC)) { - /* Oops, it already exists. No problem if it is defined as the same value */ - /* Check to see if they are the same */ - if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) { - php_error(E_WARNING,"Type library value %s is already defined and has a different value", c.name); - } - free(c.name); - j++; - continue; - } - - php_variant_to_pval(pVarDesc->lpvarValue, &c.value, codepage TSRMLS_CC); - if (mode & CONST_PERSISTENT) { - zval_persist(&c.value TSRMLS_CC); - mode |= CONST_EFREE_PERSISTENT; - } - c.flags = mode; - - zend_register_constant(&c TSRMLS_CC); - - j++; - } - TypeInfo->lpVtbl->Release(TypeInfo); - } - } - - return SUCCESS; -} - - -/* {{{ proto bool com_isenum(object com_module) - Grabs an IEnumVariant */ -PHP_FUNCTION(com_isenum) -{ - pval *object; - pval **comval_handle; - comval *obj; - int type; - - if (ZEND_NUM_ARGS() != 1) { - ZEND_WRONG_PARAM_COUNT(); - } - - zend_get_parameters(ht, 1, &object); - - /* obtain IDispatch interface */ - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); - obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type); - if (!obj || (type != IS_COM)) { - php_error(E_WARNING,"%s is not a COM object handler", ""); - RETURN_FALSE; - } - - RETURN_BOOL(C_HASENUM(obj)); -} -/* }}} */ - - -static void php_register_COM_class(TSRMLS_D) -{ - INIT_OVERLOADED_CLASS_ENTRY(COM_class_entry, "COM", NULL, - php_COM_call_function_handler, - php_COM_get_property_handler, - php_COM_set_property_handler); - - zend_register_internal_class(&COM_class_entry TSRMLS_CC); -} - - -static void php_COM_init(int module_number TSRMLS_DC) -{ - le_comval = zend_register_list_destructors_ex(php_comval_destructor, NULL, "COM", module_number); - php_register_COM_class(TSRMLS_C); -} - - -PHP_MINIT_FUNCTION(COM) -{ - php_COM_init(module_number TSRMLS_CC); - php_VARIANT_init(module_number TSRMLS_CC); - - REGISTER_LONG_CONSTANT("CLSCTX_INPROC_SERVER", CLSCTX_INPROC_SERVER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CLSCTX_INPROC_HANDLER", CLSCTX_INPROC_HANDLER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CLSCTX_LOCAL_SERVER", CLSCTX_LOCAL_SERVER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CLSCTX_REMOTE_SERVER", CLSCTX_REMOTE_SERVER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CLSCTX_SERVER", CLSCTX_SERVER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CLSCTX_ALL", CLSCTX_ALL, CONST_CS | CONST_PERSISTENT); - - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} - - -PHP_MSHUTDOWN_FUNCTION(COM) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -/* exports for external object creation */ - -zend_module_entry COM_module_entry = { - STANDARD_MODULE_HEADER, - "com", - COM_functions, - PHP_MINIT(COM), - PHP_MSHUTDOWN(COM), - NULL, - NULL, - PHP_MINFO(COM), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -PHPAPI int php_COM_get_le_comval() -{ - return le_comval; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/com/CREDITS b/ext/com/CREDITS deleted file mode 100644 index 27bb7a0b217..00000000000 --- a/ext/com/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Win32 COM -Zeev Suraski, Harald Radi, Alan Brown \ No newline at end of file diff --git a/ext/com/TODO b/ext/com/TODO deleted file mode 100644 index 6dccb556f8e..00000000000 --- a/ext/com/TODO +++ /dev/null @@ -1,27 +0,0 @@ -1) Multi-dimenstional array support --- done 2) IErrorInfo --- done 13) export VARIANT through the COM module -14) trap exceptions and errors -3) WithEvents -4) Documentation (internal and user) and howtos -5) IEnumVariant::All() which would be like IEnumVariant::Next(IDispatch::Count) -6) Look for memory leaks and AdRef/Release problems - I KNOW there are some... -7) Test component (goes with the docs) -8) Test suite (Needs test component) -9) reduce the need for VARIANT() -10) lets try if we are able to call non IDispatch - only Typelib components --- done 11) IEnumVariant::Next() without parameter should only return an object, not an array with one element --- done 12) VARIANT->value as lvalue - - -ad 6.) check vbsample.php (new VARIANT(*, *|VT_BYREF)) GPs -ad 4.) faq (i've collected a few questions from various lists) - variant attributes !! - -to be discussed: - -- dcom inporc issue -- mts support (getcontext) -- adsi support (ads* functions) -- winapi interface -- try serialisation support (if component implements IPersist) diff --git a/ext/com/VARIANT.c b/ext/com/VARIANT.c deleted file mode 100644 index 2303481cee8..00000000000 --- a/ext/com/VARIANT.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Harald Radi | - +----------------------------------------------------------------------+ - */ - - -/* - * This module maps the VARIANT datastructure into PHP so that it can be used to - * pass values to COM and DOTNET Objects by reference and not only by value. - * - * harald - */ - -#ifdef PHP_WIN32 - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_VARIANT.h" - -#include - -static int do_VARIANT_propset(VARIANT *var_arg, pval *arg_property, pval *value TSRMLS_DC); -static int php_VARIANT_set_property_handler(zend_property_reference *property_reference, pval *value); -static pval php_VARIANT_get_property_handler(zend_property_reference *property_reference); -static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); -static void php_VARIANT_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void php_register_VARIANT_class(TSRMLS_D); - -static int le_variant; -static int codepage; -static zend_class_entry VARIANT_class_entry; - - -void php_VARIANT_init(int module_number TSRMLS_DC) -{ - le_variant = zend_register_list_destructors_ex(php_VARIANT_destructor, NULL, "VARIANT", module_number); - - /* variant datatypes */ - REGISTER_LONG_CONSTANT("VT_NULL", VT_NULL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_EMPTY", VT_EMPTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_UI1", VT_UI1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_I2", VT_I2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_I4", VT_I4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_R4", VT_R4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_R8", VT_R8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_BOOL", VT_BOOL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_ERROR", VT_ERROR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_CY", VT_CY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_DATE", VT_DATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_BSTR", VT_BSTR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_DECIMAL", VT_DECIMAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_UNKNOWN", VT_UNKNOWN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_DISPATCH", VT_DISPATCH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_VARIANT", VT_VARIANT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_I1", VT_I1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_UI2", VT_UI2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_UI4", VT_UI4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_INT", VT_INT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_UINT", VT_UINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_ARRAY", VT_ARRAY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("VT_BYREF", VT_BYREF, CONST_CS | CONST_PERSISTENT); - - /* codepages */ - REGISTER_LONG_CONSTANT("CP_ACP", CP_ACP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CP_MACCP", CP_MACCP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CP_OEMCP", CP_OEMCP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CP_UTF7", CP_UTF7, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CP_UTF8", CP_UTF8, CONST_CS | CONST_PERSISTENT); - -#ifdef CP_SYMBOL - REGISTER_LONG_CONSTANT("CP_SYMBOL", CP_SYMBOL, CONST_CS | CONST_PERSISTENT); -#else -# error "CP_SYMBOL undefined" -#endif -#ifdef CP_THREAD_ACP - REGISTER_LONG_CONSTANT("CP_THREAD_ACP", CP_THREAD_ACP, CONST_CS | CONST_PERSISTENT); -#else -# error "CP_THREAD_ACP undefined" -#endif - - php_register_VARIANT_class(TSRMLS_C); -} - - -PHPAPI int php_VARIANT_get_le_variant() -{ - return le_variant; -} - - -static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) -{ - pval *object = property_reference->object; - zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data; - VARIANT *pVar; - - if ((zend_llist_count(property_reference->elements_list)==1) && !strcmp(Z_STRVAL(function_name->element), "variant")) { - /* constructor */ - pval *object_handle, *data, *type, *code_page; - - ALLOC_VARIANT(pVar); - VariantInit(pVar); - - switch (ZEND_NUM_ARGS()) { - case 0: - /* nothing to do */ - break; - case 1: - zend_get_parameters(ht, 1, &data); - php_pval_to_variant(data, pVar, codepage TSRMLS_CC); - codepage = CP_ACP; - break; - case 2: - zend_get_parameters(ht, 2, &data, &type); - php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC); - codepage = CP_ACP; - break; - case 3: - zend_get_parameters(ht, 3, &data, &type, &code_page); - php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC); - convert_to_long(code_page); - codepage = Z_LVAL_P(code_page); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - break; - } - - RETVAL_LONG(zend_list_insert(pVar, IS_VARIANT)); - - if (!zend_is_true(return_value)) { - ZVAL_FALSE(object); - return; - } - - ALLOC_ZVAL(object_handle); - *object_handle = *return_value; - pval_copy_constructor(object_handle); - INIT_PZVAL(object_handle); - zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); - zval_dtor(&function_name->element); - } -} - - -static pval php_VARIANT_get_property_handler(zend_property_reference *property_reference) -{ - zend_overloaded_element *overloaded_property; - int type; - pval result, **var_handle, *object = property_reference->object; - VARIANT *var_arg; - TSRMLS_FETCH(); - - - /* fetch the VARIANT structure */ - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); - var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); - - if (!var_arg || (type != IS_VARIANT)) { - ZVAL_FALSE(&result); - } else { - overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; - switch (Z_TYPE_P(overloaded_property)) { - case OE_IS_ARRAY: - ZVAL_FALSE(&result); - break; - - case OE_IS_OBJECT: - if (!strcmp(Z_STRVAL(overloaded_property->element), "value")) { - php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC); - } else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) { - ZVAL_LONG(&result, V_VT(var_arg)) - } else { - ZVAL_FALSE(&result); - php_error(E_WARNING, "Unknown member."); - } - break; - case OE_IS_METHOD: - ZVAL_FALSE(&result); - php_error(E_WARNING, "Unknown method."); - break; - - zval_dtor(&overloaded_property->element); - } - } - - return result; -} - - -static int php_VARIANT_set_property_handler(zend_property_reference *property_reference, pval *value) -{ - zend_overloaded_element *overloaded_property; - int type; - pval **var_handle, *object = property_reference->object; - VARIANT *var_arg; - TSRMLS_FETCH(); - - - /* fetch the VARIANT structure */ - zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); - var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); - - if (!var_arg || (type != IS_VARIANT)) { - return FAILURE; - } - - overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; - do_VARIANT_propset(var_arg, &overloaded_property->element, value TSRMLS_CC); - zval_dtor(&overloaded_property->element); - return SUCCESS; -} - - -static int do_VARIANT_propset(VARIANT *var_arg, pval *arg_property, pval *value TSRMLS_DC) -{ - int type; - - if (!strcmp(Z_STRVAL_P(arg_property), "value")) { - php_pval_to_variant(value, var_arg, codepage TSRMLS_CC); - - return SUCCESS; - } else if (!strcmp(Z_STRVAL_P(arg_property), "bVal")) { - type = VT_UI1; - } else if (!strcmp(Z_STRVAL_P(arg_property), "iVal")) { - type = VT_I2; - } else if (!strcmp(Z_STRVAL_P(arg_property), "lVal")) { - type = VT_I4; - } else if (!strcmp(Z_STRVAL_P(arg_property), "fltVal")) { - type = VT_R4; - } else if (!strcmp(Z_STRVAL_P(arg_property), "dblVal")) { - type = VT_R8; - } else if (!strcmp(Z_STRVAL_P(arg_property), "boolVal")) { - type = VT_BOOL; - } else if (!strcmp(Z_STRVAL_P(arg_property), "scode")) { - type = VT_ERROR; - } else if (!strcmp(Z_STRVAL_P(arg_property), "cyVal")) { - type = VT_CY; - } else if (!strcmp(Z_STRVAL_P(arg_property), "date")) { - type = VT_DATE; - } else if (!strcmp(Z_STRVAL_P(arg_property), "bstrVal")) { - type = VT_BSTR; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pdecVal")) { - type = VT_DECIMAL|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "punkVal")) { - type = VT_UNKNOWN; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pdispVal")) { - type = VT_DISPATCH; - } else if (!strcmp(Z_STRVAL_P(arg_property), "parray")) { - type = VT_ARRAY; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pbVal")) { - type = VT_UI1|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "piVal")) { - type = VT_I2|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "plVal")) { - type = VT_I4|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pfltVal")) { - type = VT_R4|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pdblVal")) { - type = VT_R8|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pboolVal")) { - type = VT_BOOL|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pscode")) { - type = VT_ERROR|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pcyVal")) { - type = VT_CY|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pdate")) { - type = VT_DATE|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pbstrVal")) { - type = VT_BSTR|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "ppunkVal")) { - type = VT_UNKNOWN|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "ppdispVal")) { - type = VT_DISPATCH|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pparray")) { - type = VT_ARRAY|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pvarVal")) { - type = VT_VARIANT|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "byref")) { - type = VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "cVal")) { - type = VT_I1; - } else if (!strcmp(Z_STRVAL_P(arg_property), "uiVal")) { - type = VT_UI2; - } else if (!strcmp(Z_STRVAL_P(arg_property), "ulVal")) { - type = VT_UI4; - } else if (!strcmp(Z_STRVAL_P(arg_property), "intVal")) { - type = VT_INT; - } else if (!strcmp(Z_STRVAL_P(arg_property), "uintVal")) { - type = VT_UINT|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pcVal")) { - type = VT_I1|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "puiVal")) { - type = VT_UI2|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pulVal")) { - type = VT_UI4|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "pintVal")) { - type = VT_INT|VT_BYREF; - } else if (!strcmp(Z_STRVAL_P(arg_property), "puintVal")) { - type = VT_UINT|VT_BYREF; - } else { - php_error(E_WARNING, "Unknown member."); - return FAILURE; - } - - php_pval_to_variant_ex2(value, var_arg, type, codepage TSRMLS_CC); - - return SUCCESS; -} - - -static void php_VARIANT_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - FREE_VARIANT(rsrc->ptr); -} - -static void php_register_VARIANT_class(TSRMLS_D) -{ - INIT_OVERLOADED_CLASS_ENTRY(VARIANT_class_entry, "VARIANT", NULL, - php_VARIANT_call_function_handler, - php_VARIANT_get_property_handler, - php_VARIANT_set_property_handler); - - zend_register_internal_class(&VARIANT_class_entry TSRMLS_CC); -} - -#endif /* PHP_WIN32 */ diff --git a/ext/com/com.h b/ext/com/com.h deleted file mode 100644 index 99c17782dfd..00000000000 --- a/ext/com/com.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef COM_H -#define COM_H - -#if PHP_WIN32 - -BEGIN_EXTERN_C() - -#include - -typedef struct comval_ { -#ifdef _DEBUG - int resourceindex; -#endif - BOOL typelib; - BOOL enumeration; - int refcount; - struct { - IDispatch *dispatch; - ITypeInfo *typeinfo; - IEnumVARIANT *enumvariant; - } i; -} comval; - -END_EXTERN_C() - -#define ZVAL_COM(z,o) { \ - zval *handle; \ - HashTable *properties; \ - \ - ALLOC_HASHTABLE(properties); \ - zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \ - \ - ALLOC_ZVAL(handle); \ - INIT_PZVAL(handle); \ - ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \ - \ - zval_copy_ctor(handle); \ - zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \ - object_and_properties_init(z, &COM_class_entry, properties); \ - } - -#define RETVAL_COM(o) ZVAL_COM(&return_value, o); -#define RETURN_COM(o) RETVAL_COM(o) \ - return; - -#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \ - C_REFCOUNT(z) = 0; - -#define FREE_COM(z) efree(z); - -#define IS_COM php_COM_get_le_comval() - -#define C_HASTLIB(x) ((x)->typelib) -#define C_HASENUM(x) ((x)->enumeration) -#define C_REFCOUNT(x) ((x)->refcount) -#define C_ISREFD(x) C_REFCOUNT(x) - -#define C_ADDREF(x) (++((x)->refcount)) -#define C_RELEASE(x) (--((x)->refcount)) - -#define C_DISPATCH(x) ((x)->i.dispatch) -#define C_TYPEINFO(x) ((x)->i.typeinfo) -#define C_ENUMVARIANT(x) ((x)->i.enumvariant) - -#define C_DISPATCH_VT(x) (C_DISPATCH(x)->lpVtbl) -#define C_TYPEINFO_VT(x) (C_TYPEINFO(x)->lpVtbl) -#define C_ENUMVARIANT_VT(x) (C_ENUMVARIANT(x)->lpVtbl) - -#endif /* PHP_WIN32 */ - -#endif /* COM_H */ diff --git a/ext/com/conversion.c b/ext/com/conversion.c deleted file mode 100644 index 358314f132d..00000000000 --- a/ext/com/conversion.c +++ /dev/null @@ -1,847 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Harald Radi | - | Alan Brown | - | Paul Shortis | - +----------------------------------------------------------------------+ - */ - -/* - * 03.6.2001 - * Added SafeArray ==> Hash support - */ - -/* - * Paul Shortis June 7, 2001 - Added code to support SafeArray passing - * to COM objects. Support includes passing arrays of variants as well - * as typed arrays. - */ - -#ifdef PHP_WIN32 - -#include "php.h" -#include "php_COM.h" -#include "php_VARIANT.h" - -/* prototypes */ - -static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC); - -/* implementations */ -PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC) -{ - int type = VT_EMPTY; /* default variant type */ - - switch (Z_TYPE_P(pval_arg)) { - case IS_NULL: - type = VT_NULL; - break; - - case IS_BOOL: - type = VT_BOOL; - break; - - case IS_OBJECT: - if (!strcmp(Z_OBJCE_P(pval_arg)->name, "VARIANT")) { - type = VT_VARIANT|VT_BYREF; - } else if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) { - type = VT_DISPATCH; - } - break; - - case IS_ARRAY: - type = VT_ARRAY; - break; - - case IS_RESOURCE: - case IS_CONSTANT: - case IS_CONSTANT_ARRAY: - /* ?? */ - break; - - case IS_LONG: - type = VT_I4; /* assuming 32-bit platform */ - break; - - case IS_DOUBLE: - type = VT_R8; /* assuming 64-bit double precision */ - break; - - case IS_STRING: - type = VT_BSTR; - break; - } - - php_pval_to_variant_ex2(pval_arg, var_arg, type, codepage TSRMLS_CC); -} - - -PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC) -{ - php_pval_to_variant_ex2(pval_arg, var_arg, Z_LVAL_P(pval_type), codepage TSRMLS_CC); -} - - -PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC) -{ - OLECHAR *unicode_str; - - VariantInit(var_arg); - V_VT(var_arg) = type; - - if (V_VT(var_arg) & VT_ARRAY) { - /* For now we'll just handle single dimension arrays, we'll use the data type of the first element for the - output data type */ - HashTable *ht = Z_ARRVAL(*pval_arg); - int numberOfElements = zend_hash_num_elements(ht); - SAFEARRAY *safeArray; - SAFEARRAYBOUND bounds[1]; - VARIANT *v; - zval **entry; /* An entry in the input array */ - - type &= ~VT_ARRAY; - - if (V_VT(var_arg) == (VT_ARRAY|VT_BYREF)) { /* == is intended, because VT_*|VT_BYREF|VT_ARRAY means something diffrent */ - type &= ~VT_BYREF; - ALLOC_VARIANT(V_VARIANTREF(var_arg)); - var_arg = V_VARIANTREF(var_arg); /* put the array in that VARIANT */ - } - - bounds[0].lLbound = 0; - bounds[0].cElements = numberOfElements; - safeArray = SafeArrayCreate(VT_VARIANT, 1, bounds); - - if (NULL == safeArray) { - php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); - ZVAL_FALSE(pval_arg); - } else { - V_ARRAY(var_arg) = safeArray; - V_VT(var_arg) = VT_ARRAY|VT_VARIANT; /* Now have a valid safe array allocated */ - if (SUCCEEDED(SafeArrayLock(safeArray))) { - ulong i; - - zend_hash_internal_pointer_reset(ht); - for (i = 0; i < (ulong)numberOfElements; ++i) { - if ((zend_hash_get_current_data(ht, (void **)&entry) == SUCCESS) && (entry != NULL)) { /* Get a pointer to the php array element */ - /* Add another value to the safe array */ - if (SUCCEEDED(SafeArrayPtrOfIndex( safeArray, &i, &v))) { /* Pointer to output element entry retrieved successfully */ - if (type) { /* explicit type */ - php_pval_to_variant_ex2(*entry, v, type, codepage TSRMLS_CC); /* Do the required conversion */ - } else { - php_pval_to_variant(*entry, v, codepage TSRMLS_CC); /* Do the required conversion */ - } - } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); - } - } - zend_hash_move_forward(ht); - } - SafeArrayUnlock( safeArray); - } else { - php_error( E_WARNING,"phpArrayToSafeArray() - Unable to lock safeArray"); - } - } - } else { - switch (V_VT(var_arg)) { - case VT_UI1: - convert_to_long_ex(&pval_arg); - V_UI1(var_arg) = (unsigned char) Z_LVAL_P(pval_arg); - break; - - case VT_I2: - convert_to_long_ex(&pval_arg); - V_I2(var_arg) = (short) Z_LVAL_P(pval_arg); - break; - - case VT_I4: - convert_to_long_ex(&pval_arg); - V_I4(var_arg) = Z_LVAL_P(pval_arg); - break; - - case VT_R4: - convert_to_double_ex(&pval_arg); - V_R4(var_arg) = (float) Z_DVAL_P(pval_arg); - break; - - case VT_R8: - convert_to_double_ex(&pval_arg); - V_R8(var_arg) = Z_DVAL_P(pval_arg); - break; - - case VT_BOOL: - convert_to_boolean_ex(&pval_arg); - if (Z_LVAL_P(pval_arg)) { - V_BOOL(var_arg) = VT_TRUE; - } else { - V_BOOL(var_arg) = VT_FALSE; - } - break; - - case VT_ERROR: - convert_to_long_ex(&pval_arg); - V_ERROR(var_arg) = Z_LVAL_P(pval_arg); - break; - - case VT_CY: - convert_to_double_ex(&pval_arg); - VarCyFromR8(Z_DVAL_P(pval_arg), &V_CY(var_arg)); - break; - - case VT_DATE: { - SYSTEMTIME wintime; - struct tm *phptime; - - switch (Z_TYPE_P(pval_arg)) { - case IS_DOUBLE: - /* already a VariantTime value */ - V_DATE(var_arg) = Z_DVAL_P(pval_arg); - break; - - /** @todo - case IS_STRING: - /* string representation of a time value */ - - default: - /* a PHP time value ? */ - convert_to_long_ex(&pval_arg); - phptime = gmtime(&(Z_LVAL_P(pval_arg))); - memset(&wintime, 0, sizeof(wintime)); - - wintime.wYear = phptime->tm_year + 1900; - wintime.wMonth = phptime->tm_mon + 1; - wintime.wDay = phptime->tm_mday; - wintime.wHour = phptime->tm_hour; - wintime.wMinute = phptime->tm_min; - wintime.wSecond = phptime->tm_sec; - - SystemTimeToVariantTime(&wintime, &V_DATE(var_arg)); - break; - } - } - break; - - case VT_BSTR: - convert_to_string_ex(&pval_arg); - unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - V_BSTR(var_arg) = SysAllocStringByteLen((char *) unicode_str, Z_STRLEN_P(pval_arg) * sizeof(OLECHAR)); - efree(unicode_str); - break; - - case VT_DECIMAL: - convert_to_string_ex(&pval_arg); - unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - VarDecFromStr(unicode_str, LOCALE_SYSTEM_DEFAULT, 0, &V_DECIMAL(var_arg)); - break; - - case VT_DECIMAL|VT_BYREF: - convert_to_string_ex(&pval_arg); - unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - VarDecFromStr(unicode_str, LOCALE_SYSTEM_DEFAULT, 0, V_DECIMALREF(var_arg)); - break; - - case VT_UNKNOWN: - comval_to_variant(pval_arg, var_arg TSRMLS_CC); - if (V_VT(var_arg) != VT_DISPATCH) { - VariantInit(var_arg); - } else { - V_VT(var_arg) = VT_UNKNOWN; - V_UNKNOWN(var_arg) = (IUnknown *) V_DISPATCH(var_arg); - } - break; - - case VT_DISPATCH: - comval_to_variant(pval_arg, var_arg TSRMLS_CC); - if (V_VT(var_arg) != VT_DISPATCH) { - VariantInit(var_arg); - } - break; - - case VT_UI1|VT_BYREF: - convert_to_long(pval_arg); - V_UI1REF(var_arg) = (unsigned char FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_I2|VT_BYREF: - convert_to_long(pval_arg); - V_I2REF(var_arg) = (short FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_I4|VT_BYREF: - convert_to_long(pval_arg); - V_I4REF(var_arg) = (long FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_R4|VT_BYREF: - convert_to_double(pval_arg); - V_R4REF(var_arg) = (float FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_R8|VT_BYREF: - convert_to_double(pval_arg); - V_R8REF(var_arg) = (double FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_BOOL|VT_BYREF: - convert_to_boolean(pval_arg); - /* emalloc or malloc ? */ - V_BOOLREF(var_arg) = (short FAR*) pemalloc(sizeof(short), 1); - if (Z_LVAL_P(pval_arg)) { - *V_BOOLREF(var_arg) = VT_TRUE; - } else { - *V_BOOLREF(var_arg) = VT_TRUE; - } - break; - - case VT_ERROR|VT_BYREF: - convert_to_long(pval_arg); - V_ERRORREF(var_arg) = (long FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_CY|VT_BYREF: - convert_to_double_ex(&pval_arg); - VarCyFromR8(Z_DVAL_P(pval_arg), var_arg->pcyVal); - break; - - case VT_DATE|VT_BYREF: { - SYSTEMTIME wintime; - struct tm *phptime; - - phptime = gmtime(&(Z_LVAL_P(pval_arg))); - memset(&wintime, 0, sizeof(wintime)); - - wintime.wYear = phptime->tm_year + 1900; - wintime.wMonth = phptime->tm_mon + 1; - wintime.wDay = phptime->tm_mday; - wintime.wHour = phptime->tm_hour; - wintime.wMinute = phptime->tm_min; - wintime.wSecond = phptime->tm_sec; - - SystemTimeToVariantTime(&wintime, var_arg->pdate); - } - break; - - case VT_BSTR|VT_BYREF: - convert_to_string(pval_arg); - V_BSTRREF(var_arg) = (BSTR FAR*) emalloc(sizeof(BSTR FAR*)); - unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - *V_BSTRREF(var_arg) = SysAllocString(unicode_str); - efree(unicode_str); - break; - - case VT_UNKNOWN|VT_BYREF: - comval_to_variant(pval_arg, var_arg TSRMLS_CC); - if (V_VT(var_arg) != VT_DISPATCH) { - VariantInit(var_arg); - } else { - V_VT(var_arg) = VT_UNKNOWN|VT_BYREF; - V_UNKNOWNREF(var_arg) = (IUnknown **) &V_DISPATCH(var_arg); - } - break; - - case VT_DISPATCH|VT_BYREF: - comval_to_variant(pval_arg, var_arg TSRMLS_CC); - if (V_VT(var_arg) != VT_DISPATCH) { - VariantInit(var_arg); - } else { - V_VT(var_arg) = VT_DISPATCH|VT_BYREF; - V_DISPATCHREF(var_arg) = &V_DISPATCH(var_arg); - } - break; - - case VT_VARIANT: - php_error(E_WARNING,"VT_VARIANT is invalid. Use VT_VARIANT|VT_BYREF instead."); - /* break missing intentionally */ - case VT_VARIANT|VT_BYREF: { - int tp; - pval **var_handle; - - /* fetch the VARIANT structure */ - zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &var_handle); - - V_VT(var_arg) = VT_VARIANT|VT_BYREF; - V_VARIANTREF(var_arg) = (VARIANT FAR*) zend_list_find(Z_LVAL_P(*var_handle), &tp); - - if (!V_VARIANTREF(var_arg) && (tp != IS_VARIANT)) { - VariantInit(var_arg); - } - } - /* - should be, but isn't :) - - if (V_VT(var_arg) != (VT_VARIANT|VT_BYREF)) - { - VariantInit(var_arg); - } - */ - break; - - case VT_I1: - convert_to_long_ex(&pval_arg); - V_I1(var_arg) = (char)Z_LVAL_P(pval_arg); - break; - - case VT_UI2: - convert_to_long_ex(&pval_arg); - V_UI2(var_arg) = (unsigned short)Z_LVAL_P(pval_arg); - break; - - case VT_UI4: - convert_to_long_ex(&pval_arg); - V_UI4(var_arg) = (unsigned long)Z_LVAL_P(pval_arg); - break; - - case VT_INT: - convert_to_long_ex(&pval_arg); - V_INT(var_arg) = (int)Z_LVAL_P(pval_arg); - break; - - case VT_UINT: - convert_to_long_ex(&pval_arg); - V_UINT(var_arg) = (unsigned int)Z_LVAL_P(pval_arg); - break; - - case VT_I1|VT_BYREF: - convert_to_long(pval_arg); - V_I1REF(var_arg) = (char FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_UI2|VT_BYREF: - convert_to_long(pval_arg); - V_UI2REF(var_arg) = (unsigned short FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_UI4|VT_BYREF: - convert_to_long(pval_arg); - V_UI4REF(var_arg) = (unsigned long FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_INT|VT_BYREF: - convert_to_long(pval_arg); - V_INTREF(var_arg) = (int FAR*) &Z_LVAL_P(pval_arg); - break; - - case VT_UINT|VT_BYREF: - convert_to_long(pval_arg); - V_UINTREF(var_arg) = (unsigned int FAR*) &Z_LVAL_P(pval_arg); - break; - - default: - php_error(E_WARNING, "Type not supported or not yet implemented."); - } - } -} - - -PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TSRMLS_DC) -{ - /* Changed the function to return a value for recursive error testing */ - /* Existing calls will be unaffected by the change - so it */ - /* seemed like the smallest impact on unfamiliar code */ - int ret = SUCCESS; - - INIT_PZVAL(pval_arg); - - /* Add SafeArray support */ - if (V_ISARRAY(var_arg)) { - SAFEARRAY *array = V_ARRAY(var_arg); - LONG indices[1]; - LONG lbound=0, ubound; - VARTYPE vartype; - register int ii; - UINT Dims; - VARIANT vv; - pval *element; - HRESULT hr; - - /* TODO: Add support for multi-dimensional SafeArrays */ - /* For now just validate that the SafeArray has one dimension */ - if (1 != (Dims = SafeArrayGetDim(array))) { - php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims); - ZVAL_NULL(pval_arg); - return FAILURE; - } - SafeArrayLock(array); - - /* This call has failed for everything I have tried */ - /* But best leave it to be on the safe side */ - if (FAILED(SafeArrayGetVartype(array, &vartype)) || (vartype == VT_EMPTY)) { - /* Fall back to what we do know */ - /* Mask off the array bit and assume */ - /* what is left is the type of the array */ - /* elements */ - vartype = V_VT(var_arg) & ~VT_ARRAY; - } - SafeArrayGetUBound(array, 1, &ubound); - SafeArrayGetLBound(array, 1, &lbound); - - /* Since COM returned an array we set up the php */ - /* return value to be an array */ - array_init(pval_arg); - - /* Walk the safe array */ - for (ii=lbound;ii<=ubound;ii++) { - indices[0] = ii; - VariantInit(&vv); /* Docs say this just set the vt field, but you never know */ - /* Set up a variant to pass to a recursive call */ - /* So that we do not need to have two copies */ - /* of the code */ - if (VT_VARIANT == vartype) { - hr = SafeArrayGetElement(array, indices, (VOID *) &(vv)); - } else { - V_VT(&vv) = vartype; - hr = SafeArrayGetElement(array, indices, (VOID *) &(vv.lVal)); - } - if (FAILED(hr)) { - /* Failure to retieve an element probably means the array is sparse */ - /* So leave the php array sparse too */ - continue; - } - /* Create an element to be added to the array */ - ALLOC_ZVAL(element); - /* Call ourself again to handle the base type conversion */ - /* If SafeArrayGetElement proclaims to allocate */ - /* memory for a BSTR, so the recursive call frees */ - /* the string correctly */ - if (FAILURE == php_variant_to_pval(&vv, element, codepage TSRMLS_CC)) { - /* Error occurred setting up array element */ - /* Error was displayed by the recursive call */ - FREE_ZVAL(element); - /* TODO: Do we stop here, or go on and */ - /* try to make sense of the rest of the array */ - /* Going on leads to multiple errors displayed */ - /* for the same conversion. For large arrays that */ - /* could be very annoying */ - /* And if we don't go on - what to do about */ - /* the parts of the array that are OK? */ - /* break; */ - } else { - /* Just insert the element into our return array */ - add_index_zval(pval_arg, ii, element); - } - } - SafeArrayUnlock(array); - } else switch (var_arg->vt & ~VT_BYREF) { - case VT_EMPTY: - ZVAL_NULL(pval_arg); - break; - - case VT_UI1: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_UI1REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_UI1(var_arg)); - } - break; - - case VT_I2: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long )*V_I2REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_I2(var_arg)); - } - break; - - case VT_I4: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, *V_I4REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, V_I4(var_arg)); - } - break; - - case VT_R4: - if (V_ISBYREF(var_arg)) { - ZVAL_DOUBLE(pval_arg, (double)*V_R4REF(var_arg)); - } else { - ZVAL_DOUBLE(pval_arg, (double)V_R4(var_arg)); - } - break; - - case VT_R8: - if (V_ISBYREF(var_arg)) { - ZVAL_DOUBLE(pval_arg, *V_R8REF(var_arg)); - } else { - ZVAL_DOUBLE(pval_arg, V_R8(var_arg)); - } - break; - - /* 96bit uint */ - case VT_DECIMAL: { - OLECHAR *unicode_str; - switch (VarBstrFromDec(&V_DECIMAL(var_arg), LOCALE_SYSTEM_DEFAULT, 0, &unicode_str)) { - case S_OK: - Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(unicode_str, &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - Z_TYPE_P(pval_arg) = IS_STRING; - break; - - default: - ZVAL_NULL(pval_arg); - ret = FAILURE; - php_error(E_WARNING, "Error converting DECIMAL value to PHP string"); - break; - } - } - break; - - /* Currency */ - case VT_CY: - if (V_ISBYREF(var_arg)) { - VarR8FromCy(*V_CYREF(var_arg), &Z_DVAL_P(pval_arg)); - } else { - VarR8FromCy(V_CY(var_arg), &Z_DVAL_P(pval_arg)); - } - Z_TYPE_P(pval_arg) = IS_DOUBLE; - break; - - case VT_BOOL: - if (V_ISBYREF(var_arg)) { - if (*V_BOOLREF(var_arg)) { - ZVAL_BOOL(pval_arg, Z_TRUE); - } else { - ZVAL_BOOL(pval_arg, Z_FALSE); - } - } else { - if (V_BOOL(var_arg)) { - ZVAL_BOOL(pval_arg, Z_TRUE); - } else { - ZVAL_BOOL(pval_arg, Z_FALSE); - } - } - break; - - case VT_NULL: - case VT_VOID: - ZVAL_NULL(pval_arg); - break; - - case VT_VARIANT: - php_variant_to_pval(V_VARIANTREF(var_arg), pval_arg, codepage TSRMLS_CC); - break; - - case VT_BSTR: - if (V_ISBYREF(var_arg)) { - Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - efree(V_BSTRREF(var_arg)); - } else { - Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); - } - - Z_TYPE_P(pval_arg) = IS_STRING; - break; - - case VT_DATE: { - BOOL success; - SYSTEMTIME wintime; - struct tm phptime; - - if (V_ISBYREF(var_arg)) { - success = VariantTimeToSystemTime(*V_DATEREF(var_arg), &wintime); - } else { - success = VariantTimeToSystemTime(V_DATE(var_arg), &wintime); - } - - if (success) { - memset(&phptime, 0, sizeof(phptime)); - - phptime.tm_year = wintime.wYear - 1900; - phptime.tm_mon = wintime.wMonth - 1; - phptime.tm_mday = wintime.wDay; - phptime.tm_hour = wintime.wHour; - phptime.tm_min = wintime.wMinute; - phptime.tm_sec = wintime.wSecond; - phptime.tm_isdst = -1; - - tzset(); - ZVAL_LONG(pval_arg, mktime(&phptime)); - } else { - ret = FAILURE; - } - } - break; - - case VT_UNKNOWN: - if (V_UNKNOWN(var_arg) == NULL) { - V_DISPATCH(var_arg) = NULL; - } else { - HRESULT hr; - - hr = V_UNKNOWN(var_arg)->lpVtbl->QueryInterface(var_arg->punkVal, &IID_IDispatch, &V_DISPATCH(var_arg)); - - if (FAILED(hr)) - { - char *error_message; - - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING,"Unable to obtain IDispatch interface: %s", error_message); - LocalFree(error_message); - - V_DISPATCH(var_arg) = NULL; - } - } - /* break missing intentionaly */ - case VT_DISPATCH: { - comval *obj; - - if (V_DISPATCH(var_arg) == NULL) { - ret = FAILURE; - ZVAL_NULL(pval_arg); - } else { - ALLOC_COM(obj); - php_COM_set(obj, &V_DISPATCH(var_arg), TRUE TSRMLS_CC); - - ZVAL_COM(pval_arg, obj); - } - } - break; - - case VT_I1: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_I1REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_I1(var_arg)); - } - break; - - case VT_UI2: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_UI2REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_UI2(var_arg)); - } - break; - - case VT_UI4: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_UI4REF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_UI4(var_arg)); - } - break; - - case VT_INT: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_INTREF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_INT(var_arg)); - } - break; - - case VT_UINT: - if (V_ISBYREF(var_arg)) { - ZVAL_LONG(pval_arg, (long)*V_UINTREF(var_arg)); - } else { - ZVAL_LONG(pval_arg, (long)V_UINT(var_arg)); - } - break; - - default: - php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); - ZVAL_NULL(pval_arg); - ret = FAILURE; - break; - } - return ret; -} - - -PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC) -{ - BOOL error = FALSE; - OLECHAR *unicode_str; - - if (strlen == -1) { - /* request needed buffersize */ - strlen = MultiByteToWideChar(codepage, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, C_str, -1, NULL, 0); - } else { - /* \0 terminator */ - strlen++; - } - - if (strlen >= 0) { - unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen); - - /* convert string */ - error = !MultiByteToWideChar(codepage, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, C_str, strlen, unicode_str, strlen); - } else { - /* return a zero-length string */ - unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR)); - *unicode_str = 0; - - error = TRUE; - } - - if (error) { - switch (GetLastError()) { - case ERROR_NO_UNICODE_TRANSLATION: - php_error(E_WARNING, "No unicode translation available for the specified string"); - break; - case ERROR_INSUFFICIENT_BUFFER: - php_error(E_WARNING, "Internal Error: Insufficient Buffer"); - break; - default: - php_error(E_WARNING, "Unknown error in php_char_to_OLECHAR()"); - } - } - - return unicode_str; -} - - -PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int codepage TSRMLS_DC) -{ - char *C_str; - uint length = 0; - - /* request needed buffersize */ - uint reqSize = WideCharToMultiByte(codepage, WC_COMPOSITECHECK, unicode_str, -1, NULL, 0, NULL, NULL); - - if (reqSize) { - C_str = (char *) emalloc(sizeof(char) * reqSize); - - /* convert string */ - length = WideCharToMultiByte(codepage, WC_COMPOSITECHECK, unicode_str, -1, C_str, reqSize, NULL, NULL) - 1; - } else { - C_str = (char *) emalloc(sizeof(char)); - *C_str = 0; - - php_error(E_WARNING,"Error in php_OLECHAR_to_char()"); - } - - if (out_length) { - *out_length = length; - } - - return C_str; -} - - -static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC) -{ - pval **comval_handle; - comval *obj; - int type; - - /* fetch the comval structure */ - zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &comval_handle); - obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); - if (!obj || (type != IS_COM) || !C_ISREFD(obj)) { - VariantInit(var_arg); - } else { - V_VT(var_arg) = VT_DISPATCH; - V_DISPATCH(var_arg) = C_DISPATCH(obj); - } -} - -#endif /* PHP_WIN32 */ \ No newline at end of file diff --git a/ext/com/conversion.h b/ext/com/conversion.h deleted file mode 100644 index b8c534fa221..00000000000 --- a/ext/com/conversion.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CONVERSION_H -#define CONVERSION_H - -/* isn't this defined somewhere else ? */ - -#define Z_TRUE 1 -#define Z_FALSE 0 - -#define VT_TRUE -1 -#define VT_FALSE 0 - -BEGIN_EXTERN_C() - -PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC); -PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC); -PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC); -PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TSRMLS_DC); -PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC); -PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int codepage TSRMLS_DC); - -END_EXTERN_C() - -#endif \ No newline at end of file diff --git a/ext/com/php_COM.h b/ext/com/php_COM.h deleted file mode 100644 index 5c0155515bb..00000000000 --- a/ext/com/php_COM.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef PHP_COM_H -#define PHP_COM_H - -#if PHP_WIN32 - -#include "com.h" - -BEGIN_EXTERN_C() - -PHP_MINIT_FUNCTION(COM); -PHP_MSHUTDOWN_FUNCTION(COM); - -PHP_FUNCTION(com_load); -PHP_FUNCTION(com_invoke); -PHP_FUNCTION(com_addref); -PHP_FUNCTION(com_release); -PHP_FUNCTION(com_propget); -PHP_FUNCTION(com_propput); -PHP_FUNCTION(com_load_typelib); -PHP_FUNCTION(com_isenum); - -PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC); -PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC); -PHPAPI HRESULT php_COM_release(comval *obj TSRMLS_DC); -PHPAPI HRESULT php_COM_addref(comval *obj TSRMLS_DC); -PHPAPI HRESULT php_COM_destruct(comval *obj TSRMLS_DC); -PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* pDisp, int cleanup TSRMLS_DC); -PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup TSRMLS_DC); -PHPAPI char *php_COM_error_message(HRESULT hr TSRMLS_DC); -PHPAPI int php_COM_get_le_comval(); -PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value); -PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference); -PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); - -zend_module_entry COM_module_entry; -zend_class_entry COM_class_entry; - -#ifdef DEBUG - extern int resourcecounter; -#endif - -END_EXTERN_C() - -#define phpext_com_ptr &COM_module_entry - -#else - -#define phpext_com_ptr NULL - -#endif /* PHP_WIN32 */ - -#endif /* PHP_COM_H */ diff --git a/ext/com/php_VARIANT.h b/ext/com/php_VARIANT.h deleted file mode 100644 index 54347461c86..00000000000 --- a/ext/com/php_VARIANT.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef PHP_TYPEDEF_VARIANT_H -#define PHP_TYPEDEF_VARIANT_H - -#if PHP_WIN32 - -BEGIN_EXTERN_C() - -#include "conversion.h" -#include "variant.h" - -void php_VARIANT_init(int module_number TSRMLS_DC); - -PHPAPI int php_VARIANT_get_le_variant(); - -END_EXTERN_C() - -#endif /* PHP_WIN32 */ - -#endif /* PHP_TYPEDEF_VARIANT_H */ diff --git a/ext/com/variant.h b/ext/com/variant.h deleted file mode 100644 index 3fd11f32e47..00000000000 --- a/ext/com/variant.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef VARIANT_H -#define VARIANT_H - -#if PHP_WIN32 - -#define ALLOC_VARIANT(v) (v) = (VARIANT *) emalloc(sizeof(VARIANT)); \ - VariantInit(v); - -#define FREE_VARIANT(v) VariantClear(v); \ - efree(v); - - -#define IS_VARIANT php_VARIANT_get_le_variant() - -#define ZVAL_VARIANT(z, v) if (V_VT(v) == VT_DISPATCH) { \ - comval *obj; \ - ALLOC_COM(obj); \ - php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \ - ZVAL_LONG((z), zend_list_insert(obj, IS_COM)); \ - } else { \ - php_variant_to_pval((v), (z), codepage TSRMLS_CC); \ - FREE_VARIANT(v); \ - } - -#define RETVAL_VARIANT(v) ZVAL_VARIANT(return_value, (v)); -#define RETURN_VARIANT(v) RETVAL_VARIANT(v) \ - return; - - -#endif /* PHP_WIN32 */ - -#endif /* VARIANT_H */ diff --git a/ext/cpdf/CREDITS b/ext/cpdf/CREDITS deleted file mode 100644 index 94cc1de43ca..00000000000 --- 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 d48c8366f14..00000000000 --- a/ext/cpdf/config.m4 +++ /dev/null @@ -1,70 +0,0 @@ -dnl $Id$ - -AC_MSG_CHECKING(for cpdflib support) -AC_ARG_WITH(cpdflib, -[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).], -[ - case $withval in - no) - AC_MSG_RESULT(no) ;; - yes) - AC_MSG_RESULT(yes) - PHP_NEW_EXTENSION(cpdf, cpdf.c) - AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])], - [AC_MSG_ERROR([Cpdf module requires cpdflib >= 2.])]) - PHP_ADD_LIBRARY(cpdf) - PHP_ADD_LIBRARY(tiff) - PHP_ADD_LIBRARY(jpeg) - ;; - *) - test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE=$withval/include - if test -n "$CPDFLIB_INCLUDE" ; then - AC_MSG_RESULT(yes) - PHP_NEW_EXTENSION(cpdf, cpdf.c) - old_LIBS=$LIBS - old_withval=$withval - - AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)]) - AC_ARG_WITH(jpeg-dir, - [ --with-jpeg-dir[=DIR] jpeg dir for cpdflib 2.x],[ - AC_MSG_RESULT(yes) - if test -z $withval; then - withval=/usr/local - fi - LIBS="$LIBS -L$withval/lib" - AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_RESULT(no)],) - PHP_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib) - ],[ - AC_MSG_RESULT(no) - AC_MSG_WARN(If configure fails try --with-jpeg-dir=
) - ]) - - AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)]) - AC_ARG_WITH(tiff-dir, - [ --with-tiff-dir[=DIR] tiff dir for cpdflib 2.x],[ - AC_MSG_RESULT(yes) - if test -z $withval; then - withval=/usr/local - fi - LIBS="$LIBS -L$withval/lib" - AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no)],) - PHP_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib) - ],[ - AC_MSG_RESULT(no) - AC_MSG_WARN(If configure fails try --with-tiff-dir=) - ]) - withval=$old_withval - - LIBS="$LIBS -L$withval/lib" - AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])], - [AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])]) - LIBS=$old_LIBS - PHP_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib) - PHP_ADD_INCLUDE($CPDFLIB_INCLUDE) - else - AC_MSG_RESULT(no) - fi ;; - esac -],[ - AC_MSG_RESULT(no) -]) diff --git a/ext/cpdf/cpdf.c b/ext/cpdf/cpdf.c deleted file mode 100644 index c11506f50ea..00000000000 --- a/ext/cpdf/cpdf.c +++ /dev/null @@ -1,2719 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ -/* 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 !PHP_31 && 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 -#if HAVE_LIBGD13 -#include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef PHP_WIN32 -# include -# include -#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 - -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 void 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) -{ - pval *argv[5]; - int argc; - - argc = ZEND_NUM_ARGS(); - if(argc != 5) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_long(argv[1]); - convert_to_long(argv[2]); - convert_to_long(argv[3]); - convert_to_long(argv[4]); - - cpdf_setGlobalDocumentLimits(Z_LVAL_P(argv[0]), Z_LVAL_P(argv[1]), Z_LVAL_P(argv[2]), Z_LVAL_P(argv[3]), Z_LVAL_P(argv[4])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool cpdf_set_creator(int pdfdoc, string creator) - Sets the creator field */ -PHP_FUNCTION(cpdf_set_creator) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); - RETURN_FALSE; - } - - cpdf_setCreator(pdf, Z_STRVAL_P(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) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); - RETURN_FALSE; - } - - cpdf_setTitle(pdf, Z_STRVAL_P(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) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); - RETURN_FALSE; - } - - cpdf_setSubject(pdf, Z_STRVAL_P(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) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if (!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d (type=%d)", id, type); - RETURN_FALSE; - } - - cpdf_setKeywords(pdf, Z_STRVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) - WRONG_PARAM_COUNT; - - if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(arg1); - convert_to_array(arg2); - - id = Z_LVAL_P (arg1); - - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if (zend_hash_find (Z_ARRVAL_P(arg2), "pagemode", sizeof ("pagemode"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.pageMode = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "hidetoolbar", sizeof ("hidetoolbar"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.hideToolbar = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "hidemenubar", sizeof ("hidemenubar"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.hideMenubar = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "hidewindowui", sizeof ("hidewindowui"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.hideWindowUI = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "fitwindow", sizeof ("fitwindow"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.fitWindow = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "centerwindow", sizeof ("centerwindow"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.centerWindow = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(arg2), "pagelayout", sizeof ("pagelayout"), (void **) &zvalue) == SUCCESS) - { - convert_to_long_ex (zvalue); - vP.pageLayout = Z_LVAL_PP (zvalue); - } - if (zend_hash_find (Z_ARRVAL_P(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) -{ - pval *arg1, *arg2, *arg3; - int id, argc; - CPDFdoc *cpdf; - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 1: - if (getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 2: - if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - case 3: - if (getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - default: - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - - cpdf = cpdf_open(0, NULL); - if(!cpdf) - RETURN_FALSE; - if(Z_LVAL_P(arg1) == 1) - cpdf_enableCompression(cpdf, YES); - else - cpdf_enableCompression(cpdf, NO); - - if(argc > 1) { - convert_to_string(arg2); -#if APACHE - if(strcmp(Z_STRVAL_P(arg2), "-") == 0) - php_error(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 - cpdf_setOutputFilename(cpdf, Z_STRVAL_P(arg2)); - } - cpdf_init(cpdf); - - id = zend_list_insert(cpdf, CPDF_GLOBAL(le_cpdf)); - RETURN_LONG(id); -} -/* }}} */ - -/* {{{ proto void cpdf_close(int pdfdoc) - Closes the pdf document */ -PHP_FUNCTION(cpdf_close) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - zend_list_delete(id); - - RETURN_TRUE; -} -/* }}} */ - -#define BUFFERLEN 40 -/* {{{ proto void cpdf_page_init(int pdfdoc, int pagenr, int orientation, int height, int width [, float unit]) - Starts page */ -PHP_FUNCTION(cpdf_page_init) -{ - pval *argv[6]; - int id, type, pagenr, orientation; - int height, width, argc; - char buffer[BUFFERLEN]; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if(argc < 5 || argc > 6) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_long(argv[1]); - convert_to_long(argv[2]); - convert_to_long(argv[3]); - convert_to_long(argv[4]); - id=Z_LVAL_P(argv[0]); - pagenr=Z_LVAL_P(argv[1]); - orientation=Z_LVAL_P(argv[2]); - height = Z_LVAL_P(argv[3]); - width = Z_LVAL_P(argv[4]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 5) { - convert_to_double(argv[5]); - if(Z_DVAL_P(argv[5]) > 0.0) - cpdf_setDefaultDomainUnit(pdf, Z_DVAL_P(argv[5])); - } - snprintf(buffer, BUFFERLEN, "0 0 %d %d", width, height); - cpdf_pageInit(pdf, pagenr, orientation, buffer, buffer); - - RETURN_TRUE; -} -/* }}} */ -#undef BUFFERLEN - -/* {{{ proto void cpdf_finalize_page(int pdfdoc, int pagenr) - Ends the page to save memory */ -PHP_FUNCTION(cpdf_finalize_page) -{ - pval *arg1, *arg2; - int id, type, pagenr; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - id=Z_LVAL_P(arg1); - pagenr=Z_LVAL_P(arg2); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_finalizePage(pdf, pagenr); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_current_page(int pdfdoc, int pagenr) - Sets page for output */ -PHP_FUNCTION(cpdf_set_current_page) -{ - pval *arg1, *arg2; - int id, type, pagenr; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - id=Z_LVAL_P(arg1); - pagenr=Z_LVAL_P(arg2); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setCurrentPage(pdf, pagenr); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_begin_text(int pdfdoc) - Starts text section */ -PHP_FUNCTION(cpdf_begin_text) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_beginText(pdf, 0); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_end_text(int pdfdoc) - Ends text section */ -PHP_FUNCTION(cpdf_end_text) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_endText(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_show(int pdfdoc, string text) - Output text at current position */ -PHP_FUNCTION(cpdf_show) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_textShow(pdf, Z_STRVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_show_xy(int pdfdoc, string text, float x-koor, float y-koor [, int mode]) - Output text at position */ -PHP_FUNCTION(cpdf_show_xy) -{ - pval *argv[5]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 4) || (argc > 5)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_string(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc == 5) { - convert_to_long(argv[4]); - mode = Z_LVAL_P(argv[4]); - } - if(mode == 1) - cpdf_rawText(pdf, (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3]), 0.0, Z_STRVAL_P(argv[1])); - else - cpdf_text(pdf, (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3]), 0.0, Z_STRVAL_P(argv[1])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_continue_text(int pdfdoc, string text) - Outputs text in next line */ -PHP_FUNCTION(cpdf_continue_text) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_textCRLFshow(pdf, Z_STRVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_text(int pdfdoc, string text [, float x-koor, float y-koor [, int mode [, float orientation [, int alignmode]]]]) - Outputs text */ -PHP_FUNCTION(cpdf_text) -{ - pval *argv[7]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 2) || (argc == 3) || (argc > 7) || getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_string(argv[1]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 4) { - convert_to_long(argv[4]); - mode = Z_LVAL_P(argv[2]); - } - switch(argc) { - case 2: - cpdf_textShow(pdf, Z_STRVAL_P(argv[1])); - break; - case 4: - convert_to_double(argv[2]); - convert_to_double(argv[3]); - cpdf_text(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - 0.0, - Z_STRVAL_P(argv[1])); - break; - case 5: - convert_to_double(argv[2]); - convert_to_double(argv[3]); - if(mode == 1) - cpdf_rawText(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - 0.0, - Z_STRVAL_P(argv[1])); - else - cpdf_text(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - 0.0, - Z_STRVAL_P(argv[1])); - break; - case 6: - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[5]); - if(mode == 1) - cpdf_rawText(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[5]), - Z_STRVAL_P(argv[1])); - else - cpdf_text(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[5]), - Z_STRVAL_P(argv[1])); - break; - case 7: - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[5]); - convert_to_long(argv[6]); - if(mode == 1) - cpdf_rawTextAligned(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[5]), - Z_LVAL_P(argv[6]), - Z_STRVAL_P(argv[1])); - else - cpdf_textAligned(pdf, (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[5]), - Z_LVAL_P(argv[6]), - Z_STRVAL_P(argv[1])); - break; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_font(int pdfdoc, string font, float size, string encoding) - Selects the current font face, size and encoding */ -PHP_FUNCTION(cpdf_set_font) -{ - pval *arg1, *arg2, *arg3, *arg4; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 4 || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - convert_to_double(arg3); - convert_to_string(arg4); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - -/* if(Z_LVAL_P(arg4) > 6) { - php_error(E_WARNING, "Font encoding set to 5"); - Z_LVAL_P(arg4) = 5; - } -*/ - cpdf_setFont(pdf, Z_STRVAL_P(arg2), Z_STRVAL_P(arg4), (float) Z_DVAL_P(arg3)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_font_directories(int pdfdoc, string pfmdir, string pfbdir) - Sets directories to search when using external fonts */ -PHP_FUNCTION(cpdf_set_font_directories) -{ - pval *arg1, *arg2, *arg3; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - convert_to_string(arg3); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setFontDirectories(pdf, Z_STRVAL_P(arg2), Z_STRVAL_P(arg3)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setFontMapFile(pdf, Z_STRVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_leading(int pdfdoc, float distance) - Sets distance between text lines */ -PHP_FUNCTION(cpdf_set_leading) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setTextLeading(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_text_rendering(int pdfdoc, int rendermode) - Determines how text is rendered */ -PHP_FUNCTION(cpdf_set_text_rendering) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setTextRenderingMode(pdf, Z_LVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_horiz_scaling(int pdfdoc, float scale) - Sets horizontal scaling of text */ -PHP_FUNCTION(cpdf_set_horiz_scaling) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setHorizontalScaling(pdf, (float) Z_DVAL_P(arg2) * 100.0); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_text_rise(int pdfdoc, float value) - Sets the text rise */ -PHP_FUNCTION(cpdf_set_text_rise) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setTextRise(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_text_matrix(int pdfdoc, arry matrix) - Sets the text matrix */ -PHP_FUNCTION(cpdf_set_text_matrix) -{ - pval *arg1, *arg2, *data; - int id, type, i; - HashTable *matrix; - CPDFdoc *pdf; - float *pdfmatrixptr; - float pdfmatrix[6]; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_array(arg2); - id=Z_LVAL_P(arg1); - matrix=Z_ARRVAL_P(arg2); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(zend_hash_num_elements(matrix) != 6) { - php_error(E_WARNING, "Text matrix must have 6 elements"); - RETURN_FALSE; - } - - pdfmatrixptr = pdfmatrix; - zend_hash_internal_pointer_reset(matrix); - for(i=0; i 4)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 3) { - convert_to_long(argv[3]); - mode = Z_LVAL_P(argv[3]); - } - if(mode == 1) - cpdf_rawSetTextPosition(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - else - cpdf_setTextPosition(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_rotate_text(int pdfdoc, float angle) - Sets text rotation angle */ -PHP_FUNCTION(cpdf_rotate_text) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_rotateText(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_char_spacing(int pdfdoc, float space) - Sets character spacing */ -PHP_FUNCTION(cpdf_set_char_spacing) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setCharacterSpacing(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_set_word_spacing(int pdfdoc, float space) - Sets spacing between words */ -PHP_FUNCTION(cpdf_set_word_spacing) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setWordSpacing(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto float cpdf_stringwidth(int pdfdoc, string text) - Returns width of text in current font */ -PHP_FUNCTION(cpdf_stringwidth) -{ - pval *arg1, *arg2; - int id, type; - double width; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - width = (double) cpdf_stringWidth(pdf, Z_STRVAL_P(arg2)); - - RETURN_DOUBLE((double)width); -} -/* }}} */ - -/* {{{ proto void cpdf_save(int pdfdoc) - Saves current enviroment */ -PHP_FUNCTION(cpdf_save) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_gsave(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_restore(int pdfdoc) - Restores formerly saved enviroment */ -PHP_FUNCTION(cpdf_restore) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_grestore(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_translate(int pdfdoc, float x, float y) - Sets origin of coordinate system */ -PHP_FUNCTION(cpdf_translate) -{ - pval *arg1, *arg2, *arg3; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - convert_to_double(arg3); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_rawTranslate(pdf, (float) Z_DVAL_P(arg2), (float) Z_DVAL_P(arg3)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_scale(int pdfdoc, float x_scale, float y_scale) - Sets scaling */ -PHP_FUNCTION(cpdf_scale) -{ - pval *arg1, *arg2, *arg3; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - convert_to_double(arg3); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_scale(pdf, (float) Z_DVAL_P(arg2), (float) Z_DVAL_P(arg3)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_rotate(int pdfdoc, float angle) - Sets rotation */ -PHP_FUNCTION(cpdf_rotate) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_rotate(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setflat(int pdfdoc, float value) - Sets flatness */ -PHP_FUNCTION(cpdf_setflat) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if((Z_LVAL_P(arg2) > 100) && (Z_LVAL_P(arg2) < 0)) { - php_error(E_WARNING, "Parameter of pdf_setflat() has to between 0 and 100"); - RETURN_FALSE; - } - - cpdf_setflat(pdf, (int) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setlinejoin(int pdfdoc, int value) - Sets linejoin parameter */ -PHP_FUNCTION(cpdf_setlinejoin) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if((Z_LVAL_P(arg2) > 2) && (Z_LVAL_P(arg2) < 0)) { - php_error(E_WARNING, "Parameter of pdf_setlinejoin() has to between 0 and 2"); - RETURN_FALSE; - } - - cpdf_setlinejoin(pdf, Z_LVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setlinecap(int pdfdoc, int value) - Sets linecap parameter */ -PHP_FUNCTION(cpdf_setlinecap) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if((Z_LVAL_P(arg2) > 2) && (Z_LVAL_P(arg2) < 0)) { - php_error(E_WARNING, "Parameter of pdf_setlinecap() has to be > 0 and =< 2"); - RETURN_FALSE; - } - - cpdf_setlinecap(pdf, Z_LVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setmiterlimit(int pdfdoc, float value) - Sets miter limit */ -PHP_FUNCTION(cpdf_setmiterlimit) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(Z_DVAL_P(arg2) < 1) { - php_error(E_WARNING, "Parameter of pdf_setmiterlimit() has to be >= 1"); - RETURN_FALSE; - } - - cpdf_setmiterlimit(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setlinewidth(int pdfdoc, float width) - Sets line width */ -PHP_FUNCTION(cpdf_setlinewidth) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setlinewidth(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -#define BUFFERLEN 20 -/* {{{ proto void cpdf_setdash(int pdfdoc, long white, long black) - Sets dash pattern */ -PHP_FUNCTION(cpdf_setdash) -{ - pval *arg1, *arg2, *arg3; - int id, type; - char buffer[BUFFERLEN]; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &arg1, &arg2, &arg3) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - convert_to_long(arg3); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - snprintf(buffer, BUFFERLEN, "[%d %d] 0", (int) Z_LVAL_P(arg2), (int) Z_LVAL_P(arg3)); - cpdf_setdash(pdf, buffer); - - RETURN_TRUE; -} -/* }}} */ -#undef BUFFERLEN - -/* {{{ proto void cpdf_moveto(int pdfdoc, float x, float y [, int mode]) - Sets current point */ -PHP_FUNCTION(cpdf_moveto) -{ - pval *argv[4]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 3) || (argc > 4)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 3) { - convert_to_long(argv[3]); - mode = Z_LVAL_P(argv[3]); - } - if(mode == 1) - cpdf_rawMoveto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - else - cpdf_moveto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_rmoveto(int pdfdoc, float x, float y [, int mode]) - Sets current point */ -PHP_FUNCTION(cpdf_rmoveto) -{ - pval *argv[4]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 3) || (argc > 4)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 3) { - convert_to_long(argv[3]); - mode = Z_LVAL_P(argv[3]); - } - if(mode == 1) - cpdf_rawRmoveto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - else - cpdf_rmoveto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) -{ - pval *argv[8]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 7) || (argc > 8)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_double(argv[5]); - convert_to_double(argv[6]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 7) { - convert_to_long(argv[7]); - mode = Z_LVAL_P(argv[7]); - } - if(mode == 1) - cpdf_rawCurveto(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - (float) Z_DVAL_P(argv[5]), - (float) Z_DVAL_P(argv[6])); - else - cpdf_curveto(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - (float) Z_DVAL_P(argv[5]), - (float) Z_DVAL_P(argv[6])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_lineto(int pdfdoc, float x, float y [, int mode]) - Draws a line */ -PHP_FUNCTION(cpdf_lineto) -{ - pval *argv[4]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 3) || (argc > 4)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 3) { - convert_to_long(argv[3]); - mode = Z_LVAL_P(argv[3]); - } - if(mode == 1) - cpdf_rawLineto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - else - cpdf_lineto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_rlineto(int pdfdoc, float x, float y [, int mode]) - Draws a line relative to current point */ -PHP_FUNCTION(cpdf_rlineto) -{ - pval *argv[4]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 3) || (argc > 4)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 3) { - convert_to_long(argv[3]); - mode = Z_LVAL_P(argv[3]); - } - if(mode == 1) - cpdf_rawRlineto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - else - cpdf_rlineto(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_circle(int pdfdoc, float x, float y, float radius [, int mode]) - Draws a circle */ -PHP_FUNCTION(cpdf_circle) -{ - pval *argv[5]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 4) || (argc > 5)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 4) { - convert_to_long(argv[4]); - mode = Z_LVAL_P(argv[4]); - } - if(mode == 1) - cpdf_rawCircle(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3])); - else - cpdf_circle(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_arc(int pdfdoc, float x, float y, float radius, float start, float end [, int mode]) - Draws an arc */ -PHP_FUNCTION(cpdf_arc) -{ - pval *argv[7]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 6) || (argc > 7)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_double(argv[5]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 6) { - convert_to_long(argv[6]); - mode = Z_LVAL_P(argv[6]); - } - if(mode == 1) - cpdf_rawArc(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3]), (float) Z_DVAL_P(argv[4]), (float) Z_DVAL_P(argv[5]), 1); - else - cpdf_arc(pdf, (float) Z_DVAL_P(argv[1]), (float) Z_DVAL_P(argv[2]), (float) Z_DVAL_P(argv[3]), (float) Z_DVAL_P(argv[4]), (float) Z_DVAL_P(argv[5]), 1); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_rect(int pdfdoc, float x, float y, float width, float height [, int mode]) - Draws a rectangle */ -PHP_FUNCTION(cpdf_rect) -{ - pval *argv[6]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 5) || (argc > 6)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 5) { - convert_to_long(argv[5]); - mode = Z_LVAL_P(argv[5]); - } - if(mode == 1) - cpdf_rawRect(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4])); - else - cpdf_rect(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4])); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_newpath(int pdfdoc) - Starts new path */ -PHP_FUNCTION(cpdf_newpath) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_newpath(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_closepath(int pdfdoc) - Close path */ -PHP_FUNCTION(cpdf_closepath) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_closepath(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_closepath_stroke(int pdfdoc) - Close path and draw line along path */ -PHP_FUNCTION(cpdf_closepath_stroke) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_closepath(pdf); - cpdf_stroke(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_stroke(int pdfdoc) - Draws line along path path */ -PHP_FUNCTION(cpdf_stroke) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_stroke(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_fill(int pdfdoc) - Fills current path */ -PHP_FUNCTION(cpdf_fill) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_fill(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_fill_stroke(int pdfdoc) - Fills and stroke current path */ -PHP_FUNCTION(cpdf_fill_stroke) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_fill(pdf); - cpdf_stroke(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_closepath_fill_stroke(int pdfdoc) - Close, fill and stroke current path */ -PHP_FUNCTION(cpdf_closepath_fill_stroke) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_closepath(pdf); - cpdf_fill(pdf); - cpdf_stroke(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_clip(int pdfdoc) - Clips to current path */ -PHP_FUNCTION(cpdf_clip) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_clip(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setgray_fill(int pdfdoc, float value) - Sets filling color to gray value */ -PHP_FUNCTION(cpdf_setgray_fill) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setgrayFill(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setgray_stroke(int pdfdoc, float value) - Sets drawing color to gray value */ -PHP_FUNCTION(cpdf_setgray_stroke) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setgrayStroke(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setgray(int pdfdoc, float value) - Sets drawing and filling color to gray value */ -PHP_FUNCTION(cpdf_setgray) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setgray(pdf, (float) Z_DVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setrgbcolor_fill(int pdfdoc, float red, float green, float blue) - Sets filling color to rgb color value */ -PHP_FUNCTION(cpdf_setrgbcolor_fill) -{ - pval *arg1, *arg2, *arg3, *arg4; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 4 || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - convert_to_double(arg3); - convert_to_double(arg4); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setrgbcolorFill(pdf, (float) Z_DVAL_P(arg2), (float) Z_DVAL_P(arg3), (float) Z_DVAL_P(arg4)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setrgbcolor_stroke(int pdfdoc, float red, float green, float blue) - Sets drawing color to RGB color value */ -PHP_FUNCTION(cpdf_setrgbcolor_stroke) -{ - pval *arg1, *arg2, *arg3, *arg4; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 4 || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - convert_to_double(arg3); - convert_to_double(arg4); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setrgbcolorStroke(pdf, (float) Z_DVAL_P(arg2), (float) Z_DVAL_P(arg3), (float) Z_DVAL_P(arg4)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void cpdf_setrgbcolor(int pdfdoc, float red, float green, float blue) - Sets drawing and filling color to RGB color value */ -PHP_FUNCTION(cpdf_setrgbcolor) -{ - pval *arg1, *arg2, *arg3, *arg4; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 4 || getParameters(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_double(arg2); - convert_to_double(arg3); - convert_to_double(arg4); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setrgbcolor(pdf, (float) Z_DVAL_P(arg2), (float) Z_DVAL_P(arg3), (float) Z_DVAL_P(arg4)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) -{ - pval *arg1, *arg2, *arg3, *arg4, *arg5, *arg6; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 6 || getParameters(ht, 6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_long(arg2); - convert_to_double(arg3); - convert_to_double(arg4); - convert_to_long(arg5); - convert_to_long(arg6); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_setPageTransition(pdf, Z_LVAL_P(arg2), Z_DVAL_P(arg3), Z_DVAL_P(arg4), - Z_LVAL_P(arg5), Z_LVAL_P(arg6)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array cpdf_finalize(int pdfdoc) - Creates PDF doc in memory */ -PHP_FUNCTION(cpdf_finalize) -{ - pval *arg1; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - cpdf_finalizeAll(pdf); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array cpdf_output_buffer(int pdfdoc) - Returns the internal memory stream as string */ -PHP_FUNCTION(cpdf_output_buffer) -{ - pval *arg1; - int id, type, lenght; - CPDFdoc *pdf; - char *buffer; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &arg1) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - buffer = cpdf_getBufferForPDF(pdf, &lenght); - - php_write(buffer, lenght TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array cpdf_save_to_file(int pdfdoc, string filename) - Saves the internal memory stream to a file */ -PHP_FUNCTION(cpdf_save_to_file) -{ - pval *arg1, *arg2; - int id, type; - CPDFdoc *pdf; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(arg1); - convert_to_string(arg2); - id=Z_LVAL_P(arg1); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - -#if APACHE - if(strcmp(Z_STRVAL_P(arg2), "-") == 0) - php_error(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 - - cpdf_savePDFmemoryStreamToFile(pdf, Z_STRVAL_P(arg2)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) -{ - pval *argv[11]; - int id, type, argc, mode=0; - float width, height, xscale, yscale; - CPDFdoc *pdf; - - argc = ZEND_NUM_ARGS(); - if((argc < 10) || (argc > 11)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_string(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_double(argv[5]); - width = (float) Z_DVAL_P(argv[5]); - convert_to_double(argv[6]); - height = (float) Z_DVAL_P(argv[6]); - convert_to_double(argv[7]); - xscale = (float) Z_DVAL_P(argv[7]); - convert_to_double(argv[8]); - yscale = (float) Z_DVAL_P(argv[8]); - convert_to_long(argv[9]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - if(argc > 10) { - convert_to_long(argv[10]); - mode = Z_LVAL_P(argv[10]); - } - if(mode == 1) - cpdf_rawImportImage(pdf, Z_STRVAL_P(argv[1]), - JPEG_IMG, - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - &width, - &height, - &xscale, - &yscale, - Z_LVAL_P(argv[9])); - else - cpdf_rawImportImage(pdf, Z_STRVAL_P(argv[1]), - JPEG_IMG, - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - &width, - &height, - &xscale, - &yscale, - Z_LVAL_P(argv[9])); - - RETURN_TRUE; -} -/* }}} */ - -#if HAVE_LIBGD13 -/* {{{ proto void 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) -{ - pval *argv[11]; - int id, gid, type, argc, mode=0; - int count, i, j, color; - CPDFdoc *pdf; - unsigned char *buffer, *ptr; - gdImagePtr im; - - argc = ZEND_NUM_ARGS(); - if((argc < 8) || (argc > 9)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_long(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_double(argv[5]); - convert_to_double(argv[6]); - convert_to_long(argv[7]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - gid=Z_LVAL_P(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(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(E_WARNING, "cpdf: Unable to find image pointer"); - RETURN_FALSE; - } - - if(argc > 8) { - convert_to_long(argv[8]); - mode = Z_LVAL_P(argv[8]); - } - - count = 3 * im->sx * im->sy; - if(NULL == (buffer = (unsigned char *) emalloc(count))) - RETURN_FALSE; - - ptr = buffer; - for(i=0; isy; i++) { - for(j=0; jsx; j++) { - color = im->pixels[i][j]; - *ptr++ = im->red[color]; - *ptr++ = im->green[color]; - *ptr++ = im->blue[color]; - } - } - - if(mode == 1) - cpdf_placeInLineImage(pdf, buffer, count, - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - (float) Z_DVAL_P(argv[5]), - (float) Z_DVAL_P(argv[6]), - im->sx, - im->sy, - 8, 2, Z_LVAL_P(argv[7])); - else - cpdf_rawPlaceInLineImage(pdf, buffer, count, - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - (float) Z_DVAL_P(argv[5]), - (float) Z_DVAL_P(argv[6]), - im->sx, - im->sy, - 8, 2, Z_LVAL_P(argv[7])); - - efree(buffer); - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto void 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) -{ - pval *argv[11]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - CPDFannotAttrib attrib; - - argc = ZEND_NUM_ARGS(); - if((argc < 7) || (argc > 8)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_string(argv[5]); - convert_to_string(argv[6]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - 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(argv[7]); - mode = Z_LVAL_P(argv[7]); - } - if(mode == 1) - cpdf_rawSetAnnotation(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - Z_STRVAL_P(argv[5]), - Z_STRVAL_P(argv[6]), - &attrib); - else - cpdf_setAnnotation(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - Z_STRVAL_P(argv[5]), - Z_STRVAL_P(argv[6]), - &attrib); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void 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) -{ - pval *argv[11]; - int id, type, argc, mode=0; - CPDFdoc *pdf; - CPDFannotAttrib attrib; - - argc = ZEND_NUM_ARGS(); - if((argc < 6) || (argc > 7)) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_double(argv[1]); - convert_to_double(argv[2]); - convert_to_double(argv[3]); - convert_to_double(argv[4]); - convert_to_string(argv[5]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - 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(argv[6]); - mode = Z_LVAL_P(argv[6]); - } - if(mode == 1) - cpdf_rawSetActionURL(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - Z_STRVAL_P(argv[5]), - &attrib); - else - cpdf_setActionURL(pdf, (float) Z_DVAL_P(argv[1]), - (float) Z_DVAL_P(argv[2]), - (float) Z_DVAL_P(argv[3]), - (float) Z_DVAL_P(argv[4]), - Z_STRVAL_P(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) -{ - pval *argv[11]; - int id, oid, type, argc; - CPDFdoc *pdf; - CPDFoutlineEntry *lastoutline; - - argc = ZEND_NUM_ARGS(); - if(argc != 6) - WRONG_PARAM_COUNT; - if (getParametersArray(ht, argc, argv) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(argv[0]); - convert_to_long(argv[1]); - convert_to_long(argv[2]); - convert_to_long(argv[3]); - convert_to_long(argv[4]); - convert_to_string(argv[5]); - id=Z_LVAL_P(argv[0]); - pdf = zend_list_find(id, &type); - if(!pdf || type!=CPDF_GLOBAL(le_cpdf)) { - php_error(E_WARNING, "Unable to find identifier %d", id); - RETURN_FALSE; - } - - oid=Z_LVAL_P(argv[1]); - lastoutline = zend_list_find(oid, &type); - if(!lastoutline || type!=CPDF_GLOBAL(le_outline)) { - lastoutline = NULL; -/* php_error(E_WARNING, "Unable to find last outline entry %d", id); - RETURN_FALSE; */ - } - - lastoutline = cpdf_addOutlineEntry(pdf, lastoutline, - Z_LVAL_P(argv[2]), - Z_LVAL_P(argv[3]), - Z_LVAL_P(argv[4]), - Z_STRVAL_P(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 671482e1343..00000000000 --- 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 php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.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 php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 cpdf.lib php4ts_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/php_cpdf.h b/ext/cpdf/php_cpdf.h deleted file mode 100644 index 48d26bedac7..00000000000 --- a/ext/cpdf/php_cpdf.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#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 - -#include - -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/crack/CREDITS b/ext/crack/CREDITS deleted file mode 100644 index ab451cac09f..00000000000 --- a/ext/crack/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -crack -Alexander Feldman diff --git a/ext/crack/EXPERIMENTAL b/ext/crack/EXPERIMENTAL deleted file mode 100644 index 6443e996464..00000000000 --- a/ext/crack/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/crack/config.m4 b/ext/crack/config.m4 deleted file mode 100644 index d88ccb14bf2..00000000000 --- a/ext/crack/config.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(crack, for CRACKlib support, -[ --with-crack[=DIR] Include crack support.]) - -if test "$PHP_CRACK" != "no"; then - - for i in /usr/local/lib /usr/lib $PHP_CRACK/lib $PHP_CRACK/cracklib; do - test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i - done - - for i in /usr/local/include /usr/include $PHP_CRACK/include $PHP_CRACK/cracklib; do - test -f $i/packer.h && CRACK_INCLUDEDIR=$i - done - - if test -z "$CRACK_LIBDIR"; then - AC_MSG_ERROR(Cannot find the cracklib library file) - fi - - if test -z "$CRACK_INCLUDEDIR"; then - AC_MSG_ERROR(Cannot find a cracklib header file) - fi - - PHP_ADD_INCLUDE($CRACK_INCLUDEDIR) - PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD) - - PHP_NEW_EXTENSION(crack, crack.c, $ext_shared) - PHP_SUBST(CRACK_SHARED_LIBADD) - AC_DEFINE(HAVE_CRACK, 1, [ ]) -fi - diff --git a/ext/crack/crack.c b/ext/crack/crack.c deleted file mode 100644 index da7bc547fb0..00000000000 --- a/ext/crack/crack.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Alexander Feldman | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_crack.h" - -#if HAVE_CRACK - -#include - -ZEND_DECLARE_MODULE_GLOBALS(crack) - -/* True global resources - no need for thread safety here */ -static int le_crack; - -function_entry crack_functions[] = { - ZEND_FE(crack_opendict, NULL) - ZEND_FE(crack_closedict, NULL) - ZEND_FE(crack_check, NULL) - ZEND_FE(crack_getlastmessage, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry crack_module_entry = { - STANDARD_MODULE_HEADER, - "crack", - crack_functions, - ZEND_MODULE_STARTUP_N(crack), - ZEND_MODULE_SHUTDOWN_N(crack), - ZEND_MODULE_ACTIVATE_N(crack), - ZEND_MODULE_DEACTIVATE_N(crack), - ZEND_MODULE_INFO_N(crack), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_CRACK -ZEND_GET_MODULE(crack) -#endif - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("crack.default_dictionary", NULL, PHP_INI_SYSTEM, OnUpdateString, default_dictionary, zend_crack_globals, crack_globals) -PHP_INI_END() - -long _crack_open_dict(char *dictpath TSRMLS_DC) -{ - PWDICT *pwdict; - long resource; - - if (CRACKG(current_id) != -1) { - zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack"); - return -1; - } - if (NULL == (pwdict = PWOpen(dictpath, "r"))) { - zend_error(E_WARNING, "Unable to open a crack dictionary"); - return -1; - } - - resource = zend_list_insert(pwdict, le_crack); - -/* if (CRACKG(current_id) != -1) { - zend_list_delete(CRACKG(current_id)); - } -*/ - CRACKG(current_id) = resource; - - return resource; -} - -void _close_crack_dict(PWDICT *pwdict) -{ - PWClose(pwdict); -} - -ZEND_MODULE_STARTUP_D(crack) -{ -#ifdef ZTS - zend_crack_globals *crack_globals; - - ts_allocate_id(&crack_globals_id, sizeof(zend_crack_globals), NULL, NULL); - crack_globals = ts_resource(crack_globals_id); -#endif - - REGISTER_INI_ENTRIES(); - - le_crack = register_list_destructors(_close_crack_dict, NULL); - - return SUCCESS; -} - -ZEND_MODULE_SHUTDOWN_D(crack) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -ZEND_MODULE_ACTIVATE_D(crack) -{ - CRACKG(last_message) = NULL; - CRACKG(current_id) = -1; - - return SUCCESS; -} - -ZEND_MODULE_DEACTIVATE_D(crack) -{ - if (NULL != CRACKG(last_message)) { - efree(CRACKG(last_message)); - } - return SUCCESS; -} - -ZEND_MODULE_INFO_D(crack) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "crack support", "enabled"); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -/* {{{ proto string crack_opendict(string dictionary) - Opens a new cracklib dictionary */ -ZEND_FUNCTION(crack_opendict) -{ - zval **dictpath; - long resource; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &dictpath) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(dictpath); - - if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath) TSRMLS_CC))) { - RETURN_FALSE; - } - - RETURN_RESOURCE(resource); -} -/* }}} */ - -/* {{{ proto string crack_closedict([int link_identifier]) - Closes an open cracklib dictionary */ -ZEND_FUNCTION(crack_closedict) -{ - PWDICT *pwdict; - zval **dictionary; - long id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = CRACKG(current_id); - break; - case 1: - if (zend_get_parameters_ex(1, &dictionary) == FAILURE) { - WRONG_PARAM_COUNT; - } - id = Z_LVAL_PP(dictionary); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(pwdict, PWDICT *, dictionary, id, "cracklib dictionary", le_crack); - if (CRACKG(current_id) == id) { - CRACKG(current_id) = -1; - } - zend_list_delete(id); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string crack_check([int dictionary,] string password) - Performs an obscure check with the given password */ -ZEND_FUNCTION(crack_check) -{ - zval **dictionary = NULL, **password; - char pwtrunced[STRINGSIZE]; - char *message; - PWDICT *pwdict; - long id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &password) == FAILURE) { - RETURN_FALSE; - } - if (NULL != CRACKG(default_dictionary) && CRACKG(current_id) == -1) { - _crack_open_dict(CRACKG(default_dictionary) TSRMLS_CC); - } - id = CRACKG(current_id); - break; - case 2: - if (zend_get_parameters_ex(2, &dictionary, &password) == FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(pwdict, PWDICT *, dictionary, id, "cracklib dictionary", le_crack); - convert_to_string_ex(password); - - /* Prevent buffer overflow attacks. */ - strlcpy(pwtrunced, Z_STRVAL_PP(password), sizeof(pwtrunced)); - - message = (char *)FascistLook(pwdict, pwtrunced); - - if (NULL != CRACKG(last_message)) { - efree(CRACKG(last_message)); - } - - if (NULL == message) { - CRACKG(last_message) = estrdup("strong password"); - RETURN_TRUE; - } - - CRACKG(last_message) = estrdup(message); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string crack_getlastmessage(void) - Returns the message from the last obscure check */ -ZEND_FUNCTION(crack_getlastmessage) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (NULL == CRACKG(last_message)) { - zend_error(E_WARNING, "No obscure checks in this session"); - RETURN_FALSE; - } - - RETURN_STRING(CRACKG(last_message), 1); -} -/* }}} */ - -#endif /* HAVE_CRACK */ - - -/* - * 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/crack/php_crack.h b/ext/crack/php_crack.h deleted file mode 100644 index 22f0510ccec..00000000000 --- a/ext/crack/php_crack.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Alexander Feldman | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef ZEND_CRACK_H -#define ZEND_CRACK_H - -#if HAVE_CRACK - -extern zend_module_entry crack_module_entry; -#define phpext_crack_ptr &crack_module_entry - -#ifdef ZEND_WIN32 -#define ZEND_CRACK_API __declspec(dllexport) -#else -#define ZEND_CRACK_API -#endif - -ZEND_MINIT_FUNCTION(crack); -ZEND_MSHUTDOWN_FUNCTION(crack); -ZEND_RINIT_FUNCTION(crack); -ZEND_RSHUTDOWN_FUNCTION(crack); -PHP_MINFO_FUNCTION(crack); - -ZEND_FUNCTION(crack_opendict); -ZEND_FUNCTION(crack_closedict); -ZEND_FUNCTION(crack_check); -ZEND_FUNCTION(crack_getlastmessage); - -ZEND_BEGIN_MODULE_GLOBALS(crack) - char *default_dictionary; - char *last_message; - long current_id; -ZEND_END_MODULE_GLOBALS(crack) - -#ifdef ZTS -#define CRACKG(v) TSRMG(crack_globals_id, zend_crack_globals *, v) -#else -#define CRACKG(v) (crack_globals.v) -#endif - -#else - -#define phpext_crack_ptr NULL - -#endif - -#endif /* ZEND_CRACK_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/crack/tests/001.phpt b/ext/crack/tests/001.phpt deleted file mode 100644 index dc18ef55595..00000000000 --- a/ext/crack/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for crack presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -crack extension is available \ No newline at end of file diff --git a/ext/ctype/CREDITS b/ext/ctype/CREDITS deleted file mode 100644 index 22de9027099..00000000000 --- a/ext/ctype/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ctype -Hartmut Holzgraefe diff --git a/ext/ctype/README b/ext/ctype/README deleted file mode 100644 index 1e78a3d9339..00000000000 --- a/ext/ctype/README +++ /dev/null @@ -1,5 +0,0 @@ -this is an experimental extension that provides the -ctype family of function available in C -i'm not sure about whether they should go into ext/standard -or stay as an extension of their own and about using -a ctype_ prefix or sticking with the C names ... diff --git a/ext/ctype/config.m4 b/ext/ctype/config.m4 deleted file mode 100644 index 7d575a3adcd..00000000000 --- a/ext/ctype/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ctype, whether to enable ctype functions, -[ --disable-ctype Disable ctype functions], yes) - -if test "$PHP_CTYPE" != "no"; then - AC_DEFINE(HAVE_CTYPE, 1, [ ]) - PHP_NEW_EXTENSION(ctype, ctype.c, $ext_shared) -fi diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c deleted file mode 100644 index 1298298ed5d..00000000000 --- a/ext/ctype/ctype.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ctype.h" -#include "SAPI.h" -#include "ext/standard/info.h" - -#include - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_CTYPE - -/* If you declare any globals in php_ctype.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(ctype) -*/ - -/* True global resources - no need for thread safety here */ -/* static int le_ctype; */ - -/* {{{ ctype_functions[] - * Every user visible function must have an entry in ctype_functions[]. - */ -function_entry ctype_functions[] = { - PHP_FE(ctype_alnum, NULL) - PHP_FE(ctype_alpha, NULL) - PHP_FE(ctype_cntrl, NULL) - PHP_FE(ctype_digit, NULL) - PHP_FE(ctype_lower, NULL) - PHP_FE(ctype_graph, NULL) - PHP_FE(ctype_print, NULL) - PHP_FE(ctype_punct, NULL) - PHP_FE(ctype_space, NULL) - PHP_FE(ctype_upper, NULL) - PHP_FE(ctype_xdigit, NULL) - {NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */ -}; -/* }}} */ - -/* {{{ ctype_mpodule_entry - */ -zend_module_entry ctype_module_entry = { - STANDARD_MODULE_HEADER, - "ctype", - ctype_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(ctype), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CTYPE -ZEND_GET_MODULE(ctype) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(ctype) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ctype functions", "enabled (experimental)"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ ctype - */ -#define CTYPE(iswhat) \ - zval *c; \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \ - return; \ - switch (Z_TYPE_P(c)) { \ - case IS_LONG: \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ - case IS_STRING: \ - { \ - char *p; \ - int n, len; \ - p=Z_STRVAL_P(c); \ - len = Z_STRLEN_P(c); \ - for(n=0;n -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=ctype - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "ctype.mak" CFG="ctype - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ctype - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "ctype - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ctype - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D HAVE_CTYPE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ctype.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "ctype - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CTYPE=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ctype.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "ctype - Win32 Release_TS" -# Name "ctype - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\ctype.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_ctype.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/ctype/ctype.xml b/ext/ctype/ctype.xml deleted file mode 100644 index 5837b9b5d00..00000000000 --- a/ext/ctype/ctype.xml +++ /dev/null @@ -1,245 +0,0 @@ - - Character type functions - ctype - - - - These functions check whether a character or string - falls into a certain character class according to the i - current locale. - - - When called with an integer argument theese functions - behave exactly like their C counterparts. - - - When called with a string argument they will check - every character in the string and will only return - true if every character in the string matches the - requested criteria. - - - Passing anything else but a string or integer will - return false immediately. - - - - - - - isalnum - Check for alphanumeric character(s) - - - Description - - - bool isalnum - string c - - - - See also setlocale. - - - - - - - isalpha - - - - Description - - - bool isalpha - string c - - - - - - - - - - iscntrl - - - - Description - - - bool iscntrl - string c - - - - - - - - - - isdigit - - - - Description - - - bool isdigit - string c - - - - - - - - - - islower - - - - Description - - - bool islower - string c - - - - - - - - - - isgraph - - - - Description - - - bool isgraph - string c - - - - - - - - - - isprint - - - - Description - - - bool isprint - string c - - - - - - - - - - ispunct - - - - Description - - - bool ispunct - string c - - - - - - - - - - isspace - - - - Description - - - bool isspace - string c - - - - - - - - - - isupper - - - - Description - - - bool isupper - string c - - - - - - - - - - isxdigit - - - - Description - - - bool isxdigit - string c - - - - - - - - - - - diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h deleted file mode 100644 index 4754b1045e0..00000000000 --- a/ext/ctype/php_ctype.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_CTYPE_H -#define PHP_CTYPE_H - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_CTYPE - -extern zend_module_entry ctype_module_entry; -#define phpext_ctype_ptr &ctype_module_entry - -#ifdef PHP_WIN32 -#define PHP_CTYPE_API __declspec(dllexport) -#else -#define PHP_CTYPE_API -#endif - -PHP_MINIT_FUNCTION(ctype); -PHP_MSHUTDOWN_FUNCTION(ctype); -PHP_RINIT_FUNCTION(ctype); -PHP_RSHUTDOWN_FUNCTION(ctype); -PHP_MINFO_FUNCTION(ctype); - -PHP_FUNCTION(ctype_alnum); -PHP_FUNCTION(ctype_alpha); -PHP_FUNCTION(ctype_cntrl); -PHP_FUNCTION(ctype_digit); -PHP_FUNCTION(ctype_lower); -PHP_FUNCTION(ctype_graph); -PHP_FUNCTION(ctype_print); -PHP_FUNCTION(ctype_punct); -PHP_FUNCTION(ctype_space); -PHP_FUNCTION(ctype_upper); -PHP_FUNCTION(ctype_xdigit); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(ctype) - int global_variable; -ZEND_END_MODULE_GLOBALS(ctype) -*/ - -#ifdef ZTS -#define CTYPEG(v) TSRMG(ctype_globals_id, php_ctype_globals *, v) -#else -#define CTYPEG(v) (ctype_globals.v) -#endif - -#else - -#define phpext_ctype_ptr NULL - -#endif - -#endif /* PHP_CTYPE_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/ctype/tests/001.phpt b/ext/ctype/tests/001.phpt deleted file mode 100644 index da135149931..00000000000 --- a/ext/ctype/tests/001.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -ctype on integers ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -ctype_lower 26 -ctype_upper 26 -ctype_alpha 52 -ctype_digit 10 -ctype_alnum 62 -ctype_cntrl 33 -ctype_graph 94 -ctype_print 95 -ctype_punct 32 -ctype_space 6 -ctype_xdigit 22 diff --git a/ext/ctype/tests/002.phpt b/ext/ctype/tests/002.phpt deleted file mode 100644 index 8ccc1c7f75d..00000000000 --- a/ext/ctype/tests/002.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -ctype on strings ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -ctype_lower 26 0 -ctype_upper 26 0 -ctype_alpha 52 0 -ctype_digit 10 0 -ctype_alnum 62 0 -ctype_cntrl 33 0 -ctype_graph 94 94 -ctype_print 95 95 -ctype_punct 32 0 -ctype_space 6 0 -ctype_xdigit 22 0 diff --git a/ext/curl/CREDITS b/ext/curl/CREDITS deleted file mode 100644 index 1e9f272a395..00000000000 --- a/ext/curl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CURL -Sterling Hughes diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 deleted file mode 100644 index 151a40a21ff..00000000000 --- a/ext/curl/config.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(curl, for CURL support, -[ --with-curl[=DIR] Include CURL support]) - -if test "$PHP_CURL" != "no"; then - if test -r $PHP_CURL/include/curl/easy.h; then - CURL_DIR=$PHP_CURL - else - AC_MSG_CHECKING(for CURL in default path) - for i in /usr/local /usr; do - if test -r $i/include/curl/easy.h; then - CURL_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$CURL_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libcurl distribution - - easy.h should be in /include/curl/) - fi - - CURL_CONFIG="curl-config" - AC_MSG_CHECKING(for cURL 7.9 or greater) - - if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/bin/curl-config - else - if ${CURL_DIR}/curl-config --libs print > /dev/null 2>&1; then - CURL_CONFIG=${CURL_DIR}/curl-config - fi - fi - - curl_version_full=`$CURL_CONFIG --version` - curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$curl_version" -ge 7009000; then - AC_MSG_RESULT($curl_version_full) - CURL_LIBS=`$CURL_CONFIG --libs` - else - AC_MSG_ERROR(cURL version 7.9 or later is required to compile php with cURL support) - 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_CHECK_LIBRARY(curl,curl_easy_perform, - [ - AC_DEFINE(HAVE_CURL,1,[ ]) - ],[ - AC_MSG_ERROR(There is something wrong. Please check config.log for more information.) - ],[ - $CURL_LIBS -L$CURL_DIR/lib - ]) - - PHP_NEW_EXTENSION(curl, curl.c, $ext_shared) - PHP_SUBST(CURL_SHARED_LIBADD) -fi diff --git a/ext/curl/curl.c b/ext/curl/curl.c deleted file mode 100644 index 2413d8b4e7c..00000000000 --- a/ext/curl/curl.c +++ /dev/null @@ -1,1097 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_CURL - -#include -#include - -#ifdef PHP_WIN32 -#include -#include -#endif - -#include -#include - -#define SMART_STR_PREALLOC 4096 - -#include "ext/standard/php_smart_str.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "php_curl.h" - -static int le_curl; -#define le_curl_name "cURL handle" - -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; - -/* {{{ curl_functions[] - */ -function_entry curl_functions[] = { - PHP_FE(curl_init, NULL) - PHP_FE(curl_version, NULL) - PHP_FE(curl_setopt, NULL) - PHP_FE(curl_exec, NULL) - PHP_FE(curl_getinfo, NULL) - PHP_FE(curl_error, NULL) - PHP_FE(curl_errno, NULL) - PHP_FE(curl_close, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ curl_module_entry - */ -zend_module_entry curl_module_entry = { - STANDARD_MODULE_HEADER, - "curl", - curl_functions, - PHP_MINIT(curl), - PHP_MSHUTDOWN(curl), - NULL, - NULL, - PHP_MINFO(curl), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CURL -ZEND_GET_MODULE (curl) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(curl) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "CURL support", "enabled"); - php_info_print_table_row(2, "CURL Information", curl_version()); - php_info_print_table_end(); -} -/* }}} */ - -#define REGISTER_CURL_CONSTANT(__c) REGISTER_LONG_CONSTANT(#__c, __c, CONST_CS | CONST_PERSISTENT) - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(curl) -{ - le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); - - /* Constants for curl_setopt() */ - REGISTER_CURL_CONSTANT(CURLOPT_PORT); - REGISTER_CURL_CONSTANT(CURLOPT_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_INFILE); - REGISTER_CURL_CONSTANT(CURLOPT_INFILESIZE); - REGISTER_CURL_CONSTANT(CURLOPT_URL); - REGISTER_CURL_CONSTANT(CURLOPT_PROXY); - REGISTER_CURL_CONSTANT(CURLOPT_VERBOSE); - REGISTER_CURL_CONSTANT(CURLOPT_HEADER); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_NOPROGRESS); - REGISTER_CURL_CONSTANT(CURLOPT_NOBODY); - REGISTER_CURL_CONSTANT(CURLOPT_FAILONERROR); - REGISTER_CURL_CONSTANT(CURLOPT_UPLOAD); - REGISTER_CURL_CONSTANT(CURLOPT_POST); - REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY); - REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND); - REGISTER_CURL_CONSTANT(CURLOPT_NETRC); - REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION); - REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); - REGISTER_CURL_CONSTANT(CURLOPT_PUT); - REGISTER_CURL_CONSTANT(CURLOPT_MUTE); - REGISTER_CURL_CONSTANT(CURLOPT_USERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD); - REGISTER_CURL_CONSTANT(CURLOPT_RANGE); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_POSTFIELDS); - REGISTER_CURL_CONSTANT(CURLOPT_REFERER); - REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT); - REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_LIMIT); - REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME); - REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT); - REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE); - REGISTER_CURL_CONSTANT(CURLOPT_SSLVERSION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION); - REGISTER_CURL_CONSTANT(CURLOPT_TIMEVALUE); - REGISTER_CURL_CONSTANT(CURLOPT_CUSTOMREQUEST); - REGISTER_CURL_CONSTANT(CURLOPT_STDERR); - REGISTER_CURL_CONSTANT(CURLOPT_TRANSFERTEXT); - REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER); - REGISTER_CURL_CONSTANT(CURLOPT_QUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE); - REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE); - REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL); - REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL); - REGISTER_CURL_CONSTANT(CURLOPT_FILETIME); - REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION); - REGISTER_CURL_CONSTANT(CURLOPT_MAXREDIRS); - REGISTER_CURL_CONSTANT(CURLOPT_MAXCONNECTS); - REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY); - REGISTER_CURL_CONSTANT(CURLOPT_FRESH_CONNECT); - REGISTER_CURL_CONSTANT(CURLOPT_FORBID_REUSE); - REGISTER_CURL_CONSTANT(CURLOPT_RANDOM_FILE); - REGISTER_CURL_CONSTANT(CURLOPT_EGDSOCKET); - REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYPEER); - REGISTER_CURL_CONSTANT(CURLOPT_CAINFO); - REGISTER_CURL_CONSTANT(CURLOPT_COOKIEJAR); - REGISTER_CURL_CONSTANT(CURLOPT_SSL_CIPHER_LIST); - REGISTER_CURL_CONSTANT(CURLOPT_BINARYTRANSFER); - - /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST); - - /* Info constants */ - REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL); - REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE); - REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE); - REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_NAMELOOKUP_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_CONNECT_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_PRETRANSFER_TIME); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SIZE_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_SPEED_UPLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_FILETIME); - REGISTER_CURL_CONSTANT(CURLINFO_SSL_VERIFYRESULT); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_DOWNLOAD); - REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_UPLOAD); - - /* Error Constants */ - REGISTER_CURL_CONSTANT(CURLE_OK); - REGISTER_CURL_CONSTANT(CURLE_UNSUPPORTED_PROTOCOL); - REGISTER_CURL_CONSTANT(CURLE_FAILED_INIT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT); - REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_PROXY); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_HOST); - REGISTER_CURL_CONSTANT(CURLE_COULDNT_CONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_SERVER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_ACCESS_DENIED); - REGISTER_CURL_CONSTANT(CURLE_FTP_USER_PASSWORD_INCORRECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASS_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_USER_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASV_REPLY); - REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_227_FORMAT); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_GET_HOST); - REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_RECONNECT); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_BINARY); - REGISTER_CURL_CONSTANT(CURLE_PARTIAL_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_RETR_FILE); - REGISTER_CURL_CONSTANT(CURLE_FTP_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_QUOTE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_WRITE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_MALFORMAT_USER); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_STOR_FILE); - REGISTER_CURL_CONSTANT(CURLE_READ_ERROR); - REGISTER_CURL_CONSTANT(CURLE_OUT_OF_MEMORY); - REGISTER_CURL_CONSTANT(CURLE_OPERATION_TIMEOUTED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_ASCII); - REGISTER_CURL_CONSTANT(CURLE_FTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_USE_REST); - REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_GET_SIZE); - REGISTER_CURL_CONSTANT(CURLE_HTTP_RANGE_ERROR); - REGISTER_CURL_CONSTANT(CURLE_HTTP_POST_ERROR); - REGISTER_CURL_CONSTANT(CURLE_SSL_CONNECT_ERROR); - REGISTER_CURL_CONSTANT(CURLE_FTP_BAD_DOWNLOAD_RESUME); - REGISTER_CURL_CONSTANT(CURLE_FILE_COULDNT_READ_FILE); - REGISTER_CURL_CONSTANT(CURLE_LDAP_CANNOT_BIND); - REGISTER_CURL_CONSTANT(CURLE_LDAP_SEARCH_FAILED); - REGISTER_CURL_CONSTANT(CURLE_LIBRARY_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_FUNCTION_NOT_FOUND); - REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLE_BAD_FUNCTION_ARGUMENT); - REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER); - REGISTER_CURL_CONSTANT(CURLE_HTTP_PORT_FAILED); - REGISTER_CURL_CONSTANT(CURLE_BAD_PASSWORD_ENTERED); - REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS); - REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION); - REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX); - REGISTER_CURL_CONSTANT(CURLE_OBSOLETE); - REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE); - - if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) { - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(curl) -{ - curl_global_cleanup(); - - return SUCCESS; -} -/* }}} */ - -#define PHP_CURL_STDOUT 0 -#define PHP_CURL_FILE 1 -#define PHP_CURL_USER 2 -#define PHP_CURL_DIRECT 3 -#define PHP_CURL_RETURN 4 -#define PHP_CURL_ASCII 5 -#define PHP_CURL_BINARY 6 -#define PHP_CURL_IGNORE 7 - -/* {{{ curl_write - */ -static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write; - size_t length = size * nmemb; - TSRMLS_FETCH(); - - switch (t->method) { - case PHP_CURL_STDOUT: - PUTS(data); - break; - case PHP_CURL_FILE: - return fwrite(data, size, nmemb, t->fp); - case PHP_CURL_RETURN: - smart_str_appendl(&t->buf, data, (int) length); - break; - case PHP_CURL_USER: { - zval *argv[2]; - zval *retval; - int error; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(retval); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_STRINGL(argv[1], data, (int) length, 1); - - error = call_user_function(EG(function_table), - NULL, - t->func, - retval, 2, argv TSRMLS_CC); - if (error == FAILURE) { - php_error(E_WARNING, "Couldn't call the CURLOPT_WRITEFUNCTION"); - length = -1; - } - else { - length = Z_LVAL_P(retval); - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&retval); - - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_read - */ -static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_read *t = ch->handlers->read; - int length = -1; - - switch (t->method) { - case PHP_CURL_DIRECT: - length = fread(data, size, nmemb, t->fp); - break; - case PHP_CURL_USER: { - zval *argv[3]; - zval *retval; - int length; - int error; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(argv[2]); - MAKE_STD_ZVAL(retval); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_RESOURCE(argv[1], t->fd); - zend_list_addref(t->fd); - ZVAL_LONG(argv[2], size * nmemb); - - error = call_user_function(EG(function_table), - NULL, - t->func, - retval, 3, argv TSRMLS_CC); - if (error == FAILURE) { - php_error(E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); - length = -1; - } - else { - memcpy(data, Z_STRVAL_P(retval), size * nmemb); - length = Z_STRLEN_P(retval); - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&argv[2]); - zval_ptr_dtor(&retval); - break; - } - } - - return length; -} -/* }}} */ - -/* {{{ curl_write_header - */ -static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx) -{ - php_curl *ch = (php_curl *) ctx; - php_curl_write *t = ch->handlers->write_header; - int error; - int length; - TSRMLS_FETCH(); - - switch (t->method) { - case PHP_CURL_STDOUT: - /* Handle special case write when we're returning the entire transfer - */ - if (ch->handlers->write->method == PHP_CURL_RETURN) - smart_str_appendl(&ch->handlers->write->buf, data, size * nmemb); - else - PUTS(data); - - length = size * nmemb; - - break; - case PHP_CURL_FILE: - length = fwrite(data, size, nmemb, t->fp); - break; - case PHP_CURL_USER: { - zval *argv[2]; - zval *retval; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(retval); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_STRINGL(argv[0], data, size * nmemb, 1); - - error = call_user_function(EG(function_table), - NULL, - t->func, - retval, 2, argv TSRMLS_CC); - if (error == FAILURE) { - php_error(E_WARNING, "Couldn't call the CURLOPT_HEADERFUNCTION"); - length = -1; - } - else { - length = Z_LVAL_P(retval); - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&retval); - break; - } - case PHP_CURL_IGNORE: - length = size * nmemb; - break; - } - - return length; -} -/* }}} */ - -/* {{{ curl_passwd - */ -static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen) -{ - php_curl *ch = (php_curl *) ctx; - zval *func = ch->handlers->passwd; - zval *argv[3]; - zval *retval = NULL; - int error; - int ret = 0; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(argv[0]); - MAKE_STD_ZVAL(argv[1]); - MAKE_STD_ZVAL(argv[2]); - - ZVAL_RESOURCE(argv[0], ch->id); - zend_list_addref(ch->id); - ZVAL_STRING(argv[1], prompt, 1); - ZVAL_LONG(argv[2], buflen); - - error = call_user_function(EG(function_table), - NULL, - func, - retval, 2, argv TSRMLS_CC); - if (error == FAILURE) { - php_error(E_WARNING, "Couldn't call the CURLOPT_PASSWDFUNCTION"); - ret = -1; - } - else { - if (Z_STRLEN_P(retval) > buflen) { - php_error(E_WARNING, "Returned password is too long for libcurl to handle"); - ret = -1; - } - else { - strlcpy(buf, Z_STRVAL_P(retval), buflen); - } - } - - zval_ptr_dtor(&argv[0]); - zval_ptr_dtor(&argv[1]); - zval_ptr_dtor(&argv[2]); - zval_ptr_dtor(&retval); - - return ret; -} -/* }}} */ - -/* {{{ curl_free_string - */ -static void curl_free_string(void **string) -{ - efree(*string); -} -/* }}} */ - -/* {{{ curl_free_post - */ -static void curl_free_post(void **post) -{ - curl_formfree((struct HttpPost *) *post); -} -/* }}} */ - -/* {{{ curl_free_slist - */ -static void curl_free_slist(void **slist) -{ - curl_slist_free_all((struct curl_slist *) *slist); -} -/* }}} */ - -/* {{{ proto string curl_version(void) - Return the CURL version string. */ -PHP_FUNCTION(curl_version) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_STRING(curl_version(), 1); -} -/* }}} */ - -/* {{{ alloc_curl_handle - */ -static void alloc_curl_handle(php_curl **ch) -{ - *ch = emalloc(sizeof(php_curl)); - (*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers)); - (*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write)); - (*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read)); - memset(&(*ch)->err, 0, sizeof((*ch)->err)); - - zend_llist_init(&(*ch)->to_free.str, sizeof(char *), - (void(*)(void *)) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist), - (void(*)(void *)) curl_free_slist, 0); - zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), - (void(*)(void *)) curl_free_post, 0); -} -/* }}} */ - -/* {{{ proto int curl_init([string url]) - Initialize a CURL session */ -PHP_FUNCTION(curl_init) -{ - zval **url; - php_curl *ch; - int argc = ZEND_NUM_ARGS(); - - if (argc < 0 || argc > 1 || - zend_get_parameters_ex(argc, &url) == FAILURE) { - WRONG_PARAM_COUNT; - } - - alloc_curl_handle(&ch); - - ch->cp = curl_easy_init(); - if (! ch->cp) { - php_error(E_WARNING, "Cannot initialize a new cURL handle"); - RETURN_FALSE; - } - - ch->handlers->write->method = PHP_CURL_STDOUT; - ch->handlers->write->type = PHP_CURL_ASCII; - ch->handlers->read->method = PHP_CURL_DIRECT; - ch->handlers->write_header->method = PHP_CURL_IGNORE; - - curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0); - curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str); - curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write); - curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_READFUNCTION, curl_read); - curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); - curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); - curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); - if (argc > 0) { - char *urlcopy; - convert_to_string_ex(url); - - urlcopy = estrndup(Z_STRVAL_PP(url), Z_STRLEN_PP(url)); - curl_easy_setopt(ch->cp, CURLOPT_URL, urlcopy); - zend_llist_add_element(&ch->to_free.str, &urlcopy); - } - - ZEND_REGISTER_RESOURCE(return_value, ch, le_curl); - ch->id = Z_LVAL_P(return_value); -} -/* }}} */ - -/* {{{ proto bool curl_setopt(int ch, string option, mixed value) - Set an option for a CURL transfer */ -PHP_FUNCTION(curl_setopt) -{ - zval **zid, - **zoption, - **zvalue; - php_curl *ch; - CURLcode error; - int option; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &zid, &zoption, &zvalue) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - convert_to_long_ex(zoption); - - option = Z_LVAL_PP(zoption); - switch (option) { - case CURLOPT_INFILESIZE: - case CURLOPT_VERBOSE: - case CURLOPT_HEADER: - case CURLOPT_NOPROGRESS: - case CURLOPT_NOBODY: - case CURLOPT_FAILONERROR: - case CURLOPT_UPLOAD: - case CURLOPT_POST: - case CURLOPT_FTPLISTONLY: - case CURLOPT_FTPAPPEND: - case CURLOPT_NETRC: - case CURLOPT_FOLLOWLOCATION: - case CURLOPT_PUT: - case CURLOPT_MUTE: - case CURLOPT_TIMEOUT: - case CURLOPT_LOW_SPEED_LIMIT: - case CURLOPT_SSLVERSION: - case CURLOPT_LOW_SPEED_TIME: - case CURLOPT_RESUME_FROM: - case CURLOPT_TIMEVALUE: - case CURLOPT_TIMECONDITION: - case CURLOPT_TRANSFERTEXT: - case CURLOPT_HTTPPROXYTUNNEL: - case CURLOPT_FILETIME: - case CURLOPT_MAXREDIRS: - case CURLOPT_MAXCONNECTS: - case CURLOPT_CLOSEPOLICY: - case CURLOPT_FRESH_CONNECT: - case CURLOPT_FORBID_REUSE: - case CURLOPT_CONNECTTIMEOUT: - case CURLOPT_SSL_VERIFYHOST: - case CURLOPT_SSL_VERIFYPEER: - convert_to_long_ex(zvalue); - error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); - break; - case CURLOPT_URL: - case CURLOPT_PROXY: - case CURLOPT_USERPWD: - case CURLOPT_PROXYUSERPWD: - case CURLOPT_RANGE: - case CURLOPT_CUSTOMREQUEST: - case CURLOPT_USERAGENT: - case CURLOPT_FTPPORT: - case CURLOPT_COOKIE: - case CURLOPT_SSLCERT: - case CURLOPT_SSLCERTPASSWD: - case CURLOPT_COOKIEFILE: - case CURLOPT_REFERER: - case CURLOPT_INTERFACE: - case CURLOPT_KRB4LEVEL: - case CURLOPT_RANDOM_FILE: - case CURLOPT_EGDSOCKET: - case CURLOPT_CAINFO: - case CURLOPT_COOKIEJAR: - case CURLOPT_SSL_CIPHER_LIST: { - char *copystr = NULL; - - convert_to_string_ex(zvalue); - copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - - error = curl_easy_setopt(ch->cp, option, copystr); - zend_llist_add_element(&ch->to_free.str, ©str); - - break; - } - case CURLOPT_FILE: - case CURLOPT_INFILE: - case CURLOPT_WRITEHEADER: - case CURLOPT_STDERR: { - FILE *fp = NULL; - int type; - void * what; - - what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream()); - ZEND_VERIFY_RESOURCE(what); - - if (!php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS)) - RETURN_FALSE; - if (!fp) { - RETURN_FALSE; - } - - error = CURLE_OK; - switch (option) { - case CURLOPT_FILE: - ch->handlers->write->fp = fp; - ch->handlers->write->method = PHP_CURL_FILE; - break; - case CURLOPT_WRITEHEADER: - ch->handlers->write_header->fp = fp; - ch->handlers->write_header->method = PHP_CURL_FILE; - break; - case CURLOPT_INFILE: - zend_list_addref(Z_LVAL_PP(zvalue)); - ch->handlers->read->fp = fp; - ch->handlers->read->fd = Z_LVAL_PP(zvalue); - break; - default: - error = curl_easy_setopt(ch->cp, option, fp); - break; - } - - break; - } - case CURLOPT_RETURNTRANSFER: - convert_to_long_ex(zvalue); - - if (Z_LVAL_PP(zvalue)) { - ch->handlers->write->method = PHP_CURL_RETURN; - } - break; - case CURLOPT_BINARYTRANSFER: - convert_to_long_ex(zvalue); - ch->handlers->write->type = PHP_CURL_BINARY; - break; - case CURLOPT_WRITEFUNCTION: - zval_add_ref(zvalue); - ch->handlers->write->func = *zvalue; - ch->handlers->write->method = PHP_CURL_USER; - break; - case CURLOPT_READFUNCTION: - zval_add_ref(zvalue); - ch->handlers->read->func = *zvalue; - ch->handlers->read->method = PHP_CURL_USER; - break; - case CURLOPT_HEADERFUNCTION: - zval_add_ref(zvalue); - ch->handlers->write_header->func = *zvalue; - ch->handlers->write_header->method = PHP_CURL_USER; - break; - case CURLOPT_PASSWDFUNCTION: - zval_add_ref(zvalue); - ch->handlers->passwd = *zvalue; - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd); - error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch); - break; - case CURLOPT_POSTFIELDS: - if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) { - zval **current; - HashTable *postfields; - struct HttpPost *first = NULL; - struct HttpPost *last = NULL; - char *postval; - char *string_key = NULL; - ulong num_key; - uint string_key_len; - - postfields = HASH_OF(*zvalue); - if (! postfields) { - php_error(E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS"); - RETURN_FALSE; - } - - for (zend_hash_internal_pointer_reset(postfields); - zend_hash_get_current_data(postfields, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(postfields)) { - - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0, NULL); - - postval = Z_STRVAL_PP(current); - if (*postval == '@') { - error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, - CURLFORM_FILE, ++postval, CURLFORM_END); - } - else { - error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, - CURLFORM_PTRCONTENTS, postval, - CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current), - CURLFORM_END); - } - } - - if (error != CURLE_OK) { - SAVE_CURL_ERROR(ch, error); - RETURN_FALSE; - } - - zend_llist_add_element(&ch->to_free.post, &first); - error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first); - } - else { - char *post = NULL; - - convert_to_string_ex(zvalue); - post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue)); - zend_llist_add_element(&ch->to_free.str, &post); - - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post); - error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue)); - } - - break; - case CURLOPT_HTTPHEADER: - case CURLOPT_QUOTE: - case CURLOPT_POSTQUOTE: { - zval **current; - HashTable *ph; - struct curl_slist *slist = NULL; - - ph = HASH_OF(*zvalue); - if (! ph) { - php_error(E_WARNING, - "You must pass either an object or an array with the CURLOPT_HTTPHEADER," - "CURLOPT_QUOTE and CURLOPT_POSTQUOTE arguments"); - RETURN_FALSE; - } - - for (zend_hash_internal_pointer_reset(ph); - zend_hash_get_current_data(ph, (void **) ¤t) == SUCCESS; - zend_hash_move_forward(ph)) { - char *indiv = NULL; - - SEPARATE_ZVAL(current); - convert_to_string_ex(current); - - indiv = estrndup(Z_STRVAL_PP(current), Z_STRLEN_PP(current) + 1); - slist = curl_slist_append(slist, indiv); - if (! slist) { - efree(indiv); - php_error(E_WARNING, "Couldn't build curl_slist from curl_setopt()"); - RETURN_FALSE; - } - zend_llist_add_element(&ch->to_free.str, &indiv); - } - zend_llist_add_element(&ch->to_free.slist, &slist); - - error = curl_easy_setopt(ch->cp, option, slist); - - break; - } - } - - if (error != CURLE_OK) { - SAVE_CURL_ERROR(ch, error); - RETURN_FALSE; - } else { - RETURN_TRUE; - } -} -/* }}} */ - -/* {{{ proto bool curl_exec(int ch) - Perform a CURL session */ -PHP_FUNCTION(curl_exec) -{ - zval **zid; - php_curl *ch; - CURLcode error; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - error = curl_easy_perform(ch->cp); - if (error != CURLE_OK) { - if (ch->handlers->write->buf.len > 0) - smart_str_free(&ch->handlers->write->buf); - SAVE_CURL_ERROR(ch, error); - RETURN_FALSE; - } - - if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) { - if (ch->handlers->write->type != PHP_CURL_BINARY) - smart_str_0(&ch->handlers->write->buf); - RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0); - } - - RETURN_TRUE; -} -/* }}} */ - -#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), v); -#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), v); -#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), v, 1); - -/* {{{ proto string curl_getinfo(int ch, int opt) - Get information regarding a specific transfer */ -PHP_FUNCTION(curl_getinfo) -{ - zval **zid, - **zoption; - php_curl *ch; - int option, - argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 2 || - zend_get_parameters_ex(argc, &zid, &zoption) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - if (argc < 2) { - char *url; - long l_code; - double d_code; - - array_init(return_value); - - curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &url); - CAAS("url", url); - curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code); - CAAL("http_code", l_code); - curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code); - CAAL("header_size", l_code); - curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code); - CAAL("request_size", l_code); - curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code); - CAAL("filetime", l_code); - curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code); - CAAL("ssl_verify_result", l_code); - curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code); - CAAD("total_time", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code); - CAAD("namelookup_time", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code); - CAAD("connect_time", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code); - CAAD("pretransfer_time", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code); - CAAD("size_upload", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code); - CAAD("size_download", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code); - CAAD("speed_download", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code); - CAAD("speed_upload", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code); - CAAD("download_content_length", d_code); - curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code); - CAAD("upload_content_length", d_code); - } else { - option = Z_LVAL_PP(zoption); - switch (option) { - case CURLINFO_EFFECTIVE_URL: { - char *url; - - curl_easy_getinfo(ch->cp, option, &url); - RETURN_STRING(url, 1); - - break; - } - case CURLINFO_HTTP_CODE: - case CURLINFO_HEADER_SIZE: - case CURLINFO_REQUEST_SIZE: - case CURLINFO_FILETIME: - case CURLINFO_SSL_VERIFYRESULT: { - long code; - - curl_easy_getinfo(ch->cp, option, &code); - RETURN_LONG(code); - - break; - } - case CURLINFO_TOTAL_TIME: - case CURLINFO_NAMELOOKUP_TIME: - case CURLINFO_CONNECT_TIME: - case CURLINFO_PRETRANSFER_TIME: - case CURLINFO_SIZE_UPLOAD: - case CURLINFO_SIZE_DOWNLOAD: - case CURLINFO_SPEED_DOWNLOAD: - case CURLINFO_SPEED_UPLOAD: - case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - case CURLINFO_CONTENT_LENGTH_UPLOAD: { - double code; - - curl_easy_getinfo(ch->cp, option, &code); - RETURN_DOUBLE(code); - - break; - } - } - } -} -/* }}} */ - -/* {{{ proto string curl_error(int ch) - Return a string contain the last error for the current session */ -PHP_FUNCTION(curl_error) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - ch->err.str[CURL_ERROR_SIZE] = 0; - RETURN_STRING(ch->err.str, 1); -} -/* }}} */ - -/* {{{ proto int curl_errno(int ch) - Return an integer containing the last error number */ -PHP_FUNCTION(curl_errno) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - RETURN_LONG(ch->err.no); -} -/* }}} */ - -/* {{{ proto void curl_close(int ch) - Close a CURL session */ -PHP_FUNCTION(curl_close) -{ - zval **zid; - php_curl *ch; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &zid) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); - - zend_list_delete(Z_LVAL_PP(zid)); -} -/* }}} */ - -/* {{{ _php_curl_close() - List destructor for curl handles */ -static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - php_curl *ch = (php_curl *) rsrc->ptr; - - curl_easy_cleanup(ch->cp); - zend_llist_clean(&ch->to_free.str); - zend_llist_clean(&ch->to_free.slist); - zend_llist_clean(&ch->to_free.post); - - if (ch->handlers->write->func) zval_ptr_dtor(&ch->handlers->write->func); - if (ch->handlers->read->func) zval_ptr_dtor(&ch->handlers->read->func); - if (ch->handlers->write_header->func) zval_ptr_dtor(&ch->handlers->write_header->func); - if (ch->handlers->passwd) zval_ptr_dtor(&ch->handlers->passwd); - - efree(ch->handlers->write); - efree(ch->handlers->write_header); - efree(ch->handlers->read); - efree(ch->handlers); - efree(ch); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/curl/curl.dsp b/ext/curl/curl.dsp deleted file mode 100644 index 66095f0b8ab..00000000000 --- a/ext/curl/curl.dsp +++ /dev/null @@ -1,177 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=curl - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "curl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "curl.mak" CFG="curl - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "curl - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "curl - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Debug_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS_SSL" -# PROP Intermediate_Dir "Debug_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php4ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none /nodefaultlib - -!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Intermediate_Dir "curl___Win32_Release_TS_SSL" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS_SSL" -# PROP Intermediate_Dir "Release_TS_SSL" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 php4ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "curl - Win32 Release_TS" -# Name "curl - Win32 Debug_TS" -# Name "curl - Win32 Debug_TS_SSL" -# Name "curl - Win32 Release_TS_SSL" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\curl.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_curl.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h deleted file mode 100644 index de4e1ca1704..00000000000 --- a/ext/curl/php_curl.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _PHP_CURL_H -#define _PHP_CURL_H - -#include "php.h" -#include "ext/standard/php_smart_str.h" - -#ifdef COMPILE_DL_CURL -#undef HAVE_CURL -#define HAVE_CURL 1 -#endif - -#if HAVE_CURL - -#include - - -extern zend_module_entry curl_module_entry; -#define curl_module_ptr &curl_module_entry - -#define CURLOPT_RETURNTRANSFER 19913 -#define CURLOPT_BINARYTRANSFER 19914 - -PHP_MINIT_FUNCTION(curl); -PHP_MSHUTDOWN_FUNCTION(curl); -PHP_MINFO_FUNCTION(curl); -PHP_FUNCTION(curl_version); -PHP_FUNCTION(curl_init); -PHP_FUNCTION(curl_setopt); -PHP_FUNCTION(curl_exec); -PHP_FUNCTION(curl_getinfo); -PHP_FUNCTION(curl_error); -PHP_FUNCTION(curl_errno); -PHP_FUNCTION(curl_close); - -typedef struct { - zval *func; - FILE *fp; - smart_str buf; - int method; - int type; -} php_curl_write; - -typedef struct { - zval *func; - FILE *fp; - long fd; - int method; -} php_curl_read; - -typedef struct { - php_curl_write *write; - php_curl_write *write_header; - php_curl_read *read; - zval *passwd; -} php_curl_handlers; - -struct _php_curl_error { - char str[CURL_ERROR_SIZE + 1]; - int no; -}; - -struct _php_curl_free { - zend_llist str; - zend_llist post; - zend_llist slist; -}; - -typedef struct { - CURL *cp; - php_curl_handlers *handlers; - struct _php_curl_error err; - struct _php_curl_free to_free; - long id; -} php_curl; - - -#else -#define curl_module_ptr NULL -#endif /* HAVE_CURL */ -#define phpext_curl_ptr curl_module_ptr -#endif /* _PHP_CURL_H */ diff --git a/ext/cybercash/CREDITS b/ext/cybercash/CREDITS deleted file mode 100644 index d9f4491a66a..00000000000 --- a/ext/cybercash/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CyberCash -Evan Klinger diff --git a/ext/cybercash/config.m4 b/ext/cybercash/config.m4 deleted file mode 100644 index 3deaa368ef3..00000000000 --- a/ext/cybercash/config.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for CyberCash support) -AC_ARG_WITH(cybercash, -[ --with-cybercash[=DIR] Include CyberCash support. DIR is the CyberCash MCK - install directory.], -[ - if test "$withval" != "no"; then - test -f $withval/mckcrypt.h && MCK_DIR=$withval - test -f $withval/c-api/mckcrypt.h && MCK_DIR=$withval/c-api - if test -n "$MCK_DIR"; then - AC_MSG_RESULT(yes) - PHP_NEW_EXTENSION(cybercash, cybercash.c) - old_LIBS=$LIBS - LIBS="$LIBS -L$MCK_DIR/lib" - AC_CHECK_LIB(mckcrypto,base64_encode,[AC_DEFINE(HAVE_MCK,1,[ ])], - [AC_MSG_ERROR(Please reinstall the CyberCash MCK - cannot find mckcrypto lib)]) - LIBS=$old_LIBS - PHP_ADD_LIBRARY_WITH_PATH(mckcrypto, $MCK_DIR/lib) - PHP_ADD_INCLUDE($MCK_DIR) - else - AC_MSG_RESULT(no) - fi -fi -],[ - AC_MSG_RESULT(no) -]) diff --git a/ext/cybercash/cybercash.c b/ext/cybercash/cybercash.c deleted file mode 100644 index 0a28964ea17..00000000000 --- a/ext/cybercash/cybercash.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Evan Klinger | - | Timothy Whitfield | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/info.h" -#include "cybercash.h" - -#if HAVE_MCK -#include "mckcrypt.h" -#include "base64.h" - -/* {{{ cybercash_functions[] - */ -function_entry cybercash_functions[] = { - PHP_FE(cybercash_encr, NULL) - PHP_FE(cybercash_decr, NULL) - PHP_FE(cybercash_base64_encode, NULL) - PHP_FE(cybercash_base64_decode, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ cybercash_module_entry - */ -zend_module_entry cybercash_module_entry = { - STANDARD_MODULE_HEADER, - "cybercash", - cybercash_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(cybercash), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES, -}; -/* }}} */ - -#ifdef COMPILE_DL_CYBERCASH -ZEND_GET_MODULE(cybercash) -#endif - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(cybercash) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "Cybercash Support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto array cybercash_encr(string wmk, string sk, string data) - Cybercash encrypt */ -PHP_FUNCTION(cybercash_encr) -{ - zval **wmk, **sk, **inbuff; - unsigned char *outbuff, *macbuff; - unsigned int outAlloc, outLth; - long errcode; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(wmk); - convert_to_string_ex(sk); - convert_to_string_ex(inbuff); - - outAlloc = Z_STRLEN_PP(inbuff) + 10; - - outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc); - macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20); - - errcode = mck_encr(Z_STRVAL_PP(wmk), - Z_STRVAL_PP(sk), - Z_STRLEN_PP(inbuff) + 1, - Z_STRVAL_PP(inbuff), - outAlloc, - outbuff, - &outLth, - macbuff); - - if (array_init(return_value) == FAILURE) { - php_error(E_WARNING, "Return value from cybercash_encr could not be initialized"); - RETURN_FALSE; - } - - add_assoc_long(return_value, "errcode", errcode); - - if (!errcode) { - add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0); - add_assoc_long(return_value,"outLth", outLth); - add_assoc_stringl(return_value,"macbuff", macbuff, 20, 0); - } else { - efree(outbuff); - efree(macbuff); - } -} -/* }}} */ - -/* {{{ proto array cybercash_decr(string wmp, string sk, string data) - Cybercash decrypt */ -PHP_FUNCTION(cybercash_decr) -{ - zval **wmk, **sk, **inbuff; - unsigned char *outbuff, *macbuff; - unsigned int outAlloc, outLth; - long errcode; - - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(wmk); - convert_to_string_ex(sk); - convert_to_string_ex(inbuff); - - outAlloc = Z_STRLEN_PP(inbuff); - - outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc); - macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20); - - errcode = mck_decr(Z_STRVAL_PP(wmk), - Z_STRVAL_PP(sk), - Z_STRLEN_PP(inbuff), - Z_STRVAL_PP(inbuff), - outAlloc, - outbuff, - &outLth, - macbuff); - - if (array_init(return_value) == FAILURE) { - php_error(E_WARNING, "Could not initialize Return value from cybercash_decr"); - RETURN_FALSE; - } - - add_assoc_long(return_value, "errcode", errcode); - - if (!errcode) { - add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0); - add_assoc_long(return_value, "outLth", outLth); - add_assoc_stringl(return_value, "macbuff", macbuff, 20, 0); - } else { - efree(outbuff); - efree(macbuff); - } -} -/* }}} */ - -/* {{{ proto string cybercash_base64_encode(string data) - base64 encode data for cybercash */ -PHP_FUNCTION(cybercash_base64_encode) -{ - zval **inbuff; - char *outbuff; - long ret_length; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &inbuff) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(inbuff); - - outbuff = (char *)emalloc(base64_enc_size((unsigned int)Z_STRLEN_PP(inbuff))); - - ret_length = base64_encode(outbuff, - Z_STRVAL_PP(inbuff), - Z_STRLEN_PP(inbuff)); - - RETURN_STRINGL(outbuff, ret_length, 0); -} -/* }}} */ - -/* {{{ proto string cybercash_base64_decode(string data) - base64 decode data for cybercash */ -PHP_FUNCTION(cybercash_base64_decode) -{ - zval **inbuff; - char *outbuff; - long ret_length; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &inbuff) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(inbuff); - - outbuff = (char *)emalloc(base64_dec_size((unsigned int)Z_STRLEN_PP(inbuff))); - - ret_length = base64_decode(outbuff, Z_STRVAL_PP(inbuff), Z_STRLEN_PP(inbuff)); - - RETURN_STRINGL(outbuff, ret_length, 0); -} -/* }}} */ -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/cybercash/cybercash.dsp b/ext/cybercash/cybercash.dsp deleted file mode 100644 index 83c47e1913e..00000000000 --- a/ext/cybercash/cybercash.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cybercash" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=cybercash - 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 "cybercash.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 "cybercash.mak" CFG="cybercash - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "cybercash - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "cybercash - 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)" == "cybercash - 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_CYBERCASH" /D ZTS=1 /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 "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=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 cybercashi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"libcmt.lib" /out:"..\..\Release_TS/php_cybercash.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "cybercash - 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_CYBERCASH" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=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 cybercashi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib user32.lib winspool.lib mckcrypto.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 /nodefaultlib:"libcmt.lib" /out:"..\..\Debug_TS/php_cybercash.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "cybercash - Win32 Release_TS" -# Name "cybercash - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\cybercash.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\cybercash.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/cybercash/cybercash.h b/ext/cybercash/cybercash.h deleted file mode 100644 index 60e0d1bbcf2..00000000000 --- a/ext/cybercash/cybercash.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Evan Klinger | - +----------------------------------------------------------------------+ - */ - -#ifndef CYBERCASH_H -#define CYBERCASH_H - - -#if HAVE_MCK - -extern zend_module_entry cybercash_module_entry; -#define cybercash_module_ptr &cybercash_module_entry - -PHP_MINFO_FUNCTION(cybercash); -PHP_FUNCTION(cybercash_encr); -PHP_FUNCTION(cybercash_decr); -PHP_FUNCTION(cybercash_base64_encode); -PHP_FUNCTION(cybercash_base64_decode); - -#else -#define cybercash_module_ptr NULL -#endif - -#define phpext_cybercash_ptr cybercash_module_ptr - -#endif diff --git a/ext/cybercash/cyberlib.php b/ext/cybercash/cyberlib.php deleted file mode 100644 index fa183ff93b5..00000000000 --- a/ext/cybercash/cyberlib.php +++ /dev/null @@ -1,215 +0,0 @@ - * - * * - * PHP Cybercash API - This requires that CyberCash support be * - * compiled. * - * * - * * - * This is an attempt to duplicate the cybercash API for PHP * - * users. * - ********************************************************************* - * This does not require merchant_conf for reasons that any file * - * can be accessed by the web server can be accessed by any cgi. * - ********************************************************************* - */ - - function SendCC2_1Server($merchant,$merchant_key, - $url,$operation,$CCNVList) - { - /* We need to make the url. */ - $url=$url."cr21api.cgi/".$operation; - - return SendCCServer($merchant,$merchant_key,$url,$CCNVList); - } - - function SendCCServer($merchant,$merchant_key,$url,$CCNVList) - { - /* Break the url into parts. */ - $url=parse_url($url); - - /* Turn the name value pairs into a url encoded message. */ - $pairs=""; - $done=0; - $more=list($key,$val)=each($CCNVList); - while(!$done) - { - $pairs.=rtrim($key)."=".urlencode(rtrim($val)); - - $more=list($key,$val)=each($CCNVList); - if($more) - { - $pairs.="&"; - } - else - { - $done=1; - } - } - - $encrypted_pairs=CCEncrypt($merchant_key,$pairs); - $pairs_length=strlen($encrypted_pairs); - - $message=sprintf("POST %s/%s HTTP/1.0\r\n",$url["path"],$merchant); - $message.=sprintf("User-Agent: CCMCK-%s\r\n","3.2.0.5"); - $message.="Content-type: application/x-www-form-urlencoded\r\n"; - $message.=sprintf("Content-length: %d\r\n",$pairs_length); - $message.="\r\n"; - $message.=$encrypted_pairs."\r\n"; - -$response=CCSocketSend($merchant_key,$url["host"],isset($url["port"])?$url["port"]:"",$message); - return $response; - } - - function CCEncrypt($merchant_key,$pairs) - { - $session_key=sprintf("%s #%ld",date("D M j H:i:s Y"),getmypid()); - $enc_msg=cybercash_encr($merchant_key,$session_key,$pairs); - $pairs=cybercash_base64_encode($enc_msg["outbuff"]); - $mac=cybercash_base64_encode($enc_msg["macbuff"]); - - /* This adds the information needed to decrypt. */ - $encrypted_pairs="message=".urlencode($pairs)."&"; - $encrypted_pairs.="session-key=".urlencode($session_key)."&"; - $encrypted_pairs.="mac=".urlencode($mac); - - - return $encrypted_pairs; - } - - function CCSocketSend($merchant_key,$host,$port,$message) - { - - if(!$port) - { - $port="80"; - } - - /*This opens the port. */ - $fd=fsockopen($host,$port); - - /* Minor error checking. */ - if(!$fd) - { - $vars["MStatus"]="failure-hard"; - $vars["MErrMsg"]="Error contacting credit processor."; - - return $vars; - } - - /*This sends the message. */ - fputs($fd,$message); - - /* We read the header in and parse at the same time. */ - - /* Retrieve header. */ - $i=0; - $response=""; - while(!feof($fd) && $response != "\n") - { - $response=""; - $more=""; - while(!feof($fd) && $more != "\n") - { - $more=fgetc($fd); - if($more != "\n" || $response=="") - { - if($more != "\r") - { - $response.=$more; - } - } - } - $header[$i++]=$response; - } - - /* We will now get the message. */ - $message=""; - while(!feof($fd)) - { - $message.=fgets($fd,50); - } - - /* It should be ok to close the socket now. */ - fclose($fd); - - /* This set of variables is encoded/encrypted. */ - $vars=CCGetVars($message); - $vars["message"]=cybercash_base64_decode($vars["message"]); - $vars["mac"]=cybercash_base64_decode($vars["mac"]); - - /* Check for errors with the request/decryption. */ - /* message is base64 and encrypted. */ - $dec_msg=cybercash_decr($merchant_key,$vars["session-key"], - $vars["message"]); - - if($dec_msg["errcode"]) - { - $vars["MStatus"]="failure-hard"; - $vars["MErrMsg"]="Response non-decodable."; - return $vars; - } - - if($dec_msg["macbuff"] != $vars["mac"]) - { - $vars["MStatus"]="failure-hard"; - $vars["MErrMsg"]="Signitures do not match."; - return $vars; - } - - /* We will have to parse again to get more info. */ - $vars=CCGetVars($dec_msg["outbuff"]); - - return $vars; - } - - function CCGetVars($message) - { - /* Retrieve variables. - This function retrieves variables in var/value key pairs. - So that $myvar["var"]==value - */ - - /* Need to find these variables too. */ - $cx=0; - $response=""; - $more=""; - $message.="\n"; - $msg_len=strlen($message); - - while($cx<=$msg_len) - { - $more=""; - $varname=""; - $varval=""; - while($cx<=$msg_len && $more != "&" && $more != "\n") - { - $more=substr($message,$cx,1); - $cx++; - if($more != "&" && $more != "=" && $more != "\n") - { - $response=$response.$more; - } - if($more=="=") - { - $varname=$response; - $response=""; - } - if($more=="&" || $more=="\n") - { - $varval=$response; - $response=""; - } - } - - if($varname != "") - { - $cybervar[$varname]=urldecode($varval); - } - } - - return $cybervar; - } -?> diff --git a/ext/cybercash/test.php b/ext/cybercash/test.php deleted file mode 100644 index 2e5f3955ee4..00000000000 --- a/ext/cybercash/test.php +++ /dev/null @@ -1,26 +0,0 @@ - "2342322", - "Amount" => "usd 11.50", - "Card-Number" => "4111111111111111", - "Card-Address" => "1600 Pennsylvania Avenue", - "Card-City" => "Washington", - "Card-State" => "DC", - "Card-Zip" => "20500", - "Card-Country" => "USA", - "Card-Exp" => "12/99", - "Card-Name" => "Bill Clinton")); - - while(list($key,$val)=each($response)) - { - echo $key."=".$val."
"; - } - -?> diff --git a/ext/cybermut/config.m4 b/ext/cybermut/config.m4 deleted file mode 100644 index e4f06b200c3..00000000000 --- a/ext/cybermut/config.m4 +++ /dev/null @@ -1,48 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(cybermut, for cybermut support, -[ --with-cybermut[=DIR] Include CyberMut (french Credit Mutuel telepaiement)]) - -if test "$PHP_CYBERMUT" != "no"; then - for i in /usr/local /usr $PHP_CYBERMUT; do - if test -r $i/cm-mac.h; then - CYBERMUT_INC_DIR=$i - elif test -r $i/include/cm-mac.h; then - CYBERMUT_INC_DIR=$i/include - fi - - if test -r $i/libcm-mac.a; then - CYBERMUT_LIB_DIR=$i - elif test -r $i/lib/libcm-mac.a; then - CYBERMUT_LIB_DIR=$i/lib - fi - done - - if test -z "$CYBERMUT_INC_DIR"; then - AC_MSG_ERROR(Could not find cm-mac.h Please make sure you have the - CyberMut SDK installed. Use - ./configure --with-cybermut= if necessary) - fi - - if test -z "$CYBERMUT_LIB_DIR"; then - AC_MSG_ERROR(Could not find libcm-mac.a Please make sure you have the - CyberMut SDK installed. Use - ./configure --with-cybermut= if necessary) - fi - AC_MSG_RESULT(found in $CYBERMUT_LIB_DIR) - - AC_MSG_RESULT(linking libcm-mac.a with libcybermut.a) - ln -sf $CYBERMUT_LIB_DIR/libcm-mac.a $CYBERMUT_LIB_DIR/libcybermut.a - - PHP_ADD_INCLUDE($CYBERMUT_INC_DIR) - - PHP_SUBST(CYBERMUT_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(cybermut, $CYBERMUT_LIB_DIR, CYBERMUT_SHARED_LIBADD) - - AC_DEFINE(HAVE_CYBERMUT, 1, [ ]) - - - PHP_NEW_EXTENSION(cybermut, cybermut.c, $ext_shared) -fi diff --git a/ext/cybermut/cybermut.c b/ext/cybermut/cybermut.c deleted file mode 100644 index 48139d69161..00000000000 --- a/ext/cybermut/cybermut.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sylvain PAGES | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_cybermut.h" - -#include "cm-mac.h" - -/* If you declare any globals in php_cybermut.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(cybermut) -*/ - -/* True global resources - no need for thread safety here */ -static int le_cybermut; - -/* {{{ cybermut_functions[] - */ -function_entry cybermut_functions[] = { - PHP_FE(cybermut_creerformulairecm, NULL) - PHP_FE(cybermut_testmac, NULL) - PHP_FE(cybermut_creerreponsecm, NULL) - {NULL, NULL, NULL} /* Must be the last line in cybermut_functions[] */ -}; -/* }}} */ - -/* {{{ cybermut_module_entry - */ -zend_module_entry cybermut_module_entry = { - STANDARD_MODULE_HEADER, - "cybermut", - cybermut_functions, - PHP_MINIT(cybermut), - PHP_MSHUTDOWN(cybermut), - NULL, - NULL, - PHP_MINFO(cybermut), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CYBERMUT -ZEND_GET_MODULE(cybermut) -#endif - -PHP_MINIT_FUNCTION(cybermut) -{ - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(cybermut) -{ - return SUCCESS; -} - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(cybermut) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "cybermut support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ proto string cybermut_creerformulairecm(string url_CM, string version, string TPE, string montant, string ref_commande, string texte_libre, string url_retour, string url_retour_ok, string url_retour_err, string langue, string code_societe, string texte_bouton) - Returns a string containing source HTML of the form of request for payment. This result corresponds to the last parameter "formulaire" of the original function which was removed */ -PHP_FUNCTION(cybermut_creerformulairecm) -{ - zval **url_CM, **version, **TPE, **montant, **ref_commande, **texte_libre, **url_retour, **url_retour_ok, **url_retour_err, **langue, **code_societe, **texte_bouton; - - char formulaire [10000]; - - if (ZEND_NUM_ARGS() != 12 || zend_get_parameters_ex(12, &url_CM, &version, &TPE, &montant, &ref_commande, &texte_libre, &url_retour, &url_retour_ok, &url_retour_err, &langue, &code_societe, &texte_bouton) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(url_CM); - convert_to_string_ex(version); - convert_to_string_ex(TPE); - convert_to_string_ex(montant); - convert_to_string_ex(ref_commande); - convert_to_string_ex(texte_libre); - convert_to_string_ex(url_retour); - convert_to_string_ex(url_retour_ok); - convert_to_string_ex(url_retour_err); - convert_to_string_ex(langue); - convert_to_string_ex(code_societe); - convert_to_string_ex(texte_bouton); - - CreerFormulaireCM ( Z_STRVAL_PP(url_CM), Z_STRVAL_PP(version), Z_STRVAL_PP(TPE), Z_STRVAL_PP(montant), Z_STRVAL_PP(ref_commande), Z_STRVAL_PP(texte_libre), Z_STRVAL_PP(url_retour), Z_STRVAL_PP(url_retour_ok), Z_STRVAL_PP(url_retour_err), Z_STRVAL_PP(langue), Z_STRVAL_PP(code_societe), Z_STRVAL_PP(texte_bouton), formulaire); - - - RETURN_STRING(formulaire, 1); - -} -/* }}} */ - -/* {{{ proto bool cybermut_testmac(string code_MAC, string version, string TPE, string cdate, string montant, string ref_commande, string texte_libre, string code_retour) - Returns a boolean attesting that the authentification proceeded well. TRUE if the received message is authenticated and FALSE if not */ -PHP_FUNCTION(cybermut_testmac) -{ - zval **code_MAC, **version, **TPE, **cdate, **montant, **ref_commande, **texte_libre, **code_retour; - int cdr_test; - - if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &code_MAC, &version, &TPE, &cdate, &montant, &ref_commande, &texte_libre, &code_retour) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(code_MAC); - convert_to_string_ex(version); - convert_to_string_ex(TPE); - convert_to_string_ex(cdate); - convert_to_string_ex(montant); - convert_to_string_ex(ref_commande); - convert_to_string_ex(texte_libre); - convert_to_string_ex(code_retour); - - cdr_test = TestMAC ( Z_STRVAL_PP(code_MAC), Z_STRVAL_PP(version), Z_STRVAL_PP(TPE), Z_STRVAL_PP(cdate), Z_STRVAL_PP(montant), Z_STRVAL_PP(ref_commande), Z_STRVAL_PP(texte_libre), Z_STRVAL_PP(code_retour)); - - if (cdr_test == 1) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - -} -/* }}} */ - -/* {{{ proto string cybermut_creerreponsecm(string phrase) - Returns a string containing the message of acknowledgement of delivery (headers and body of the message). This result corresponds to the last parameter "reponse" of the original function which was removed */ -PHP_FUNCTION(cybermut_creerreponsecm) -{ - zval **phrase; - char buf[5000]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &phrase) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(phrase); - - CreerReponseCM( Z_STRVAL_PP(phrase), buf); - - RETURN_STRING (buf, 1); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/cybermut/cybermut.xml b/ext/cybermut/cybermut.xml deleted file mode 100644 index fabc94b5b2f..00000000000 --- a/ext/cybermut/cybermut.xml +++ /dev/null @@ -1,214 +0,0 @@ - - Credit Mutuel CyberMUT functions - CyberMUT - - - This extension allows you to process credit cards transactions using Credit - Mutuel CyberMUT system (http://www.creditmutuel.fr/centre_commercial/vendez_sur_internet.html). - - - CynerMUT is a popular Web Payment Service in France, provided by the - Credit Mutuel bank. If you are foreign in France, these functions will not - be useful for you. - - - These functions are only available if PHP has been compiled with the - option, where DIR is - the location of libcm-mac.a and cm-mac.h. You will require the - appropriate SDK for your platform, which may be sent to you after your - CyberMUT's subscription (contact them via Web, or go to the nearest - Credit Mutuel). - - - The use of these functions is almost identical to the original functions, - except for the parameters of return for CreerFormulaireCM and CreerReponseCM, - which are returned directly by functions PHP, whereas they had passed in - reference in the original functions. - - - These functions have been added in PHP 4.0.4. ??? - - - - These functions only provide a link to CyberMUT SDK. Be sure to read the - CynerMUT Developers Guide for full details of the required parameters. - - - - - - cybermut_creerformulairecm - Generate HTML form of request for payment - - - Description - - - string pfpro_init - string url_CM - string version - string TPE - string montant - string ref_commande - string texte_libre - string url_retour - string url_retour_ok - string url_retour_err - string langue - string code_societe - string texte_bouton - - - - cynermut_creerformulairecm is used to generate the - HTML form of request for payment. - - - See also cybermut_testmac - cybermut_creerreponsecm. - - - First step of payment (equiv cgi1.c) - -<?php -// Directory where are located the keys -putenv("CMKEYDIR=/var/creditmut/cles"); - -// Version number -$VERSION="1.2"; - - $retour = creditmut_creerformulairecm( - "https://www.creditmutuel.fr/test/telepaiement/paiement.cgi", - $VERSION, - "1234567890", - "300FRF", - $REFERENCE, - $TEXTE_LIBRE, - $URL_RETOUR, - $URL_RETOUR_OK, - $URL_RETOUR_ERR, - "francais", - "company", - "Paiement par carte bancaire"); - -echo $retour; -?> - - - - - - - - cybermut_testmac - Make sure that there no was data diddling contained - in the received message of confirmation - - - Description - - - bool cybermut_testmac - string code_MAC - string version - string TPE - string cdate - string montant - string ref_commande - string texte_libre - string code-retour - - - - cybermut_testmac is used to make sure that there was - not data diddling contained in the received message of confirmation. - Pay attention to parameters code-retour and texte-libre, which cannot be - evaluated as is, because auf the dash. You must retrieve them by using: - -$code_retour=$HTTP_GET_VARS["code-retour"]; -$texte_libre=$HTTP_GET_VARS["texte-libre"]; - - - - See also cybermut_creerformulairecm - cybermut_creerreponsecm. - - - Last step of payment (equiv cgi2.c) - -<?php_track_vars?> -<?php -// Directory where are located the keys -putenv("CMKEYDIR=/var/creditmut/cles"); - -// Version number -$VERSION="1.2"; - -$texte_libre = $HTTP_GET_VARS["texte-libre"]; -$code_retour = $HTTP_GET_VARS["code-retour"]; - -$mac_ok = creditmut_testmac($MAC,$VERSION,$TPE,$date,$montant,$reference,$texte_libre,$code_retour); - -if ($mac_ok) { - - // - // insert data processing here - // - // - - $result=creditmut_creerreponsecm("OK"); - } else { - $result=creditmut_creerreponsecm("Document Falsifie");} - -?> - - - - - - - - cybermut_creerreponsecm - Generate the acknowledgement of delivery of the confirmation - of payment - - - Description - - - string cybermut_creerreponsecm - string phrase - - - - Returns: string containing the message of aknowledgement of delivery. - - - The parameter is "OK" if the message of confirmation of the payment - were correctly auhentified by cybermut_testmac. - Any other chain is regarded as an error message. - - - See also cybermut_creerformulairecm - cybermut_testmac. - - - - - - diff --git a/ext/cybermut/php_cybermut.h b/ext/cybermut/php_cybermut.h deleted file mode 100644 index fe390cbc470..00000000000 --- a/ext/cybermut/php_cybermut.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sylvain PAGES | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_CYBERMUT_H -#define PHP_CYBERMUT_H - -extern zend_module_entry cybermut_module_entry; -#define phpext_cybermut_ptr &cybermut_module_entry - -#ifdef PHP_WIN32 -#define PHP_CYBERMUT_API __declspec(dllexport) -#else -#define PHP_CYBERMUT_API -#endif - -PHP_MINIT_FUNCTION(cybermut); -PHP_MSHUTDOWN_FUNCTION(cybermut); -PHP_RINIT_FUNCTION(cybermut); -PHP_RSHUTDOWN_FUNCTION(cybermut); -PHP_MINFO_FUNCTION(cybermut); - -PHP_FUNCTION(confirm_cybermut_compiled); /* For testing, remove later. */ -PHP_FUNCTION(cybermut_creerformulairecm); -PHP_FUNCTION(cybermut_testmac); -PHP_FUNCTION(cybermut_creerreponsecm); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(cybermut) - int global_variable; -ZEND_END_MODULE_GLOBALS(cybermut) -*/ - -/* In every function that needs to use variables in php_cybermut_globals, - do call CYBERMUTLS_FETCH(); after declaring other variables used by - that function, and always refer to them as CYBERMUTG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define CYBERMUTG(v) TSRMG(cybermut_globals_id, php_cybermut_globals *, v) -#else -#define CYBERMUTG(v) (cybermut_globals.v) -#endif - -#endif /* PHP_CYBERMUT_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/cybermut/tests/001.phpt b/ext/cybermut/tests/001.phpt deleted file mode 100644 index 9fb02fd784a..00000000000 --- a/ext/cybermut/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for cybermut presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -cybermut extension is available \ No newline at end of file diff --git a/ext/cyrus/CREDITS b/ext/cyrus/CREDITS deleted file mode 100644 index 74371fa716a..00000000000 --- a/ext/cyrus/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Cyrus -Sterling Hughes diff --git a/ext/cyrus/config.m4 b/ext/cyrus/config.m4 deleted file mode 100644 index 5bc12fdaf48..00000000000 --- a/ext/cyrus/config.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(cyrus, for cyrus imap support, -[ --with-cyrus Include cyrus imap support]) - -if test "$PHP_CYRUS" != "no"; then - found_cyrus=no - found_sasl=no - found_openssl=no - for i in /usr /usr/local $PHP_CYRUS; do - if test -r $i/include/cyrus/imclient.h && test "$found_cyrus" = "no"; then - PHP_ADD_INCLUDE($i/include) - PHP_SUBST(CYRUS_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(cyrus, $i/lib, CYRUS_SHARED_LIBADD) - found_cyrus=yes - fi - if test -r $i/include/sasl.h && test "$found_sasl" = "no"; then - PHP_ADD_INCLUDE($i/include) - PHP_SUBST(SASL_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, SASL_SHARED_LIBADD) - found_sasl=yes - fi - if test -r $i/include/openssl/ssl.h && test "$found_openssl" = "no" && test "$PHP_OPENSSL" = "no"; then - PHP_SUBST(OPENSSL_SHARED_LIBADD) - PHP_SUBST(CRYPTO_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, OPENSSL_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CRYPTO_SHARED_LIBADD) - found_openssl=yes - fi - done - - if test "$found_cyrus" = "no"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please Re-install the cyrus distribution) - fi - - if test "$found_sasl" = "no"; then - AC_MSG_RESULT(sasl not found) - AC_MSG_ERROR(Please Re-install the cyrus distribution) - fi - - AC_DEFINE(HAVE_CYRUS,1,[ ]) - - PHP_NEW_EXTENSION(cyrus, cyrus.c, $ext_shared) -fi diff --git a/ext/cyrus/cyrus.c b/ext/cyrus/cyrus.c deleted file mode 100644 index 6a77a43a5a1..00000000000 --- a/ext/cyrus/cyrus.c +++ /dev/null @@ -1,516 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_cyrus.h" - -#if HAVE_CYRUS - -#include - -#include -#include -#include -#include - -static int le_cyrus; -#define le_cyrus_name "Cyrus IMAP connection" - -function_entry cyrus_functions[] = { - PHP_FE(cyrus_connect, NULL) - PHP_FE(cyrus_authenticate, NULL) - PHP_FE(cyrus_bind, NULL) - PHP_FE(cyrus_unbind, NULL) - PHP_FE(cyrus_query, NULL) - PHP_FE(cyrus_close, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry cyrus_module_entry = { - STANDARD_MODULE_HEADER, - "cyrus", - cyrus_functions, - PHP_MINIT(cyrus), - NULL, - NULL, - NULL, - PHP_MINFO(cyrus), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_CYRUS -ZEND_GET_MODULE(cyrus) -#endif - -static void cyrus_free(zend_rsrc_list_entry *rsrc) -{ - php_cyrus *conn = (php_cyrus *) rsrc->ptr; - - if (conn->client) - imclient_close(conn->client); - - if (conn->host) - efree(conn->host); - - if (conn->port) - efree(conn->port); - - efree(conn); -} - -PHP_MINIT_FUNCTION(cyrus) -{ - le_cyrus = zend_register_list_destructors_ex(cyrus_free, NULL, - le_cyrus_name, module_number); - - REGISTER_LONG_CONSTANT("CYRUS_CONN_NONSYNCLITERAL", - IMCLIENT_CONN_NONSYNCLITERAL, - CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CYRUS_CONN_INITIALRESPONSE", - IMCLIENT_CONN_INITIALRESPONSE, - CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CYRUS_CALLBACK_NUMBERED", CALLBACK_NUMBERED, - CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("CYRUS_CALLBACK_NOLITERAL", CALLBACK_NOLITERAL, - CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(cyrus) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Cyrus IMAP support", "enabled"); - php_info_print_table_end(); -} - -extern void fatal(char *s, int exit) -{ - php_error(E_ERROR, s); -} - -/* {{{ proto resource cyrus_connect([ string host [, string port [, int flags]]]) - Connect to a Cyrus IMAP server */ -PHP_FUNCTION(cyrus_connect) -{ - zval **z_host; - zval **z_port; - zval **z_flags; - php_cyrus *conn; - struct imclient *client; - char *host; - char *port = NULL; - int flags = 0; - int error; - int argc = ZEND_NUM_ARGS(); - - if (argc < 0 || argc > 3 || - zend_get_parameters_ex(argc, &z_host, &z_port, &z_flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 0) { - convert_to_string_ex(z_host); - host = estrndup(Z_STRVAL_PP(z_host), Z_STRLEN_PP(z_host)); - } - else { - host = estrndup("localhost", sizeof("localhost") - 1); - } - - if (argc > 1) { - convert_to_string_ex(z_port); - port = estrndup(Z_STRVAL_PP(z_port), Z_STRLEN_PP(z_port)); - } - - if (argc > 2) { - convert_to_long_ex(z_flags); - flags = Z_LVAL_PP(z_flags); - } - - error = imclient_connect(&client, host, port, NULL); - switch (error) { - case 0: - if (client) { - conn = ecalloc(1, sizeof *conn); - conn->client = client; - conn->host = host; - conn->port = port; - - if (flags) { - imclient_setflags(conn->client, flags); - conn->flags = flags; - } - } - - break; - - case -1: - php_error(E_WARNING, "Invalid hostname: %s", host); - RETURN_FALSE; - - case -2: - php_error(E_WARNING, "Invalid port: %d", port); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, conn, le_cyrus); - conn->id = Z_LVAL_P(return_value); -} -/* }}} */ - - -static void cyrus_capable_callback(struct imclient *client, void *rock, - struct imclient_reply *reply) -{ - char *token = NULL; - char *token_buf; - char *mechanism = rock; - - - /* We need to split the reply up by the whitespace */ - token = php_strtok_r(reply->text, " ", &token_buf); - while (token != NULL) { - if (! strncmp(token, "AUTH=", 5)) { - memcpy(mechanism, token + 5, strlen(token) - 5); - break; - } - - token = php_strtok_r(NULL, " ", &token_buf); - } -} - - -/* {{{ proto bool cyrus_authenticate( resource connection [, string mechlist [, string service [, string user [, int minssf [, int maxssf]]]]]) - Authenticate agaings a Cyrus IMAP server */ -PHP_FUNCTION(cyrus_authenticate) -{ - zval **z_conn; - zval **z_mechlist; - zval **z_service; - zval **z_user; - zval **z_minssf; - zval **z_maxssf; - php_cyrus *conn; - char *mechlist; - char *service; - char *user; - int minssf; - int maxssf; - int argc = ZEND_NUM_ARGS(); - - if (argc < 1 || argc > 6 || - zend_get_parameters_ex(argc, &z_conn, &z_mechlist, &z_service, &z_user, &z_minssf, &z_maxssf) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus); - - /* Determine support mechanisms */ - if (argc > 1 && Z_TYPE_PP(z_mechlist) != IS_NULL) { - convert_to_string_ex(z_mechlist); - - mechlist = estrndup(Z_STRVAL_PP(z_mechlist), Z_STRLEN_PP(z_mechlist)); - } - else { - char tmp_mechlist[100]; - int pos = 0; - - /* NULL out the buffer, ensures it has a safe ending and allows us to - * test properly for the end of the buffer - */ - memset(tmp_mechlist, 0, sizeof tmp_mechlist); - - /* We'll be calling the "CAPABILITY" command, which will give us a list - * of the types of authorization the server is capable of - */ - imclient_addcallback(conn->client, "CAPABILITY", 0, - cyrus_capable_callback, (void *) tmp_mechlist, 0); - imclient_send(conn->client, NULL, NULL, "CAPABILITY"); - - /* Grab the end of string position into pos */ - while (tmp_mechlist[pos++] != 0) - ; - - /* Tack on PLAIN to whatever the auth string is */ - memcpy(tmp_mechlist + pos, " PLAIN", 6); - - /* Copy it onto the main buffer */ - mechlist = estrndup(tmp_mechlist, pos + 6); - } - - /* Determine the service type */ - if (argc > 2 && Z_TYPE_PP(z_service) != IS_NULL) { - convert_to_string_ex(z_service); - service = estrndup(Z_STRVAL_PP(z_service), Z_STRLEN_PP(z_service)); - } - else { - service = estrndup("imap", 4); - } - - /* Determine the user */ - if (argc > 3 && Z_TYPE_PP(z_user) != IS_NULL) { - convert_to_string_ex(z_user); - user = estrndup(Z_STRVAL_PP(z_user), Z_STRLEN_PP(z_user)); - } - else { - /* XXX: UGLY, but works, determines the username to use */ - user = (char *) sapi_getenv("USER", 4); - if (! user) { - user = (char *) getenv("USER"); - if (! user) { - user = (char *) sapi_getenv("LOGNAME", 7); - if (! user) { - user = (char *) getenv("LOGNAME"); - if (! user) { - struct passwd *pwd = getpwuid(getuid()); - if (! pwd) { - php_error(E_WARNING, "Couldn't determine user id"); - RETURN_FALSE; - } - - user = estrdup(pwd->pw_name); - } - } - } - } - } - - /* Determine the minssf */ - if (argc > 4 && Z_TYPE_PP(z_minssf) != NULL) { - convert_to_long_ex(z_minssf); - minssf = Z_LVAL_PP(z_minssf); - } - else { - minssf = 0; - } - - /* Determine the maxssf */ - if (argc > 5 && Z_TYPE_PP(z_maxssf) != NULL) { - convert_to_long_ex(z_maxssf); - maxssf = Z_LVAL_PP(z_maxssf); - } - else { - maxssf = 1000; - } - - imclient_authenticate(conn->client, mechlist, service, - user, minssf, maxssf); - - efree(mechlist); - efree(service); - efree(user); -} -/* }}} */ - - -static void cyrus_generic_callback(struct imclient *client, - void *rock, - struct imclient_reply *reply) -{ - php_cyrus_callback *callback = rock; - - if (client) { - zval **argv[4]; - zval *retval; - zval *cyrus; - zval *keyword; - zval *text; - zval *msgno; - TSRMLS_FETCH(); - - MAKE_STD_ZVAL(cyrus); - MAKE_STD_ZVAL(keyword); - MAKE_STD_ZVAL(text); - MAKE_STD_ZVAL(msgno); - - ZVAL_RESOURCE(cyrus, callback->le); - zend_list_addref(callback->le); - - ZVAL_STRING(keyword, reply->keyword, 1); - ZVAL_STRING(text, reply->text, 1); - ZVAL_LONG(msgno, reply->msgno); - - argv[0] = &cyrus; - argv[1] = &keyword; - argv[2] = &text; - argv[3] = &msgno; - - if (call_user_function_ex(EG(function_table), NULL, callback->function, - &retval, 4, argv, 0, NULL) == FAILURE) { - php_error(E_WARNING, "Couldn't call the %s handler", - callback->trigger); - } - - zval_ptr_dtor(argv[0]); - zval_ptr_dtor(argv[1]); - zval_ptr_dtor(argv[2]); - zval_ptr_dtor(argv[3]); - - efree(argv); - } - else { - return; - } -} - - -/* {{{ proto bool cyrus_bind( resource connection, array callbacks) - Bind callbacks to a Cyrus IMAP connection */ -PHP_FUNCTION(cyrus_bind) -{ - zval **z_conn; - zval **z_callback; - zval **tmp; - HashTable *hash; - php_cyrus *conn; - php_cyrus_callback callback; - char *string_key; - ulong num_key; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &z_conn, &z_callback) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus); - - hash = HASH_OF(*z_callback); - if (! hash) { - php_error(E_WARNING, - "Second argument to cyrus_bind() must be an array or object"); - RETURN_FALSE; - } - - for (zend_hash_internal_pointer_reset(hash); - zend_hash_get_current_data(hash, (void **) &tmp) == SUCCESS; - zend_hash_move_forward(hash)) { - SEPARATE_ZVAL(tmp); - zend_hash_get_current_key(hash, &string_key, &num_key, 0); - if (! string_key) - continue; - - if (! strcasecmp(string_key, "trigger")) { - convert_to_string_ex(tmp); - callback.trigger = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - } - else if (! strcasecmp(string_key, "function")) { - callback.function = *tmp; - zval_add_ref(&callback.function); - } - else if (! strcasecmp(string_key, "flags")) { - convert_to_long_ex(tmp); - callback.flags |= Z_LVAL_PP(tmp); - } - } - - if (! callback.trigger) { - php_error(E_WARNING, "You must specify a trigger in your callback"); - RETURN_FALSE; - } - - if (! callback.function) { - php_error(E_WARNING, "You must specify a function in your callback"); - RETURN_FALSE; - } - - callback.le = conn->id; - - imclient_addcallback(conn->client, callback.trigger, callback.flags, - cyrus_generic_callback, (void **) &callback, 0); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool cyrus_unbind( resource connection, string trigger_name) - Unbind ... */ -PHP_FUNCTION(cyrus_unbind) -{ - zval **z_conn; - zval **trigger_name; - php_cyrus *conn; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &z_conn, &trigger_name) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus); - convert_to_string_ex(trigger_name); - - imclient_addcallback(conn->client, Z_STRVAL_PP(trigger_name), 0, - NULL, NULL, 0); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool cyrus_query( resource connection, string query) - Send a query to a Cyrus IMAP server */ -PHP_FUNCTION(cyrus_query) -{ - zval **z_conn; - zval **query; - php_cyrus *conn; - - if (ZEND_NUM_ARGS() != 2 || - zend_get_parameters_ex(2, &z_conn, &query) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus); - convert_to_string_ex(query); - - imclient_send(conn->client, NULL, NULL, Z_STRVAL_PP(query)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool cyrus_close( resource connection) - Close connection to a cyrus server */ -PHP_FUNCTION(cyrus_close) -{ - zval **z_conn; - php_cyrus *conn; - - if (ZEND_NUM_ARGS() != 1 || - zend_get_parameters_ex(1, &z_conn) == FAILURE) { - WRONG_PARAM_COUNT; - } - ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus); - - zend_list_delete(Z_LVAL_PP(z_conn)); - - RETURN_TRUE; -} -/* }}} */ -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/cyrus/php_cyrus.h b/ext/cyrus/php_cyrus.h deleted file mode 100644 index fbe6f923c60..00000000000 --- a/ext/cyrus/php_cyrus.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sterling Hughes | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_CYRUS_H -#define PHP_CYRUS_H - -#include "php.h" - -#if HAVE_CYRUS - -#include - -extern zend_module_entry cyrus_module_entry; -#define phpext_cyrus_ptr &cyrus_module_entry - -#ifdef PHP_WIN32 -#define PHP_CYRUS_API __declspec(dllexport) -#else -#define PHP_CYRUS_API -#endif - -PHP_MINIT_FUNCTION(cyrus); -PHP_MINFO_FUNCTION(cyrus); - -PHP_FUNCTION(cyrus_connect); -PHP_FUNCTION(cyrus_authenticate); -PHP_FUNCTION(cyrus_bind); -PHP_FUNCTION(cyrus_unbind); -PHP_FUNCTION(cyrus_query); -PHP_FUNCTION(cyrus_close); - -typedef struct { - struct imclient *client; - char *host; - char *port; - int flags; - int id; -} -php_cyrus; - -typedef struct { - zval *function; - char *trigger; - long le; - int flags; -} -php_cyrus_callback; - -#endif - - -#endif - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/db/CREDITS b/ext/db/CREDITS deleted file mode 100644 index 9efbe3fe52b..00000000000 --- a/ext/db/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBM -Rasmus Lerdorf, Jim Winstead diff --git a/ext/db/config.m4 b/ext/db/config.m4 deleted file mode 100644 index 9f4a102aad7..00000000000 --- a/ext/db/config.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl -dnl $Id$ -dnl - -# Checks for libraries. -# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order -AC_DEFUN(AC_PREFERRED_DB_LIB,[ - AC_CHECK_LIB(gdbm, gdbm_open,[AC_DEFINE(GDBM,1, [Whether you have GDBM]) DBM_TYPE=gdbm; DBM_LIB=-lgdbm], - [AC_CHECK_LIB(c, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=], - [AC_CHECK_LIB(dbm, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=-ldbm], - [AC_CHECK_LIB(db, dbm_open,[AC_DEFINE(NDBM,1, [Whether you have NDBM]) DBM_TYPE=ndbm; DBM_LIB=-ldb], - [DBM_TYPE=""]) - ]) - ]) - ]) - AC_MSG_CHECKING([preferred dbm library]) - if test "a$DBM_TYPE" = a; then - AC_MSG_RESULT(none found) - AC_MSG_WARN(No dbm library found - using built-in flatfile support) - else - AC_MSG_RESULT($DBM_TYPE chosen) - fi - PHP_SUBST(DBM_LIB) - PHP_SUBST(DBM_TYPE) -]) - - -PHP_ARG_WITH(db, for xDBM support, -[ --with-db Include old xDBM support (deprecated)]) - -if test "$PHP_DB" != "no"; then - - AC_PREFERRED_DB_LIB - - if test "$DBM_LIB" = "-lgdbm"; then - AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [ - AC_MSG_RESULT("Try /usr/local/include/gdbm.h"); - AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE=-I/usr/local/include ],[ - AC_MSG_RESULT("Try /opt/local/include/gdbm.h"); - AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE=-I/opt/local/include ],[ - dnl if in /usr/pkg/include, do not add anything. See above. - AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h"); - AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[ - AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere"); - exit - ]) - ]) - ]) - ]) - fi - - if test -n "$DBM_LIB"; then - INCLUDES="$INCLUDES $GDBM_INCLUDE" - EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB" - fi - - PHP_NEW_EXTENSION(db, db.c) -fi diff --git a/ext/db/db.c b/ext/db/db.c deleted file mode 100644 index f089504ad38..00000000000 --- a/ext/db/db.c +++ /dev/null @@ -1,1209 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ -#define IS_EXT_MODULE - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include "ext/standard/flock_compat.h" -#include "ext/standard/info.h" - -#include -#include -#include -#if HAVE_UNISTD_H -#include -#endif - -#ifdef PHP_31 -#include "os/nt/flock.h" -#else -#ifdef PHP_WIN32 -#include "win32/flock.h" -#else -#include -#endif -#endif - -#if HAVE_FCNTL_H -#include -#endif - -#if GDBM -#include - -#define DBM_TYPE GDBM_FILE -#define DBM_MODE_TYPE int -#define DBM_WRITE_MODE GDBM_WRITER -#define DBM_CREATE_MODE GDBM_WRCREAT -#define DBM_NEW_MODE GDBM_NEWDB -#define DBM_DEFAULT_MODE GDBM_READER -#define DBM_OPEN(filename, mode) gdbm_open(filename, 512, mode, 0666, 0) -#define DBM_CLOSE(dbf) gdbm_close(dbf) -#define DBM_STORE(dbf, key, value, mode) gdbm_store(dbf, key, value, mode) -#define DBM_FETCH(dbf, key) gdbm_fetch(dbf, key) -#define DBM_EXISTS(dbf, key) gdbm_exists(dbf, key) -#define DBM_DELETE(dbf, key) gdbm_delete(dbf, key) -#define DBM_FIRSTKEY(dbf) gdbm_firstkey(dbf) -#define DBM_NEXTKEY(dbf, key) gdbm_nextkey(dbf, key) - -#define DBM_INSERT GDBM_INSERT -#define DBM_REPLACE GDBM_REPLACE -#endif - -#if NDBM && !GDBM -#if BSD2 -#define DB_DBM_HSEARCH 1 -#include -#else -#ifdef HAVE_DB1_NDBM_H -#include -#else -#include -#endif -#endif - -#define DBM_TYPE DBM * -#define DBM_MODE_TYPE int -#define DBM_WRITE_MODE O_RDWR -#define DBM_CREATE_MODE O_RDWR | O_CREAT -#define DBM_NEW_MODE O_RDWR | O_CREAT | O_TRUNC -#define DBM_DEFAULT_MODE O_RDONLY -#define DBM_OPEN(filename, mode) dbm_open(filename, mode, 0666) -#define DBM_CLOSE(dbf) dbm_close(dbf) -#define DBM_STORE(dbf, key, value, mode) dbm_store(dbf, key, value, mode) -#define DBM_FETCH(dbf, key) dbm_fetch(dbf, key) -#define DBM_EXISTS(dbf, key) php_dbm_key_exists(dbf, key) -#define DBM_DELETE(dbf, key) dbm_delete(dbf, key) -#define DBM_FIRSTKEY(dbf) dbm_firstkey(dbf) -#define DBM_NEXTKEY(dbf, key) dbm_nextkey(dbf) - -/* {{{ php_dbm_key_exists - */ -static int php_dbm_key_exists(DBM *dbf, datum key_datum) { - datum value_datum; - int ret; - - value_datum = dbm_fetch(dbf, key_datum); - if (value_datum.dptr) - ret = 1; - else - ret = 0; - return ret; -} -/* }}} */ -#endif - -#if !NDBM && !GDBM -#define DBM_TYPE FILE * - -#define DBM_MODE_TYPE char * -#define DBM_WRITE_MODE "r+b" -#define DBM_CREATE_MODE "a+b" -#define DBM_NEW_MODE "w+b" -#define DBM_DEFAULT_MODE "r" -#define DBM_OPEN(filename, mode) VCWD_FOPEN(filename, mode) -#define DBM_CLOSE(dbf) fclose(dbf) -#define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode) -#define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key) -#define DBM_EXISTS(dbf, key) flatfile_findkey(dbf, key) -#define DBM_DELETE(dbf, key) flatfile_delete(dbf, key) -#define DBM_FIRSTKEY(dbf) flatfile_firstkey(dbf) -#define DBM_NEXTKEY(dbf, key) flatfile_nextkey(dbf) - -#define DBM_INSERT 0 -#define DBM_REPLACE 1 - -typedef struct { - char *dptr; - int dsize; -} datum; - -int flatfile_store(FILE *dbf, datum key, datum value, int mode); -datum flatfile_fetch(FILE *dbf, datum key); -int flatfile_findkey(FILE *dbf, datum key); -int flatfile_delete(FILE *dbf, datum key); -datum flatfile_firstkey(FILE *dbf); -datum flatfile_nextkey(FILE *dbf); - -#endif - -#include "php_db.h" -#include "ext/standard/php_string.h" - -static int le_db; - -/* {{{ php_find_dbm - */ -dbm_info *php_find_dbm(pval *id TSRMLS_DC) -{ - list_entry *le; - dbm_info *info; - int numitems, i; - int info_type; - - if (Z_TYPE_P(id) == IS_STRING) { - numitems = zend_hash_num_elements(&EG(regular_list)); - for (i=1; i<=numitems; i++) { - if (zend_hash_index_find(&EG(regular_list), i, (void **) &le)==FAILURE) { - continue; - } - if (Z_TYPE_P(le) == le_db) { - info = (dbm_info *)(le->ptr); - if (!strcmp(info->filename, Z_STRVAL_P(id))) { - return (dbm_info *)(le->ptr); - } - } - } - } - - /* didn't find it as a database filename, try as a number */ - convert_to_long(id); - info = zend_list_find(Z_LVAL_P(id), &info_type); - if (info_type != le_db) - return NULL; - return info; -} -/* }}} */ - -/* {{{ php_get_info_db - */ -static char *php_get_info_db(void) -{ - static char temp1[128]; - static char temp[256]; - - temp1[0]='\0'; - temp[0]='\0'; - -#ifdef DB_VERSION_STRING /* using sleepycat dbm */ - strcat(temp, DB_VERSION_STRING); -#endif - -#if GDBM - sprintf(temp1, "%s", gdbm_version); - strcat(temp, temp1); -#endif - -#if NDBM && !GDBM - strcat(temp, "ndbm support enabled"); -#endif - -#if !GDBM && !NDBM - strcat(temp, "flat file support enabled"); -#endif - -#if NFS_HACK - strcat(temp, "NFS hack in effect"); -#endif - - if (!*temp) - strcat(temp, "No database support"); - - return temp; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(db) -{ - /* this isn't pretty ... should break out the info a bit more (cmv) */ - php_info_print_box_start(0); - php_printf(php_get_info_db()); - php_info_print_box_end(); -} -/* }}} */ - -/* {{{ proto string dblist(void) - Describes the dbm-compatible library being used */ -PHP_FUNCTION(dblist) -{ - char *str; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - str = php_get_info_db(); - RETURN_STRING(str, 1); -} -/* }}} */ - -/* {{{ proto int dbmopen(string filename, string mode) - Opens a dbm database */ -PHP_FUNCTION(dbmopen) -{ - pval *filename, *mode; - dbm_info *info=NULL; - int ret; - - if (ZEND_NUM_ARGS()!=2 || zend_get_parameters(ht, 2, &filename, &mode)==FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string(filename); - convert_to_string(mode); - - info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode) TSRMLS_CC); - if (info) { - ret = zend_list_insert(info, le_db); - RETURN_LONG(ret); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_dbm_open - */ -dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) -{ - dbm_info *info; - int ret, lock=0; - char *lockfn = NULL; - int lockfd = 0; -#if NFS_HACK - int last_try = 0; - struct stat sb; - int retries = 0; -#endif - DBM_TYPE dbf=NULL; - DBM_MODE_TYPE imode; - - if (filename == NULL) { - php_error(E_WARNING, "NULL filename passed to php_dbm_open()"); - return NULL; - } - - if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return NULL; - } - - if (php_check_open_basedir(filename TSRMLS_CC)) { - return NULL; - } - - switch (*mode) { - case 'w': - imode = DBM_WRITE_MODE; - lock = 1; - break; - case 'c': - imode = DBM_CREATE_MODE; - lock = 1; - break; - case 'n': - imode = DBM_NEW_MODE; - lock = 1; - break; - default: - imode = DBM_DEFAULT_MODE; - lock = 0; - break; - } - - if (lock) { - lockfn = emalloc(strlen(filename) + 5); - strcpy(lockfn, filename); - strcat(lockfn, ".lck"); - -#if NFS_HACK - while((last_try = VCWD_STAT(lockfn, &sb))==0) { - retries++; - php_sleep(1); - if (retries>30) break; - } - if (last_try!=0) { - lockfd = open(lockfn, O_RDWR|O_CREAT, 0644); - close(lockfd); - } else { - php_error(E_WARNING, "File appears to be locked [%s]\n", lockfn); - return -1; - } -#else /* NFS_HACK */ - - lockfd = VCWD_OPEN_MODE(lockfn, O_RDWR|O_CREAT, 0644); - - if (lockfd) { - flock(lockfd, LOCK_EX); - close(lockfd); - } else { - php_error(E_WARNING, "Unable to establish lock: %s", filename); - } -#endif /* else NFS_HACK */ - - } - - dbf = DBM_OPEN(filename, imode); - -#if !NDBM && !GDBM - if (dbf) { - setvbuf(dbf, NULL, _IONBF, 0); - } -#endif - - if (dbf) { - info = (dbm_info *)emalloc(sizeof(dbm_info)); - if (!info) { - php_error(E_ERROR, "problem allocating memory!"); - return NULL; - } - - info->filename = estrdup(filename); - info->lockfn = lockfn; - info->lockfd = lockfd; - info->dbf = dbf; - - return info; - } else { -#if GDBM - php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]", filename, gdbm_errno, gdbm_strerror(gdbm_errno), errno, strerror(errno)); - if (gdbm_errno) - ret = gdbm_errno; - else if (errno) - ret = errno; - else - ret = -1; -#else -#if NDBM -#if PHP_DEBUG - php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); -#endif - if (errno) ret=errno; - else ret = -1; -#else -#if PHP_DEBUG - php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); -#endif - if (errno) ret=errno; - else ret = -1; -#endif -#endif - -#if NFS_HACK - if (lockfn) { - VCWD_UNLINK(lockfn); - } -#endif - if (lockfn) efree(lockfn); - } - - return NULL; -} -/* }}} */ - -/* {{{ proto bool dbmclose(int dbm_identifier) - Closes a dbm database */ -PHP_FUNCTION(dbmclose) -{ - pval *id; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht, 1, &id)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(id); - - if (zend_list_delete(Z_LVAL_P(id)) == SUCCESS) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_dbm_close - */ -void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int ret = 0; - dbm_info *info = (dbm_info *)rsrc->ptr; - DBM_TYPE dbf; - int lockfd; - - dbf = info->dbf; - -#if NFS_HACK - VCWD_UNLINK(info->lockfn); -#else - if (info->lockfn) { - lockfd = VCWD_OPEN_MODE(info->lockfn, O_RDWR, 0644); - flock(lockfd, LOCK_UN); - close(lockfd); - } -#endif - - if (dbf) - DBM_CLOSE(dbf); - - /* free the memory used by the dbm_info struct */ - if (info->filename) efree(info->filename); - if (info->lockfn) efree(info->lockfn); - efree(info); -} -/* }}} */ - -/* - * ret = -1 means that database was opened for read-only - * ret = 0 success - * ret = 1 key already exists - nothing done - */ -/* {{{ proto int dbminsert(int dbm_identifier, string key, string value) - Inserts a value for a key in a dbm database */ -PHP_FUNCTION(dbminsert) -{ - pval *id, *key, *value; - dbm_info *info; - int ret; - - if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - convert_to_string(value); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_insert(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC); - RETURN_LONG(ret); -} -/* }}} */ - - -/* {{{ php_dbm_insert - */ -int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC) { - datum key_datum, value_datum; - int ret; - DBM_TYPE dbf; - - php_stripslashes(key, NULL TSRMLS_CC); - php_stripslashes(value, NULL TSRMLS_CC); - - value_datum.dptr = estrdup(value); - value_datum.dsize = strlen(value); - - key_datum.dptr = estrdup(key); - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return 1; - } - - ret = DBM_STORE(dbf, key_datum, value_datum, DBM_INSERT); - - /* free the memory */ - efree(key_datum.dptr); efree(value_datum.dptr); - - return(ret); -} -/* }}} */ - -/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value) - Replaces the value for a key in a dbm database */ -PHP_FUNCTION(dbmreplace) -{ - pval *id, *key, *value; - dbm_info *info; - int ret; - - if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - convert_to_string(value); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC); - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ php_dbm_replace - */ -int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC) -{ - DBM_TYPE dbf; - int ret; - datum key_datum, value_datum; - - if (PG(magic_quotes_runtime)) { - php_stripslashes(key, NULL TSRMLS_CC); - php_stripslashes(value, NULL TSRMLS_CC); - } - - value_datum.dptr = estrdup(value); - value_datum.dsize = strlen(value); - - key_datum.dptr = estrdup(key); - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return 1; - } - - ret = DBM_STORE(dbf, key_datum, value_datum, DBM_REPLACE); - - /* free the memory */ - efree(key_datum.dptr); efree(value_datum.dptr); - - return(ret); -} -/* }}} */ - -/* {{{ proto string dbmfetch(int dbm_identifier, string key) - Fetches a value for a key from a dbm database */ -PHP_FUNCTION(dbmfetch) -{ - pval *id, *key; - dbm_info *info; - char *ret; - - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_fetch(info, Z_STRVAL_P(key) TSRMLS_CC); - if (ret) { - RETVAL_STRING(ret, 0); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_dbm_fetch - */ -char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC) -{ - datum key_datum, value_datum; - char *ret; - DBM_TYPE dbf; - - key_datum.dptr = key; - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - value_datum.dptr = NULL; - value_datum.dsize = 0; - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return(NULL); - } - - value_datum = DBM_FETCH(dbf, key_datum); - - if (value_datum.dptr) { - ret = (char *)emalloc(sizeof(char) * value_datum.dsize + 1); - strncpy(ret, value_datum.dptr, value_datum.dsize); - ret[value_datum.dsize] = '\0'; - -#if GDBM -/* all but NDBM use malloc to allocate the content blocks, so we need to free it */ - free(value_datum.dptr); -#else -# if !NDBM - efree(value_datum.dptr); -# endif -#endif - } - else - ret = NULL; - - if (ret && PG(magic_quotes_runtime)) { - ret = php_addslashes(ret, value_datum.dsize, NULL, 1 TSRMLS_CC); - } - return(ret); -} -/* }}} */ - -/* {{{ proto int dbmexists(int dbm_identifier, string key) - Tells if a value exists for a key in a dbm database */ -PHP_FUNCTION(dbmexists) -{ - pval *id, *key; - dbm_info *info; - int ret; - - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_exists(info, Z_STRVAL_P(key)); - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ php_dbm_exists - */ -int php_dbm_exists(dbm_info *info, char *key) { - datum key_datum; - int ret; - DBM_TYPE dbf; - - key_datum.dptr = key; - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return(0); - } - - ret = DBM_EXISTS(dbf, key_datum); - - return(ret); -} -/* }}} */ - -/* {{{ proto int dbmdelete(int dbm_identifier, string key) - Deletes the value for a key from a dbm database */ -PHP_FUNCTION(dbmdelete) -{ - pval *id, *key; - dbm_info *info; - int ret; - - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_delete(info, Z_STRVAL_P(key)); - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ php_dbm_delete - */ -int php_dbm_delete(dbm_info *info, char *key) { - datum key_datum; - int ret; - DBM_TYPE dbf; - - key_datum.dptr = key; - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return(0); - } - - ret = DBM_DELETE(dbf, key_datum); - return(ret); -} -/* }}} */ - -/* {{{ proto string dbmfirstkey(int dbm_identifier) - Retrieves the first key from a dbm database */ -PHP_FUNCTION(dbmfirstkey) -{ - pval *id; - dbm_info *info; - char *ret; - - if (ZEND_NUM_ARGS()!=1||zend_get_parameters(ht, 1, &id)==FAILURE) { - WRONG_PARAM_COUNT; - } - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_first_key(info); - if (!ret) { - RETURN_FALSE; - } else { - RETVAL_STRING(ret, 0); - } -} -/* }}} */ - -/* {{{ php_dbm_first_key - */ -char *php_dbm_first_key(dbm_info *info) { - datum ret_datum; - char *ret; - DBM_TYPE dbf; - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return(NULL); - } - - /* explicitly zero-out ret_datum */ - ret_datum.dptr = NULL; - ret_datum.dsize = 0; - - ret_datum = DBM_FIRSTKEY(dbf); - - if (!ret_datum.dptr) - return NULL; - - ret = (char *)emalloc((ret_datum.dsize + 1) * sizeof(char)); - strncpy(ret, ret_datum.dptr, ret_datum.dsize); - ret[ret_datum.dsize] = '\0'; - -#if !NDBM & !GDBM - efree(ret_datum.dptr); -#endif - - return (ret); -} -/* }}} */ - -/* {{{ proto string dbmnextkey(int dbm_identifier, string key) - Retrieves the next key from a dbm database */ -PHP_FUNCTION(dbmnextkey) -{ - pval *id, *key; - dbm_info *info; - char *ret; - - if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(key); - - info = php_find_dbm(id TSRMLS_CC); - if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); - RETURN_FALSE; - } - - ret = php_dbm_nextkey(info, Z_STRVAL_P(key) TSRMLS_CC); - if (!ret) { - RETURN_FALSE; - } else { - RETVAL_STRING(ret, 0); - } -} -/* }}} */ - -/* {{{ php_dbm_nextkey - */ -char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC) -{ - datum key_datum, ret_datum; - char *ret; - DBM_TYPE dbf; - - key_datum.dptr = key; - key_datum.dsize = strlen(key); -#if GDBM_FIX - key_datum.dsize++; -#endif - - dbf = info->dbf; - if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); - return(NULL); - } - - /* explicitly zero-out ret_datum */ - ret_datum.dptr = NULL; - ret_datum.dsize = 0; - - ret_datum = DBM_NEXTKEY(dbf, key_datum); - - if (ret_datum.dptr) { - ret = (char *)emalloc(sizeof(char) * ret_datum.dsize + 1); - strncpy(ret, ret_datum.dptr, ret_datum.dsize); - ret[ret_datum.dsize] = '\0'; -#if GDBM -/* GDBM uses malloc to allocate the value_datum block, so we need to free it */ - free(ret_datum.dptr); -#else -# if !NDBM - efree(ret_datum.dptr); -# endif -#endif - } - else ret=NULL; - - if (ret && PG(magic_quotes_runtime)) { - ret = php_addslashes(ret, ret_datum.dsize, NULL, 1 TSRMLS_CC); - } - return(ret); -} -/* }}} */ - -#if !GDBM && !NDBM -static long CurrentFlatFilePos = 0L; -/* {{{ flatfile_store - */ -int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) { - int ret; - - if (mode == DBM_INSERT) { - if (flatfile_findkey(dbf, key_datum)) { - return 1; - } - fseek(dbf, 0L, SEEK_END); - fprintf(dbf, "%d\n", key_datum.dsize); - fflush(dbf); - ret = write(fileno(dbf), key_datum.dptr, key_datum.dsize); - fprintf(dbf, "%d\n", value_datum.dsize); - fflush(dbf); - ret = write(fileno(dbf), value_datum.dptr, value_datum.dsize); - } else { /* DBM_REPLACE */ - flatfile_delete(dbf, key_datum); - fprintf(dbf, "%d\n", key_datum.dsize); - fflush(dbf); - ret = write(fileno(dbf), key_datum.dptr, key_datum.dsize); - fprintf(dbf, "%d\n", value_datum.dsize); - ret = write(fileno(dbf), value_datum.dptr, value_datum.dsize); - } - - if (ret>0) - ret=0; - return ret; -} -/* }}} */ - -/* {{{ flatfile_fetch - */ -datum flatfile_fetch(FILE *dbf, datum key_datum) { - datum value_datum = {NULL, 0}; - int num=0, buf_size=1024; - char *buf; - - if (flatfile_findkey(dbf, key_datum)) { - buf = emalloc((buf_size+1) * sizeof(char)); - if (fgets(buf, 15, dbf)) { - num = atoi(buf); - if (num > buf_size) { - buf_size+=num; - buf = emalloc((buf_size+1)*sizeof(char)); - } - read(fileno(dbf), buf, num); - value_datum.dptr = buf; - value_datum.dsize = num; - } - } - return value_datum; -} -/* }}} */ - -/* {{{ flatfile_delete - */ -int flatfile_delete(FILE *dbf, datum key_datum) { - char *key = key_datum.dptr; - int size = key_datum.dsize; - - char *buf; - int num, buf_size = 1024; - long pos; - - rewind(dbf); - - buf = emalloc((buf_size + 1)*sizeof(char)); - while(!feof(dbf)) { - /* read in the length of the key name */ - if (!fgets(buf, 15, dbf)) - break; - num = atoi(buf); - if (num > buf_size) { - buf_size += num; - if (buf) efree(buf); - buf = emalloc((buf_size+1)*sizeof(char)); - } - pos = ftell(dbf); - - /* read in the key name */ - num = fread(buf, sizeof(char), num, dbf); - if (num<0) break; - *(buf+num) = '\0'; - - if (size == num && !memcmp(buf, key, size)) { - fseek(dbf, pos, SEEK_SET); - fputc(0, dbf); - fflush(dbf); - fseek(dbf, 0L, SEEK_END); - if (buf) efree(buf); - return SUCCESS; - } - - /* read in the length of the value */ - if (!fgets(buf, 15, dbf)) - break; - num = atoi(buf); - if (num > buf_size) { - buf_size+=num; - if (buf) efree(buf); - buf = emalloc((buf_size+1)*sizeof(char)); - } - /* read in the value */ - num = fread(buf, sizeof(char), num, dbf); - if (num<0) - break; - } - if (buf) efree(buf); - return FAILURE; -} -/* }}} */ - -/* {{{ flatfile_findkey - */ -int flatfile_findkey(FILE *dbf, datum key_datum) { - char *buf = NULL; - int num; - int buf_size=1024; - int ret=0; - void *key = key_datum.dptr; - int size = key_datum.dsize; - - rewind(dbf); - buf = emalloc((buf_size+1)*sizeof(char)); - while (!feof(dbf)) { - if (!fgets(buf, 15, dbf)) break; - num = atoi(buf); - if (num > buf_size) { - if (buf) efree(buf); - buf_size+=num; - buf = emalloc((buf_size+1)*sizeof(char)); - } - num = fread(buf, sizeof(char), num, dbf); - if (num<0) break; - *(buf+num) = '\0'; - if (size == num) { - if (!memcmp(buf, key, size)) { - ret = 1; - break; - } - } - if (!fgets(buf, 15, dbf)) - break; - num = atoi(buf); - if (num > buf_size) { - if (buf) efree(buf); - buf_size+=num; - buf = emalloc((buf_size+1)*sizeof(char)); - } - num = fread(buf, sizeof(char), num, dbf); - if (num<0) break; - *(buf+num) = '\0'; - } - if (buf) efree(buf); - return(ret); -} -/* }}} */ - -/* {{{ flatfile_firstkey - */ -datum flatfile_firstkey(FILE *dbf) { - datum buf; - int num; - int buf_size=1024; - - rewind(dbf); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - while(!feof(dbf)) { - if (!fgets(buf.dptr, 15, dbf)) break; - num = atoi(buf.dptr); - if (num > buf_size) { - buf_size+=num; - if (buf.dptr) efree(buf.dptr); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - } - num=read(fileno(dbf), buf.dptr, num); - if (num<0) break; - buf.dsize = num; - if (*(buf.dptr)!=0) { - CurrentFlatFilePos = ftell(dbf); - return(buf); - } - if (!fgets(buf.dptr, 15, dbf)) break; - num = atoi(buf.dptr); - if (num > buf_size) { - buf_size+=num; - if (buf.dptr) efree(buf.dptr); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - } - num=read(fileno(dbf), buf.dptr, num); - if (num<0) break; - } - if (buf.dptr) efree(buf.dptr); - buf.dptr = NULL; - return(buf); -} -/* }}} */ - -/* {{{ latfile_nextkey - */ -datum flatfile_nextkey(FILE *dbf) { - datum buf; - int num; - int buf_size=1024; - - fseek(dbf, CurrentFlatFilePos, SEEK_SET); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - while(!feof(dbf)) { - if (!fgets(buf.dptr, 15, dbf)) break; - num = atoi(buf.dptr); - if (num > buf_size) { - buf_size+=num; - if (buf.dptr) efree(buf.dptr); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - } - num=read(fileno(dbf), buf.dptr, num); - if (num<0) break; - if (!fgets(buf.dptr, 15, dbf)) break; - num = atoi(buf.dptr); - if (num > buf_size) { - buf_size+=num; - if (buf.dptr) efree(buf.dptr); - buf.dptr = emalloc((buf_size+1)*sizeof(char)); - } - num=read(fileno(dbf), buf.dptr, num); - if (num<0) break; - buf.dsize = num; - if (*(buf.dptr)!=0) { - CurrentFlatFilePos = ftell(dbf); - return(buf); - } - } - if (buf.dptr) efree(buf.dptr); - buf.dptr = NULL; - return(buf); -} -/* }}} */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(db) -{ - le_db = zend_register_list_destructors_ex(php_dbm_close, NULL, "dbm", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(db) -{ -#if !GDBM && !NDBM - CurrentFlatFilePos = 0L; -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ dbm_functions[] - */ -function_entry dbm_functions[] = { - PHP_FE(dblist, NULL) - PHP_FE(dbmopen, NULL) - PHP_FE(dbmclose, NULL) - PHP_FE(dbminsert, NULL) - PHP_FE(dbmfetch, NULL) - PHP_FE(dbmreplace, NULL) - PHP_FE(dbmexists, NULL) - PHP_FE(dbmdelete, NULL) - PHP_FE(dbmfirstkey, NULL) - PHP_FE(dbmnextkey, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry dbm_module_entry = { - STANDARD_MODULE_HEADER, - "db", - dbm_functions, - PHP_MINIT(db), - NULL, - PHP_RINIT(db), - NULL, - PHP_MINFO(db), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DB -ZEND_GET_MODULE(dbm) -#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/db/db.dsp b/ext/db/db.dsp deleted file mode 100644 index a514dba9aa6..00000000000 --- a/ext/db/db.dsp +++ /dev/null @@ -1,122 +0,0 @@ -# Microsoft Developer Studio Project File - Name="db" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=db - 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 "db.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 "db.mak" CFG="db - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "db - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "db - 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)" == "db - 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_DB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DB_EXPORTS" /D "COMPILE_DL_DB" /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_INET_ATON" /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 php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_db.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "db - 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_DB" /D ZTS=1 /YX /FD /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 "DB_EXPORTS" /D "COMPILE_DL_DB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_INET_ATON" /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 php4ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_db.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "db - Win32 Release_TS" -# Name "db - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\db.c -# End Source File -# Begin Source File - -SOURCE=..\standard\flock_compat.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=.\php_db.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/db/php_db.h b/ext/db/php_db.h deleted file mode 100644 index 8fc598a57fa..00000000000 --- a/ext/db/php_db.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#ifndef PHP_DB_H -#define PHP_DB_H - - -#ifndef DLEXPORT -#define DLEXPORT -#endif - - -extern zend_module_entry dbm_module_entry; -#define phpext_db_ptr &dbm_module_entry - - - -typedef struct dbm_info { - char *filename; - char *lockfn; - int lockfd; - void *dbf; -} dbm_info; - -/* - we're not going to bother with flatfile on win32 - because the dbm module will be external, and we - do not want flatfile compiled staticly -*/ -#if defined(PHP_WIN32) && !defined(COMPILE_DL_DB) -#undef phpext_db_ptr -#define phpext_db_ptr NULL -#endif - -dbm_info *php_find_dbm(pval *id TSRMLS_DC); -void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); -dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC); -int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC); -char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC); -int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC); -int php_dbm_exists(dbm_info *info, char *key); -int php_dbm_delete(dbm_info *info, char *key); -char *php_dbm_first_key(dbm_info *info); -char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC); - -/* db file functions */ -PHP_MINIT_FUNCTION(db); -PHP_RINIT_FUNCTION(db); -PHP_MINFO_FUNCTION(db); - -PHP_FUNCTION(dblist); -PHP_FUNCTION(dbmopen); -PHP_FUNCTION(dbmclose); -PHP_FUNCTION(dbminsert); -PHP_FUNCTION(dbmfetch); -PHP_FUNCTION(dbmreplace); -PHP_FUNCTION(dbmexists); -PHP_FUNCTION(dbmdelete); -PHP_FUNCTION(dbmfirstkey); -PHP_FUNCTION(dbmnextkey); - -#endif /* PHP_DB_H */ diff --git a/ext/db/tests/001.phpt b/ext/db/tests/001.phpt deleted file mode 100644 index ea95d3d70ae..00000000000 --- a/ext/db/tests/001.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -DBM File Creation Test ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- - diff --git a/ext/db/tests/002.phpt b/ext/db/tests/002.phpt deleted file mode 100644 index d0bc710f084..00000000000 --- a/ext/db/tests/002.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -DBM Insert/Fetch Test ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -This is a test insert diff --git a/ext/db/tests/003.phpt b/ext/db/tests/003.phpt deleted file mode 100644 index 319325c398d..00000000000 --- a/ext/db/tests/003.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -DBM Insert/Replace/Fetch Test ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -This is the replacement text diff --git a/ext/db/tests/004.phpt b/ext/db/tests/004.phpt deleted file mode 100644 index 1becfcfdcd3..00000000000 --- a/ext/db/tests/004.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -DBM Multiple Insert/Fetch Test ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -Another Content String Content String 2 diff --git a/ext/db/tests/005.phpt b/ext/db/tests/005.phpt deleted file mode 100644 index de332018837..00000000000 --- a/ext/db/tests/005.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -DBM FirstKey/NextKey Loop Test With 5 Items ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -5 diff --git a/ext/db/tests/006.phpt b/ext/db/tests/006.phpt deleted file mode 100644 index 3428ce3948a..00000000000 --- a/ext/db/tests/006.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -DBM FirstKey/NextKey with 2 deletes ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -3 diff --git a/ext/dba/CREDITS b/ext/dba/CREDITS deleted file mode 100644 index 2f063076938..00000000000 --- a/ext/dba/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBA -Sascha Schumann diff --git a/ext/dba/config.m4 b/ext/dba/config.m4 deleted file mode 100644 index 57e8bdbb9b3..00000000000 --- a/ext/dba/config.m4 +++ /dev/null @@ -1,238 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN(PHP_TEMP_LDFLAGS,[ - old_LDFLAGS=$LDFLAGS - LDFLAGS="$1 $LDFLAGS" - $2 - LDFLAGS=$old_LDFLAGS -]) - - -dnl Assign INCLUDE/LFLAGS from PREFIX -AC_DEFUN(PHP_DBA_STD_ASSIGN,[ - if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then - THIS_INCLUDE=$THIS_PREFIX/include - THIS_LFLAGS=$THIS_PREFIX/lib - fi -]) - -dnl Standard check -AC_DEFUN(PHP_DBA_STD_CHECK,[ - THIS_RESULT="yes" - if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then - AC_MSG_ERROR(cannot find necessary header file(s)) - fi - if test "$THIS_LIBS" = "" ; then - AC_MSG_ERROR(cannot find necessary library) - fi -]) - -dnl Attach THIS_x to DBA_x -AC_DEFUN(PHP_DBA_STD_ATTACH,[ - PHP_ADD_INCLUDE($THIS_INCLUDE) - PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD) - unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX -]) - -dnl Print the result message -AC_DEFUN(AC_DBA_STD_RESULT,[ - if test "$THIS_RESULT" = "yes"; then - HAVE_DBA=1 - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - unset THIS_RESULT -]) - -PHP_ARG_ENABLE(dba,whether to enable DBA, -[ --enable-dba=shared Build DBA as a shared module]) - -AC_ARG_WITH(gdbm, -[ --with-gdbm[=DIR] Include GDBM support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr $withval; do - if test -f "$i/include/gdbm.h"; then - THIS_PREFIX="$i" - fi - done - - unset ac_cv_lib_gdbm_gdbm_open - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1, [ ]) THIS_LIBS=gdbm]) - ]) - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for GDBM support) -AC_DBA_STD_RESULT - -AC_ARG_WITH(ndbm, -[ --with-ndbm[=DIR] Include NDBM support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr $withval; do - if test -f "$i/include/db1/ndbm.h" ; then - THIS_PREFIX=$i - NDBM_EXTRA=db1/ndbm.h - elif test -f "$i/include/ndbm.h" ; then - THIS_PREFIX=$i - NDBM_EXTRA=ndbm.h - fi - done - - if test "$NDBM_EXTRA" != ""; then - AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$NDBM_EXTRA", [ ]) - fi - - for LIB in db1 ndbm c; do - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1, [ ]) THIS_LIBS=$LIB]) - ]) - done - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for NDBM support) -AC_DBA_STD_RESULT - -AC_ARG_WITH(db2, -[ --with-db2[=DIR] Include Berkeley DB2 support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr /usr/BerkeleyDB $withval/BerkeleyDB $withval; do - if test -f "$i/db2/db.h"; then - THIS_PREFIX=$i - DB2_EXTRA=db2 - elif test -f "$i/include/db2/db.h"; then - THIS_PREFIX=$i - DB2_EXTRA=db2/db.h - elif test -f "$i/include/db/db2.h"; then - THIS_PREFIX=$i - DB2_EXTRA=db/db2.h - elif test -f "$i/include/db2.h"; then - THIS_PREFIX=$i - DB2_EXTRA=db2.h - elif test -f "$i/include/db.h" ; then - THIS_PREFIX=$i - DB2_EXTRA=db.h - fi - done - - if test "$DB2_EXTRA" = "db2" ; then - DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2" - DB2_EXTRA=db.h - fi - - if test -n "$DB2_EXTRA"; then - AC_DEFINE_UNQUOTED(DB2_INCLUDE_FILE, "$DB2_EXTRA", [ ]) - fi - - for LIB in db db2 c; do - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB($LIB, db_appinit, [AC_DEFINE(DBA_DB2,1,[ ]) THIS_LIBS=$LIB]) - ]) - done - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for Berkeley DB2 support) -AC_DBA_STD_RESULT - -AC_ARG_WITH(db3, -[ --with-db3[=DIR] Include Berkeley DB3 support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do - if test -f "$i/include/db3/db.h"; then - THIS_PREFIX=$i - DB3_EXTRA=db3/db.h - elif test -f "$i/include/db.h" ; then - THIS_PREFIX=$i - DB3_EXTRA=db.h - fi - done - - if test -n "$DB3_EXTRA"; then - AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ]) - fi - - for LIB in db-3 db3 db; do - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS=$LIB]) - ]) - done - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for Berkeley DB3 support) -AC_DBA_STD_RESULT - -AC_ARG_WITH(dbm, -[ --with-dbm[=DIR] Include DBM support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr $withval; do - if test -f "$i/include/dbm.h" ; then - THIS_PREFIX=$i - fi - done - - for LIB in db1 dbm c; do - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB($LIB, dbminit, [AC_DEFINE(DBA_DBM,1,[ ]) THIS_LIBS=$LIB]) - ]) - done - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for DBM support) -AC_DBA_STD_RESULT - -AC_ARG_WITH(cdb, -[ --with-cdb[=DIR] Include CDB support],[ - if test "$withval" != "no"; then - for i in /usr/local /usr $withval; do - if test -f "$i/include/cdb.h" ; then - THIS_PREFIX=$i - fi - done - - for LIB in cdb c; do - PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[ - AC_CHECK_LIB($LIB, cdb_bread, [AC_DEFINE(DBA_CDB,1,[ ]) THIS_LIBS=$LIB]) - ]) - done - - PHP_DBA_STD_ASSIGN - PHP_DBA_STD_CHECK - PHP_DBA_STD_ATTACH - fi -]) -AC_MSG_CHECKING(for CDB support) -AC_DBA_STD_RESULT - -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, $ext_shared) - PHP_SUBST(DBA_SHARED_LIBADD) -else - AC_MSG_RESULT(no) - AC_DEFINE(HAVE_DBA, 0, [ ]) -fi - diff --git a/ext/dba/dba.c b/ext/dba/dba.c deleted file mode 100644 index 4b40983208d..00000000000 --- a/ext/dba/dba.c +++ /dev/null @@ -1,523 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_DBA - -#include "php_dba.h" -#include "ext/standard/info.h" - -#include "php_gdbm.h" -#include "php_ndbm.h" -#include "php_dbm.h" -#include "php_cdb.h" -#include "php_db2.h" -#include "php_db3.h" - -/* {{{ dba_functions[] - */ -function_entry dba_functions[] = { - PHP_FE(dba_open, NULL) - PHP_FE(dba_popen, NULL) - PHP_FE(dba_close, NULL) - PHP_FE(dba_delete, NULL) - PHP_FE(dba_exists, NULL) - PHP_FE(dba_fetch, NULL) - PHP_FE(dba_insert, NULL) - PHP_FE(dba_replace, NULL) - PHP_FE(dba_firstkey, NULL) - PHP_FE(dba_nextkey, NULL) - PHP_FE(dba_optimize, NULL) - PHP_FE(dba_sync, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -static PHP_MINIT_FUNCTION(dba); -static PHP_MSHUTDOWN_FUNCTION(dba); -static PHP_MINFO_FUNCTION(dba); - -zend_module_entry dba_module_entry = { - STANDARD_MODULE_HEADER, - "dba", - dba_functions, - PHP_MINIT(dba), - PHP_MSHUTDOWN(dba), - NULL, - NULL, - PHP_MINFO(dba), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DBA -ZEND_GET_MODULE(dba) -#endif - -typedef struct dba_handler { - char *name; - int (*open)(dba_info * TSRMLS_DC); - void (*close)(dba_info *); - char* (*fetch)(dba_info *, char *, int, int *); - int (*update)(dba_info *, char *, int, char *, int, int); - int (*exists)(dba_info *, char *, int); - int (*delete)(dba_info *, char *, int); - char* (*firstkey)(dba_info *, int *); - char* (*nextkey)(dba_info *, int *); - int (*optimize)(dba_info *); - int (*sync)(dba_info *); -} dba_handler; - -/* {{{ macromania */ - -#define DBA_ID_PARS \ - pval **id; \ - dba_info *info = NULL; \ - int type, ac = ZEND_NUM_ARGS() - -/* these are used to get the standard arguments */ - -#define DBA_GET1 \ - if(ac != 1 || zend_get_parameters_ex(ac, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } - -#define DBA_GET2 \ - pval **key; \ - if(ac != 2 || zend_get_parameters_ex(ac, &key, &id) != SUCCESS) { \ - WRONG_PARAM_COUNT; \ - } \ - convert_to_string_ex(key) - -#define DBA_IF_NOT_CORRECT_TYPE(link_id) \ - info = zend_list_find(link_id, &type); \ - if(!info || (type != GLOBAL(le_db) && type != GLOBAL(le_pdb))) - -#define DBA_ID_GET \ - convert_to_long_ex(id); \ - DBA_IF_NOT_CORRECT_TYPE(Z_LVAL_PP(id)) { \ - php_error(E_WARNING, "Unable to find DBA identifier %d", \ - Z_LVAL_PP(id)); \ - RETURN_FALSE; \ - } - -#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET -#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_ID_GET - -/* a DBA handler must have specific routines */ - -#define DBA_HND(x) \ -{\ - #x, dba_open_##x, dba_close_##x, dba_fetch_##x, dba_update_##x, \ - dba_exists_##x, dba_delete_##x, dba_firstkey_##x, dba_nextkey_##x, \ - dba_optimize_##x, dba_sync_##x \ -}, - -/* check whether the user has write access */ -#define DBA_WRITE_CHECK \ - if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \ - RETURN_FALSE; \ - } - -#define GLOBAL(a) a - -/* }}} */ - -/* {{{ globals */ - -static dba_handler handler[] = { -#if DBA_GDBM - DBA_HND(gdbm) -#endif -#if DBA_DBM - DBA_HND(dbm) -#endif -#if DBA_NDBM - DBA_HND(ndbm) -#endif -#if DBA_CDB - DBA_HND(cdb) -#endif -#if DBA_DB2 - DBA_HND(db2) -#endif -#if DBA_DB3 - DBA_HND(db3) -#endif - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } -}; - -static int le_db; -static int le_pdb; -static HashTable ht_keys; -/* }}} */ - -/* {{{ dba_close - */ -static void dba_close(dba_info *info) -{ - if(info->hnd) info->hnd->close(info); - if(info->path) free(info->path); - free(info); -} -/* }}} */ - -/* {{{ dba_close_rsrc - */ -static void dba_close_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dba_info *info = (dba_info *)rsrc->ptr; - - dba_close(info); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -static PHP_MINIT_FUNCTION(dba) -{ - zend_hash_init(&ht_keys, 0, NULL, NULL, 1); - GLOBAL(le_db) = zend_register_list_destructors_ex(dba_close_rsrc, NULL, "dba", module_number); - GLOBAL(le_pdb) = zend_register_list_destructors_ex(NULL, dba_close_rsrc, "dba persistent", module_number); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(dba) -{ - zend_hash_destroy(&ht_keys); - return SUCCESS; -} -/* }}} */ - -#include "ext/standard/php_smart_str.h" - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(dba) -{ - dba_handler *hptr; - smart_str handlers = {0}; - - for(hptr = handler; hptr->name; hptr++) { - smart_str_appends(&handlers, hptr->name); - smart_str_appendc(&handlers, ' '); - } - - php_info_print_table_start(); - php_info_print_table_row(2, "DBA support", "enabled"); - if (handlers.c) { - smart_str_0(&handlers); - php_info_print_table_row(2, "Supported handlers", handlers.c); - smart_str_free(&handlers); - } else { - php_info_print_table_row(2, "Supported handlers", "none"); - } - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ php_dba_update - */ -static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - DBA_ID_PARS; - pval **val, **key; - - if(ac != 3 || zend_get_parameters_ex(ac, &key, &val, &id) != SUCCESS) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(key); - convert_to_string_ex(val); - DBA_ID_GET; - - DBA_WRITE_CHECK; - - if(info->hnd->update(info, VALLEN(key), VALLEN(val), mode) == SUCCESS) - RETURN_TRUE; - RETURN_FALSE; -} -/* }}} */ - -#define FREENOW if(args) efree(args); if(key) efree(key) - -/* {{{ php_dba_open - */ -static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - pval ***args = (pval ***) NULL; - int ac = ZEND_NUM_ARGS(); - dba_mode_t modenr; - dba_info *info; - dba_handler *hptr; - char *key = NULL; - int keylen = 0; - int listid; - int i; - - if(ac < 3) { - WRONG_PARAM_COUNT; - } - - /* we pass additional args to the respective handler */ - args = emalloc(ac * sizeof(pval *)); - if(zend_get_parameters_array_ex(ac, args) != SUCCESS) { - FREENOW; - WRONG_PARAM_COUNT; - } - - /* we only take string arguments */ - for(i = 0; i < ac; i++) { - convert_to_string_ex(args[i]); - keylen += Z_STRLEN_PP(args[i]); - } - - if(persistent) { - /* calculate hash */ - key = emalloc(keylen); - keylen = 0; - - for(i = 0; i < ac; i++) { - memcpy(key+keylen, Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i])); - keylen += Z_STRLEN_PP(args[i]); - } - - if(zend_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) { - FREENOW; - RETURN_LONG(zend_list_insert(info, GLOBAL(le_pdb))); - } - } - - for(hptr = handler; hptr->name && - strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++); - - if(!hptr->name) { - php_error(E_WARNING, "no such handler: %s", Z_STRVAL_PP(args[2])); - FREENOW; - RETURN_FALSE; - } - - switch(Z_STRVAL_PP(args[1])[0]) { - case 'c': - modenr = DBA_CREAT; - break; - case 'w': - modenr = DBA_WRITER; - break; - case 'r': - modenr = DBA_READER; - break; - case 'n': - modenr = DBA_TRUNC; - break; - default: - php_error(E_WARNING, "illegal DBA mode: %s", Z_STRVAL_PP(args[1])); - FREENOW; - RETURN_FALSE; - } - - info = malloc(sizeof(*info)); - memset(info, 0, sizeof(info)); - info->path = strdup(Z_STRVAL_PP(args[0])); - info->mode = modenr; - info->argc = ac - 3; - info->argv = args + 3; - info->hnd = NULL; - - if(hptr->open(info TSRMLS_CC) != SUCCESS) { - dba_close(info); - php_error(E_WARNING, "driver initialization failed"); - FREENOW; - RETURN_FALSE; - } - info->hnd = hptr; - info->argc = 0; - info->argv = NULL; - - listid = zend_list_insert(info, persistent?GLOBAL(le_pdb):GLOBAL(le_db)); - if(persistent) { - zend_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL); - } - - FREENOW; - RETURN_LONG(listid); -} -/* }}} */ -#undef FREENOW - -/* {{{ proto int dba_popen(string path, string mode, string handlername [, string ...]) - Opens path using the specified handler in mode persistently */ -PHP_FUNCTION(dba_popen) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int dba_open(string path, string mode, string handlername [, string ...]) - Opens path using the specified handler in mode*/ -PHP_FUNCTION(dba_open) -{ - php_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto void dba_close(int handle) - Closes database */ -PHP_FUNCTION(dba_close) -{ - DBA_ID_GET1; - - zend_list_delete(Z_LVAL_PP(id)); -} -/* }}} */ - -/* {{{ proto bool dba_exists(string key, int handle) - Checks, if the specified key exists */ -PHP_FUNCTION(dba_exists) -{ - DBA_ID_GET2; - - if(info->hnd->exists(info, VALLEN(key)) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_fetch(string key, int handle) - Fetches the data associated with key */ -PHP_FUNCTION(dba_fetch) -{ - char *val; - int len = 0; - DBA_ID_GET2; - - if((val = info->hnd->fetch(info, VALLEN(key), &len)) != NULL) { - RETURN_STRINGL(val, len, 0); - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_firstkey(int handle) - Resets the internal key pointer and returns the first key */ -PHP_FUNCTION(dba_firstkey) -{ - char *fkey; - int len; - DBA_ID_GET1; - - fkey = info->hnd->firstkey(info, &len); - if(fkey) - RETURN_STRINGL(fkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto string dba_nextkey(int handle) - Returns the next key */ -PHP_FUNCTION(dba_nextkey) -{ - char *nkey; - int len; - DBA_ID_GET1; - - nkey = info->hnd->nextkey(info, &len); - if(nkey) - RETURN_STRINGL(nkey, len, 0); - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_delete(string key, int handle) - Deletes the entry associated with key */ -PHP_FUNCTION(dba_delete) -{ - DBA_ID_GET2; - - DBA_WRITE_CHECK; - - if(info->hnd->delete(info, VALLEN(key)) == SUCCESS) - RETURN_TRUE; - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_insert(string key, string value, int handle) - Inserts value as key, returns false, if key exists already */ -PHP_FUNCTION(dba_insert) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool dba_replace(string key, string value, int handle) - Inserts value as key, replaces key, if key exists already */ -PHP_FUNCTION(dba_replace) -{ - php_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto bool dba_optimize(int handle) - Optimizes (e.g. clean up, vacuum) database */ -PHP_FUNCTION(dba_optimize) -{ - DBA_ID_GET1; - - DBA_WRITE_CHECK; - if(info->hnd->optimize(info) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool dba_sync(int handle) - Synchronizes database */ -PHP_FUNCTION(dba_sync) -{ - DBA_ID_GET1; - - if(info->hnd->sync(info) == SUCCESS) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba.dsp b/ext/dba/dba.dsp deleted file mode 100644 index bcea596d596..00000000000 --- a/ext/dba/dba.dsp +++ /dev/null @@ -1,157 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dba" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dba - Win32 Debug_TS Berkeley DB3 -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dba.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dba.mak" CFG="dba - Win32 Debug_TS Berkeley DB3" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dba - Win32 Release_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dba - Win32 Debug_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dba - Win32 Release_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=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 php4ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php4ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "dba - Win32 Debug_TS Berkeley DB3" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /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 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "dba - Win32 Release_TS Berkeley DB3" -# Name "dba - Win32 Debug_TS Berkeley DB3" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\dba.c -# End Source File -# Begin Source File - -SOURCE=.\dba_cdb.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db2.c -# End Source File -# Begin Source File - -SOURCE=.\dba_db3.c -# End Source File -# Begin Source File - -SOURCE=.\dba_dbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_gdbm.c -# End Source File -# Begin Source File - -SOURCE=.\dba_ndbm.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_cdb.h -# End Source File -# Begin Source File - -SOURCE=.\php_db2.h -# End Source File -# Begin Source File - -SOURCE=.\php_db3.h -# End Source File -# Begin Source File - -SOURCE=.\php_dba.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_gdbm.h -# End Source File -# Begin Source File - -SOURCE=.\php_ndbm.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c deleted file mode 100644 index 9b6364e3672..00000000000 --- a/ext/dba/dba_cdb.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_CDB -#include "php_cdb.h" - -#include -#include -#include - -#include -#include - -#define CDB_INFO \ - dba_cdb *cdb = (dba_cdb *) info->dbf - -typedef struct { - int fd; - uint32 eod; /* size of constant database */ - uint32 pos; /* current position for traversing */ -} dba_cdb; - -DBA_OPEN_FUNC(cdb) -{ - int gmode = 0; - dba_cdb *cdb; - dba_info *pinfo = (dba_info *) info; - - switch(info->mode) { - case DBA_READER: - gmode = O_RDONLY; break; - /* currently not supported: */ -#if 0 - case DBA_WRITER: - gmode = O_RDWR; break; -#endif - default: - return FAILURE; - } - - cdb = malloc(sizeof *cdb); - memset(cdb, 0, sizeof *cdb); - - cdb->fd = VCWD_OPEN(info->path, gmode); - if(cdb->fd < 0) { - free(cdb); - return FAILURE; - } - - pinfo->dbf = cdb; - return SUCCESS; -} - -DBA_CLOSE_FUNC(cdb) -{ - CDB_INFO; - - close(cdb->fd); - free(cdb); -} - -DBA_FETCH_FUNC(cdb) -{ - CDB_INFO; - int len; - char *new = NULL; - - if(cdb_seek(cdb->fd, key, keylen, &len) == 1) { - new = emalloc(len); - read(cdb->fd, new, len); - if(newlen) *newlen = len; - } - - return new; -} - -DBA_UPDATE_FUNC(cdb) -{ - /* if anyone figures out cdbmake.c, let me know */ - return FAILURE; -} - -DBA_EXISTS_FUNC(cdb) -{ - CDB_INFO; - int len; - - if(cdb_seek(cdb->fd, key, keylen, &len) == 1) - return SUCCESS; - return FAILURE; -} - -DBA_DELETE_FUNC(cdb) -{ - return FAILURE; -} - - -#define CREAD(n) if(read(cdb->fd, buf, n) < n) return NULL -#define CSEEK(n) \ - if(n >= cdb->eod) return NULL; \ - if(lseek(cdb->fd, (off_t)n, SEEK_SET) != (off_t) n) return NULL - -DBA_FIRSTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 len; - char buf[8]; - char *key; - - cdb->eod = -1; - CSEEK(0); - CREAD(4); - cdb->eod = cdb_unpack(buf); - - CSEEK(2048); - CREAD(8); - len = cdb_unpack(buf); - - key = emalloc(len + 1); - if(read(cdb->fd, key, len) < len) { - efree(key); - key = NULL; - } else - key[len] = '\0'; - /* header + klenlen + dlenlen + klen + dlen */ - cdb->pos = 2048 + 4 + 4 + len + cdb_unpack(buf + 4); - - return key; -} - -DBA_NEXTKEY_FUNC(cdb) -{ - CDB_INFO; - uint32 len; - char buf[8]; - char *nkey; - - CSEEK(cdb->pos); - CREAD(8); - len = cdb_unpack(buf); - - nkey = emalloc(len + 1); - if(read(cdb->fd, nkey, len) < len) { - efree(nkey); - return NULL; - } - nkey[len] = '\0'; - if(newlen) *newlen = len; - - cdb->pos += 8 + len + cdb_unpack(buf + 4); - - return nkey; -#if 0 - /* this code cdb_seeks and is thus slower than directly seeking - in the file */ - CDB_INFO; - char *nkey = NULL; - uint32 len; - char buf[8]; - - if(cdb_seek(cdb->fd, key, keylen, &len) == 1) { - if(lseek(cdb->fd, (off_t) len, SEEK_CUR) >= (off_t) cdb->eod) - return NULL; - CREAD(8); - len = cdb_unpack(buf); - - nkey = emalloc(len + 1); - if(read(cdb->fd, nkey, len) < len) { - efree(nkey); - nkey = NULL; - } else - nkey[len] = '\0'; - } - return nkey; -#endif -} - -DBA_OPTIMIZE_FUNC(cdb) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(cdb) -{ - /* this is read-only */ - return SUCCESS; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c deleted file mode 100644 index d3ecfa3b67f..00000000000 --- a/ext/dba/dba_db2.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DB2 -#include "php_db2.h" -#include - -#include -#ifdef DB2_INCLUDE_FILE -#include DB2_INCLUDE_FILE -#endif - -#define DB2_DATA dba_db2_data *dba = info->dbf -#define DB2_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db2_data; - -DBA_OPEN_FUNC(db2) -{ - DB *dbp; - DBTYPE type; - int gmode = 0; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s ? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if(gmode == -1) - return FAILURE; - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if(db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) { - info->dbf = malloc(sizeof(dba_db2_data)); - memset(info->dbf, 0, sizeof(dba_db2_data)); - ((dba_db2_data *) info->dbf)->dbp = dbp; - return SUCCESS; - } - return FAILURE; -} - -DBA_CLOSE_FUNC(db2) -{ - DB2_DATA; - - if(dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - free(dba); -} - -DBA_FETCH_FUNC(db2) -{ - DBT gval; - char *new = NULL; - DB2_DATA; - DB2_GKEY; - - memset(&gval, 0, sizeof(gval)); - if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if(newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - } - return new; -} - -DBA_UPDATE_FUNC(db2) -{ - DBT gval; - DB2_DATA; - DB2_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if(!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db2) -{ - DBT gval; - DB2_DATA; - DB2_GKEY; - - memset(&gval, 0, sizeof(gval)); - if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db2) -{ - DB2_DATA; - DB2_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db2) -{ - DB2_DATA; - - if(dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; -#if (DB_VERSION_MAJOR > 2) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 6) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 6 && DB_VERSION_PATCH >= 4) - if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) { -#else - if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) { -#endif - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db2(info, newlen); -} - -DBA_NEXTKEY_FUNC(db2) -{ - DB2_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if(!dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT)) { - if(gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if(newlen) *newlen = gkey.size; - } - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(db2) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db2) -{ - DB2_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c deleted file mode 100644 index bbdca401a2b..00000000000 --- a/ext/dba/dba_db3.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DB3 -#include "php_db3.h" -#include - -#include -#ifdef DB3_INCLUDE_FILE -#include DB3_INCLUDE_FILE -#else -#include -#endif - -#define DB3_DATA dba_db3_data *dba = info->dbf -#define DB3_GKEY \ - DBT gkey; \ - memset(&gkey, 0, sizeof(gkey)); \ - gkey.data = (char *) key; gkey.size = keylen - -typedef struct { - DB *dbp; - DBC *cursor; -} dba_db3_data; - -DBA_OPEN_FUNC(db3) -{ - DB *dbp = NULL; - DBTYPE type; - int gmode = 0; - int filemode = 0644; - struct stat check_stat; - int s = VCWD_STAT(info->path, &check_stat); - - type = info->mode == DBA_READER ? DB_UNKNOWN : - info->mode == DBA_TRUNC ? DB_BTREE : - s? DB_BTREE : DB_UNKNOWN; - - gmode = info->mode == DBA_READER ? DB_RDONLY : - (info->mode == DBA_CREAT && s) ? DB_CREATE : - (info->mode == DBA_CREAT && !s) ? 0 : - info->mode == DBA_WRITER ? 0 : - info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1; - - if (gmode == -1) - return FAILURE; - - if (info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if (db_create(&dbp, NULL, 0) == 0 && - dbp->open(dbp, info->path, NULL, type, gmode, filemode) == 0) { - dba_db3_data *data; - - data = malloc(sizeof(*data)); - data->dbp = dbp; - data->cursor = NULL; - info->dbf = data; - - return SUCCESS; - } else if (dbp != NULL) { - dbp->close(dbp, 0); - } - - return FAILURE; -} - -DBA_CLOSE_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) dba->cursor->c_close(dba->cursor); - dba->dbp->close(dba->dbp, 0); - free(dba); -} - -DBA_FETCH_FUNC(db3) -{ - DBT gval; - char *new = NULL; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - if (newlen) *newlen = gval.size; - new = estrndup(gval.data, gval.size); - } - return new; -} - -DBA_UPDATE_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - gval.data = (char *) val; - gval.size = vallen; - - if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval, - mode == 1 ? DB_NOOVERWRITE : 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_EXISTS_FUNC(db3) -{ - DBT gval; - DB3_DATA; - DB3_GKEY; - - memset(&gval, 0, sizeof(gval)); - if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(db3) -{ - DB3_DATA; - DB3_GKEY; - - return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(db3) -{ - DB3_DATA; - - if (dba->cursor) { - dba->cursor->c_close(dba->cursor); - } - - dba->cursor = NULL; - if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) { - return NULL; - } - - /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db3(info, newlen); -} - -DBA_NEXTKEY_FUNC(db3) -{ - DB3_DATA; - DBT gkey, gval; - char *nkey = NULL; - - memset(&gkey, 0, sizeof(gkey)); - memset(&gval, 0, sizeof(gval)); - - if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) { - if (gkey.data) { - nkey = estrndup(gkey.data, gkey.size); - if (newlen) *newlen = gkey.size; - } - } - - return nkey; -} - -DBA_OPTIMIZE_FUNC(db3) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(db3) -{ - DB3_DATA; - - return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c deleted file mode 100644 index 437a79e7bc8..00000000000 --- a/ext/dba/dba_dbm.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DBM -#include "php_dbm.h" - -#include - -#include -#include -#include -#include - -#define DBM_DATA dba_dbm_data *dba = info->dbf -#define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -#define TRUNC_IT(extension, mode) \ - snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \ - buf[MAXPATHLEN-1] = '\0'; \ - if((fd = VCWD_OPEN_MODE(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \ - return FAILURE; \ - close(fd); - - -typedef struct { - datum nextkey; -} dba_dbm_data; - -DBA_OPEN_FUNC(dbm) -{ - int fd; - int filemode = 0644; - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - if(info->mode == DBA_TRUNC) { - char buf[MAXPATHLEN]; - - /* dbm/ndbm original */ - TRUNC_IT(".pag", O_TRUNC); - TRUNC_IT(".dir", O_TRUNC); - } - - if(info->mode == DBA_CREAT) { - char buf[MAXPATHLEN]; - - TRUNC_IT(".pag", 0); - TRUNC_IT(".dir", 0); - } - - if(dbminit((char *) info->path) == -1) { - return FAILURE; - } - - info->dbf = calloc(sizeof(dba_dbm_data), 1); - return SUCCESS; -} - -DBA_CLOSE_FUNC(dbm) -{ - free(info->dbf); - dbmclose(); -} - -DBA_FETCH_FUNC(dbm) -{ - datum gval; - char *new = NULL; - - DBM_GKEY; - gval = fetch(gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(dbm) -{ - datum gval; - - DBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - return (store(gkey, gval) == -1 ? FAILURE : SUCCESS); -} - -DBA_EXISTS_FUNC(dbm) -{ - datum gval; - DBM_GKEY; - - gval = fetch(gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(dbm) -{ - DBM_GKEY; - return(delete(gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *key = NULL; - - gkey = firstkey(); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return key; -} - -DBA_NEXTKEY_FUNC(dbm) -{ - DBM_DATA; - datum gkey; - char *nkey = NULL; - - if(!dba->nextkey.dptr) return NULL; - - gkey = nextkey(dba->nextkey); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - dba->nextkey = gkey; - } else - dba->nextkey.dptr = NULL; - return nkey; -} - -DBA_OPTIMIZE_FUNC(dbm) -{ - /* dummy */ - return SUCCESS; -} - -DBA_SYNC_FUNC(dbm) -{ - return SUCCESS; -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c deleted file mode 100644 index 7b3188ffb51..00000000000 --- a/ext/dba/dba_gdbm.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_GDBM -#include "php_gdbm.h" - -#include - -#define GDBM_DATA dba_gdbm_data *dba = info->dbf -#define GDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -typedef struct { - GDBM_FILE dbf; - datum nextkey; -} dba_gdbm_data; - -DBA_OPEN_FUNC(gdbm) -{ - GDBM_FILE dbf; - int gmode = 0; - int filemode = 0644; - - gmode = info->mode == DBA_READER ? GDBM_READER : - info->mode == DBA_WRITER ? GDBM_WRITER : - info->mode == DBA_CREAT ? GDBM_WRCREAT : - info->mode == DBA_TRUNC ? GDBM_NEWDB : -1; - - if(gmode == -1) - return FAILURE; - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = gdbm_open(info->path, 0, gmode, filemode, NULL); - - if(dbf) { - info->dbf = malloc(sizeof(dba_gdbm_data)); - memset(info->dbf, 0, sizeof(dba_gdbm_data)); - ((dba_gdbm_data *) info->dbf)->dbf = dbf; - return SUCCESS; - } - return FAILURE; -} - -DBA_CLOSE_FUNC(gdbm) -{ - GDBM_DATA; - - if(dba->nextkey.dptr) free(dba->nextkey.dptr); - gdbm_close(dba->dbf); - free(dba); -} - -DBA_FETCH_FUNC(gdbm) -{ - GDBM_DATA; - datum gval; - char *new = NULL; - - GDBM_GKEY; - gval = gdbm_fetch(dba->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - free(gval.dptr); - } - return new; -} - -DBA_UPDATE_FUNC(gdbm) -{ - datum gval; - GDBM_DATA; - - GDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(gdbm_store(dba->dbf, gkey, gval, - mode == 1 ? GDBM_INSERT : GDBM_REPLACE) == 0) - return SUCCESS; - printf("XXX %s\n", gdbm_strerror(gdbm_errno)); - return FAILURE; -} - -DBA_EXISTS_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_exists(dba->dbf, gkey) ? SUCCESS : FAILURE; -} - -DBA_DELETE_FUNC(gdbm) -{ - GDBM_DATA; - GDBM_GKEY; - - return gdbm_delete(dba->dbf, gkey) == -1 ? FAILURE : SUCCESS; -} - -DBA_FIRSTKEY_FUNC(gdbm) -{ - GDBM_DATA; - datum gkey; - char *key = NULL; - - if(dba->nextkey.dptr) { - free(dba->nextkey.dptr); - } - - gkey = gdbm_firstkey(dba->dbf); - if(gkey.dptr) { - key = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return key; -} - -DBA_NEXTKEY_FUNC(gdbm) -{ - GDBM_DATA; - char *nkey = NULL; - datum gkey; - - if(!dba->nextkey.dptr) return NULL; - - gkey = gdbm_nextkey(dba->dbf, dba->nextkey); - free(dba->nextkey.dptr); - if(gkey.dptr) { - nkey = estrndup(gkey.dptr, gkey.dsize); - if(newlen) *newlen = gkey.dsize; - dba->nextkey = gkey; - } else { - dba->nextkey.dptr = NULL; - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(gdbm) -{ - GDBM_DATA; - gdbm_reorganize(dba->dbf); - return SUCCESS; -} - -DBA_SYNC_FUNC(gdbm) -{ - GDBM_DATA; - - gdbm_sync(dba->dbf); - return SUCCESS; -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c deleted file mode 100644 index 2b224202648..00000000000 --- a/ext/dba/dba_ndbm.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_NDBM -#include "php_ndbm.h" - -#include -#ifdef NDBM_INCLUDE_FILE -#include NDBM_INCLUDE_FILE -#endif - -#define NDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen - -DBA_OPEN_FUNC(ndbm) -{ - DBM *dbf; - int gmode = 0; - int filemode = 0644; - dba_info *pinfo = (dba_info *) info; - - switch(info->mode) { - case DBA_READER: - gmode = O_RDONLY; - break; - case DBA_WRITER: - gmode = O_RDWR; - break; - case DBA_CREAT: - gmode = O_RDWR | O_CREAT; - break; - case DBA_TRUNC: - gmode = O_RDWR | O_CREAT | O_TRUNC; - break; - default: - return FAILURE; - } - - if(info->argc > 0) { - convert_to_long_ex(info->argv[0]); - filemode = Z_LVAL_PP(info->argv[0]); - } - - dbf = dbm_open(info->path, gmode, filemode); - - if(dbf) { - pinfo->dbf = dbf; - return SUCCESS; - } - return FAILURE; -} - -DBA_CLOSE_FUNC(ndbm) -{ - dbm_close(info->dbf); -} - -DBA_FETCH_FUNC(ndbm) -{ - datum gval; - char *new = NULL; - - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - if(newlen) *newlen = gval.dsize; - new = estrndup(gval.dptr, gval.dsize); - } - return new; -} - -DBA_UPDATE_FUNC(ndbm) -{ - datum gval; - - NDBM_GKEY; - gval.dptr = (char *) val; - gval.dsize = vallen; - - if(!dbm_store(info->dbf, gkey, gval, mode == 1 ? DBM_INSERT : DBM_REPLACE)) - return SUCCESS; - return FAILURE; -} - -DBA_EXISTS_FUNC(ndbm) -{ - datum gval; - NDBM_GKEY; - gval = dbm_fetch(info->dbf, gkey); - if(gval.dptr) { - return SUCCESS; - } - return FAILURE; -} - -DBA_DELETE_FUNC(ndbm) -{ - NDBM_GKEY; - return(dbm_delete(info->dbf, gkey) == -1 ? FAILURE : SUCCESS); -} - -DBA_FIRSTKEY_FUNC(ndbm) -{ - datum gkey; - char *key = NULL; - - gkey = dbm_firstkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - key = estrndup(gkey.dptr, gkey.dsize); - } - return key; -} - -DBA_NEXTKEY_FUNC(ndbm) -{ - datum gkey; - char *nkey = NULL; - - gkey = dbm_nextkey(info->dbf); - if(gkey.dptr) { - if(newlen) *newlen = gkey.dsize; - nkey = estrndup(gkey.dptr, gkey.dsize); - } - return nkey; -} - -DBA_OPTIMIZE_FUNC(ndbm) -{ - return SUCCESS; -} - -DBA_SYNC_FUNC(ndbm) -{ - return SUCCESS; -} -#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/php_cdb.h b/ext/dba/php_cdb.h deleted file mode 100644 index a046f0796b3..00000000000 --- a/ext/dba/php_cdb.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_CDB_H -#define PHP_CDB_H - -#if DBA_CDB - -#include "php_dba.h" - -DBA_FUNCS(cdb); - -#endif - -#endif diff --git a/ext/dba/php_db2.h b/ext/dba/php_db2.h deleted file mode 100644 index 2a95223a854..00000000000 --- a/ext/dba/php_db2.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB2_H -#define PHP_DB2_H - -#if DBA_DB2 - -#include "php_dba.h" - -DBA_FUNCS(db2); - -#endif - -#endif diff --git a/ext/dba/php_db3.h b/ext/dba/php_db3.h deleted file mode 100644 index 58bb0b62a08..00000000000 --- a/ext/dba/php_db3.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DB3_H -#define PHP_DB3_H - -#if DBA_DB3 - -#include "php_dba.h" - -DBA_FUNCS(db3); - -#endif - -#endif diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h deleted file mode 100644 index 07f0b38449e..00000000000 --- a/ext/dba/php_dba.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef PHP_DBA_H -#define PHP_DBA_H - -#if HAVE_DBA - -typedef enum { - DBA_READER = 1, - DBA_WRITER, - DBA_TRUNC, - DBA_CREAT -} dba_mode_t; - -typedef struct dba_info { - /* public */ - void *dbf; /* ptr to private data or whatever */ - char *path; - dba_mode_t mode; - /* arg[cv] are only available when the dba_open handler is called! */ - int argc; - pval ***argv; - /* private */ - struct dba_handler *hnd; -} dba_info; - -extern zend_module_entry dba_module_entry; -#define dba_module_ptr &dba_module_entry - -/* common prototypes which must be supplied by modules */ - -#define DBA_OPEN_FUNC(x) \ - int dba_open_##x(dba_info *info TSRMLS_DC) -#define DBA_CLOSE_FUNC(x) \ - void dba_close_##x(dba_info *info) -#define DBA_FETCH_FUNC(x) \ - char *dba_fetch_##x(dba_info *info, char *key, int keylen, int *newlen) -#define DBA_UPDATE_FUNC(x) \ - int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode) -#define DBA_EXISTS_FUNC(x) \ - int dba_exists_##x(dba_info *info, char *key, int keylen) -#define DBA_DELETE_FUNC(x) \ - int dba_delete_##x(dba_info *info, char *key, int keylen) -#define DBA_FIRSTKEY_FUNC(x) \ - char *dba_firstkey_##x(dba_info *info, int *newlen) -#define DBA_NEXTKEY_FUNC(x) \ - char *dba_nextkey_##x(dba_info *info, int *newlen) -#define DBA_OPTIMIZE_FUNC(x) \ - int dba_optimize_##x(dba_info *info) -#define DBA_SYNC_FUNC(x) \ - int dba_sync_##x(dba_info *info) - -#define DBA_FUNCS(x) \ - DBA_OPEN_FUNC(x); \ - DBA_CLOSE_FUNC(x); \ - DBA_FETCH_FUNC(x); \ - DBA_UPDATE_FUNC(x); \ - DBA_DELETE_FUNC(x); \ - DBA_EXISTS_FUNC(x); \ - DBA_FIRSTKEY_FUNC(x); \ - DBA_NEXTKEY_FUNC(x); \ - DBA_OPTIMIZE_FUNC(x); \ - DBA_SYNC_FUNC(x) - -#define VALLEN(p) Z_STRVAL_PP(p), Z_STRLEN_PP(p) - -PHP_FUNCTION(dba_open); -PHP_FUNCTION(dba_popen); -PHP_FUNCTION(dba_close); -PHP_FUNCTION(dba_firstkey); -PHP_FUNCTION(dba_nextkey); -PHP_FUNCTION(dba_replace); -PHP_FUNCTION(dba_insert); -PHP_FUNCTION(dba_delete); -PHP_FUNCTION(dba_exists); -PHP_FUNCTION(dba_fetch); -PHP_FUNCTION(dba_optimize); -PHP_FUNCTION(dba_sync); - -#else -#define dba_module_ptr NULL -#endif - -#define phpext_dba_ptr dba_module_ptr - -#endif diff --git a/ext/dba/php_dbm.h b/ext/dba/php_dbm.h deleted file mode 100644 index 4c963d18ed9..00000000000 --- a/ext/dba/php_dbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_DBM_H -#define PHP_DBM_H - -#if DBA_DBM - -#include "php_dba.h" - -DBA_FUNCS(dbm); - -#endif - -#endif diff --git a/ext/dba/php_gdbm.h b/ext/dba/php_gdbm.h deleted file mode 100644 index 3068404cfe2..00000000000 --- a/ext/dba/php_gdbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_GDBM_H -#define PHP_GDBM_H - -#if DBA_GDBM - -#include "php_dba.h" - -DBA_FUNCS(gdbm); - -#endif - -#endif diff --git a/ext/dba/php_ndbm.h b/ext/dba/php_ndbm.h deleted file mode 100644 index b1ebf15af32..00000000000 --- a/ext/dba/php_ndbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_NDBM_H -#define PHP_NDBM_H - -#if DBA_NDBM - -#include "php_dba.h" - -DBA_FUNCS(ndbm); - -#endif - -#endif diff --git a/ext/dbase/CREDITS b/ext/dbase/CREDITS deleted file mode 100644 index ea6adcaf41d..00000000000 --- a/ext/dbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dBase -Jim Winstead diff --git a/ext/dbase/config.m4 b/ext/dbase/config.m4 deleted file mode 100644 index d19c24c779c..00000000000 --- a/ext/dbase/config.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_ARG_WITH(dbase,[],[enable_dbase=$withval]) - -PHP_ARG_ENABLE(dbase,whether to enable dbase support, -[ --enable-dbase Enable the bundled dbase library]) - -if test "$PHP_DBASE" = "yes"; then - AC_DEFINE(DBASE,1,[ ]) - PHP_NEW_EXTENSION(dbase, dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c, $ext_shared) -fi diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c deleted file mode 100644 index 445f014a31f..00000000000 --- a/ext/dbase/dbase.c +++ /dev/null @@ -1,842 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include "php_globals.h" - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if DBASE -#include "php_dbase.h" -#include "dbf.h" -#if defined(THREAD_SAFE) -DWORD DbaseTls; -static int numthreads=0; -void *dbase_mutex; - -typedef struct dbase_global_struct{ - int le_dbhead; -}dbase_global_struct; - -#define DBase_GLOBAL(a) dbase_globals->a - -#define DBase_TLS_VARS \ - dbase_global_struct *dbase_globals; \ - dbase_globals=TlsGetValue(DbaseTls); - -#else -static int le_dbhead; -#define DBase_GLOBAL(a) a -#define DBase_TLS_VARS -#endif - -#include -#include - - -static void _close_dbase(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - dbhead_t *dbhead = (dbhead_t *)rsrc->ptr; - - close(dbhead->db_fd); - free_dbf_head(dbhead); -} - - -PHP_MINIT_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; -#ifdef COMPILE_DL_DBASE - CREATE_MUTEX(dbase_mutex, "DBase_TLS"); - SET_MUTEX(dbase_mutex); - numthreads++; - if (numthreads==1){ - if ((DbaseTls=TlsAlloc())==0xFFFFFFFF){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif - dbase_globals = (dbase_global_struct *) LocalAlloc(LPTR, sizeof(dbase_global_struct)); - TlsSetValue(DbaseTls, (void *) dbase_globals); -#endif - DBase_GLOBAL(le_dbhead) = - zend_register_list_destructors_ex(_close_dbase, NULL, "dbase", module_number); - return SUCCESS; -} - -static PHP_MSHUTDOWN_FUNCTION(dbase) -{ -#if defined(THREAD_SAFE) - dbase_global_struct *dbase_globals; - dbase_globals = TlsGetValue(DbaseTls); - if (dbase_globals != 0) - LocalFree((HLOCAL) dbase_globals); -#ifdef COMPILE_DL_DBASE - SET_MUTEX(dbase_mutex); - numthreads--; - if (!numthreads){ - if (!TlsFree(DbaseTls)){ - FREE_MUTEX(dbase_mutex); - return 0; - }} - FREE_MUTEX(dbase_mutex); -#endif -#endif - return SUCCESS; -} - -/* {{{ proto int dbase_open(string name, int mode) - Opens a dBase-format database file */ -PHP_FUNCTION(dbase_open) -{ - pval *dbf_name, *options; - dbhead_t *dbh; - int handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbf_name, &options)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(dbf_name); - convert_to_long(options); - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_P(dbf_name) TSRMLS_CC)) { - RETURN_FALSE; - } - - dbh = dbf_open(Z_STRVAL_P(dbf_name), Z_LVAL_P(options) TSRMLS_CC); - if (dbh == NULL) { - php_error(E_WARNING, "unable to open database %s", Z_STRVAL_P(dbf_name)); - RETURN_FALSE; - } - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ proto bool dbase_close(int identifier) - Closes an open dBase-format database file */ -PHP_FUNCTION(dbase_close) -{ - pval *dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_P(dbh_id)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int dbase_numrecords(int identifier) - Returns the number of records in the database */ -PHP_FUNCTION(dbase_numrecords) -{ - pval *dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_records); -} -/* }}} */ - -/* {{{ proto int dbase_numfields(int identifier) - Returns the number of fields (columns) in the database */ -PHP_FUNCTION(dbase_numfields) -{ - pval *dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - RETURN_LONG(dbh->db_nfields); -} -/* }}} */ - -/* {{{ proto bool dbase_pack(int identifier) - Packs the database (deletes records marked for deletion) */ -PHP_FUNCTION(dbase_pack) -{ - pval *dbh_id; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dbh_id)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - pack_dbf(dbh); - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_add_record(int identifier, array data) - Adds a record to the database */ -PHP_FUNCTION(dbase_add_record) -{ - pval *dbh_id, *fields, **field; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &fields)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - if (Z_TYPE_P(fields) != IS_ARRAY) { - php_error(E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_P(fields)); - - if (num_fields != dbh->db_nfields) { - php_error(E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - if (!cp) { - php_error(E_WARNING, "unable to allocate memory"); - RETURN_FALSE; - } - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - zval tmp; - if (zend_hash_index_find(Z_ARRVAL_P(fields), i, (void **)&field) == FAILURE) { - php_error(E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - - tmp = **field; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - sprintf(t_cp, cur_f->db_format, Z_STRVAL(tmp)); - zval_dtor(&tmp); - t_cp += cur_f->db_flen; - } - - dbh->db_records++; - if (put_dbf_record(dbh, dbh->db_records, cp) < 0) { - php_error(E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_replace_record(int identifier, array data, int recnum) - Replaces a record to the database */ -PHP_FUNCTION(dbase_replace_record) -{ - pval *dbh_id, *fields, **field, *recnum; - dbhead_t *dbh; - int dbh_type; - - int num_fields; - dbfield_t *dbf, *cur_f; - char *cp, *t_cp; - int i; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 3 || getParameters(ht, 3, &dbh_id, &fields, &recnum)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - convert_to_long(recnum); - if (Z_TYPE_P(fields) != IS_ARRAY) { - php_error(E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_P(fields)); - - if (num_fields != dbh->db_nfields) { - php_error(E_WARNING, "Wrong number of fields specified"); - RETURN_FALSE; - } - - cp = t_cp = (char *)emalloc(dbh->db_rlen + 1); - if (!cp) { - php_error(E_WARNING, "unable to allocate memory"); - RETURN_FALSE; - } - *t_cp++ = VALID_RECORD; - - dbf = dbh->db_fields; - for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { - if (zend_hash_index_find(Z_ARRVAL_P(fields), i, (void **)&field) == FAILURE) { - php_error(E_WARNING, "unexpected error"); - efree(cp); - RETURN_FALSE; - } - convert_to_string_ex(field); - sprintf(t_cp, cur_f->db_format, Z_STRVAL_PP(field)); - t_cp += cur_f->db_flen; - } - - if (put_dbf_record(dbh, Z_LVAL_P(recnum), cp) < 0) { - php_error(E_WARNING, "unable to put record at %ld", dbh->db_records); - efree(cp); - RETURN_FALSE; - } - - put_dbf_info(dbh); - efree(cp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool dbase_delete_record(int identifier, int record) - Marks a record to be deleted */ -PHP_FUNCTION(dbase_delete_record) -{ - pval *dbh_id, *record; - dbhead_t *dbh; - int dbh_type; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - convert_to_long(record); - - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - if (del_dbf_record(dbh, Z_LVAL_P(record)) < 0) { - if (Z_LVAL_P(record) > dbh->db_records) { - php_error(E_WARNING, "record %d out of bounds", Z_LVAL_P(record)); - } else { - php_error(E_WARNING, "unable to delete record %d", Z_LVAL_P(record)); - } - RETURN_FALSE; - } - - put_dbf_info(dbh); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array dbase_get_record(int identifier, int record) - Returns an array representing a record from the database */ -PHP_FUNCTION(dbase_get_record) -{ - pval *dbh_id, *record; - dbhead_t *dbh; - int dbh_type; - dbfield_t *dbf, *cur_f; - char *data, *fnp, *str_value; - size_t cursize = 0; - long overflow_test; - int errno_save; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - convert_to_long(record); - - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - if ((data = get_dbf_record(dbh, Z_LVAL_P(record))) == NULL) { - php_error(E_WARNING, "Tried to read bad record %d", Z_LVAL_P(record)); - RETURN_FALSE; - } - - dbf = dbh->db_fields; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - fnp = NULL; - for (cur_f = dbf; cur_f < &dbf[dbh->db_nfields]; cur_f++) { - /* get the value */ - str_value = (char *)emalloc(cur_f->db_flen + 1); - - if(cursize <= (unsigned)cur_f->db_flen) { - cursize = cur_f->db_flen + 1; - fnp = erealloc(fnp, cursize); - } - snprintf(str_value, cursize, cur_f->db_format, get_field_val(data, cur_f, fnp)); - - /* now convert it to the right php internal type */ - switch (cur_f->db_type) { - case 'C': - case 'D': - add_next_index_string(return_value, str_value, 1); - break; - case 'I': /* FALLS THROUGH */ - case 'N': - if (cur_f->db_fdc == 0) { - /* Large integers in dbase can be larger than long */ - errno_save = errno; - overflow_test = strtol(str_value, NULL, 10); - if (errno == ERANGE) { - /* If the integer is too large, keep it as string */ - add_next_index_string(return_value, str_value, 1); - } else { - add_next_index_long(return_value, overflow_test); - } - errno = errno_save; - } else { - add_next_index_double(return_value, atof(str_value)); - } - break; - case 'L': /* we used to FALL THROUGH, but now we check for T/Y and F/N - and insert 1 or 0, respectively. db_fdc is the number of - decimals, which we don't care about. 3/14/2001 LEW */ - if ((*str_value == 'T') || (*str_value == 'Y')) { - add_next_index_long(return_value, strtol("1", NULL, 10)); - } else { - if ((*str_value == 'F') || (*str_value == 'N')) { - add_next_index_long(return_value, strtol("0", NULL, 10)); - } else { - add_next_index_long(return_value, strtol(" ", NULL, 10)); - } - } - break; - case 'M': - /* this is a memo field. don't know how to deal with - this yet */ - break; - default: - /* should deal with this in some way */ - break; - } - efree(str_value); - } - efree(fnp); - - /* mark whether this record was deleted */ - if (data[0] == '*') { - add_assoc_long(return_value, "deleted", 1); - } - else { - add_assoc_long(return_value, "deleted", 0); - } - - free(data); -} -/* }}} */ - -/* From Martin Kuba */ -/* {{{ proto array dbase_get_record_with_names(int identifier, int record) - Returns an associative array representing a record from the database */ -PHP_FUNCTION(dbase_get_record_with_names) -{ - pval *dbh_id, *record; - dbhead_t *dbh; - int dbh_type; - dbfield_t *dbf, *cur_f; - char *data, *fnp, *str_value; - long overflow_test; - int errno_save; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &dbh_id, &record)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long(dbh_id); - convert_to_long(record); - - dbh = zend_list_find(Z_LVAL_P(dbh_id), &dbh_type); - if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) { - php_error(E_WARNING, "Unable to find database for identifier %d", Z_LVAL_P(dbh_id)); - RETURN_FALSE; - } - - if ((data = get_dbf_record(dbh, Z_LVAL_P(record))) == NULL) { - php_error(E_WARNING, "Tried to read bad record %d", Z_LVAL_P(record)); - RETURN_FALSE; - } - - dbf = dbh->db_fields; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - fnp = (char *)emalloc(dbh->db_rlen); - for (cur_f = dbf; cur_f < &dbf[dbh->db_nfields]; cur_f++) { - /* get the value */ - str_value = (char *)emalloc(cur_f->db_flen + 1); - sprintf(str_value, cur_f->db_format, get_field_val(data, cur_f, fnp)); - - /* now convert it to the right php internal type */ - switch (cur_f->db_type) { - case 'C': - case 'D': - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - break; - case 'I': /* FALLS THROUGH */ - case 'N': - if (cur_f->db_fdc == 0) { - /* Large integers in dbase can be larger than long */ - errno_save = errno; - overflow_test = strtol(str_value, NULL, 10); - if (errno == ERANGE) { - /* If the integer is too large, keep it as string */ - add_assoc_string(return_value, cur_f->db_fname, str_value, 1); - } else { - add_assoc_long(return_value, cur_f->db_fname, overflow_test); - } - errno = errno_save; - } else { - add_assoc_double(return_value, cur_f->db_fname, atof(str_value)); - } - break; - case 'L': /* we used to FALL THROUGH, but now we check for T/Y and F/N - and insert 1 or 0, respectively. db_fdc is the number of - decimals, which we don't care about. 3/14/2001 LEW */ - if ((*str_value == 'T') || (*str_value == 'Y')) { - add_assoc_long(return_value, cur_f->db_fname,strtol("1", NULL, 10)); - } else { - if ((*str_value == 'F') || (*str_value == 'N')) { - add_assoc_long(return_value, cur_f->db_fname,strtol("0", NULL, 10)); - } else { - add_assoc_long(return_value, cur_f->db_fname,strtol(" ", NULL, 10)); - } - } - break; - case 'M': - /* this is a memo field. don't know how to deal with this yet */ - break; - default: - /* should deal with this in some way */ - break; - } - efree(str_value); - } - efree(fnp); - - /* mark whether this record was deleted */ - if (data[0] == '*') { - add_assoc_long(return_value, "deleted", 1); - } else { - add_assoc_long(return_value, "deleted", 0); - } - - free(data); -} -/* }}} */ - -/* {{{ proto bool dbase_create(string filename, array fields) - Creates a new dBase-format database file */ -PHP_FUNCTION(dbase_create) -{ - pval *filename, *fields, **field, **value; - int fd; - dbhead_t *dbh; - - int num_fields; - dbfield_t *dbf, *cur_f; - int i, rlen, handle; - DBase_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &filename, &fields)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string(filename); - - if (Z_TYPE_P(fields) != IS_ARRAY) { - php_error(E_WARNING, "Expected array as second parameter"); - RETURN_FALSE; - } - - if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) { - RETURN_FALSE; - } - - if ((fd = VCWD_OPEN_MODE(Z_STRVAL_P(filename), O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) { - php_error(E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno)); - RETURN_FALSE; - } - - num_fields = zend_hash_num_elements(Z_ARRVAL_P(fields)); - - /* have to use regular malloc() because this gets free()d by - code in the dbase library */ - dbh = (dbhead_t *)malloc(sizeof(dbhead_t)); - dbf = (dbfield_t *)malloc(sizeof(dbfield_t) * num_fields); - if (!dbh || !dbf) { - php_error(E_WARNING, "Unable to allocate memory for header info"); - RETURN_FALSE; - } - - /* initialize the header structure */ - dbh->db_fields = dbf; - dbh->db_fd = fd; - dbh->db_dbt = DBH_TYPE_NORMAL; - strcpy(dbh->db_date, "19930818"); - dbh->db_records = 0; - dbh->db_nfields = num_fields; - dbh->db_hlen = sizeof(struct dbf_dhead) + 1 + num_fields * sizeof(struct dbf_dfield); - - rlen = 1; - /** - * Patch by greg@darkphoton.com - **/ - /* make sure that the db_format entries for all fields are set to NULL to ensure we - don't seg fault if there's an error and we need to call free_dbf_head() before all - fields have been defined. */ - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - cur_f->db_format = NULL; - } - /** - * end patch - */ - - - for (i = 0, cur_f = dbf; i < num_fields; i++, cur_f++) { - /* look up the first field */ - if (zend_hash_index_find(Z_ARRVAL_P(fields), i, (void **)&field) == FAILURE) { - php_error(E_WARNING, "unable to find field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - - if (Z_TYPE_PP (field) != IS_ARRAY) { - php_error(E_WARNING, "second parameter must be array of arrays"); - free_dbf_head(dbh); - RETURN_FALSE; - } - - /* field name */ - if (zend_hash_index_find(Z_ARRVAL_PP(field), 0, (void **)&value) == FAILURE) { - php_error(E_WARNING, "expected field name as first element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_string_ex(value); - if (Z_STRLEN_PP(value) > 10 || Z_STRLEN_PP(value) == 0) { - php_error(E_WARNING, "invalid field name '%s' (must be non-empty and less than or equal to 10 characters)", Z_STRVAL_PP(value)); - free_dbf_head(dbh); - RETURN_FALSE; - } - copy_crimp(cur_f->db_fname, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); - - /* field type */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) { - php_error(E_WARNING, "expected field type as sececond element of list in field %d", i); - RETURN_FALSE; - } - convert_to_string_ex(value); - cur_f->db_type = toupper(*Z_STRVAL_PP(value)); - - cur_f->db_fdc = 0; - - /* verify the field length */ - switch (cur_f->db_type) { - case 'L': - cur_f->db_flen = 1; - break; - case 'M': - cur_f->db_flen = 10; - dbh->db_dbt = DBH_TYPE_MEMO; - /* should create the memo file here, probably */ - break; - case 'D': - cur_f->db_flen = 8; - break; - case 'N': - case 'C': - /* field length */ - if (zend_hash_index_find(Z_ARRVAL_PP (field), 2, (void **)&value) == FAILURE) { - php_error(E_WARNING, "expected field length as third element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_flen = Z_LVAL_PP(value); - - if (cur_f->db_type == 'N') { - if (zend_hash_index_find(Z_ARRVAL_PP (field), 3, (void **)&value) == FAILURE) { - php_error(E_WARNING, "expected field precision as fourth element of list in field %d", i); - free_dbf_head(dbh); - RETURN_FALSE; - } - convert_to_long_ex(value); - cur_f->db_fdc = Z_LVAL_PP(value); - } - break; - default: - php_error(E_WARNING, "unknown field type '%c'", cur_f->db_type); - } - cur_f->db_foffset = rlen; - rlen += cur_f->db_flen; - - cur_f->db_format = get_dbf_f_fmt(cur_f); - } - - dbh->db_rlen = rlen; - put_dbf_info(dbh); - - handle = zend_list_insert(dbh, DBase_GLOBAL(le_dbhead)); - RETURN_LONG(handle); -} -/* }}} */ - -/* {{{ dbase_functions[] - */ -function_entry dbase_functions[] = { - PHP_FE(dbase_open, NULL) - PHP_FE(dbase_create, NULL) - PHP_FE(dbase_close, NULL) - PHP_FE(dbase_numrecords, NULL) - PHP_FE(dbase_numfields, NULL) - PHP_FE(dbase_add_record, NULL) - PHP_FE(dbase_replace_record, NULL) - PHP_FE(dbase_get_record, NULL) - PHP_FE(dbase_get_record_with_names, NULL) - PHP_FE(dbase_delete_record, NULL) - PHP_FE(dbase_pack, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry dbase_module_entry = { - STANDARD_MODULE_HEADER, - "dbase", dbase_functions, PHP_MINIT(dbase), PHP_MSHUTDOWN(dbase), NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_DBASE -ZEND_GET_MODULE(dbase) - -#if (WIN32|WINNT) && defined(THREAD_SAFE) - -/*NOTE: You should have an odbc.def file where you -export DllMain*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - return 1; -} -#endif -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbase.dsp b/ext/dbase/dbase.dsp deleted file mode 100644 index 63bb66dbcca..00000000000 --- a/ext/dbase/dbase.dsp +++ /dev/null @@ -1,151 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dbase" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dbase - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dbase.mak" CFG="dbase - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dbase - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D HAVE_DBASE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D DBASE=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbase.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dbase - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBASE=1 /D DBASE=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_dbase.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "dbase - Win32 Release_TS" -# Name "dbase - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\dbase.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.c -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\dbf.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_head.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_misc.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_ndx.h -# End Source File -# Begin Source File - -SOURCE=.\dbf_rec.h -# End Source File -# Begin Source File - -SOURCE=.\php_dbase.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/dbase/dbf.h b/ext/dbase/dbf.h deleted file mode 100644 index c7ee8fde714..00000000000 --- a/ext/dbase/dbf.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf header structure on disk (pc dbase III) - * - * Basic info taken from: - * "File Formats for Popular PC Software" - * Jeff Walden - * (c) 1986 John Wiley & Sons, Inc. - */ - -#ifndef DBF_H_ -#define DBF_H_ - -#include -#include -#ifdef WIN32 -#include -#else -#include -#endif - -/* So we can use O_BINARY on non-Win32 systems. */ -#if !defined(O_BINARY) && !defined(WIN32) -#define O_BINARY (0) -#endif - -struct dbf_dhead { - char dbh_dbt; /* memo (dbt) file present */ - char dbh_date[3]; /* last update YY, MM, DD */ - char dbh_records[4]; /* number of records LE */ - char dbh_hlen[2]; /* header length LE */ - char dbh_rlen[2]; /* record length LE */ - char dbh_res[20]; /* padding */ -}; -#define DBH_DATE_YEAR 0 /* byte offset for year in dbh_date */ -#define DBH_DATE_MONTH 1 -#define DBH_DATE_DAY 2 - -/* - * field description on disk - */ - -#define DBF_NAMELEN 11 - -struct dbf_dfield { - char dbf_name[DBF_NAMELEN]; /* name of field */ - char dbf_type; /* type of field */ - char dbf_fda[4]; /* something for dbase III */ - char dbf_flen[2]; /* field length [and decimal if N] */ - char dbf_res[14]; /* padding */ -}; - -struct db_field { - char db_fname[DBF_NAMELEN+1]; /* 0 terminated */ - char db_type; /* type of field */ - int db_flen; /* length of field */ - int db_fdc; /* number of decimals in field */ - - char *db_format; /* format for printing %s etc */ - int db_foffset; /* offset within record */ -}; -typedef struct db_field dbfield_t; - -struct db_head { - int db_fd; - unsigned char db_dbt; /* dbt present */ - char db_date[9]; /* date of last update in db format */ - long db_records; /* number of records */ - int db_hlen; /* header length */ - int db_rlen; /* record length */ - - int db_nfields; /* number of fields */ - dbfield_t *db_fields; /* field info */ - char *db_name; /* name of dbf file */ - int db_cur_rec; /* current record */ -}; -typedef struct db_head dbhead_t; - -#define DBH_TYPE_NORMAL 0x03 -#define DBH_TYPE_MEMO 0x83 - -#define VALID_RECORD ' ' -#define DELETED_RECORD '*' - -#include "dbf_head.h" -#include "dbf_misc.h" -#include "dbf_rec.h" - -#endif /* DBF_H_ */ diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c deleted file mode 100644 index e73d134907d..00000000000 --- a/ext/dbase/dbf_head.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "php.h" -#include "dbf.h" - -void free_dbf_head(dbhead_t *dbh); -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); - -/* - * get the header info from the file - * basic header info & field descriptions - */ -dbhead_t *get_dbf_head(int fd) -{ - dbhead_t *dbh; - struct dbf_dhead dbhead; - dbfield_t *dbf, *cur_f, *tdbf; - int ret, nfields, offset, gf_retval; - - if ((dbh = (dbhead_t *)malloc(sizeof(dbhead_t))) == NULL) - return NULL; - if (lseek(fd, 0, 0) < 0) - return NULL; - if ((ret = read(fd, &dbhead, sizeof(dbhead))) < 0) - return NULL; - - /* build in core info */ - dbh->db_fd = fd; - dbh->db_dbt = dbhead.dbh_dbt; - dbh->db_records = get_long(dbhead.dbh_records); - dbh->db_hlen = get_short(dbhead.dbh_hlen); - dbh->db_rlen = get_short(dbhead.dbh_rlen); - - db_set_date(dbh->db_date, dbhead.dbh_date[DBH_DATE_YEAR] + 1900, - dbhead.dbh_date[DBH_DATE_MONTH], - dbhead.dbh_date[DBH_DATE_DAY]); - - /* malloc enough memory for the maximum number of fields: - 32 * 254 = 8128 bytes */ - tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*254); - - offset = 1; - nfields = 0; - gf_retval = 0; - for (cur_f = tdbf; gf_retval < 2 && nfields < 254; cur_f++) { - gf_retval = get_dbf_field(dbh, cur_f); - - if (gf_retval < 0) { - free_dbf_head(dbh); - return NULL; - } - if (gf_retval != 2 ) { - cur_f->db_foffset = offset; - offset += cur_f->db_flen; - nfields++; - } - } - dbh->db_nfields = nfields; - - /* malloc the right amount of space for records, copy and destroy old */ - dbf = (dbfield_t *)malloc(sizeof(dbfield_t)*nfields); - memcpy(dbf, tdbf, sizeof(dbfield_t)*nfields); - free(tdbf); - - dbh->db_fields = dbf; - - return dbh; -} - -/* - * free up the header info built above - */ -void free_dbf_head(dbhead_t *dbh) -{ - dbfield_t *dbf, *cur_f; - int nfields; - - dbf = dbh->db_fields; - nfields = dbh->db_nfields; - for (cur_f = dbf; cur_f < &dbf[nfields]; cur_f++) { - if (cur_f->db_format) { - free(cur_f->db_format); - } - } - - free(dbf); - free(dbh); -} - -/* - * put out the header info - */ -int put_dbf_head(dbhead_t *dbh) -{ - int fd = dbh->db_fd; - struct dbf_dhead dbhead; - int ret; - - memset (&dbhead, 0, sizeof(dbhead)); - - /* build on disk info */ - dbhead.dbh_dbt = dbh->db_dbt; - put_long(dbhead.dbh_records, dbh->db_records); - put_short(dbhead.dbh_hlen, dbh->db_hlen); - put_short(dbhead.dbh_rlen, dbh->db_rlen); - - /* put the date spec'd into the on disk header */ - dbhead.dbh_date[DBH_DATE_YEAR] =(char)(db_date_year(dbh->db_date) - - 1900); - dbhead.dbh_date[DBH_DATE_MONTH]=(char)(db_date_month(dbh->db_date)); - dbhead.dbh_date[DBH_DATE_DAY] =(char)(db_date_day(dbh->db_date)); - - if (lseek(fd, 0, 0) < 0) - return -1; - if ((ret = write(fd, &dbhead, sizeof(dbhead))) < 0) - return -1; - return ret; -} - -/* - * get a field off the disk from the current file offset - */ -int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - int ret; - - if ((ret = read(dbh->db_fd, &dbfield, sizeof(dbfield))) < 0) { - return ret; - } - - /* Check for the '0Dh' field terminator , if found return '2' - which will tell the loop we are at the end of fields */ - if (dbfield.dbf_name[0]==0x0d) { - return 2; - } - - /* build the field name */ - copy_crimp(dbf->db_fname, dbfield.dbf_name, DBF_NAMELEN); - - dbf->db_type = dbfield.dbf_type; - switch (dbf->db_type) { - case 'N': - dbf->db_flen = dbfield.dbf_flen[0]; - dbf->db_fdc = dbfield.dbf_flen[1]; - break; - default: - dbf->db_flen = get_short(dbfield.dbf_flen); - break; - } - - if ((dbf->db_format = get_dbf_f_fmt(dbf)) == NULL) { - return 1; - } - - return 0; -} - -/* - * put a field out on the disk at the current file offset - */ -int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf) -{ - struct dbf_dfield dbfield; - char *scp, *dcp; - int ret; - - memset (&dbfield, 0, sizeof(dbfield)); - - /* build the on disk field info */ - scp = dbf->db_fname; dcp = dbfield.dbf_name; - - strncpy(dbfield.dbf_name, dbf->db_fname, DBF_NAMELEN); - - dbfield.dbf_type = dbf->db_type; - switch (dbf->db_type) { - case 'N': - dbfield.dbf_flen[0] = dbf->db_flen; - dbfield.dbf_flen[1] = dbf->db_fdc; - break; - default: - put_short(dbfield.dbf_flen, dbf->db_flen); - } - - /* now write it out to disk */ - if ((ret = write(dbh->db_fd, &dbfield, sizeof(dbfield))) < 0) { - return ret; - } - return 1; -} - -/* - * put out all the info at the top of the file... - */ -static char end_stuff[2] = {0x0d, 0}; - -void put_dbf_info(dbhead_t *dbh) -{ - dbfield_t *dbf; - char *cp; - int fcnt; - - if ((cp = db_cur_date(NULL))) { - strncpy(dbh->db_date, cp, 8); - free(cp); - } - put_dbf_head(dbh); - dbf = dbh->db_fields; - for (fcnt = dbh->db_nfields; fcnt > 0; fcnt--, dbf++) - put_dbf_field(dbh, dbf); - write(dbh->db_fd, end_stuff, 1); -} - -char *get_dbf_f_fmt(dbfield_t *dbf) -{ - char format[100]; - - /* build the field format for printf */ - switch (dbf->db_type) { - case 'C': - sprintf(format, "%%-%ds", dbf->db_flen); - break; - case 'N': - case 'L': - case 'D': - sprintf(format, "%%%ds", dbf->db_flen); - break; - case 'M': - strcpy(format, "%s"); - break; - } - return (char *)strdup(format); -} - -dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC) -{ - int fd; - char *cp; - dbhead_t *dbh; - - cp = dp; - if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) { - cp = (char *)malloc(256); - strcpy(cp, dp); strcat(cp, ".dbf"); - if ((fd = VCWD_OPEN(cp, o_flags)) < 0) { - perror("open"); - return NULL; - } - } - - if ((dbh = get_dbf_head(fd)) == 0) { - fprintf(stderr, "Unable to get header\n"); - return NULL; - } - dbh->db_name = cp; - dbh->db_cur_rec = 0; - - return dbh; -} - -void dbf_head_info(dbhead_t *dbh) -{ - int nfields; - dbfield_t *dbf, *cur_f; - - nfields = dbh->db_nfields; - printf("# fields: %d, record len: %d, total records %ld\n", - nfields, dbh->db_rlen, dbh->db_records); - dbf = dbh->db_fields; - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf("# %s, %c, %d, %d\n", cur_f->db_fname, - cur_f->db_type, cur_f->db_flen, cur_f->db_fdc); - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_head.h b/ext/dbase/dbf_head.h deleted file mode 100644 index 9a17a3a91f3..00000000000 --- a/ext/dbase/dbf_head.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "php.h" - -extern dbhead_t *get_dbf_head(int fd); -void free_dbf_head(dbhead_t *dbh); -extern int put_dbf_head(dbhead_t *dbh); -extern int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -extern int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf); -void put_dbf_info(dbhead_t *dbh); -extern char *get_dbf_f_fmt(dbfield_t *dbf); -extern dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC); -void dbf_head_info(dbhead_t *dbh); diff --git a/ext/dbase/dbf_misc.c b/ext/dbase/dbf_misc.c deleted file mode 100644 index ad17bd4e3fb..00000000000 --- a/ext/dbase/dbf_misc.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ -#include -#include -#include - -#include "dbf_misc.h" - -#include "php_reentrancy.h" - -/* - * routine to change little endian long to host long - */ -long get_long(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - ret += ((*source++)<<16); - ret += ((*source++)<<24); - - return ret; -} - -void put_long(char *cp, long lval) -{ - *cp++ = lval & 0xff; - *cp++ = (lval >> 8) & 0xff; - *cp++ = (lval >> 16) & 0xff; - *cp++ = (lval >> 24) & 0xff; -} - -/* - * routine to change little endian short to host short - */ -int get_short(char *cp) -{ - int ret; - unsigned char *source = (unsigned char *)cp; - - ret = *source++; - ret += ((*source++)<<8); - - return ret; -} - -void put_short(char *cp, int sval) -{ - *cp++ = sval & 0xff; - *cp++ = (sval >> 8) & 0xff; -} - -double get_double(char *cp) -{ - double ret; - unsigned char *dp = (unsigned char *)&ret; - - dp[7] = *cp++; - dp[6] = *cp++; - dp[5] = *cp++; - dp[4] = *cp++; - dp[3] = *cp++; - dp[2] = *cp++; - dp[1] = *cp++; - dp[0] = *cp++; - - return ret; -} - -void put_double(char *cp, double fval) -{ - unsigned char *dp = (unsigned char *)&fval; - - cp[7] = *dp++; - cp[6] = *dp++; - cp[5] = *dp++; - cp[4] = *dp++; - cp[3] = *dp++; - cp[2] = *dp++; - cp[1] = *dp++; - cp[0] = *dp++; -} - -void copy_fill(char *dp, char *sp, int len) -{ - while (*sp && len > 0) { - *dp++ = *sp++; - len--; - } - while (len-- > 0) - *dp++ = ' '; -} - -void copy_crimp(char *dp, char *sp, int len) -{ - while (len-- > 0) { - *dp++ = *sp++; - } - *dp = 0; - for (dp-- ; *dp == ' '; dp--) { - *dp = 0; - } - -} - -void db_set_date(char *cp, int year, int month, int day) -{ - if (month > 12) - month = 0; - if (day > 31) - day = 0; - sprintf(cp, "%d", year); - cp[4] = month / 10 + '0'; - cp[5] = month % 10 + '0'; - cp[6] = day / 10 + '0'; - cp[7] = day % 10 + '0'; - cp[8] = 0; -} - -int db_date_year(char *cp) -{ - int year, i; - - for (year = 0, i = 0; i < 4; i++) - year = year * 10 + (cp[i] - '0'); - return year; -} - -int db_date_month(char *cp) -{ - int month, i; - - for (month = 0, i = 4; i < 6; i++) - month = month * 10 + (cp[i] - '0'); - return month; -} - -int db_date_day(char *cp) -{ - int day, i; - - for (day = 0, i = 6; i < 8; i++) - day = day * 10 + (cp[i] - '0'); - return day; -} - -#include - -char *db_cur_date(char *cp) -{ - struct tm *ctm, tmbuf; - time_t c_time; - - c_time = time((time_t *)NULL); - ctm = php_localtime_r(&c_time, &tmbuf); - if (cp == NULL) - cp = (char *)malloc(9); - - if (ctm == NULL || cp == NULL) - return NULL; - - db_set_date(cp, ctm->tm_year + 1900, ctm->tm_mon + 1, ctm->tm_mday); - - return cp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_misc.h b/ext/dbase/dbf_misc.h deleted file mode 100644 index 37fe8b0ea98..00000000000 --- a/ext/dbase/dbf_misc.h +++ /dev/null @@ -1,13 +0,0 @@ -void put_long(char *cp, long lval); -extern long get_long(char *cp); -extern int get_short(char *cp); -void put_short(char *cp, int sval); -void put_double(char *cp, double fval); -extern double get_double(char *cp); -void copy_fill(char *dp, char *sp, int len); -void copy_crimp(char *dp, char *sp, int len); -void db_set_date(char *cp, int year, int month, int day); -extern int db_date_year(char *cp); -extern int db_date_month(char *cp); -extern int db_date_day(char *cp); -extern char *db_cur_date(char *cp); diff --git a/ext/dbase/dbf_ndx.c b/ext/dbase/dbf_ndx.c deleted file mode 100644 index 121a0e81e26..00000000000 --- a/ext/dbase/dbf_ndx.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 1991, 1992, 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#include -#include - -#include "dbf.h" -#include "dbf_ndx.h" - -/* - * get the ndx header for this file - */ -ndx_header_t *ndx_get_header(int fd) -{ - dndx_header_t *dp; - ndx_header_t *np; - - if ((dp = (dndx_header_t *)malloc(NDX_PAGE_SZ)) == NULL) - return NULL; - if ((np = (ndx_header_t *)malloc(sizeof(ndx_header_t))) == NULL) { - free(dp); - return NULL; - } - if ((lseek(fd, 0, 0) < 0) || (read(fd, dp, NDX_PAGE_SZ) < 0)) { - free(dp); free(np); - return NULL; - } - np->ndx_hpage = dp; - np->ndx_fd = fd; - np->ndx_start_pg = get_long(dp->dndx_st_pg); - np->ndx_total_pgs = get_long(dp->dndx_tot_pg); - np->ndx_key_len = get_short(dp->dndx_key_len); - np->ndx_keys_ppg = get_short(dp->dndx_keys_ppg); - np->ndx_key_type = get_short(dp->dndx_key_type); - np->ndx_key_size = get_long(dp->dndx_size_key); - np->ndx_key_name = dp->dndx_key_name; - np->ndx_unique = dp->dndx_unique; - - np->ndx_fp = NULL; - - return np; -} - -static ndx_page_t *ndx_get_page(ndx_header_t *hp, int pageno) -{ - ndx_page_t *fp; - dndx_page_t *dp; - ndx_record_t *rp; - -#if PHP_DEBUG - printf("getting page %d", pageno); -#endif - if ((fp = (ndx_page_t *)malloc(sizeof(ndx_page_t))) == NULL) - return NULL; - if ((dp = (dndx_page_t *)malloc(NDX_PAGE_SZ)) == NULL) { - free(fp); - return NULL; - } - if ((rp = (ndx_record_t *)malloc(sizeof(ndx_record_t) * hp->ndx_keys_ppg)) == NULL) { - free(dp); free(fp); - return NULL; - } - fp->ndxp_page_data = dp; - if ((lseek(hp->ndx_fd, pageno * NDX_PAGE_SZ, 0) < 0) || - (read(hp->ndx_fd, dp, NDX_PAGE_SZ) < 0)) { - free(fp); free(dp); - return NULL; - } - fp->ndxp_parent = NULL; - fp->ndxp_page_no = pageno; - fp->ndxp_num_keys = get_long(dp->dndxp_num_keys); - memset(rp, 0, sizeof(ndx_record_t) * hp->ndx_keys_ppg); - fp->ndxp_records = rp; - fp->ndxp_header_p = hp; -#if PHP_DEBUG - printf(", n_keys %ld\n", fp->ndxp_num_keys); -#endif - return fp; -} - -/* - * get the first entry for this ndx - */ -static ndx_page_t *ndx_get_first_pg(ndx_header_t *hp) -{ - ndx_page_t *fp; - - if (hp->ndx_fp) - return hp->ndx_fp; - if ((fp = ndx_get_page(hp, hp->ndx_start_pg))) { - hp->ndx_fp = fp; - } - return fp; -} - -static ndx_record_t *ndx_get_record(ndx_page_t *fp, int rec_no) -{ - ndx_record_t *rp; - ndx_header_t *hp = fp->ndxp_header_p; - struct dndx_record *drp; - -#if PHP_DEBUG - printf("page %ld, rec %d: ", fp->ndxp_page_no, rec_no); -#endif - if (rec_no >= fp->ndxp_num_keys) - return NULL; - rp = &(fp->ndxp_records[rec_no]); - if (!rp->ndxr_page) { - rp->ndxr_page = fp; - drp = (dndx_record_t *)((char *)&fp->ndxp_page_data->dndx_rp - + rec_no * hp->ndx_key_size); - rp->ndxr_left = get_long(drp->dndx_left_pg); - rp->ndxr_rec = get_long(drp->dndx_dbf_rec); - rp->ndxr_key_data = &drp->dndx_key_data; - rp->ndxr_p_nrec = rec_no; - } -#if PHP_DEBUG - printf("left %ld, dbf_rec %ld, data '%s'\n", rp->ndxr_left, - rp->ndxr_rec, rp->ndxr_key_data); -#endif - return rp; -} - -static ndx_record_t *ndx_scan_down(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_page_t *np; - ndx_record_t *rp; - - while ((rp = ndx_get_record(fp, recno)) && (rp->ndxr_rec == 0)) { - np = ndx_get_page(hp, rp->ndxr_left); - np->ndxp_parent = fp; - np->ndxp_par_rno = recno; - fp = np; - recno = 0; - } - return rp; -} - -static ndx_record_t *ndx_scan_up(ndx_header_t *hp, ndx_page_t *fp, int recno) -{ - ndx_record_t *rp; - - if (fp == NULL) - rp = NULL; - else if (recno < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, recno); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -ndx_record_t *ndx_get_first_rec(ndx_header_t *hp) -{ - ndx_page_t *fp; - ndx_record_t *rp = NULL; - - if ((fp = ndx_get_first_pg(hp))) { - fp->ndxp_last_key = 0; - rp = ndx_scan_down(hp, fp, 0); - } - hp->ndx_cur_rec = rp; - return rp; -} - -ndx_record_t *ndx_get_next_rec(ndx_header_t *hp, ndx_record_t *rp) -{ - ndx_page_t *fp; - int rec_no; - - fp = rp->ndxr_page; - rec_no = rp->ndxr_p_nrec + 1; - if (rec_no < fp->ndxp_num_keys) { - rp = ndx_scan_down(hp, fp, rec_no); - } else { - rp = ndx_scan_up(hp, fp->ndxp_parent, fp->ndxp_par_rno + 1); - } - return rp; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_ndx.h b/ext/dbase/dbf_ndx.h deleted file mode 100644 index 4bc3d29641f..00000000000 --- a/ext/dbase/dbf_ndx.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -/* - * dbf .ndx header structure on disk and in memory - * - * Basic info taken from: - * "Clipper Programming Guide, 3rd Edition, Version 5.01" - * by Rick Spence - */ - -#ifndef DBF_NDX_H_ -#define DBF_NDX_H_ - -#include "dbf.h" - -#define NDX_PAGE_SZ 512 - -/* on disk ndx header */ -struct dndx_header { - char dndx_st_pg[4]; /* starting page number */ - char dndx_tot_pg[4]; /* total number of pages */ - char dndx_filler1[4]; /* space */ - char dndx_key_len[2]; /* key length */ - char dndx_keys_ppg[2]; /* number of keys per page */ - char dndx_key_type[2]; /* key type */ - char dndx_size_key[4]; /* size of the key record */ - char dndx_filler2; /* space */ - char dndx_unique; /* whether or not done with unique */ - char dndx_key_name[488]; /* string defining the key */ -}; -typedef struct dndx_header dndx_header_t; - -/* in memory ndx header */ -struct ndx_header { - long ndx_start_pg; - long ndx_total_pgs; - unsigned short ndx_key_len; - unsigned short ndx_keys_ppg; - unsigned short ndx_key_type; - char ndx_unique; - long ndx_key_size; - char *ndx_key_name; - int ndx_fd; - struct ndx_page *ndx_fp; - dndx_header_t *ndx_hpage; - struct ndx_record *ndx_cur_rec; -}; -typedef struct ndx_header ndx_header_t; - -/* these are the possible values in the key type field */ -#define NDX_CHAR_TYPE 00 -#define NDX_NUM_TYPE 01 - -/* on disk key record */ -struct dndx_record { - char dndx_left_pg[4]; /* number of left page */ - char dndx_dbf_rec[4]; /* dbf record number */ - char dndx_key_data; /* key data */ -}; -typedef struct dndx_record dndx_record_t; - -struct ndx_record { - long ndxr_left; - long ndxr_rec; - char *ndxr_key_data; - struct ndx_page *ndxr_page; /* page pointer to where we are from*/ - int ndxr_p_nrec; /* number of the record within page */ -}; -typedef struct ndx_record ndx_record_t; - -struct dndx_page { - char dndxp_num_keys[4]; /* number of keys on this page */ - struct dndx_record dndx_rp; -}; -typedef struct dndx_page dndx_page_t; - -struct ndx_page { - long ndxp_page_no; - long ndxp_num_keys; - dndx_page_t *ndxp_page_data; - ndx_header_t *ndxp_header_p; - long ndxp_last_key; - struct ndx_page *ndxp_parent; /* parent page */ - int ndxp_par_rno; /* record number within parent */ - struct ndx_record *ndxp_records; -}; -typedef struct ndx_page ndx_page_t; - -extern ndx_header_t *ndx_get_header(int); - -extern ndx_record_t *ndx_get_first_rec(ndx_header_t *); -extern ndx_record_t *ndx_get_next_rec(ndx_header_t *, ndx_record_t *); - -#endif /* DBF_NDX_H_ */ diff --git a/ext/dbase/dbf_rec.c b/ext/dbase/dbf_rec.c deleted file mode 100644 index 7c976aedc15..00000000000 --- a/ext/dbase/dbf_rec.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#ifdef PHP_WIN32 -#include "ext/standard/flock_compat.h" -#endif - -#include -#include - -#include "dbf.h" - -int get_piece(dbhead_t *dbh, long offset, char *cp, int len); -int put_piece(dbhead_t *dbh, long offset, char *cp, int len); - -/* - * get a record off the database - */ -char *get_dbf_record(dbhead_t *dbh, long rec_num) -{ - long offset; - char *cp; - - if (rec_num > dbh->db_records) { - return NULL; - } - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return NULL; - } - - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (get_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - free(cp); - cp = NULL; - } - if (cp) - dbh->db_cur_rec = rec_num; - return cp; -} - -int -get_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* read the record into the allocated space */ - return read(dbh->db_fd, cp, len); -} - -/* - * put a record to the database - */ -long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp) -{ - long offset; - - if (rec_num == 0) { - rec_num = dbh->db_records; - } - if (rec_num > dbh->db_records) { - return 0L; - } - /* go to the correct spot on the file */ - offset = dbh->db_hlen + (rec_num - 1) * dbh->db_rlen; - if (put_piece(dbh, offset, cp, dbh->db_rlen) != dbh->db_rlen) { - rec_num = -1; - } - return rec_num; -} - -int put_piece(dbhead_t *dbh, long offset, char *cp, int len) -{ - /* go to the correct spot on the file */ - if ( lseek(dbh->db_fd, offset, 0) < 0 ) { - return -1; - } - - /* write the record into the file */ - return write(dbh->db_fd, cp, len); -} - -int del_dbf_record(dbhead_t *dbh, long rec_num) -{ - int ret = 0; - char *cp; - - if (rec_num > dbh->db_records) - return -1; - if ((cp = get_dbf_record(dbh, rec_num))) { - *cp = DELETED_RECORD; - ret = put_dbf_record(dbh, rec_num, cp); - free(cp); - } - return ret; -} - -void pack_dbf(dbhead_t *dbh) -{ - long out_off, in_off; - int rec_cnt, new_cnt; - char *cp; - - if ((cp = (char *)malloc(dbh->db_rlen)) == NULL) { - return; - } - in_off = out_off = dbh->db_hlen; - - new_cnt = 0; - rec_cnt = dbh->db_records; - while (rec_cnt > 0) { - if (get_piece(dbh, in_off, cp, dbh->db_rlen) < 0) - break; - - if (*cp != DELETED_RECORD) { - /* write the record into the file */ - if (put_piece(dbh, out_off, cp, dbh->db_rlen) < 0) - break; - out_off += dbh->db_rlen; - new_cnt++; - } - in_off += dbh->db_rlen; - rec_cnt--; - } - free(cp); - - /* Try to truncate the file to the right size. */ - if (ftruncate(dbh->db_fd, out_off) != 0) { - php_error(E_WARNING, "dbase_pack() couldn't truncate the file to the right size. Some deleted records may still be left in there."); - } - - if (rec_cnt == 0) - dbh->db_records = new_cnt; -} - -/* routine to get a field from a record */ -char *get_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - int flen = fldp->db_flen; - - if ( !cp ) - cp = (char *)malloc(flen + 1); - if ( cp ) { - strncpy(cp, &rp[fldp->db_foffset], flen); - cp[flen] = 0; - } - return cp; -} - -void put_field_val(char *rp, dbfield_t *fldp, char *cp) -{ - strncpy(&rp[fldp->db_foffset], cp, fldp->db_flen); -} - -/* - * output a record - */ -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp) -{ - dbfield_t *cur_f; - int nfields = dbh->db_nfields; - char *fnp = (char *)malloc(dbh->db_rlen); - - printf("%c", *cp); - for (cur_f = dbf; cur_f < &dbf[nfields] ; cur_f++) { - printf(" "); - printf(cur_f->db_format, get_field_val(cp, cur_f, fnp)); - } - printf("\n"); - free(fnp); -} - -/* check for record validity */ -int is_valid_rec(char *cp) -{ - if (cp && (*cp == VALID_RECORD)) - return 1; - else - return 0; -} - -/* get the next record */ -char *dbf_get_next(dbhead_t *dbh) -{ - return get_dbf_record(dbh, dbh->db_cur_rec + 1); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/dbase/dbf_rec.h b/ext/dbase/dbf_rec.h deleted file mode 100644 index 6407c702f66..00000000000 --- a/ext/dbase/dbf_rec.h +++ /dev/null @@ -1,10 +0,0 @@ -extern char *get_dbf_record(dbhead_t *dbh, long rec_num); -extern long put_dbf_record(dbhead_t *dbh, long rec_num, char *cp); -extern int put_piece(dbhead_t *dbh, long offset, char *cp, int len); -extern int del_dbf_record(dbhead_t *dbh, long rec_num); -void pack_dbf(dbhead_t *dbh); -extern char *get_field_val(char *rp, dbfield_t *fldp, char *cp); -void put_field_val(char *rp, dbfield_t *fldp, char *cp); -void out_rec(dbhead_t *dbh, dbfield_t *dbf, char *cp); -extern int is_valid_rec(char *cp); -extern char *dbf_get_next(dbhead_t *dbh); diff --git a/ext/dbase/php_dbase.h b/ext/dbase/php_dbase.h deleted file mode 100644 index c9e62b269f7..00000000000 --- a/ext/dbase/php_dbase.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jim Winstead | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_DBASE_H -#define PHP_DBASE_H -#if DBASE -extern zend_module_entry dbase_module_entry; -#define dbase_module_ptr &dbase_module_entry - -PHP_MINIT_FUNCTION(dbase); -PHP_FUNCTION(dbase_open); -PHP_FUNCTION(dbase_create); -PHP_FUNCTION(dbase_close); -PHP_FUNCTION(dbase_numrecords); -PHP_FUNCTION(dbase_numfields); -PHP_FUNCTION(dbase_add_record); -PHP_FUNCTION(dbase_get_record); -PHP_FUNCTION(dbase_delete_record); -PHP_FUNCTION(dbase_pack); -PHP_FUNCTION(dbase_get_record_with_names); -#else -#define dbase_module_ptr NULL -#endif - -#define phpext_dbase_ptr dbase_module_ptr - -#endif /* PHP_DBASE_H */ diff --git a/ext/dbplus/CREDITS b/ext/dbplus/CREDITS deleted file mode 100644 index ad7e7425a3f..00000000000 --- a/ext/dbplus/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dbplus -Hartmut Holzgraefe diff --git a/ext/dbplus/EXPERIMENTAL b/ext/dbplus/EXPERIMENTAL deleted file mode 100644 index 6443e996464..00000000000 --- a/ext/dbplus/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/dbplus/README b/ext/dbplus/README deleted file mode 100644 index e313a10377f..00000000000 --- a/ext/dbplus/README +++ /dev/null @@ -1,3 +0,0 @@ -experimental db++ extension -for more information on db++ see -http://www.concept-asa.de diff --git a/ext/dbplus/config.m4 b/ext/dbplus/config.m4 deleted file mode 100644 index c2322a1174d..00000000000 --- a/ext/dbplus/config.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(dbplus, for dbplus support, -[ --with-dbplus Include dbplus support]) - -if test "$PHP_DBPLUS" != "no"; then - # --with-dbplus -> check with-path - SEARCH_PATH="/usr/dbplus /usr/local/dbplus /opt/dbplus" - SEARCH_FOR="/include/dbconfig.h" - if test -r $PHP_DBPLUS/; then # path given as parameter - DBPLUS_DIR=$PHP_DBPLUS - else # search default path list - AC_MSG_CHECKING(for dbplus files in default path) - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - DBPLUS_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$DBPLUS_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the dbplus distribution) - fi - - # --with-dbplus -> add include path - PHP_ADD_INCLUDE($DBPLUS_DIR/include) - - # --with-dbplus -> chech for lib and symbol presence - LIBNAME=Ddb - LIBSYMBOL=Db_Init - old_LIBS=$LIBS - LIBS="-L$DBPLUS_DIR/lib -lm -ldl -lDmacc -lDracc" - AC_CHECK_LIB($LIBNAME, $LIBSYMBOL, [AC_DEFINE(HAVE_DBPLUSLIB,1,[ ])], - [AC_MSG_ERROR(wrong dbplus lib version or lib not found)]) - LIBS=$old_LIBS - - PHP_SUBST(DBPLUS_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $DBPLUS_DIR/lib, DBPLUS_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(Dmacc, $DBPLUS_DIR/lib, DBPLUS_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(Dracc, $DBPLUS_DIR/lib, DBPLUS_SHARED_LIBADD) - - PHP_NEW_EXTENSION(dbplus, dbplus.c php_dbplus.c , $ext_shared) -fi diff --git a/ext/dbplus/dbplus.c b/ext/dbplus/dbplus.c deleted file mode 100644 index 57835281784..00000000000 --- a/ext/dbplus/dbplus.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#include "php.h" -#include "ext/standard/info.h" -#include "php_ini.h" -#include "php_dbplus.h" - -#include -#include -#include - - -/* If you declare any globals in php_dbplus.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(dbplus) -*/ - -#ifdef COMPILE_DL_DBPLUS -ZEND_GET_MODULE(dbplus) -#endif - - -/* {{{ Resource handling */ - -/* True global resources - no need for thread safety here */ -int le_dbplus_relation; -int le_dbplus_tupel; - -void dbplus_destruct_relation(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - relf *conn = (relf *)(rsrc->ptr); - - cdb_close(conn); -} - - -void dbplus_destruct_tupel(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - tuple *t = (tuple *)(rsrc->ptr); - - efree(t); -} - -/* }}} */ - -/* {{{ function table */ - -/* Every user visible function must have an entry in dbplus_functions[]. -*/ -function_entry dbplus_functions[] = { - PHP_FE(dbplus_add, NULL) - PHP_FE(dbplus_aql, NULL) - PHP_FE(dbplus_chdir, NULL) - PHP_FE(dbplus_close, NULL) - PHP_FE(dbplus_curr, NULL) - PHP_FE(dbplus_errno, NULL) - PHP_FE(dbplus_errcode, NULL) - PHP_FE(dbplus_find, NULL) - PHP_FE(dbplus_first, NULL) - PHP_FE(dbplus_flush, NULL) - PHP_FE(dbplus_freealllocks, NULL) - PHP_FE(dbplus_freelock, NULL) - PHP_FE(dbplus_freerlocks, NULL) - PHP_FE(dbplus_getlock, NULL) - PHP_FE(dbplus_getunique, NULL) - PHP_FE(dbplus_info, NULL) - PHP_FE(dbplus_last, NULL) - PHP_FE(dbplus_next, NULL) - PHP_FE(dbplus_open, NULL) - PHP_FE(dbplus_prev, NULL) - PHP_FE(dbplus_rchperm, NULL) - PHP_FE(dbplus_rcreate, NULL) - PHP_FE(dbplus_rcrtexact, NULL) - PHP_FE(dbplus_rcrtlike, NULL) - PHP_FE(dbplus_resolve, NULL) - PHP_FE(dbplus_restorepos, NULL) - PHP_FE(dbplus_rkeys, NULL) - PHP_FE(dbplus_ropen, NULL) - PHP_FE(dbplus_rquery, NULL) - PHP_FE(dbplus_rrename, NULL) - PHP_FE(dbplus_rsecindex, NULL) - PHP_FE(dbplus_runlink, NULL) - PHP_FE(dbplus_rzap, NULL) - PHP_FE(dbplus_savepos, NULL) - PHP_FE(dbplus_setindex, NULL) - PHP_FE(dbplus_setindexbynumber, NULL) - PHP_FE(dbplus_sql, NULL) - PHP_FE(dbplus_tcl, NULL) - PHP_FE(dbplus_tremove, NULL) - PHP_FE(dbplus_undo, NULL) - PHP_FE(dbplus_undoprepare, NULL) - PHP_FE(dbplus_unlockrel, NULL) - PHP_FE(dbplus_unselect, NULL) - PHP_FE(dbplus_update, NULL) - PHP_FE(dbplus_xlockrel, NULL) - PHP_FE(dbplus_xunlockrel, NULL) - {NULL, NULL, NULL} /* Must be the last line in dbplus_functions[] */ -}; - -/* }}} */ - -/* {{{ module entry */ - -zend_module_entry dbplus_module_entry = { - STANDARD_MODULE_HEADER, - "dbplus", - dbplus_functions, - PHP_MINIT(dbplus), - PHP_MSHUTDOWN(dbplus), - PHP_RINIT(dbplus), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(dbplus), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(dbplus), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -/* }}} */ - -/* {{{ ini parameters */ - -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() -PHP_INI_END() -*/ - -/* }}} */ - -/* {{{ module init */ - -PHP_MINIT_FUNCTION(dbplus) -{ - /* resource id for cdb connections */ - le_dbplus_relation = zend_register_list_destructors_ex(dbplus_destruct_relation, NULL, "dbplus_relation", module_number); - le_dbplus_tupel = zend_register_list_destructors_ex(dbplus_destruct_tupel , NULL, "dbplus_tuple" , module_number); - - /* constants for DBPLUS error codes */ - REGISTER_LONG_CONSTANT("DBPLUS_ERR_NOERR", ERR_NOERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_DUPLICATE", ERR_DUPLICATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_EOSCAN", ERR_EOSCAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_EMPTY", ERR_EMPTY, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_CLOSE", ERR_CLOSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_WLOCKED", ERR_WLOCKED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_LOCKED", ERR_LOCKED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_NOLOCK", ERR_NOLOCK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_READ", ERR_READ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_WRITE", ERR_WRITE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_CREATE", ERR_CREATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_LSEEK", ERR_LSEEK, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_LENGTH", ERR_LENGTH, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_OPEN", ERR_OPEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_WOPEN", ERR_WOPEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_MAGIC", ERR_MAGIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_VERSION", ERR_VERSION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PGSIZE", ERR_PGSIZE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_CRC", ERR_CRC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PIPE", ERR_PIPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_NIDX", ERR_NIDX, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_MALLOC", ERR_MALLOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_NUSERS", ERR_NUSERS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PREEXIT", ERR_PREEXIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_ONTRAP", ERR_ONTRAP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PREPROC", ERR_PREPROC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_DBPARSE", ERR_DBPARSE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_DBRUNERR", ERR_DBRUNERR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_DBPREEXIT", ERR_DBPREEXIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_WAIT", ERR_WAIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_CORRUPT_TUPLE", ERR_CORRUPT_TUPLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_WARNING0", ERR_WARNING0, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PANIC", ERR_PANIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_FIFO", ERR_FIFO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_PERM", ERR_PERM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_TCL", ERR_TCL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_RESTRICTED", ERR_RESTRICTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_USER", ERR_USER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("DBPLUS_ERR_UNKNOWN", ERR_UNKNOWN, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -/* }}} */ - -/* {{{ module shutdown */ - -PHP_MSHUTDOWN_FUNCTION(dbplus) -{ - return SUCCESS; -} - -/* }}} */ - -/* {{{ request init */ - -/* Remove if there's nothing to do at request start */ -PHP_RINIT_FUNCTION(dbplus) -{ - return SUCCESS; -} - -/* }}} */ - -/* {{{ request shutdown */ - -/* Remove if there's nothing to do at request end */ -PHP_RSHUTDOWN_FUNCTION(dbplus) -{ - return SUCCESS; -} - -/* }}} */ - -/* {{{ module information */ - -PHP_MINFO_FUNCTION(dbplus) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "dbplus support", "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: - */ diff --git a/ext/dbplus/php_dbplus.c b/ext/dbplus/php_dbplus.c deleted file mode 100644 index 241b990c304..00000000000 --- a/ext/dbplus/php_dbplus.c +++ /dev/null @@ -1,1557 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#include "php.h" -#include "php_ini.h" -#include "php_dbplus.h" - -#include "ext/standard/php_string.h" - -#include -#include -#include - -/* missing prototypes in dbplus header files */ -void string_to_scalop(char *op, enum scalop *sop); -field * string_to_field(char *val, attribute *ap, int flags); -void cdb_tcl(int,char *,char **, int *); -relf * aql_exec(char *, char *); -tuple *rnext(relf *); - - -#define _STRING(x) (Z_STRVAL_PP(x)) -#define _INT(x) (Z_LVAL_PP(x)) -#define _HASH(x) (Z_ARRVAL_PP(x)) - -#define DBPLUS_FETCH_RESOURCE(r, z) ZEND_FETCH_RESOURCE(r, relf *, z, -1, "dbplus_relation", le_dbplus_relation); \ - if(!r) RETURN_LONG(ERR_UNKNOWN); - - -static int -var2tuple(relf *r, zval **zv, tuple *t) -{ - register attribute *ap ; - unsigned deg ; - zval **element; - - if (Z_TYPE_PP(zv)!=IS_ARRAY) - return 1; - - rtupinit(r, t); - - ap = r->r_atts; - deg = r->r_rel.rel_deg; - do { - if(SUCCESS!=zend_hash_find(Z_ARRVAL_PP(zv), ap->att_name, strlen(ap->att_name)+1, (void **)&element)) { - continue; - } - - if (! *element) { - return 1; - } - - switch(ap->att_type) { - - case FT_SHORT: - /* short integer */ - convert_to_long_ex(element); - AFFIX(ap, t)->f_short = (short) Z_LVAL_PP(element); - break; - - case FT_UNSIGNED: - /* unsigned short integer */ - convert_to_long_ex(element); - AFFIX(ap, t)->f_unsigned = (unsigned) Z_LVAL_PP(element); - break; - - case FT_LONG: - /* 32bit signed long */ - case FT_SEQUENCE: - /* unique sequence number -> just a long to outsiders */ - convert_to_long_ex(element); - AFFIX(ap, t)->f_long = (long4) Z_LVAL_PP(element); - break; - - case FT_DATE: - /* date -> long containing YYYYMMDD */ - convert_to_long_ex(element); - AFFIX(ap, t)->f_date = (long4) Z_LVAL_PP(element); - break; - - case FT_TIME: - /* time as unix timestamp */ - convert_to_long_ex(element); - AFFIX(ap, t)->f_time = (long4) Z_LVAL_PP(element); - break; - - case FT_FLOAT: - /* single prec. floating point */ - convert_to_double_ex(element); - AFFIX(ap, t)->f_float = (float) Z_DVAL_PP(element); - break; - - case FT_DOUBLE: - /* double prec. floating point */ - convert_to_double_ex(element); - AFFIX(ap, t)->f_double = (double) Z_DVAL_PP(element); - break; - - case FT_STRING: - case FT_DEUTSCH: - case FT_CHAR: - case FT_ANSI: - case FT_ISO: - case FT_ISOL: - /* different variants of Strings */ - convert_to_string_ex(element); - afput(ap, t, (field *)0, Z_STRVAL_PP(element)); - break; - - default: - php_error(E_WARNING,"%s is of yet unsupported type %d",ap->att_name,ap->att_type); - break; - } - } while (ap++, --deg); - return 0; -} - - - -static int -tuple2var(relf * r, tuple * t, zval **zv) -{ - register attribute *ap ; - unsigned deg ; - zval *element; - - zval_dtor(*zv); - if (array_init(*zv) == FAILURE) { - return 1; - } - - ap = r->r_atts; - deg = r->r_rel.rel_deg; - do { - MAKE_STD_ZVAL(element); Z_TYPE_P(element)=IS_NULL; - - switch(ap->att_type) { - case FT_SHORT: - ZVAL_LONG(element, AFFIX(ap, t)->f_short); - break; - - case FT_UNSIGNED: - ZVAL_LONG(element, AFFIX(ap, t)->f_unsigned); - break; - - case FT_LONG: - case FT_SEQUENCE: - ZVAL_LONG(element, AFFIX(ap, t)->f_long); - break; - - case FT_TIME: - ZVAL_LONG(element, AFFIX(ap, t)->f_time); - break; - - case FT_FLOAT: - ZVAL_DOUBLE(element, AFFIX(ap, t)->f_float); - break; - - case FT_DOUBLE: - ZVAL_DOUBLE(element, AFFIX(ap, t)->f_double); - break; - - case FT_STRING: - case FT_DEUTSCH: - case FT_CHAR: - ZVAL_STRING(element, AFVAR(ap, t)->f_string, 1); - break; - - default: - php_error(E_WARNING,"%s is of yet unsupported type %d",ap->att_name,ap->att_type); - break; - } - - if(Z_TYPE_P(element)!=IS_NULL) - zend_hash_update(Z_ARRVAL_PP(zv), - ap->att_name, - strlen(ap->att_name)+1, - (void *)&element, - sizeof(zval*), - NULL); - - } while (ap++, --deg); - return 0; -} - -static constraint * -ary2constr(relf * r, zval** constr) -{ - attribute *ap; - static constraint c; - field *f; - enum scalop sop; - char * dom; - char * val; - char * op; - zval **zdata; - - /* init first */ - db_coninit(r, &c); - - if (Z_TYPE_PP(constr) != IS_ARRAY) { - php_error(E_WARNING, "Constraint is not an array"); - return NULL; - } - - zend_hash_internal_pointer_reset(_HASH(constr)); - if(zend_hash_get_current_data(_HASH(constr), (void **)&zdata)!=SUCCESS) { - php_error(E_WARNING, "Constraint array is empty"); - return NULL; - } - - switch(Z_TYPE_PP(zdata)) { - case IS_STRING: /* constraints in plain string array */ - if (_HASH(constr)->nNumOfElements%3) { - php_error(E_WARNING, "Constraint array has to have triples of strings"); - return NULL; - } - - do { - convert_to_string_ex(zdata); - dom = _STRING(zdata); - zend_hash_move_forward(_HASH(constr)); - zend_hash_get_current_data(_HASH(constr), (void **)&zdata); - convert_to_string_ex(zdata); - op = _STRING(zdata); - zend_hash_move_forward(_HASH(constr)); - zend_hash_get_current_data(_HASH(constr), (void **)&zdata); - convert_to_string_ex(zdata); - val = _STRING(zdata); - zend_hash_move_forward(_HASH(constr)); - - if (!(ap = (attribute *) attno (r, dom))) { - fprintf(stderr, "Invalid domain \"%s\"\n", dom); - return 0; - } - - /* operator */ - string_to_scalop(op, &sop); - - /* value */ - f = string_to_field(val, ap, 0); - - (void) db_constrain(r, &c, dom, sop, f ? f : (field *) val); - } while(SUCCESS==zend_hash_get_current_data(_HASH(constr), (void **)&zdata)); - - break; - case IS_ARRAY: - { - zval **entry; - for(zend_hash_internal_pointer_reset(_HASH(constr)); - SUCCESS==zend_hash_get_current_data(_HASH(constr), (void **)&zdata); - zend_hash_move_forward(_HASH(constr))) { - if(!(Z_TYPE_PP(zdata)==IS_ARRAY)) { - php_error(E_WARNING, "Constraint array element not an array"); - return NULL; - } - if(_HASH(zdata)->nNumOfElements!=3) { - php_error(E_WARNING, "Constraint array element not an array of size 3"); - return NULL; - } - - zend_hash_internal_pointer_reset(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata), (void **)&entry); - convert_to_string_ex(entry); - dom=_STRING(entry); - - zend_hash_move_forward(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata), (void **)&entry); - convert_to_string_ex(entry); - op=_STRING(entry); - - zend_hash_move_forward(_HASH(zdata)); - zend_hash_get_current_data(_HASH(zdata), (void **)&entry); - convert_to_string_ex(entry); - val=_STRING(entry); - - if (!(ap = (attribute *) attno (r, dom))) { - fprintf(stderr, "Invalid domain \"%s\"\n", dom); - return 0; - } - - /* operator */ - string_to_scalop(op, &sop); - - /* value */ - f = string_to_field(val, ap, 0); - - (void) db_constrain(r, &c, dom, sop, f ? f : (field *) val); - } - - } - break; - default: - /* TODO error-handling */ - return NULL; - } - - return &c; -} - - -/* {{{ proto int dbplus_add(int relation, array tuple) - Adds a tuple to a relation */ -PHP_FUNCTION(dbplus_add) -{ - zval **relation, **data; - enum errorcond stat = ERR_UNKNOWN; - relf *r; - tuple t; - - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &data) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - convert_to_array_ex(data); - - if(var2tuple(r, data, &t)) - RETURN_LONG(ERR_UNKNOWN); - - stat=cdb_add(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, data); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto resource dbplus_aql(string query [, string server [, string dbpath]]) - Performs AQL query */ -PHP_FUNCTION(dbplus_aql) -{ - int argc; - zval **query, **server, **dbpath; - relf *r; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &query, &server, &dbpath) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_string_ex(dbpath); - php_error(E_WARNING, "Arg dbpath: %s", _STRING(dbpath)); - /* Fall-through. */ - case 2: - convert_to_string_ex(server); - php_error(E_WARNING, "Arg server: %s", _STRING(server)); - /* Fall-through. */ - case 1: - convert_to_string_ex(query); - php_error(E_WARNING, "Arg query: %s", _STRING(query)); - break; - } - - r = cdb_aql((argc>=2)?_STRING(server):"localhost", - _STRING(query), - (argc==3)?_STRING(dbpath):NULL); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto string dbplus_chdir([string newdir]) - Gets/Sets database virtual current directory */ -PHP_FUNCTION(dbplus_chdir) -{ - int argc; - char *p; - zval **newdir; - - argc = ZEND_NUM_ARGS(); - switch(argc) { - case 0: - break; - case 1: - if(zend_get_parameters_ex(1, &newdir) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - convert_to_string_ex(newdir); - } - break; - default: - WRONG_PARAM_COUNT; - } - - p = cdb_chdir((argc)?_STRING(newdir):NULL); - if(p) { - RETURN_STRING(p, 1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int dbplus_close(int relation) - Closes a relation */ -PHP_FUNCTION(dbplus_close) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - zend_list_delete(Z_LVAL_PP(relation)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int dbplus_curr(int relation, array tuple) - Gets current tuple from relation */ -PHP_FUNCTION(dbplus_curr) -{ - zval **relation, **tname; - relf *r; - tuple t; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_current(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto string dbplus_errcode(int err) - Gets error string for given errorcode or last error */ -PHP_FUNCTION(dbplus_errcode) -{ - zval **err; - int errno; - - switch (ZEND_NUM_ARGS()) { - case 0: - errno=-1; - break; - case 1: - if( zend_get_parameters_ex(1, &err) == FAILURE){ - WRONG_PARAM_COUNT; - } - convert_to_long_ex(err); - errno = _INT(err); - } - - if(errno==-1) errno = Acc_error; - - RETURN_STRING(dbErrorMsg(errno, NULL), 1); -} -/* }}} */ - -/* {{{ proto int dbplus_errno(void) - Gets error code for last operation */ -PHP_FUNCTION(dbplus_errno) -{ - RETURN_LONG(Acc_error); -} -/* }}} */ - -/* {{{ proto int dbplus_find(int relation, array constr, mixed tuple) - Sets a constraint on a relation */ -PHP_FUNCTION(dbplus_find) -{ - relf *r; - zval **relation, **constr, **data; - constraint *c; - tuple t; - int stat; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &relation, &constr, &data) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - if (Z_TYPE_PP(constr) != IS_ARRAY) { - php_error(E_WARNING, "Constraint is not an array"); - RETURN_LONG(ERR_UNKNOWN); - } - - convert_to_array_ex(data); - - c = ary2constr(r, constr); - - if (!c){ - RETURN_LONG(ERR_USER); - } - - stat = cdb_find(r, &t, c); - - if(stat==ERR_NOERR) - tuple2var(r, &t, data); - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_first(int relation, array tuple) - Gets first tuple from relation */ -PHP_FUNCTION(dbplus_first) -{ - zval **relation, **tname; - relf *r; - tuple t; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_first(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_flush(int relation) - ??? */ -PHP_FUNCTION(dbplus_flush) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_flush(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_freealllocks(void) - Frees all locks held by this client */ -PHP_FUNCTION(dbplus_freealllocks) -{ - RETURN_LONG(cdbFreeAllLocks()); -} -/* }}} */ - - -/* {{{ proto int dbplus_freelock(int relation, array tuple) - Releases write lock on tuple */ -PHP_FUNCTION(dbplus_freelock) -{ - zval **relation, **data; - enum errorcond stat = ERR_UNKNOWN; - relf *r; - tuple t; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &data) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_array_ex(data); - - if(var2tuple(r, data, &t)) - RETURN_LONG(ERR_UNKNOWN); - - stat=cdb_freelock(r, &t); - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_freerlocks(int relation) - Frees all locks on given relation */ -PHP_FUNCTION(dbplus_freerlocks) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_freerlocks(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_getlock(int relation, array tuple) - Requests locking of tuple */ -PHP_FUNCTION(dbplus_getlock) -{ - zval **relation, **data; - enum errorcond stat = ERR_UNKNOWN; - relf *r; - tuple t; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &data) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_array_ex(data); - - if(var2tuple(r, data, &t)) - RETURN_LONG(ERR_UNKNOWN); - - stat=cdb_getlock(r, &t); - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_getunique(int handle, int uniqueid) - Gets a id number unique to a relation */ -PHP_FUNCTION(dbplus_getunique) -{ - relf *r; - zval **relation, **uniqueid; - long l; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &uniqueid) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_getunique(r, &l, 1); - if(!stat) { - ZVAL_LONG(*uniqueid,l); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_info(int relation, string key, array &result) - ??? */ -PHP_FUNCTION(dbplus_info) -{ - zval **relation, **key, **result, *element; - relf *r; - register attribute *ap; - unsigned deg; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &relation, &key, &result) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - ap = r->r_atts; - deg = r->r_rel.rel_deg; - - convert_to_string_ex(key); - - zval_dtor(*result); - if (array_init(*result) == FAILURE) - RETURN_LONG(ERR_USER); - - if(!strcmp("atts", Z_STRVAL_PP(key))) { - do { - MAKE_STD_ZVAL(element); - - ZVAL_STRING(element, ap->att_name, 1); - - zend_hash_update(Z_ARRVAL_PP(result), - ap->att_name, - strlen(ap->att_name)+1, - (void *)&element, - sizeof(zval*), - NULL); - } while (ap++, deg--); - RETURN_LONG(ERR_NOERR); - } - - RETURN_LONG(ERR_USER); -} -/* }}} */ - -/* {{{ proto int dbplus_last(int relation, array tuple) - Gets last tuple from relation */ -PHP_FUNCTION(dbplus_last) -{ - zval **relation, **tname; - relf *r; - tuple t; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_last(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - - -/* {{{ proto int dbplus_lockrel(int relation) - Requests write lock on relation */ -PHP_FUNCTION(dbplus_lockrel) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_lockrel(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_next(int relation, array &tname) - Gets next tuple from relation */ -PHP_FUNCTION(dbplus_next) -{ - zval **relation, **tname; - relf *r; - tuple *t; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - if(r->r_sid = 9999) { - t = rnext(r); - stat = Acc_error; - } else { - t = (tuple *) pmalloc(sizeof(tuple)); - stat = cdb_next(r, t); - } - if(stat==ERR_NOERR) { - tuple2var(r, t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto resource dbplus_open(string name) - Opens a relation file */ -PHP_FUNCTION(dbplus_open) -{ - relf *r; - zval **tname; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(tname); - - r = cdb_open(Z_STRVAL_PP(tname), 1, 1); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto int dbplus_prev(int relation, array tuple) - Gets previous tuple from relation */ -PHP_FUNCTION(dbplus_prev) -{ - zval **relation, **tname; - relf *r; - tuple t; - int stat; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_previous(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_rchperm(int relation, int mask, string user, string group) - ??? */ -PHP_FUNCTION(dbplus_rchperm) -{ - relf *r; - zval **relation, **mask, **user, **group; - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &relation, &mask, &user, &group) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_long_ex(mask); - convert_to_string_ex(user); - convert_to_string_ex(group); - - RETURN_LONG(cdbRchperm(r, _INT(mask), _STRING(user), _STRING(group))); -} -/* }}} */ - -/* {{{ proto resource dbplus_rcreate(string name, mixed domlist [, int overwrite]) - Creates a new DB++ relation */ -PHP_FUNCTION(dbplus_rcreate) -{ - zval **name, **domlist, **overwrite; - relf *r=NULL; - int flag, ndoms, argc = ZEND_NUM_ARGS(); - attdef *at0; - - switch(argc) { - case 3: - if(zend_get_parameters_ex(3, &name, &domlist, &overwrite) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(overwrite); - flag=_INT(overwrite); - break; - case 2: - if(zend_get_parameters_ex(3, &name, &domlist) == FAILURE) { - WRONG_PARAM_COUNT; - } - flag=0; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(name); - - switch ( Z_TYPE_PP(domlist) ) { - case IS_STRING: - convert_to_string_ex(domlist); - break; - - case IS_ARRAY: - { - zval tmp; - ZVAL_STRING(&tmp," ",0); - php_implode(&tmp,*domlist,*domlist); - } - break; - - default: - } - - at0 = create2att(_STRING(domlist), &ndoms); - if (at0) { - r = cdbRcreate(_STRING(name), 0666, 0, ndoms, at0, flag); - dbxfree((char *) at0); - } - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto resource dbplus_rcrtexact(string name, resource relation [, boolean overwrite]) - Creates an exact but empty copy of a relation including indices */ -PHP_FUNCTION(dbplus_rcrtexact) -{ - zval **name, **relation, **overwrite; - relf *r; - int f,argc = ZEND_NUM_ARGS(); - - switch(argc) { - case 3: - if(zend_get_parameters_ex(3, &name, &relation, &overwrite) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(overwrite); - f=_INT(overwrite); - break; - case 2: - if(zend_get_parameters_ex(3, &name, &relation) == FAILURE) { - WRONG_PARAM_COUNT; - } - f=0; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(name); - DBPLUS_FETCH_RESOURCE(r, relation); - - r = cdbRcrtexact(_STRING(name), 0666, r, f); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto resource dbplus_rcrtlike(string name, int handle [, int overwrite]) - Creates an empty copy of a relation with default indices */ -PHP_FUNCTION(dbplus_rcrtlike) -{ - zval **name, **relation, **overwrite; - relf *r; - int f,argc = ZEND_NUM_ARGS(); - - switch(argc) { - case 3: - if(zend_get_parameters_ex(3, &name, &relation, &overwrite) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_long_ex(overwrite); - f=_INT(overwrite); - break; - case 2: - if(zend_get_parameters_ex(3, &name, &relation) == FAILURE) { - WRONG_PARAM_COUNT; - } - f=0; - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string_ex(name); - DBPLUS_FETCH_RESOURCE(r, relation); - - r = cdbRcrtlike(_STRING(name), 0666, 0, r, f); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto int dbplus_resolve(string name) - Resolves host information for relation */ -PHP_FUNCTION(dbplus_resolve) -{ - zval **name, *element; - char * host; - char * host_path; - int sid; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(name); - - sid = cdb_resolve(_STRING(name), &host, &host_path); - if (sid <= 0) - RETURN_FALSE; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - - MAKE_STD_ZVAL(element); Z_TYPE_P(element)=IS_NULL; - ZVAL_LONG(element,sid); - zend_hash_update(Z_ARRVAL_P(return_value), "sid", 4, - &element, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(element); Z_TYPE_P(element)=IS_NULL; - ZVAL_STRING(element,host,1); - zend_hash_update(Z_ARRVAL_P(return_value), "host", 5, - &element, sizeof(zval *), NULL); - - MAKE_STD_ZVAL(element); Z_TYPE_P(element)=IS_NULL; - ZVAL_STRING(element,host_path,1); - zend_hash_update(Z_ARRVAL_P(return_value), "host_path", 10, - &element, sizeof(zval *), NULL); -} -/* }}} */ - -/* {{{ proto int dbplus_restorepos(int relation, array tuple) - ??? */ -PHP_FUNCTION(dbplus_restorepos) -{ - zval **relation, **tname; - relf *r; - tuple t; - int stat; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - stat = cdb_next(r, &t); - if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); - } - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto resource dbplus_rkeys(resource relation, mixed domlist) - Defines primary key for relation -*/ -PHP_FUNCTION(dbplus_rkeys) -{ - relf *r, *rnew; - zval **relation, **domlist, **zdata; - int nkeys=0; - char *name=NULL, *keys[40]; /* TODO hardcoded magic number ??? */ - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &domlist) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - switch(Z_TYPE_PP(domlist)) { - case IS_ARRAY: - convert_to_array_ex(domlist); - for(zend_hash_internal_pointer_reset(_HASH(domlist)); - SUCCESS==zend_hash_get_current_data(_HASH(domlist), (void **)&zdata); - zend_hash_move_forward(_HASH(domlist))) { - if(Z_TYPE_PP(zdata)==IS_STRING) - keys[nkeys++] = _STRING(zdata); - else { - php_error(E_WARNING, "dbplus_rkeys: domlist array contains non-string value(s)"); - Acc_error = ERR_USER; - RETURN_FALSE; - } - } - break; - - case IS_STRING: - convert_to_string_ex(domlist); - keys[0] = _STRING(domlist); - nkeys = 1; - break; - - default: - php_error(E_WARNING, "dbplus_rkeys: domlist has to be of type string or an array of strings"); - Acc_error = ERR_USER; - RETURN_FALSE; - } - - rnew = cdbRkeys(r, nkeys, keys); - if(name) efree(name); - - if(rnew) { - /* TODO realy delete old relation resource ? */ -#if 0 - zend_list_delete(Z_LVAL_PP(relation)); -#endif - ZEND_REGISTER_RESOURCE(return_value, rnew, le_dbplus_relation); - } else { - /* TODO error reporting */ - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource dbplus_ropen(string name) - Opens relation file local */ -PHP_FUNCTION(dbplus_ropen) -{ - relf *r; - zval **tname; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &tname) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(tname); - - r = ropen(Z_STRVAL_PP(tname), 0, 0); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - r->r_sid = 9999; - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto resource dbplus_rquery(string name, string dbpath) - ??? */ -PHP_FUNCTION(dbplus_rquery) -{ - relf *r; - zval **name, **dbpath; - int argc = ZEND_NUM_ARGS(); - - if ((argc <1) || (argc>2) || (zend_get_parameters_ex(2, &name, &dbpath) == FAILURE)){ - WRONG_PARAM_COUNT; - } - - r = aql_exec(_STRING(name), (argc==2)?_STRING(dbpath):NULL); - - if(!r) { - /* TODO error handling */ - RETURN_FALSE; - } - - r->r_sid = 9999; - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto int dbplus_rrename(int relation, string name) - ??? */ -PHP_FUNCTION(dbplus_rrename) -{ - relf *r; - zval **relation, **name; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &name) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_string_ex(name); - - RETURN_LONG(cdbRrename(r, _STRING(name), 0)); -} -/* }}} */ - -/* {{{ proto resource dbplus_rsecindex(resource relation, mixed domlist, int compact) - Creates an additional index on relation */ -PHP_FUNCTION(dbplus_rsecindex) -{ - relf *r, *rnew; - zval **relation, **domlist, **compact, **zdata; - int nkeys=0; - char *name=NULL, *keys[40]; /* TODO hardcoded magic number ??? */ - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &relation, &domlist, &compact) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - switch ( Z_TYPE_PP(domlist) ) { - case IS_ARRAY: - convert_to_array_ex(domlist); - for(zend_hash_internal_pointer_reset(_HASH(domlist)); - SUCCESS==zend_hash_get_current_data(_HASH(domlist), (void **)&zdata); - zend_hash_move_forward(_HASH(domlist))) { - if(Z_TYPE_PP(zdata)==IS_STRING) - keys[nkeys++] = _STRING(zdata); - else { - php_error(E_WARNING, "dbplus_rsecindex: domlist array contains non-string value(s)"); - Acc_error = ERR_USER; - RETURN_FALSE; - } - } - break; - - case IS_STRING: - convert_to_string_ex(domlist); - keys[0] = _STRING(domlist); - nkeys = 1; - break; - - default: - php_error(E_WARNING, "dbplus_rsecindex: domlist has to be of type string or an array of strings"); - Acc_error = ERR_USER; - RETURN_FALSE; - } - - convert_to_long_ex(compact); - - rnew = cdbRsecindex(r, nkeys, keys, _INT(compact)); - if(name) efree(name); - - if(rnew) { - /* TODO realy delete old relation resource ? */ - zend_list_delete(Z_LVAL_PP(relation)); - - ZEND_REGISTER_RESOURCE(return_value, rnew, le_dbplus_relation); - } else { - /* TODO error reporting */ - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int dbplus_runlink(int relation) - Removes relation from filesystem */ -PHP_FUNCTION(dbplus_runlink) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdbRunlink(&r)); -} -/* }}} */ - -/* {{{ proto int dbplus_rzap(int relation, int truncate) - Removes all tuples from relation */ -PHP_FUNCTION(dbplus_rzap) -{ - - /* todo: optional argument */ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdbRzap(r, 1)); -} -/* }}} */ - -/* {{{ proto int dbplus_savepos(int relation) - ??? */ -PHP_FUNCTION(dbplus_savepos) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_savepos(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_setindex(int relation, string idx_name) - ??? */ -PHP_FUNCTION(dbplus_setindex) -{ - relf *r; - zval **relation, **idx_name; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &idx_name) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_string_ex(idx_name); - - RETURN_LONG(cdb_setindex(r, _STRING(idx_name))); -} -/* }}} */ - -/* {{{ proto int dbplus_setindexbynumber(int relation, int idx_number) - ??? */ -PHP_FUNCTION(dbplus_setindexbynumber) -{ - relf *r; - zval **relation, **idx_number; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &idx_number) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_long_ex(idx_number); - - RETURN_LONG(cdb_setindexbynumber(r, Z_LVAL_PP(idx_number))); -} -/* }}} */ - -/* {{{ proto resource dbplus_sql(string query, string server, string dbpath) - Performs SQL query */ -PHP_FUNCTION(dbplus_sql) -{ - int argc; - zval **query, **server, **dbpath; - relf *r; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &query, &server, &dbpath) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_string_ex(dbpath); - php_error(E_WARNING, "Arg dbpath: %s", _STRING(dbpath)); - /* Fall-through. */ - case 2: - convert_to_string_ex(server); - php_error(E_WARNING, "Arg server: %s", _STRING(server)); - /* Fall-through. */ - case 1: - convert_to_string_ex(query); - php_error(E_WARNING, "Arg query: %s", _STRING(query)); - break; - } - - r = cdb_sql((argc>=2)?_STRING(server):"localhost", - _STRING(query), - (argc==3)?_STRING(dbpath):NULL); - if(r == NULL) { - /* TODO error handling */ - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); -} -/* }}} */ - -/* {{{ proto string dbplus_tcl(int sid, string script) - Executes server side TCL code */ -PHP_FUNCTION(dbplus_tcl) -{ - zval **sid, **script; - char *ret; - int result_type; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &sid, &script) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(sid); - convert_to_string_ex(script); - - cdb_tcl(_INT(sid),_STRING(script),&ret,&result_type); - - if(ret) { - RETURN_STRING(ret,1); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int dbplus_tremove(int relation, array old [, array current]) - Removes tuple and return new current tuple */ -PHP_FUNCTION(dbplus_tremove) -{ - zval **relation, **old, **current; - enum errorcond stat = ERR_UNKNOWN; - relf *r; - tuple told, tcurr; - int argc; - - argc = ZEND_NUM_ARGS(); - if ( argc<2 || argc>3 || zend_get_parameters_ex(2, &relation, &old, ¤t) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_array_ex(old); - - if(var2tuple(r, old, &told)) - RETURN_LONG(ERR_UNKNOWN); - - stat=cdbTremove(r, &told, &tcurr); - - if((stat==ERR_NOERR) && (argc==3)) - tuple2var(r, &tcurr, current); - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_undo(int relation) - ??? */ -PHP_FUNCTION(dbplus_undo) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_undo(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_undoprepare(int relation) - ??? */ -PHP_FUNCTION(dbplus_undoprepare) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_undoprepare(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_unlockrel(int relation) - Gives up write lock on relation */ -PHP_FUNCTION(dbplus_unlockrel) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_unlockrel(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_unselect(int relation) - Removes constraint from relation */ -PHP_FUNCTION(dbplus_unselect) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_unselect(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_update(int relation, array old, array new) - Updates specified tuple in relation */ -PHP_FUNCTION(dbplus_update) -{ - zval **relation, **old, **new; - enum errorcond stat = ERR_UNKNOWN; - relf *r; - tuple told, tnew; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &relation, &old, &new) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - convert_to_array_ex(old); - convert_to_array_ex(new); - - if(var2tuple(r, old, &told)) - RETURN_LONG(ERR_UNKNOWN); - - if(var2tuple(r, new, &tnew)) - RETURN_LONG(ERR_UNKNOWN); - - stat=cdb_update(r, &told, &tnew); - - RETURN_LONG(stat); -} -/* }}} */ - -/* {{{ proto int dbplus_xlockrel(int relation) - Requests exclusive lock on relation */ -PHP_FUNCTION(dbplus_xlockrel) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_xlockrel(r)); -} -/* }}} */ - -/* {{{ proto int dbplus_xunlockrel(int relation) - Frees exclusive lock on relation */ -PHP_FUNCTION(dbplus_xunlockrel) -{ - relf *r; - zval **relation; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &relation) == FAILURE){ - WRONG_PARAM_COUNT; - } - - DBPLUS_FETCH_RESOURCE(r, relation); - - RETURN_LONG(cdb_xunlockrel(r)); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 2 - * c-basic-offset: 2 - * End: - */ diff --git a/ext/dbplus/php_dbplus.h b/ext/dbplus/php_dbplus.h deleted file mode 100644 index f2b417b9f55..00000000000 --- a/ext/dbplus/php_dbplus.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable 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_DBPLUS_H -#define PHP_DBPLUS_H - - -extern zend_module_entry dbplus_module_entry; -#define phpext_dbplus_ptr &dbplus_module_entry - -#ifdef PHP_WIN32 -#define PHP_DBPLUS_API __declspec(dllexport) -#else -#define PHP_DBPLUS_API -#endif - -PHP_MINIT_FUNCTION(dbplus); -PHP_MSHUTDOWN_FUNCTION(dbplus); -PHP_RINIT_FUNCTION(dbplus); -PHP_RSHUTDOWN_FUNCTION(dbplus); -PHP_MINFO_FUNCTION(dbplus); - -PHP_FUNCTION(dbplus_add); -PHP_FUNCTION(dbplus_aql); -PHP_FUNCTION(dbplus_chdir); -PHP_FUNCTION(dbplus_close); -PHP_FUNCTION(dbplus_curr); -PHP_FUNCTION(dbplus_errno); -PHP_FUNCTION(dbplus_errcode); -PHP_FUNCTION(dbplus_find); -PHP_FUNCTION(dbplus_first); -PHP_FUNCTION(dbplus_flush); -PHP_FUNCTION(dbplus_freealllocks); -PHP_FUNCTION(dbplus_freelock); -PHP_FUNCTION(dbplus_freerlocks); -PHP_FUNCTION(dbplus_getlock); -PHP_FUNCTION(dbplus_getunique); -PHP_FUNCTION(dbplus_info); -PHP_FUNCTION(dbplus_last); -PHP_FUNCTION(dbplus_next); -PHP_FUNCTION(dbplus_open); -PHP_FUNCTION(dbplus_prev); -PHP_FUNCTION(dbplus_rchperm); -PHP_FUNCTION(dbplus_rcreate); -PHP_FUNCTION(dbplus_rcrtexact); -PHP_FUNCTION(dbplus_rcrtlike); -PHP_FUNCTION(dbplus_resolve); -PHP_FUNCTION(dbplus_restorepos); -PHP_FUNCTION(dbplus_rkeys); -PHP_FUNCTION(dbplus_ropen); -PHP_FUNCTION(dbplus_rquery); -PHP_FUNCTION(dbplus_rrename); -PHP_FUNCTION(dbplus_rsecindex); -PHP_FUNCTION(dbplus_runlink); -PHP_FUNCTION(dbplus_rzap); -PHP_FUNCTION(dbplus_savepos); -PHP_FUNCTION(dbplus_setindex); -PHP_FUNCTION(dbplus_setindexbynumber); -PHP_FUNCTION(dbplus_sql); -PHP_FUNCTION(dbplus_tcl); -PHP_FUNCTION(dbplus_tremove); -PHP_FUNCTION(dbplus_undo); -PHP_FUNCTION(dbplus_undoprepare); -PHP_FUNCTION(dbplus_unlockrel); -PHP_FUNCTION(dbplus_unselect); -PHP_FUNCTION(dbplus_update); -PHP_FUNCTION(dbplus_xlockrel); -PHP_FUNCTION(dbplus_xunlockrel); - - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(dbplus) - int global_variable; -ZEND_END_MODULE_GLOBALS(dbplus) -*/ - -/* In every function that needs to use variables in php_dbplus_globals, - do call DBPLUSLS_FETCH(); after declaring other variables used by - that function, and always refer to them as DBPLUSG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define AG(v) TSRMG(dbplus_globals_id, php_dbplus_globals *, v) -#else -#define DBPLUSG(v) (dbplus_globals.v) -#endif - - -int le_dbplus_relation; -int le_dbplus_tuple; - -void dbplus_destruct_relation(zend_rsrc_list_entry *rsrc TSRMLS_DC); -void dbplus_destruct_tupel(zend_rsrc_list_entry *rsrc TSRMLS_DC); - - -#endif /* PHP_DBPLUS_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/dbplus/tests/001.phpt b/ext/dbplus/tests/001.phpt deleted file mode 100644 index 2c56768952d..00000000000 --- a/ext/dbplus/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for dbplus presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -dbplus extension is available \ No newline at end of file diff --git a/ext/dbx/CREDITS b/ext/dbx/CREDITS deleted file mode 100644 index efc04660a49..00000000000 --- 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 d98e33a42d5..00000000000 --- 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 8c5dc11ba8d..00000000000 --- a/ext/dbx/config.m4 +++ /dev/null @@ -1,10 +0,0 @@ -dnl -dnl $Id$ -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, $ext_shared) -fi diff --git a/ext/dbx/dbx.c b/ext/dbx/dbx.c deleted file mode 100644 index 3cd74ffae3d..00000000000 --- a/ext/dbx/dbx.c +++ /dev/null @@ -1,819 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 -/* 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" - -/* 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"); - } - 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; - return DBX_UNKNOWN; -} - -int split_dbx_handle_object(zval **dbx_object, zval ***pdbx_handle, zval ***pdbx_module, zval ***pdbx_database) -{ - 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; -} - -/* 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) { - zend_error(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 */ - -/* 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_error, 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_MINIT_FUNCTION(dbx) -{ - 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_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_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) -{ - 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.0.0"); - php_info_print_table_row(2, "supported databases", "MySQL
ODBC
PostgreSQL
Microsoft SQL Server
FrontBase
Oracle 8 (not really)
Sybase-CT"); - php_info_print_table_end(); -} - -/* - - 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]))) { - zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.\n", 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]))) { - zend_error(E_WARNING, "dbx: module '%s' not loaded.\n", Z_STRVAL_PP(arguments[0])); - return; - } - module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0])); - if (!module_identifier) { - zend_error(E_WARNING, "dbx: unsupported module '%s'.\n", 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); - } - - if (object_init(return_value) != SUCCESS) { - zend_error(E_ERROR, "dbx: unable to create resulting object..."); - FREE_ZVAL(dbx_module); - zval_dtor(db_name); /* to free stringvalue memory */ - FREE_ZVAL(db_name); - FREE_ZVAL(rv_dbx_handle); - RETURN_LONG(0); - } - - 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 bool 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)) { - zend_error(E_WARNING, "dbx_close: 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 [, long 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 info_flags; - zval *data; - zval **row_ptr; - 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_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database)) { - zend_error(E_WARNING, "dbx_query: not a valid dbx_handle-object..."); - RETURN_LONG(0); - } - /* default values */ - info_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; - /* parameter overrides */ - if (ZEND_NUM_ARGS()>2) { - convert_to_long_ex(arguments[2]); - info_flags = Z_LVAL_PP(arguments[2]); - /* fieldnames are needed for association! */ - if (info_flags & DBX_RESULT_ASSOC) { - info_flags |= DBX_RESULT_INFO; - } - } - 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) */ - if (object_init(return_value) != SUCCESS) { - zend_error(E_ERROR, "dbx_query: unable to create resulting object..."); - FREE_ZVAL(rv_result_handle); - RETURN_LONG(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); - /* init info property as array and add to return_value as a property */ - if (info_flags & DBX_RESULT_INFO) { - MAKE_STD_ZVAL(info); - if (array_init(info) != SUCCESS) { - zend_error(E_ERROR, "dbx_query: unable to create info-array for results..."); - FREE_ZVAL(info); - RETURN_LONG(0); - } - 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 */ - MAKE_STD_ZVAL(data); - if (array_init(data) != SUCCESS) { - zend_error(E_ERROR, "dbx_query: unable to create data-array for results..."); - FREE_ZVAL(data); - RETURN_LONG(0); - } - 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) { - zend_error(E_ERROR, "dbx_query: 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 (info_flags & DBX_RESULT_INFO) { - zval *info_row_name; - zval *info_row_type; - MAKE_STD_ZVAL(info_row_name); - MAKE_STD_ZVAL(info_row_type); - if (array_init(info_row_name) != SUCCESS) { - zend_error(E_ERROR, "dbx_query: unable to create info_row_name-array for results..."); - FREE_ZVAL(info_row_name); - FREE_ZVAL(info_row_type); - RETURN_LONG(0); - } - if (array_init(info_row_type) != SUCCESS) { - zend_error(E_ERROR, "dbx_query: unable to create info_row_type-array for results..."); - FREE_ZVAL(info_row_name); - FREE_ZVAL(info_row_type); - RETURN_LONG(0); - } - for (col_index=0; col_indexrefcount+=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); -} -/* }}} */ - -/* {{{ proto void 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)) { - zend_error(E_WARNING, "dbx_error: 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); -} -/* }}} */ - -/* - * 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_argumentsmax_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) { - zend_error(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) { - zend_error(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; - int result=0; - 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) { - zend_error(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) { - zend_error(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: zend_error(E_WARNING, "dbx_connect: OCI8 extension is still highly experimental!"); - 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); - } - zend_error(E_WARNING, "dbx_connect: 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: zend_error(E_WARNING, "dbx_pconnect: OCI8 extension is still highly experimental!"); - 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); - } - zend_error(E_WARNING, "dbx_pconnect: 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); - } - zend_error(E_WARNING, "dbx_close: 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); - } - zend_error(E_WARNING, "dbx_query: 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); - } - zend_error(E_WARNING, "dbx_getcolumncount: 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); - } - zend_error(E_WARNING, "dbx_getcolumnname: 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); - } - zend_error(E_WARNING, "dbx_getcolumntype: 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); - } - zend_error(E_WARNING, "dbx_getrow: 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); - } - zend_error(E_WARNING, "dbx_error: 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 d4f59514900..00000000000 --- a/ext/dbx/dbx.dsp +++ /dev/null @@ -1,173 +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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_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 php4ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_dbx.dll" /libpath:"..\..\Debug_TS" -# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /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_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_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 8bfb9fe73aa..00000000000 --- a/ext/dbx/dbx.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_DBX_H -#define ZEND_DBX_H - -#ifndef INIT_FUNC_ARGS -#include "zend_modules.h" -#endif - -#include "php.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_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 3ab8bbd232f..00000000000 --- a/ext/dbx/dbx_fbsql.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - | Frank M. Kromann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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; -} - -/* - * 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 e36504b0cba..00000000000 --- a/ext/dbx/dbx_fbsql.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - | Frank M. Kromann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 f905ed10bed..00000000000 --- a/ext/dbx/dbx_mssql.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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; -} - -/* - * 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 2051da357fe..00000000000 --- a/ext/dbx/dbx_mssql.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 b9873147b69..00000000000 --- a/ext/dbx/dbx_mysql.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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; -} - -/* - * 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 f9b14a1170b..00000000000 --- a/ext/dbx/dbx_mysql.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 4ee58e0e77a..00000000000 --- a/ext/dbx/dbx_oci8.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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, "OCILogon", &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, "OCIPLogon", &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 */ - int number_of_arguments=1; - zval **arguments[1]; - zval *returned_zval=NULL; - - arguments[0]=dbx_handle; - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogOff", &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; - - arguments[0]=dbx_handle; - arguments[1]=sql_statement; - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIParse", &returned_zval, number_of_arguments, arguments); - /* OCIParse 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, "OCIExecute", &execute_zval, number_of_arguments, arguments); - /* OCIExecute returns a bool for success or failure???? */ - if (!execute_zval || Z_TYPE_P(execute_zval)!=IS_BOOL) { - if (execute_zval) zval_ptr_dtor(&execute_zval); - zval_ptr_dtor(&returned_zval); - return 0; - } - MOVE_RETURNED_TO_RV(rv, returned_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, "OCINumCols", &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, "OCIColumnName", &returned_zval, number_of_arguments, arguments); - /* OCIColumnName 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, "OCIColumnType", &returned_zval, number_of_arguments, arguments); - /* OCIColumnType 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=3; - zval **arguments[3]; - zval *zval_resulttype=NULL; - zval *zval_returned_array=NULL; - zval *returned_zval=NULL; - - MAKE_STD_ZVAL(zval_resulttype); - ZVAL_LONG(zval_resulttype, OCI_NUM | OCI_RETURN_NULLS); /* no ASSOC, dbx handles that part */ - arguments[0]=result_handle; - arguments[1]=&zval_returned_array; - arguments[2]=&zval_resulttype; - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIFetchInto", &returned_zval, number_of_arguments, arguments); - /* OCIFetchInto returns an integer, but the actual array is passed back in arg[1] */ - /* I'm not sure how this will work, Thies, so this is something that should be especially tested! */ - if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL || Z_LVAL_P(returned_zval)==0) { - if (returned_zval) zval_ptr_dtor(&returned_zval); - FREE_ZVAL(zval_resulttype); - return 0; - } - FREE_ZVAL(zval_resulttype); - zval_ptr_dtor(&returned_zval); - MOVE_RETURNED_TO_RV(rv, zval_returned_array); - return 1; -} - -int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) -{ - /* returns string */ - 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, "OCIError", &returned_zval, number_of_arguments, arguments); - /* OCIError 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; -} - -/* - * 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 be483df6c4a..00000000000 --- a/ext/dbx/dbx_oci8.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 40f282b2bc9..00000000000 --- a/ext/dbx/dbx_odbc.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 exit_status=EG(exit_status); - - 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); - if (array_init(returned_zval) != SUCCESS) { - zend_error(E_ERROR, "dbx_odbc_getrow: unable to create result-array..."); - FREE_ZVAL(returned_zval); - return 0; - } - MAKE_STD_ZVAL(field_index_zval); - ZVAL_LONG(field_index_zval, 0); - number_of_arguments=2; - for (field_index=0; field_index | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 88e28816eef..00000000000 --- a/ext/dbx/dbx_pgsql.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "dbx.h" -#include "php_dbx.h" -#include "dbx_pgsql.h" -#include - -#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_exec", &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_numfields", &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_fieldname", &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_fieldtype", &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=2; - int save_error_reporting=0; - zval **arguments[2]; - zval *zval_row=NULL; - zval *returned_zval=NULL; - - MAKE_STD_ZVAL(zval_row); - ZVAL_LONG(zval_row, row_number); - arguments[0]=result_handle; - arguments[1]=&zval_row; - - if (EG(error_reporting) & E_WARNING){ - save_error_reporting = EG(error_reporting); - EG(error_reporting) &= ~E_WARNING; - } - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fetch_array", &returned_zval, number_of_arguments, arguments); - if (save_error_reporting) { - EG(error_reporting) = save_error_reporting; - } - if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { - if (returned_zval) zval_ptr_dtor(&returned_zval); - FREE_ZVAL(zval_row); - return 0; - } - FREE_ZVAL(zval_row); - 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_errormessage", &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; -} - -/* - * 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 8da190bdcbf..00000000000 --- a/ext/dbx/dbx_pgsql.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#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 */ - -#endif /* ZEND_DBX_PGSQL_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 7c51c33ebb2..00000000000 --- a/ext/dbx/dbx_sybasect.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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(returned_zval->value.obj.properties, "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(returned_zval->value.obj.properties, "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; -} - -/* - * 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 8b599c209a5..00000000000 --- a/ext/dbx/dbx_sybasect.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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 */ - -#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 9b1ba6e4f3a..00000000000 --- a/ext/dbx/howto_extend_dbx.html +++ /dev/null @@ -1,316 +0,0 @@ - - - -HOWTO extend dbx - - - - - - - - - - - -
-How-to code support for another database
-
-
-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 and ODBC, but it is not difficult to add support for more databases.
-
-The dbx module is found in de PHP ext/dbx folder. The support-code is found in the same folder
-
-To add support for module 'blabla' the following steps must be taken:
-1. the dbx.c source file must be extended to recognize module 'blabla' and switch to the 'blabla' functions.
-2. the files dbx_blabla.h and dbx_blabla.c must be created and edited to produce the required response.
-3. add the files from step 2 to the project.
-4. compile.
-5. enjoy.
-
-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)
-Help for step 1 and 2 is given below, bold text in code indicate the important bits.
-
-

-home
-

- -
-1. the dbx.c source file must be extended
-
-
-Define a module identifier and assign it a unique number. Include your header file here as well.
-
-// defines for supported databases
-#define DBX_UNKNOWN 0
-#define DBX_MYSQL 1
-#define DBX_ODBC 2
-#define DBX_BLABLA 3
-// includes for supported databases
-#include "dbx.h"
-#include "dbx_mysql.h"
-#include "dbx_odbc.h"
-#include "dbx_blabla.h"
-
-Add code to the module_identifier_exists function so DBX_BLABLA will be recognized:
-
-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_BLABLA: return module_exists("blabla");
-        }
-    return 0;
-    }
-
-Add code to the get_module_identifier function so your extension will be recognized:
-
-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("blabla", module_name)) return DBX_BLABLA;
-    return DBX_UNKNOWN;
-    }
-
-Add code for exposing the DBX_BLABLA constant to the world:
-
-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_BLABLA", DBX_BLABLA CONST_CS | CONST_PERSISTENT);
-
-    [...]
-
-    return SUCCESS;
-    }
-
-Add code for inclusion in the phpinfo() function (optional, but recommended):
-
-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");
-    php_info_print_table_row(2, "dbx support for BlaBla", "enabled");
-    php_info_print_table_end();
-    DISPLAY_INI_ENTRIES();
-}
-
-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:
-
-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)->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);
-        case DBX_BLABLA: return dbx_blabla_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
-        }
-    zend_error(E_WARNING, "dbx_connect: not supported in this module");
-    return 0;
-    }
-
-This should be done for all switch_dbx_XXXXX functions. They are listed below:
-
-int switch_dbx_connect(...);
-int switch_dbx_pconnect(...);
-int switch_dbx_close(...);
-int switch_dbx_query(...);
-int switch_dbx_getcolumncount(...);
-int switch_dbx_getcolumnname(...);
-int switch_dbx_getcolumntype(...);
-int switch_dbx_getrow(...);
-int switch_dbx_error(...);
-
-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.
-
-

-top
-

- -
-2. the files dbx_blabla.h and dbx_blabla.c
-
-
-The dbx_blabla.h and dbx_blabla.c file are created in the folder /ext/dbx.
-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.
-For the .h file, that's all.
-For the .c file, the fun has just started :-)
-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!
-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.
-

- 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.
-

-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, "mysql_connect", &returned_zval, number_of_arguments, arguments);
-    if (!returned_zval || returned_zval->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, "mysql_select_db", &select_db_zval, number_of_arguments, arguments);
-    zval_ptr_dtor(&select_db_zval);
-
-    return 1;
-    }
-
-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.
-The actual value that is of interest to the caller is returned in the rv 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.
-The parameters that are of interest to the function are located between the rv and INTERNAL_FUNCTION_PARAMETERS parameters, in this case it is a host name, a db name, a username and a password. 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'.
-To actually call a mysql module function, you can use dbx_call_any_function where you specify the function name (it is used twice in dbx_mysql_connect, see 'mysql_connect' and 'mysql_select_db', 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. returned_zval) parameter that you must declare locally. To actually return such a parameter, use the MOVE_RETURNED_TO_RV(rv, returned_zval) macro, which copies the values to rv and frees anything that may be left in returned_zval. Parameters that must be passed to the mysql-function are stored in the arguments 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 arguments array is defined 'zval **arguments[3]'). The number_of_arguments 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 zval_ptr_dtor, 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).
-

-OK, now the description of all functions that you should implement, and what is expected of them...
-

-int dbx_blabla_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on connect-failure and 1 on success
-// rv: connection handle as resource on success or nothing on failure
-
-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).
-What must be returned (in rv) is the link identifier that is returned from the blabla_connect function, in it's native form so the end-user can use $db->handle to call other blabla_* functions that expect this parameter.
-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!
-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.
-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.
-The username (string) and password (string) are used for authentication.
-
-int dbx_blabla_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, 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
-
-dbx_blabla_pconnect is identical to dbx_blabla_connect except that it will create a persistent connection.
-
-int dbx_blabla_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on close-failure and 1 on success
-// rv: 1 as bool on success or nothing on failure
-
-dbx_blabla_close closes an open connection, whether it was created persistently or not.
-What must be returned (in rv) is a boolean true that indicates when the connection was closed successfully. If it wasn't, no value is returned in rv.
-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.
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.
-
-int dbx_blabla_query(zval **rv, zval **dbx_handle, zval **sql_statement, 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
-
-dbx_blabla_query executes an SQL statement over the connection.
-What must be returned (in rv) 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->handle) can be used by the end-user to call other blabla_* functions that expect this parameter.
-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!
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.
-The sql_statement (string) can have any value.
-
-int dbx_blabla_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on query-failure and 1 on success
-// returns column-count as long on success or nothing on failure
-
-dbx_blabla_getcolumncount gets the number of fields that the query-result contains.
-What must be returned (in rv) is the number of fields as long from the query result specified by the result_handle.
-What must be returned from the function is a 1 on success and a 0 on failure.
-The result_handle is the same value that you returned from dbx_query.
-
-int dbx_blabla_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns column-name as string on success or nothing on failure
-
-dbx_blabla_getcolumnname gets the fieldname of the specified column.
-What must be returned (in rv) is the fieldname as string of the given column.
-What must be returned from the function is a 1 on success and a 0 on failure.
-The result_handle is the same value that you returned from dbx_query.
-The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].
-
-int dbx_blabla_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns column-type as string on success or nothing on failure
-
-dbx_blabla_getcolumnname gets the field type of the specified column.
-What must be returned (in rv) is the field type as string of the given column.
-What must be returned from the function is a 1 on success and a 0 on failure.
-The result_handle is the same value that you returned from dbx_query.
-The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].
-
-int dbx_blabla_getrow(zval **rv, zval **result_handle, long row_number, 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
-
-dbx_blabla_getrow gets the next row from the query-results.
-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.
-What must be returned (in rv) 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).
-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).
-The result_handle is the same value that you returned from dbx_query.
-
-int dbx_blabla_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
-// int: returns 0 on failure and 1 on success
-// returns error message as string
-
-dbx_blabla_error gets the error message from the last database call.
-What must be returned (in rv) is the error message as a string.
-What must be returned from the function is a 1 on success and a 0 on failure.
-The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.
-
-

-top
-

-

-

-For specifics or the finer details you can always refer to dbx_mysql.c and dbx_odbc.c to see everything in action.
-More Zend API documentation can be found at http://www.zend.com/apidoc.
-This document can be found at http://www.guidance.nl/php/dbx.
-
-

-top
-

- - - diff --git a/ext/dbx/php_dbx.h b/ext/dbx/php_dbx.h deleted file mode 100644 index d6e0286624a..00000000000 --- a/ext/dbx/php_dbx.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | dbx module version 1.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 2001 Guidance Rotterdam BV | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#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_error); - -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 2281426230f..00000000000 --- a/ext/dbx/tests/001.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Check for dbx presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---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 f9dff861559..00000000000 --- a/ext/dbx/tests/002.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DBX_CONSTANTS ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---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 03eec20ddf4..00000000000 --- a/ext/dbx/tests/003.phpt +++ /dev/null @@ -1,107 +0,0 @@ ---TEST-- -dbx_connect ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---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 80baa533743..00000000000 --- a/ext/dbx/tests/004.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -dbx_close ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---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 447fb3625ce..00000000000 --- a/ext/dbx/tests/005.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -dbx_query ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- -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"); - } - } - } - - // 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 -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 b4f29b51f82..00000000000 --- a/ext/dbx/tests/006.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -dbx_error ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---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 bfc8baa505f..00000000000 --- a/ext/dbx/tests/007.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -dbx_sort ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- -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 ac3f76fe94f..00000000000 --- a/ext/dbx/tests/008.phpt +++ /dev/null @@ -1,146 +0,0 @@ ---TEST-- -dbx_compare ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- -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/dbx_test.p b/ext/dbx/tests/dbx_test.p deleted file mode 100644 index 79418b20e07..00000000000 --- a/ext/dbx/tests/dbx_test.p +++ /dev/null @@ -1,62 +0,0 @@ - \ 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 316349df927..00000000000 --- 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 1bad104fbac..00000000000 --- 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/dio/EXPERIMENTAL b/ext/dio/EXPERIMENTAL deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ext/dio/config.m4 b/ext/dio/config.m4 deleted file mode 100644 index 59d24229e1f..00000000000 --- a/ext/dio/config.m4 +++ /dev/null @@ -1,10 +0,0 @@ -dnl -dnl $Id$ -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/dio.c b/ext/dio/dio.c deleted file mode 100644 index 7aa674c25b7..00000000000 --- a/ext/dio/dio.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -#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 -#include -#include -#include - -#define le_fd_name "Direct I/O File Descriptor" -static int le_fd; - -function_entry dio_functions[] = { - PHP_FE(dio_open, NULL) - PHP_FE(dio_truncate, NULL) - PHP_FE(dio_stat, NULL) - PHP_FE(dio_seek, NULL) - PHP_FE(dio_fcntl, NULL) - PHP_FE(dio_read, NULL) - PHP_FE(dio_write, NULL) - PHP_FE(dio_close, NULL) - {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; - close(f->fd); - free(f); -} - -#define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT) - -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); - RDIOC(O_NONBLOCK); - RDIOC(O_NDELAY); - RDIOC(O_SYNC); - RDIOC(O_NOCTTY); - 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); - - return SUCCESS; -} - -PHP_MINFO_FUNCTION(dio) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "dio support", "enabled"); - php_info_print_table_end(); -} - -static void new_php_fd(php_fd_t **f, int fd) -{ - *f = malloc(sizeof(php_fd_t)); - (*f)->fd = fd; -} - -/* {{{ 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; - int flags; - mode_t 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 (ZEND_NUM_ARGS() == 3) { - fd = open(file_name, flags, mode); - } - else { - fd = open(file_name, flags); - } - - if (fd == -1) { - php_error(E_WARNING, "%s(): cannot open file %s with flags %d and permissions %d: %s", - get_active_function_name(TSRMLS_C), file_name, flags, mode, strerror(errno)); - RETURN_FALSE; - } - - new_php_fd(&f, fd); - 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; - int 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); - - data = emalloc(bytes + 1); - res = read(f->fd, data, bytes); - if (res <= 0) { - RETURN_NULL(); - } - - 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; - size_t data_len; - size_t 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; - } - 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(E_WARNING, "%s(): cannot write data to file descriptor %d, %s", - get_active_function_name(TSRMLS_C), f->fd, strerror(errno)); - } - - RETURN_LONG(res); -} -/* }}} */ - -/* {{{ 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; - off_t 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(E_WARNING, "%s(): couldn't truncate %d to %d bytes: %s", - get_active_function_name(TSRMLS_C), f->fd, offset, strerror(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -#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(E_WARNING, "%s(): cannot stat %d: %s", - get_active_function_name(TSRMLS_C), 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); - ADD_FIELD("block_size", s.st_blksize); - ADD_FIELD("blocks", s.st_blocks); - 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; - off_t offset; - int 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)); -} -/* }}} */ - -/* {{{ 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; - int 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(E_WARNING, "%s() expects argument 3 to be array or int, none given", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - if (Z_TYPE_P(arg) == IS_ARRAY) { - fh = HASH_OF(arg); - if (zend_hash_find(fh, "start", 5, (void **) &element) == FAILURE) { - lk.l_start = 0; - } - else { - lk.l_start = Z_LVAL_PP(element); - } - - if (zend_hash_find(fh, "length", 6, (void **) &element) == FAILURE) { - lk.l_len = 0; - } - else { - lk.l_len = Z_LVAL_PP(element); - } - - if (zend_hash_find(fh, "whence", 6, (void **) &element) == FAILURE) { - lk.l_whence = 0; - } - else { - lk.l_whence = SEEK_SET; - } - - if (zend_hash_find(fh, "type", 6, (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(E_WARNING, "%s() expects argument 3 to be array or int, %s given", - get_active_function_name(TSRMLS_C), 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(E_WARNING, "%s() expects argument 3 to be int", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg))); - ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd); - break; - } - default: - if (!arg || Z_TYPE_P(arg) != IS_LONG) { - php_error(E_WARNING, "%s() expects argument 3 to be int", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - RETURN_LONG(fcntl(f->fd, cmd, Z_LVAL_P(arg))); - } -} -/* }}} */ - -/* {{{ 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/php_dio.h b/ext/dio/php_dio.h deleted file mode 100644 index 39408c655c4..00000000000 --- a/ext/dio/php_dio.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable 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); - -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 d527e1a961d..00000000000 --- a/ext/dio/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for dio presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -dio extension is available \ No newline at end of file diff --git a/ext/domxml/CREDITS b/ext/domxml/CREDITS deleted file mode 100644 index 368d09d4a59..00000000000 --- a/ext/domxml/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -domxml -Uwe Steinmann diff --git a/ext/domxml/EXPERIMENTAL b/ext/domxml/EXPERIMENTAL deleted file mode 100644 index 6443e996464..00000000000 --- a/ext/domxml/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/domxml/TODO b/ext/domxml/TODO deleted file mode 100644 index f379aaaf908..00000000000 --- a/ext/domxml/TODO +++ /dev/null @@ -1,17 +0,0 @@ -1) Implement the following list entries and thier destructors: - le_domxmldoctypep - le_domxmldtdp - le_domxmlcdatap - le_domxmlpip - le_domxmlcommentp - le_domxmlnotationp - le_domxmlentityrefp - -2) Use ZEND_FETCH_RESOURCE() macros instead of custom functions. -3) Implement those classes we really want, kill all of the rest. -4) Remove debug code (many calls to fprintf()). -5) Make 1st arg always be the object. This is currently half-and-half, or so. -6) Take a hard look at startup/shutdown code. This is really running slower than - it ought to be. -7) Fix the many, many memory leaks. -8) Modify new_child to allow creation of attribute, cdata, dtd, etc nodes. diff --git a/ext/domxml/config.m4 b/ext/domxml/config.m4 deleted file mode 100644 index 64556002f9d..00000000000 --- a/ext/domxml/config.m4 +++ /dev/null @@ -1,193 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN(PHP_DOM_CHECK_VERSION,[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$DOMXML_DIR/include$DOMXML_DIR_ADD - AC_MSG_CHECKING(for libxml version) - AC_EGREP_CPP(yes,[ - #include - #if LIBXML_VERSION >= 20402 - yes - #endif - ],[ - AC_MSG_RESULT(>= 2.4.2) - ],[ - AC_MSG_ERROR(libxml version 2.4.2 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS -]) - -PHP_ARG_WITH(dom, for DOM support, -[ --with-dom[=DIR] Include DOM support (requires libxml >= 2.4.2). - DIR is the libxml install directory.]) - -if test "$PHP_DOM" != "no"; then - - DOMXML_DIR_ADD="" - if test -r $PHP_DOM/include/libxml2/libxml/tree.h; then - DOMXML_DIR=$PHP_DOM - DOMXML_DIR_ADD="/libxml2" - elif test -r $PHP_DOM/include/libxml/tree.h; then - DOMXML_DIR=$PHP_DOM - else - for i in /usr/local /usr; do - test -r $i/include/libxml/tree.h && DOMXML_DIR=$i - test -r $i/include/libxml2/libxml/tree.h && DOMXML_DIR=$i && DOMXML_DIR_ADD="/libxml2" - done - fi - - if test -z "$DOMXML_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libxml >= 2.4.2 distribution) - fi - - PHP_DOM_CHECK_VERSION - - if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then - DOM_LIBNAME=xml2 - else - DOM_LIBNAME=xml - fi - - XML2_CONFIG=$DOMXML_DIR/bin/xml2-config - - if test -x $XML2_CONFIG; then - DOM_LIBS=`$XML2_CONFIG --libs` - PHP_EVAL_LIBLINE($DOM_LIBS, DOMXML_SHARED_LIBADD) - else - PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD) - fi - - PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD) - - if test "$PHP_ZLIB_DIR" = "no"; then - AC_MSG_ERROR(DOMXML requires ZLIB. Use --with-zlib-dir=) - else - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD) - fi - - AC_DEFINE(HAVE_DOMXML,1,[ ]) - PHP_NEW_EXTENSION(domxml, php_domxml.c, $ext_shared) - PHP_SUBST(DOMXML_SHARED_LIBADD) -fi - -AC_DEFUN(PHP_DOM_XSLT_CHECK_VERSION,[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$DOMXSLT_DIR/include - AC_MSG_CHECKING(for libxslt version) - AC_EGREP_CPP(yes,[ - #include - #if LIBXSLT_VERSION >= 10003 - yes - #endif - ],[ - AC_MSG_RESULT(>= 1.0.3) - ],[ - AC_MSG_ERROR(libxslt version 1.0.3 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS -]) - -AC_DEFUN(PHP_DOM_EXSLT_CHECK_VERSION,[ - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS=-I$DOMEXSLT_DIR/include - AC_MSG_CHECKING(for libexslt version) - AC_EGREP_CPP(yes,[ - #include - #if LIBEXSLT_VERSION >= 600 - yes - #endif - ],[ - AC_MSG_RESULT(>= 1.0.3) - ],[ - AC_MSG_ERROR(libxslt version 1.0.3 or greater required.) - ]) - CPPFLAGS=$old_CPPFLAGS -]) - -PHP_ARG_WITH(dom-xslt, for DOM XSLT support, -[ --with-dom-xslt[=DIR] Include DOM XSLT support (requires libxslt >= 1.0.3). - DIR is the libxslt install directory.]) - -PHP_ARG_WITH(dom-exslt, for DOM EXSLT support, -[ --with-dom-exslt[=DIR] Include DOM EXSLT support (requires libxslt >= 1.0.3). - DIR is the libexslt install directory.]) - -if test "$PHP_DOM_XSLT" != "no"; then - - if test -r $PHP_DOM_XSLT/include/libxslt/transform.h; then - DOMXSLT_DIR=$PHP_DOM_XSLT - else - for i in /usr/local /usr; do - test -r $i/include/libxslt/transform.h && DOMXSLT_DIR=$i - done - fi - - if test -z "$DOMXSLT_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution) - fi - - PHP_DOM_XSLT_CHECK_VERSION - - PHP_ADD_LIBRARY_WITH_PATH(xslt, $DOMXSLT_DIR/lib, DOMXML_SHARED_LIBADD) - - PHP_ADD_INCLUDE($DOMXSLT_DIR/include) - - if test "$PHP_DOM" = "no"; then - AC_MSG_ERROR(DOMXSLT requires DOMXML. Use --with-dom=) - fi - - if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then - DOM_LIBNAME=xml2 - else - DOM_LIBNAME=xml - fi - - PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD) - PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD) - - if test -f $DOMXML_DIR/lib/libxsltbreakpoint.a -o -f $DOMXML_DIR/lib/libxsltbreakpoint.$SHLIB_SUFFIX_NAME ; then - PHP_ADD_LIBRARY_WITH_PATH(xsltbreakpoint, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD) - fi - - AC_DEFINE(HAVE_DOMXSLT,1,[ ]) - - PHP_SUBST(DOMXML_SHARED_LIBADD) -fi - -if test "$PHP_DOM_EXSLT" != "no"; then - if test "$PHP_DOM" = "no"; then - AC_MSG_ERROR(DOMEXSLT requires DOMXML. Use --with-dom=) - fi - - if test "$PHP_DOM_XSLT" = "no"; then - AC_MSG_ERROR(DOMEXSLT requires DOMXSLT. Use --with-dom-xslt=) - fi - - if test -r $PHP_DOM_EXSLT/include/libexslt/exslt.h; then - DOMEXSLT_DIR=$PHP_DOM_EXSLT - else - for i in /usr/local /usr; do - test -r $i/include/libexslt/exslt.h && DOMEXSLT_DIR=$i - done - fi - - if test -z "$DOMEXSLT_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution) - fi - - PHP_DOM_EXSLT_CHECK_VERSION - - PHP_ADD_LIBRARY_WITH_PATH(exslt, $DOMEXSLT_DIR/lib, DOMXML_SHARED_LIBADD) - - PHP_ADD_INCLUDE($DOMEXSLT_DIR/include) - - AC_DEFINE(HAVE_DOMEXSLT,1,[ ]) - - PHP_SUBST(DOMXML_SHARED_LIBADD) - -fi diff --git a/ext/domxml/domxml.dsp b/ext/domxml/domxml.dsp deleted file mode 100644 index 40768294e9f..00000000000 --- a/ext/domxml/domxml.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="domxml" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=domxml - 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 "domxml.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 "domxml.mak" CFG="domxml - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "domxml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "domxml - 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)" == "domxml - 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_DOMXML" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D HAVE_DOMXML=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 libxml2.lib wsock32.lib php4ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "domxml - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOMXML" /D ZTS=1 /YX /FD /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 "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=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 php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 libxml2.lib php4ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "domxml - Win32 Release_TS" -# Name "domxml - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_domxml.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_domxml.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/domxml/php_domxml.c b/ext/domxml/php_domxml.c deleted file mode 100644 index 04b95e45ac1..00000000000 --- a/ext/domxml/php_domxml.c +++ /dev/null @@ -1,3828 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* TODO - * - Support Notation Nodes - * */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_domxml.h" - -#if HAVE_DOMXML -#include "ext/standard/info.h" -#define PHP_XPATH 1 -#define PHP_XPTR 2 - -/* General macros used by domxml */ -#define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret TSRMLS_CC))) { \ - php_error(E_WARNING, "%s(): cannot create required DOM object", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } - -#define DOMXML_RET_ZVAL(zval) SEPARATE_ZVAL(&zval); \ - *return_value = *zval; \ - FREE_ZVAL(zval); - -#define DOMXML_RET_OBJ(zval, obj, ret) DOMXML_DOMOBJ_NEW(zval, obj, ret); \ - DOMXML_RET_ZVAL(zval); - -#define DOMXML_GET_THIS(zval) if (NULL == (zval = getThis())) { \ - php_error(E_WARNING, "%s(): underlying object missing", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } - -#define DOMXML_GET_OBJ(ret, zval, le) if (NULL == (ret = php_dom_get_object(zval, le, 0 TSRMLS_CC))) { \ - php_error(E_WARNING, "%s(): cannot fetch DOM object", \ - get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } - -#define DOMXML_GET_THIS_OBJ(ret, zval, le) DOMXML_GET_THIS(zval); \ - DOMXML_GET_OBJ(ret, zval, le); - -#define DOMXML_NO_ARGS() if (ZEND_NUM_ARGS() != 0) { \ - php_error(E_WARNING, "%s() expects exactly 0 parameters, %d given", \ - get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); \ - return; \ - } - -#define DOMXML_NOT_IMPLEMENTED() php_error(E_WARNING, "%s() not yet implemented", \ - get_active_function_name(TSRMLS_C)); \ - return; - -/* WARNING: The number of parameters is actually the - * number of passed variables to zend_parse_parameters(), - * *NOT* the number of parameters expected by the PHP function. */ -#define DOMXML_PARAM_NONE(ret, zval, le) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &zval) == FAILURE) { \ - return; \ - } \ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -#define DOMXML_PARAM_ONE(ret, zval, le, s, p1) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1) == FAILURE) { \ - return; \ - } \ - } else { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1) == FAILURE) { \ - return; \ - } \ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -#define DOMXML_PARAM_TWO(ret, zval, le, s, p1, p2) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2) == FAILURE) { \ - return; \ - } \ - } else { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1, p2) == FAILURE) { \ - return; \ - } \ - } \ - DOMXML_GET_OBJ(ret, zval, le); - -#define DOMXML_PARAM_THREE(ret, zval, le, s, p1, p2, p3) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2, p3) == FAILURE) { \ - return; \ - } \ - } else { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1, p2, p3) == FAILURE) { \ - return; \ - } \ - } \ - DOMXML_GET_OBJ(ret, zval, le); - - -#define DOMXML_PARAM_FOUR(ret, zval, le, s, p1, p2, p3, p4) if (NULL == (zval = getThis())) { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o"s, &zval, p1, p2, p3, p4) == FAILURE) { \ - return; \ - } \ - } else { \ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, p1, p2, p3, p4) == FAILURE) { \ - return; \ - } \ - } \ - DOMXML_GET_OBJ(ret, zval, le); - - -static int le_domxmldocp; -static int le_domxmldoctypep; -static int le_domxmldtdp; -static int le_domxmlnodep; -static int le_domxmlelementp; -static int le_domxmlattrp; -static int le_domxmlcdatap; -static int le_domxmltextp; -static int le_domxmlpip; -static int le_domxmlcommentp; -static int le_domxmlnotationp; -/*static int le_domxmlentityp;*/ -static int le_domxmlentityrefp; -/*static int le_domxmlnsp;*/ -#if HAVE_DOMXSLT -static int le_domxsltstylesheetp; -#endif - -#if defined(LIBXML_XPATH_ENABLED) -static int le_xpathctxp; -static int le_xpathobjectp; -#endif - -zend_class_entry *domxmldoc_class_entry; -zend_class_entry *domxmldoctype_class_entry; -zend_class_entry *domxmlelement_class_entry; -zend_class_entry *domxmldtd_class_entry; -zend_class_entry *domxmlnode_class_entry; -zend_class_entry *domxmlattr_class_entry; -zend_class_entry *domxmlcdata_class_entry; -zend_class_entry *domxmltext_class_entry; -zend_class_entry *domxmlpi_class_entry; -zend_class_entry *domxmlcomment_class_entry; -zend_class_entry *domxmlnotation_class_entry; -zend_class_entry *domxmlentity_class_entry; -zend_class_entry *domxmlentityref_class_entry; -zend_class_entry *domxmlns_class_entry; -#if defined(LIBXML_XPATH_ENABLED) -zend_class_entry *xpathctx_class_entry; -zend_class_entry *xpathobject_class_entry; -#endif -#if HAVE_DOMXSLT -zend_class_entry *domxsltstylesheet_class_entry; -#endif - - -static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC); -static int node_children(zval **children, xmlNode *nodep TSRMLS_DC); - -static zend_function_entry domxml_functions[] = { - PHP_FE(domxml_version, NULL) - PHP_FE(xmldoc, NULL) - PHP_FE(xmldocfile, NULL) -#if defined(LIBXML_HTML_ENABLED) - PHP_FE(html_doc, NULL) - PHP_FE(html_doc_file, NULL) -#endif - PHP_FE(xmltree, NULL) - PHP_FE(domxml_substitute_entities_default, NULL) - PHP_FE(domxml_add_root, NULL) - PHP_FE(domxml_dump_mem, NULL) - PHP_FE(domxml_dump_mem_file, NULL) - PHP_FE(domxml_dump_node, NULL) -#if defined(LIBXML_HTML_ENABLED) - PHP_FE(domxml_html_dump_mem, NULL) -#endif - PHP_FE(domxml_node_attributes, NULL) - PHP_FE(domxml_elem_get_attribute, NULL) - PHP_FE(domxml_elem_set_attribute, NULL) - PHP_FE(domxml_node_children, NULL) - PHP_FE(domxml_node_has_attributes, NULL) - PHP_FE(domxml_node_new_child, NULL) - PHP_FE(domxml_node, NULL) - PHP_FE(domxml_node_unlink_node, NULL) - PHP_FE(domxml_node_set_content, NULL) - PHP_FE(domxml_node_get_content, NULL) - PHP_FE(domxml_new_xmldoc, NULL) - -#if defined(LIBXML_XPATH_ENABLED) - PHP_FE(xpath_new_context, NULL) - PHP_FE(xpath_eval, NULL) - PHP_FE(xpath_eval_expression, NULL) - PHP_FE(xpath_register_ns, NULL) - PHP_FE(domxml_doc_get_elements_by_tagname, NULL) - PHP_FE(domxml_doc_get_element_by_id, NULL) -#endif -#if defined(LIBXML_XPTR_ENABLED) - PHP_FE(xptr_new_context, NULL) - PHP_FE(xptr_eval, NULL) -#endif -#if HAVE_DOMXSLT - PHP_FE(domxml_xslt_version, NULL) - PHP_FE(domxml_xslt_stylesheet, NULL) - PHP_FE(domxml_xslt_stylesheet_doc, NULL) - PHP_FE(domxml_xslt_stylesheet_file, NULL) - PHP_FE(domxml_xslt_process, NULL) -#endif - - PHP_FALIAS(domxml_root, domxml_doc_document_element, NULL) - PHP_FALIAS(domxml_attributes, domxml_node_attributes, NULL) - PHP_FALIAS(domxml_get_attribute, domxml_elem_get_attribute, NULL) - PHP_FALIAS(domxml_getattr, domxml_elem_get_attribute, NULL) - PHP_FALIAS(domxml_set_attribute, domxml_elem_set_attribute, NULL) - PHP_FALIAS(domxml_setattr, domxml_elem_set_attribute, NULL) - PHP_FALIAS(domxml_children, domxml_node_children, NULL) - PHP_FALIAS(domxml_new_child, domxml_node_new_child, NULL) - PHP_FALIAS(domxml_unlink_node, domxml_node_unlink_node, NULL) - PHP_FALIAS(set_content, domxml_node_set_content, NULL) - PHP_FALIAS(new_xmldoc, domxml_new_xmldoc, NULL) - PHP_FALIAS(domxml_dumpmem, domxml_dump_mem, NULL) - - {NULL, NULL, NULL} -}; - - -static function_entry php_domxmldoc_class_functions[] = { -/* PHP_FALIAS(domdocument, xmldoc, NULL) */ - {"domdocument", PHP_FN(xmldoc), NULL}, - - PHP_FALIAS(doctype, domxml_doc_doctype, NULL) - PHP_FALIAS(implementation, domxml_doc_implementation, NULL) - PHP_FALIAS(root, domxml_doc_document_element, NULL) /* not DOM */ - PHP_FALIAS(document_element, domxml_doc_document_element, NULL) - PHP_FALIAS(create_element, domxml_doc_create_element, NULL) - PHP_FALIAS(create_text_node, domxml_doc_create_text_node, NULL) - PHP_FALIAS(create_comment, domxml_doc_create_comment, NULL) - PHP_FALIAS(create_attribute, domxml_doc_create_attribute, NULL) - PHP_FALIAS(create_cdata_section, domxml_doc_create_cdata_section, NULL) - PHP_FALIAS(create_entity_reference, domxml_doc_create_entity_reference, NULL) - PHP_FALIAS(create_processing_instruction, domxml_doc_create_processing_instruction, NULL) - PHP_FALIAS(children, domxml_node_children, NULL) - PHP_FALIAS(add_root, domxml_add_root, NULL) - PHP_FALIAS(imported_node, domxml_doc_imported_node, NULL) - PHP_FALIAS(dtd, domxml_intdtd, NULL) - PHP_FALIAS(dumpmem, domxml_dump_mem, NULL) - PHP_FALIAS(dump_mem, domxml_dump_mem, NULL) - PHP_FALIAS(dump_mem_file, domxml_dump_mem_file, NULL) -#if defined(LIBXML_HTML_ENABLED) - PHP_FALIAS(html_dump_mem, domxml_html_dump_mem, NULL) -#endif -#if defined(LIBXML_XPATH_ENABLED) - PHP_FALIAS(xpath_init, xpath_init, NULL) - PHP_FALIAS(xpath_new_context, xpath_new_context, NULL) - PHP_FALIAS(xptr_new_context, xptr_new_context, NULL) - PHP_FALIAS(get_elements_by_tagname, domxml_doc_get_elements_by_tagname, NULL) - PHP_FALIAS(get_element_by_id, domxml_doc_get_element_by_id, NULL) -#endif - {NULL, NULL, NULL} -}; - -static function_entry php_domxmldoctype_class_functions[] = { - PHP_FALIAS(name, domxml_doctype_name, NULL) -/* - PHP_FALIAS(entities, domxml_doctype_entities, NULL) - PHP_FALIAS(notations, domxml_doctype_notations, NULL) - PHP_FALIAS(system_id, domxml_doctype_system_id, NULL) - PHP_FALIAS(public_id, domxml_doctype_public_id, NULL) - PHP_FALIAS(internal_subset, domxml_doctype_internal_subset, NULL) -*/ - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmldtd_class_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlnode_class_functions[] = { - PHP_FALIAS(domnode, domxml_node, NULL) - PHP_FALIAS(first_child, domxml_node_first_child, NULL) - PHP_FALIAS(last_child, domxml_node_last_child, NULL) - PHP_FALIAS(add_child, domxml_node_add_child, NULL) - PHP_FALIAS(children, domxml_node_children, NULL) - PHP_FALIAS(child_nodes, domxml_node_children, NULL) - PHP_FALIAS(previous_sibling, domxml_node_previous_sibling, NULL) - PHP_FALIAS(next_sibling, domxml_node_next_sibling, NULL) - PHP_FALIAS(has_child_nodes, domxml_node_has_child_nodes, NULL) - PHP_FALIAS(prefix, domxml_node_prefix, NULL) - PHP_FALIAS(parent, domxml_node_parent, NULL) - PHP_FALIAS(parent_node, domxml_node_parent, NULL) - PHP_FALIAS(insert_before, domxml_node_insert_before, NULL) - PHP_FALIAS(append_child, domxml_node_append_child, NULL) - PHP_FALIAS(owner_document, domxml_node_owner_document, NULL) - PHP_FALIAS(new_child, domxml_node_new_child, NULL) - PHP_FALIAS(attributes, domxml_node_attributes, NULL) - PHP_FALIAS(has_attributes, domxml_node_has_attributes, NULL) - PHP_FALIAS(node, domxml_node, NULL) - PHP_FALIAS(unlink, domxml_node_unlink_node, NULL) - PHP_FALIAS(replace_node, domxml_node_replace_node, NULL) - PHP_FALIAS(set_content, domxml_node_set_content, NULL) - PHP_FALIAS(get_content, domxml_node_get_content, NULL) - PHP_FALIAS(text_concat, domxml_node_text_concat, NULL) - PHP_FALIAS(set_name, domxml_node_set_name, NULL) - PHP_FALIAS(node_name, domxml_node_name, NULL) - PHP_FALIAS(node_type, domxml_node_type, NULL) - PHP_FALIAS(node_value, domxml_node_value, NULL) - PHP_FALIAS(clone_node, domxml_clone_node, NULL) - PHP_FALIAS(is_blank_node, domxml_is_blank_node, NULL) - PHP_FALIAS(dump_node, domxml_dump_node, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlelement_class_functions[] = { - PHP_FALIAS(domelement, domxml_element, NULL) - PHP_FALIAS(name, domxml_elem_tagname, NULL) - PHP_FALIAS(tagname, domxml_elem_tagname, NULL) - PHP_FALIAS(get_attribute, domxml_elem_get_attribute, NULL) - PHP_FALIAS(set_attribute, domxml_elem_set_attribute, NULL) - PHP_FALIAS(remove_attribute, domxml_elem_remove_attribute, NULL) - PHP_FALIAS(get_attribute_node, domxml_elem_get_attribute_node, NULL) - PHP_FALIAS(set_attribute_node, domxml_elem_set_attribute_node, NULL) - PHP_FALIAS(get_elements_by_tagname, domxml_elem_get_elements_by_tagname, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlcdata_class_functions[] = { - PHP_FALIAS(length, domxml_cdata_length, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmltext_class_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlcomment_class_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlnotation_class_functions[] = { - PHP_FALIAS(public_id, domxml_notation_public_id, NULL) - PHP_FALIAS(system_id, domxml_notation_system_id, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlentityref_class_functions[] = { - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlentity_class_functions[] = { -/* - PHP_FALIAS(public_id, domxml_entity_public_id, NULL) - PHP_FALIAS(system_id, domxml_entity_system_id, NULL) - PHP_FALIAS(notation_name, domxml_entity_notation_name, NULL) -*/ - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlpi_class_functions[] = { - PHP_FALIAS(target, domxml_pi_target, NULL) - PHP_FALIAS(data, domxml_pi_data, NULL) - {NULL, NULL, NULL} -}; - -#if defined(LIBXML_XPATH_ENABLED) -static zend_function_entry php_xpathctx_class_functions[] = { - PHP_FALIAS(xpath_eval, xpath_eval, NULL) - PHP_FALIAS(xpath_eval_expression, xpath_eval_expression, NULL) - PHP_FALIAS(xpath_register_ns, xpath_register_ns, NULL) - {NULL, NULL, NULL} -}; - -static zend_function_entry php_xpathobject_class_functions[] = { - {NULL, NULL, NULL} -}; -#endif - -static zend_function_entry php_domxmlattr_class_functions[] = { - PHP_FALIAS(name, domxml_attr_name, NULL) - PHP_FALIAS(value, domxml_attr_value, NULL) - PHP_FALIAS(specified, domxml_attr_specified, NULL) -/* - PHP_FALIAS(owner_element, domxml_attr_owner_element, NULL) -*/ - {NULL, NULL, NULL} -}; - -static zend_function_entry php_domxmlns_class_functions[] = { - {NULL, NULL, NULL} -}; - -#if HAVE_DOMXSLT -static zend_function_entry php_domxsltstylesheet_class_functions[] = { -/* TODO: maybe some more methods? */ - PHP_FALIAS(process, domxml_xslt_process, NULL) - {NULL, NULL, NULL} -}; -#endif - -zend_module_entry domxml_module_entry = { - STANDARD_MODULE_HEADER, - "domxml", - domxml_functions, - PHP_MINIT(domxml), - NULL, - PHP_RINIT(domxml), - NULL, - PHP_MINFO(domxml), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_DOMXML -ZEND_GET_MODULE(domxml) -#endif - - -static void dom_object_set_data(void *obj, zval *wrapper) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Adding %s to hash\n", tmp); -*/ - ((xmlNodePtr) obj)->_private = wrapper; -} - - -static zval *dom_object_get_data(void *obj) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Trying getting %s from object ...", tmp); - if(((xmlNodePtr) obj)->_private) - fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); -*/ - return ((zval *) (((xmlNodePtr) obj)->_private)); -} - - -static inline void node_wrapper_dtor(xmlNodePtr node) -{ - zval *wrapper; - - // FIXME: type check probably unnecessary here? - if (!node || Z_TYPE_P(node) == XML_DTD_NODE) - return; - - wrapper = dom_object_get_data(node); - - if (wrapper) - zval_ptr_dtor(&wrapper); - -} - - -static inline void attr_list_wrapper_dtor(xmlAttrPtr attr) -{ - while (attr != NULL) { - node_wrapper_dtor((xmlNodePtr) attr); - attr = attr->next; - } -} - - -static inline void node_list_wrapper_dtor(xmlNodePtr node) -{ - while (node != NULL) { - node_list_wrapper_dtor(node->children); - switch (node->type) { - /* Skip property freeing for the following types */ - case XML_ATTRIBUTE_DECL: - case XML_DTD_NODE: - case XML_ENTITY_DECL: - break; - default: - attr_list_wrapper_dtor(node->properties); - } - node_wrapper_dtor(node); - node = node->next; - } -} - -static xmlNodeSetPtr php_get_elements_by_tagname(xmlNodePtr n, xmlChar* name) -{ - xmlNodeSetPtr rv = NULL; - xmlNodePtr cld = NULL; - - if ( n != NULL && name != NULL ) { - cld = n->children; - while ( cld != NULL ) { - if ( xmlStrcmp( name, cld->name ) == 0 ){ - if ( rv == NULL ) { - rv = xmlXPathNodeSetCreate( cld ) ; - } - else { - xmlXPathNodeSetAdd( rv, cld ); - } - } - cld = cld->next; - } - } - return rv; -} - -static void php_free_xml_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xmlDoc *doc = (xmlDoc *) rsrc->ptr; - - if (doc) { - node_list_wrapper_dtor(doc->children); - - node_wrapper_dtor((xmlNodePtr) doc); - xmlFreeDoc(doc); - } -} - - -static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xmlNodePtr node = (xmlNodePtr) rsrc->ptr; - - if (node) { - zval *wrapper = dom_object_get_data(node); - if (wrapper) - zval_ptr_dtor(&wrapper); - } -} - - -#if defined(LIBXML_XPATH_ENABLED) -static void php_free_xpath_context(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xmlXPathContextPtr ctx = (xmlXPathContextPtr) rsrc->ptr; - if (ctx) { - if (ctx->user) { - zval *wrapper = ctx->user; - zval_ptr_dtor(&wrapper); - } - xmlXPathFreeContext(ctx); - } -} - -static void php_free_xpath_object(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xmlXPathObjectPtr obj = (xmlXPathObjectPtr) rsrc->ptr; - - if (obj) { - if (obj->user) { - zval *wrapper = obj->user; - zval_ptr_dtor(&wrapper); - } - xmlXPathFreeObject(obj); - } -} -#endif - - -#if HAVE_DOMXSLT -static void php_free_xslt_stylesheet(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - xsltStylesheetPtr sheet = (xsltStylesheetPtr) rsrc->ptr; - - if (sheet) { - node_wrapper_dtor((xmlNodePtr) sheet); - xsltFreeStylesheet(sheet); - } -} - -static void xsltstylesheet_set_data(void *obj, zval *wrapper) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Adding %s to hash\n", tmp); -*/ - ((xsltStylesheetPtr) obj)->_private = wrapper; -} - - -static zval *xsltstylesheet_get_data(void *obj) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Trying getting %s from object ...", tmp); - if(((xmlNodePtr) obj)->_private) - fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); -*/ - return ((zval *) (((xsltStylesheetPtr) obj)->_private)); -} - -void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) -{ - void *obj; - zval **handle; - int type; - - if (NULL == wrapper) { - php_error(E_WARNING, "xsltstylesheet_get_object() invalid wrapper object passed"); - return NULL; - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { - php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return obj; -} - -static void php_xsltstylesheet_set_object(zval *wrapper, void *obj, int rsrc_type) -{ - zval *handle, *addr; - - MAKE_STD_ZVAL(handle); - Z_TYPE_P(handle) = IS_LONG; - Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) obj; - - zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL); - zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL); - zval_add_ref(&wrapper); - xsltstylesheet_set_data(obj, wrapper); -} -#endif /* HAVE_DOMXSLT */ - - -void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) -{ - void *obj; - zval **handle; - int type; - - if (NULL == wrapper) { - php_error(E_WARNING, "php_xpath_get_object() invalid wrapper object passed"); - return NULL; - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { - php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return obj; -} - - -static void xpath_object_set_data(void *obj, zval *wrapper) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Adding %s to hash\n", tmp); -*/ - ((xmlXPathObjectPtr) obj)->user = wrapper; -} - - -static zval *xpath_object_get_data(void *obj) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Trying getting %s from hash ...", tmp); - if(((xmlXPathObjectPtr) obj)->user) - fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); -*/ - return ((zval *) (((xmlXPathObjectPtr) obj)->user)); -} - - -static void php_xpath_set_object(zval *wrapper, void *obj, int rsrc_type) -{ - zval *handle, *addr; - - MAKE_STD_ZVAL(handle); - Z_TYPE_P(handle) = IS_LONG; - Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) obj; - - zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL); - zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL); - zval_add_ref(&wrapper); - xpath_object_set_data(obj, wrapper); -} - -static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found TSRMLS_DC) -{ - zval *wrapper; - - if (! found) { - *found = 0; - } - - if (!obj) { - MAKE_STD_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) xpath_object_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - MAKE_STD_ZVAL(wrapper); - object_init_ex(wrapper, xpathobject_class_entry); - -/* - rsrc_type = le_xpathobjectp; - php_xpath_set_object(wrapper, (void *) obj, rsrc_type); -*/ - - php_xpath_set_object(wrapper, (void *) obj, le_xpathobjectp); - - return (wrapper); -} - -void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) -{ - void *obj; - zval **handle; - int type; - - if (NULL == wrapper) { - php_error(E_WARNING, "php_xpath_get_context() invalid wrapper object passed"); - return NULL; - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == - FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - if (!obj || ((type != rsrc_type1) && (type != rsrc_type2))) { - php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return obj; -} - -static void xpath_context_set_data(void *obj, zval *wrapper) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Adding %s to hash\n", tmp); -*/ - ((xmlXPathContextPtr) obj)->user = (void *) wrapper; -} - -static zval *xpath_context_get_data(void *obj) -{ -/* - char tmp[20]; - sprintf(tmp, "%08X", obj); - fprintf(stderr, "Trying getting %s from hash ...", tmp); - if(((xmlXPathContextPtr) obj)->user) - fprintf(stderr, " found\n"); - else - fprintf(stderr, " not found\n"); -*/ - return ((zval *) (((xmlXPathContextPtr) obj)->user)); -} - -static void php_xpath_set_context(zval *wrapper, void *obj, int rsrc_type) -{ - zval *handle, *addr; - - MAKE_STD_ZVAL(handle); - Z_TYPE_P(handle) = IS_LONG; - Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) obj; - - zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL); - zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL); - zval_add_ref(&wrapper); - xpath_context_set_data(obj, wrapper); -} - -static zval *php_xpathcontext_new(xmlXPathContextPtr obj, int *found TSRMLS_DC) -{ - zval *wrapper; - int rsrc_type; - - if (! found) { - *found = 0; - } - - if (!obj) { - MAKE_STD_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) xpath_context_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - MAKE_STD_ZVAL(wrapper); -/* - fprintf(stderr, "Adding new XPath Context\n"); -*/ - object_init_ex(wrapper, xpathctx_class_entry); - rsrc_type = le_xpathctxp; - php_xpath_set_context(wrapper, (void *) obj, rsrc_type); - - return (wrapper); -} - - -void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC) -{ - void *obj; - zval **handle; - int type; - - if (NULL == wrapper) { - php_error(E_WARNING, "php_dom_get_object() invalid wrapper object passed"); - return NULL; - } - - if (Z_TYPE_P(wrapper) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); - return NULL; - } - - if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); - return NULL; - } - - obj = zend_list_find(Z_LVAL_PP(handle), &type); - -/* The following test should be replaced with search in all parents */ - if (!obj) { /* || ((type != rsrc_type1) && (type != rsrc_type2))) { */ - php_error(E_WARNING, "%s(): underlying object missing or of invalid type", get_active_function_name(TSRMLS_C)); - return NULL; - } - - return obj; -} - - -static void php_dom_set_object(zval *wrapper, void *obj, int rsrc_type) -{ - zval *handle, *addr; - - MAKE_STD_ZVAL(handle); - Z_TYPE_P(handle) = IS_LONG; - Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type); - - MAKE_STD_ZVAL(addr); - Z_TYPE_P(addr) = IS_LONG; - Z_LVAL_P(addr) = (int) obj; - - zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL); - zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL); - zval_add_ref(&wrapper); - dom_object_set_data(obj, wrapper); -} - - -static zval *php_domobject_new(xmlNodePtr obj, int *found TSRMLS_DC) -{ - zval *wrapper; - char *content; - int rsrc_type; - - if (! found) { - *found = 0; - } - - if (!obj) { - MAKE_STD_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) dom_object_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - MAKE_STD_ZVAL(wrapper); - - switch (Z_TYPE_P(obj)) { - - case XML_ELEMENT_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlelement_class_entry); - rsrc_type = le_domxmlelementp; - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "tagname", (char *) nodep->name, strlen(nodep->name), 1); - break; - } - - case XML_TEXT_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmltext_class_entry); - rsrc_type = le_domxmltextp; - content = xmlNodeGetContent(nodep); - if (content) { - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); - } - break; - } - - case XML_COMMENT_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlcomment_class_entry); - rsrc_type = le_domxmlcommentp; - content = xmlNodeGetContent(nodep); - if (content) { - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); - } - break; - } - - case XML_PI_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlpi_class_entry); - rsrc_type = le_domxmlpip; - content = xmlNodeGetContent(nodep); - add_property_stringl(wrapper, "target", (char *) nodep->name, strlen(nodep->name), 1); - if (content) - add_property_stringl(wrapper, "data", (char *) content, strlen(content), 1); - break; - } - - case XML_ENTITY_REF_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlentityref_class_entry); - rsrc_type = le_domxmlentityrefp; - add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1); - break; - } - - case XML_ENTITY_DECL: - case XML_ELEMENT_DECL: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlnode_class_entry); - rsrc_type = le_domxmlnodep; - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1); - if (Z_TYPE_P(obj) == XML_ENTITY_REF_NODE) { - content = xmlNodeGetContent(nodep); - if (content) - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); - } - break; - } - - case XML_ATTRIBUTE_NODE: - { - xmlAttrPtr attrp = (xmlAttrPtr) obj; - object_init_ex(wrapper, domxmlattr_class_entry); - rsrc_type = le_domxmlattrp; - add_property_stringl(wrapper, "name", (char *) attrp->name, strlen(attrp->name), 1); - add_property_long(wrapper, "type", Z_TYPE_P(attrp)); - content = xmlNodeGetContent((xmlNodePtr) attrp); - if (content) - add_property_stringl(wrapper, "value", (char *) content, strlen(content), 1); - break; - } - - case XML_DOCUMENT_NODE: - case XML_HTML_DOCUMENT_NODE: - { - xmlDocPtr docp = (xmlDocPtr) obj; - - object_init_ex(wrapper, domxmldoc_class_entry); - rsrc_type = le_domxmldocp; - if (docp->name) - add_property_stringl(wrapper, "name", (char *) docp->name, strlen(docp->name), 1); - else - add_property_stringl(wrapper, "name", "", 0, 1); - if (docp->URL) - add_property_stringl(wrapper, "url", (char *) docp->URL, strlen(docp->URL), 1); - else - add_property_stringl(wrapper, "url", "", 0, 1); - if (docp->version) - add_property_stringl(wrapper, "version", (char *) docp->version, strlen(docp->version), 1); - else - add_property_stringl(wrapper, "version", "", 0, 1); - if (docp->encoding) - add_property_stringl(wrapper, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); - add_property_long(wrapper, "standalone", docp->standalone); - add_property_long(wrapper, "type", Z_TYPE_P(docp)); - add_property_long(wrapper, "compression", docp->compression); - add_property_long(wrapper, "charset", docp->charset); - break; - } - - case XML_DTD_NODE: - { - xmlDtdPtr dtd = (xmlDtdPtr) obj; - object_init_ex(wrapper, domxmldtd_class_entry); - rsrc_type = le_domxmldtdp; - add_property_long(wrapper, "type", Z_TYPE_P(dtd)); - if (dtd->ExternalID) - add_property_string(wrapper, "publicId", (char *) dtd->ExternalID, 1); - if (dtd->SystemID) - add_property_string(wrapper, "systemId", (char *) dtd->SystemID, 1); - if (dtd->name) - add_property_string(wrapper, "name", (char *) dtd->name, 1); - break; - } - - case XML_CDATA_SECTION_NODE: - { - xmlNodePtr nodep = obj; - object_init_ex(wrapper, domxmlcdata_class_entry); - rsrc_type = le_domxmlcdatap; - content = xmlNodeGetContent(nodep); - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - if (content) - add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1); - break; - } - - default: - php_error(E_WARNING, "%s(): unsupported node type: %d\n", get_active_function_name(TSRMLS_C), Z_TYPE_P(obj)); - FREE_ZVAL(wrapper); - return NULL; - } - - php_dom_set_object(wrapper, (void *) obj, rsrc_type); - return (wrapper); -} - - -static void domxml_error(void *ctx, const char *msg, ...) -{ - char buf[1024]; - va_list ap; - va_start(ap, msg); - vsnprintf(buf, 1024, msg, ap); - va_end(ap); - php_error(E_WARNING, buf); -} - - -PHP_RINIT_FUNCTION(domxml) -{ - return SUCCESS; -} - - -PHP_MINIT_FUNCTION(domxml) -{ - zend_class_entry ce; - - le_domxmldocp = zend_register_list_destructors_ex(php_free_xml_doc, NULL, "domdocument", module_number); - /* Freeing the document contains freeing the complete tree. - Therefore nodes, attributes etc. may not be freed seperately. - */ - le_domxmlnodep = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domnode", module_number); - le_domxmlcommentp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domnode", module_number); - le_domxmlattrp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domattribute", module_number); - le_domxmltextp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domtext", module_number); - le_domxmlelementp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domelement", module_number); - le_domxmldtdp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domdtd", module_number); - le_domxmlcdatap = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcdata", module_number); - le_domxmlentityrefp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domentityref", module_number); - le_domxmlpip = zend_register_list_destructors_ex(php_free_xml_node, NULL, "dompi", module_number); - - /* Not yet initialized le_*s */ - le_domxmldoctypep = -10000; - le_domxmlnotationp = -10003; - -#if defined(LIBXML_XPATH_ENABLED) - le_xpathctxp = zend_register_list_destructors_ex(php_free_xpath_context, NULL, "xpathcontext", module_number); - le_xpathobjectp = zend_register_list_destructors_ex(php_free_xpath_object, NULL, "xpathobject", module_number); -#endif - -/* le_domxmlnsp = register_list_destructors(NULL, NULL); */ - -#if HAVE_DOMXSLT - le_domxsltstylesheetp = zend_register_list_destructors_ex(php_free_xslt_stylesheet, NULL, "xsltstylesheet", module_number); -#endif - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNode", php_domxmlnode_class_functions, NULL, NULL, NULL); - domxmlnode_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomDocument", php_domxmldoc_class_functions, NULL, NULL, NULL); - domxmldoc_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomDocumentType", php_domxmldoctype_class_functions, NULL, NULL, NULL); - domxmldoctype_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "Dtd", php_domxmldtd_class_functions, NULL, NULL, NULL); - domxmldtd_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomElement", php_domxmlelement_class_functions, NULL, NULL, NULL); - domxmlelement_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomAttribute", php_domxmlattr_class_functions, NULL, NULL, NULL); - domxmlattr_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomCData", php_domxmlcdata_class_functions, NULL, NULL, NULL); - domxmlcdata_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomText", php_domxmltext_class_functions, NULL, NULL, NULL); - domxmltext_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomComment", php_domxmlcomment_class_functions, NULL, NULL, NULL); - domxmlcomment_class_entry = zend_register_internal_class_ex(&ce, domxmlcdata_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomProcessingInstruction", php_domxmlpi_class_functions, NULL, NULL, NULL); - domxmlpi_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNotation", php_domxmlnotation_class_functions, NULL, NULL, NULL); - domxmlnotation_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomEntity", php_domxmlentity_class_functions, NULL, NULL, NULL); - domxmlentity_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomEntityReference", php_domxmlentityref_class_functions, NULL, NULL, NULL); - domxmlentityref_class_entry = zend_register_internal_class_ex(&ce, domxmlnode_class_entry, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "DomNamespace", php_domxmlns_class_functions, NULL, NULL, NULL); - domxmlns_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - -#if defined(LIBXML_XPATH_ENABLED) - INIT_OVERLOADED_CLASS_ENTRY(ce, "XPathContext", php_xpathctx_class_functions, NULL, NULL, NULL); - xpathctx_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - - INIT_OVERLOADED_CLASS_ENTRY(ce, "XPathObject", php_xpathobject_class_functions, NULL, NULL, NULL); - xpathobject_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); -#endif - -#if HAVE_DOMXSLT - INIT_OVERLOADED_CLASS_ENTRY(ce, "XsltStylesheet", php_domxsltstylesheet_class_functions, NULL, NULL, NULL); - domxsltstylesheet_class_entry = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); -#endif - - REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NODE", XML_ATTRIBUTE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_TEXT_NODE", XML_TEXT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_CDATA_SECTION_NODE", XML_CDATA_SECTION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_REF_NODE", XML_ENTITY_REF_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_NODE", XML_ENTITY_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_PI_NODE", XML_PI_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_COMMENT_NODE", XML_COMMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_NODE", XML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_TYPE_NODE", XML_DOCUMENT_TYPE_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DOCUMENT_FRAG_NODE", XML_DOCUMENT_FRAG_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NOTATION_NODE", XML_NOTATION_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_HTML_DOCUMENT_NODE", XML_HTML_DOCUMENT_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_DTD_NODE", XML_DTD_NODE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ELEMENT_DECL_NODE", XML_ELEMENT_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_DECL_NODE", XML_ATTRIBUTE_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ENTITY_DECL_NODE", XML_ENTITY_DECL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_NAMESPACE_DECL_NODE", XML_NAMESPACE_DECL, CONST_CS | CONST_PERSISTENT); -#ifdef XML_GLOBAL_NAMESPACE - REGISTER_LONG_CONSTANT("XML_GLOBAL_NAMESPACE", XML_GLOBAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); -#endif - REGISTER_LONG_CONSTANT("XML_LOCAL_NAMESPACE", XML_LOCAL_NAMESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_CDATA", XML_ATTRIBUTE_CDATA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ID", XML_ATTRIBUTE_ID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREF", XML_ATTRIBUTE_IDREF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_IDREFS", XML_ATTRIBUTE_IDREFS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENTITY", XML_ATTRIBUTE_ENTITIES, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKEN", XML_ATTRIBUTE_NMTOKEN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NMTOKENS", XML_ATTRIBUTE_NMTOKENS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT); - -#if defined(LIBXML_XPATH_ENABLED) - REGISTER_LONG_CONSTANT("XPATH_UNDEFINED", XPATH_UNDEFINED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_NODESET", XPATH_NODESET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_BOOLEAN", XPATH_BOOLEAN, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_NUMBER", XPATH_NUMBER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_STRING", XPATH_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_POINT", XPATH_POINT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_RANGE", XPATH_RANGE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_LOCATIONSET", XPATH_LOCATIONSET, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XPATH_USERS", XPATH_USERS, CONST_CS | CONST_PERSISTENT); -#endif - - xmlSetGenericErrorFunc(xmlGenericErrorContext, (xmlGenericErrorFunc)domxml_error); -#if HAVE_DOMXSLT - xsltSetGenericErrorFunc(xsltGenericErrorContext, (xmlGenericErrorFunc)domxml_error); -#if HAVE_DOMEXSLT - exsltRegisterAll(); -#endif -#endif - - - return SUCCESS; -} - - -/* {{{ proto int domxml_test(int id) - Unity function for testing */ -PHP_FUNCTION(domxml_test) -{ - zval *id; - - if ((ZEND_NUM_ARGS() != 1) || getParameters(ht, 1, &id) == FAILURE) - WRONG_PARAM_COUNT; - - convert_to_long(id); - RETURN_LONG(Z_LVAL_P(id)); -} -/* }}} */ - - -PHP_MINFO_FUNCTION(domxml) -{ - /* don't know why that line was commented out in the previous version, so i left it (cmv) */ - php_info_print_table_start(); - php_info_print_table_row(2, "DOM/XML", "enabled"); - php_info_print_table_row(2, "libxml Version", LIBXML_DOTTED_VERSION); -#if defined(LIBXML_HTML_ENABLED) - php_info_print_table_row(2, "HTML Support", "enabled"); -#endif -#if defined(LIBXML_XPATH_ENABLED) - php_info_print_table_row(2, "XPath Support", "enabled"); -#endif -#if defined(LIBXML_XPTR_ENABLED) - php_info_print_table_row(2, "XPointer Support", "enabled"); -#endif -#if HAVE_DOMXSLT - php_info_print_table_row(2, "DOM/XSLT", "enabled"); - php_info_print_table_row(2, "libxslt Version", LIBXSLT_DOTTED_VERSION); -#if HAVE_DOMEXSLT - php_info_print_table_row(2, "DOM/EXSLT", "enabled"); - php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION); -#endif -#endif - - php_info_print_table_end(); -} - -/* {{{ Methods of Class DomAttribute */ - -/* {{{ proto array domxml_attr_name(void) - Returns list of attribute names - Notice: domxml_node_name() does exactly the same for attribute-nodes, - is this function here still needed, or would an alias be enough? - */ -PHP_FUNCTION(domxml_attr_name) -{ - zval *id; - xmlAttrPtr attrp; - - DOMXML_GET_THIS_OBJ(attrp, id,le_domxmlattrp); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) (attrp->name), 1); -} -/* }}} */ - -/* {{{ proto array domxml_attr_value(void) - Returns list of attribute names */ -PHP_FUNCTION(domxml_attr_value) -{ - zval *id; - xmlAttrPtr attrp; - - DOMXML_GET_THIS_OBJ(attrp, id, le_domxmlattrp); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1); -} -/* }}} */ - -/* {{{ proto array domxml_attr_specified(void) - Returns list of attribute names */ -PHP_FUNCTION(domxml_attr_specified) -{ - zval *id; - xmlAttrPtr attrp; - - DOMXML_NOT_IMPLEMENTED(); - - id = getThis(); - attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* End of Methods DomAttr }}} */ - - -/* {{{ Methods of Class DomProcessingInstruction */ - -/* {{{ proto array domxml_pi_target(void) - Returns target of pi */ -PHP_FUNCTION(domxml_pi_target) -{ - zval *id; - xmlNodePtr nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlpip); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) nodep->name, 1); -} -/* }}} */ - -/* {{{ proto array domxml_pi_data(void) - Returns data of pi */ -PHP_FUNCTION(domxml_pi_data) -{ - zval *id; - xmlNodePtr nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlpip); - - DOMXML_NO_ARGS(); - - RETURN_STRING(xmlNodeGetContent(nodep), 1); -} -/* }}} */ - -/* End of Methods of DomProcessingInstruction }}} */ - - -/* {{{ Methods of Class DomCData */ - -/* {{{ proto array domxml_cdata_length(void) - Returns list of attribute names */ -PHP_FUNCTION(domxml_cdata_length) -{ - zval *id; - xmlNodePtr nodep; - - DOMXML_NOT_IMPLEMENTED(); - - id = getThis(); - nodep = php_dom_get_object(id, le_domxmlcdatap, 0 TSRMLS_CC); - - RETURN_LONG(1); -} -/* }}} */ - -/* End of Methods DomCDdata }}} */ - - -/* {{{ Methods of Class DomNode */ - -/* {{{ proto object domxml_node(string name) - Creates node */ -PHP_FUNCTION(domxml_node) -{ - zval *rv; - xmlNode *node; - int ret, name_len; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - node = xmlNewNode(NULL, name); - if (!node) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_name(void) - Returns name of node */ -PHP_FUNCTION(domxml_node_name) -{ - zval *id; - xmlNode *n; - const char *str = NULL; - - DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - switch (Z_TYPE_P(n)) { - case XML_ELEMENT_NODE: - str = n->name; - break; - - case XML_TEXT_NODE: - str = "#text"; - break; - - case XML_ATTRIBUTE_NODE: - str = n->name; - break; - - case XML_CDATA_SECTION_NODE: - str = "#cdata-section"; - break; - - case XML_ENTITY_REF_NODE: - str = n->name; - break; - - case XML_ENTITY_NODE: - str = NULL; - break; - - case XML_PI_NODE: - str = n->name; - break; - - case XML_COMMENT_NODE: - str = "#comment"; - break; - - case XML_DOCUMENT_NODE: - str = "#document"; - break; - - case XML_DOCUMENT_FRAG_NODE: - str = "#document-fragment"; - break; - - default: - str = NULL; - break; - } - - if(str != NULL) { - RETURN_STRING((char *) str, 1); - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto object domxml_node_value(void) - Returns name of value */ -PHP_FUNCTION(domxml_node_value) -{ - zval *id; - xmlNode *n; - char *str = NULL; - - DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - switch (Z_TYPE_P(n)) { - case XML_TEXT_NODE: - case XML_COMMENT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - str = n->content; - break; - default: - str = NULL; - break; - } - if(str != NULL) { - RETURN_STRING((char *) str, 1); - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto bool domxml_is_blank_node(void) - Returns true if node is blank */ -PHP_FUNCTION(domxml_is_blank_node) -{ - zval *id; - xmlNode *n; - - DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - if(xmlIsBlankNode(n)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int domxml_node_type(void) - Returns the type of the node */ -PHP_FUNCTION(domxml_node_type) -{ - zval *id; - xmlNode *node; - - DOMXML_GET_THIS_OBJ(node, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - RETURN_LONG(node->type); -} -/* }}} */ - -/* {{{ proto bool domxml_clone_node(void) - Clones a node */ -PHP_FUNCTION(domxml_clone_node) -{ - zval *rv; - zval *id; - xmlNode *n, *node; - int ret, recursive = 0;; - - DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &recursive) == FAILURE) { - return; - } - - node = xmlCopyNode(n, recursive); - if (!node) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_first_child(void) - Returns first child from list of children */ -PHP_FUNCTION(domxml_node_first_child) -{ - zval *id, *rv; - xmlNode *nodep, *first; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - first = nodep->children; - if (!first) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, first, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_last_child(void) - Returns last child from list of children */ -PHP_FUNCTION(domxml_node_last_child) -{ - zval *id, *rv; - xmlNode *nodep, *last; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - last = nodep->last; - if (!last) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, last, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_next_sibling(void) - Returns next child from list of children */ -PHP_FUNCTION(domxml_node_next_sibling) -{ - zval *id, *rv; - xmlNode *nodep, *first; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - first = nodep->next; - if (!first) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, first, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_previous_sibling(void) - Returns previous child from list of children */ -PHP_FUNCTION(domxml_node_previous_sibling) -{ - zval *id, *rv; - xmlNode *nodep, *first; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - first = nodep->prev; - if (!first) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, first, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_owner_document(void) - Returns document this node belongs to */ -PHP_FUNCTION(domxml_node_owner_document) -{ - zval *id, *rv; - xmlNode *nodep; - xmlDocPtr docp; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - docp = nodep->doc; - if (!docp) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_has_child_nodes(void) - Returns true if node has children */ -PHP_FUNCTION(domxml_node_has_child_nodes) -{ - zval *id; - xmlNode *nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - if (nodep->children) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object domxml_node_has_attributes(void) - Returns true if node has attributes */ -PHP_FUNCTION(domxml_node_has_attributes) -{ - zval *id; - xmlNode *nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - if (Z_TYPE_P(nodep) != XML_ELEMENT_NODE) - RETURN_FALSE; - - if (nodep->properties) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto object domxml_node_prefix(void) - Returns namespace prefix of node */ -PHP_FUNCTION(domxml_node_prefix) -{ - zval *id; - xmlNode *nodep; - xmlNsPtr ns; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - ns = nodep->ns; - if (!ns) { - RETURN_EMPTY_STRING(); - } - - if (ns->prefix) { - RETURN_STRING((char *) (ns->prefix), 1); - } else { - RETURN_EMPTY_STRING(); - } -} -/* }}} */ - -/* {{{ proto object domxml_node_parent(void) - Returns parent of node */ -PHP_FUNCTION(domxml_node_parent) -{ - zval *id, *rv; - xmlNode *nodep, *last; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - DOMXML_NO_ARGS(); - - last = nodep->parent; - if (!last) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, last, &ret); -} -/* }}} */ - -/* {{{ proto array domxml_node_children(void) - Returns list of children nodes */ -PHP_FUNCTION(domxml_node_children) -{ - zval *id; - xmlNode *nodep, *last; - int ret; - - DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - - /* Even if the nodep is a XML_DOCUMENT_NODE the type is at the - same position. - */ - if ((Z_TYPE_P(nodep) == XML_DOCUMENT_NODE) || (Z_TYPE_P(nodep) == XML_HTML_DOCUMENT_NODE)) - last = ((xmlDoc *) nodep)->children; - else - last = nodep->children; - if (!last) { - RETURN_FALSE; - } - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - while (last) { - zval *child; - child = php_domobject_new(last, &ret TSRMLS_CC); - add_next_index_zval(return_value, child); - last = last->next; - } -} -/* }}} */ - -/* {{{ proto void domxml_node_unlink_node([object node]) - Deletes the node */ -PHP_FUNCTION(domxml_node_unlink_node) -{ - zval *id; - xmlNode *nodep; - - DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - - xmlUnlinkNode(nodep); - /* This causes a Segmentation Fault for some reason. Removing - it allows the user to re-add the node at some other time, in - addition to fixing the segfault. Node will be freed at - shutdown. */ - /*xmlFreeNode(nodep); - zval_dtor(id);*/ /* This is not enough because the children won't be deleted */ -} -/* }}} */ - -/* {{{ proto object domxml_node_add_child(object domnode) - Adds existing node to parent node */ -PHP_FUNCTION(domxml_node_add_child) -{ - zval *id, *rv, *node; - xmlNodePtr child, nodep, new_child; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { - return; - } - - DOMXML_GET_OBJ(child, node, le_domxmlnodep); - - if (child->type == XML_ATTRIBUTE_NODE) { - php_error(E_WARNING, "%s(): can't add attribute node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - if (NULL == (new_child = xmlCopyNode(child, 1))) { - php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - child = xmlAddChild(nodep, new_child); - - if (NULL == child) { - php_error(E_WARNING, "%s(): couldn't add child", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, child, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_replace_node(object domnode) - Replaces one node with another node */ -PHP_FUNCTION(domxml_node_replace_node) -{ - zval *id, *rv, *node; - xmlNodePtr repnode, nodep, new_repnode; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { - return; - } - - DOMXML_GET_OBJ(repnode, node, le_domxmlnodep); - - if (NULL == (new_repnode = xmlCopyNode(repnode, 1))) { - php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - repnode = xmlReplaceNode(nodep, new_repnode); - - DOMXML_RET_OBJ(rv, repnode, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_append_child(object domnode) - Adds node to list of children */ -PHP_FUNCTION(domxml_node_append_child) -{ - zval *id, *rv, *node; - xmlNodePtr child, nodep, new_child; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) { - return; - } - - DOMXML_GET_OBJ(child, node, le_domxmlnodep); - - if (child->type == XML_ATTRIBUTE_NODE) { - php_error(E_WARNING, "%s(): can't append attribute node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - if (NULL == (new_child = xmlCopyNode(child, 1))) { - php_error(E_WARNING, "%s(): unable to clone node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - // FIXME reverted xmlAddChildList; crashes - child = xmlAddSibling(nodep, new_child); - - if (NULL == child) { - php_error(E_WARNING, "%s(): couldn't append node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, child, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_node_insert_before(object newnode, object refnode) - Adds node in list of nodes before given node */ -PHP_FUNCTION(domxml_node_insert_before) -{ - zval *id, *rv, *node, *ref; - xmlNodePtr child, nodep, refp; - int ret; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oo", &node, &ref) == FAILURE) { - return; - } - - DOMXML_GET_OBJ(child, node, le_domxmlnodep); - DOMXML_GET_OBJ(refp, ref, le_domxmlnodep); - - child = xmlAddPrevSibling(refp, child); - - if (NULL == child) { - php_error(E_WARNING, "%s(): couldn't add newnode as the previous sibling of refnode", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, child, &ret); -} -/* }}} */ - -/* {{{ proto bool domxml_node_set_name(string name) - Sets name of a node */ -PHP_FUNCTION(domxml_node_set_name) -{ - zval *id; - xmlNode *nodep; - int name_len; - char *name; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - xmlNodeSetName(nodep, name); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array domxml_node_attributes(void) - Returns list of attributes of node */ -PHP_FUNCTION(domxml_node_attributes) -{ - zval *id, *attrs; - xmlNode *nodep; -#ifdef oldstyle_for_libxml_1_8_7 - xmlAttr *attr; -#endif - - DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - - if (node_attributes(&attrs, nodep TSRMLS_CC) < 0) - RETURN_FALSE; - - *return_value = *attrs; - FREE_ZVAL(attrs); - -#ifdef oldstyle_for_libxml_1_8_7 - attr = nodep->properties; - if (!attr) { - RETURN_FALSE; - } - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - while (attr) { - add_assoc_string(return_value, (char *) attr->name, xmlNodeGetContent(attr), 1); - attr = attr->next; - } -#endif -} -/* }}} */ - -/* {{{ proto object domxml_node_new_child(string name, string content) - Adds child node to parent node */ -PHP_FUNCTION(domxml_node_new_child) -{ - zval *id, *rv; - xmlNodePtr child, nodep; - int ret, name_len, content_len; - char *name, *content = NULL; - - DOMXML_PARAM_FOUR(nodep, id, le_domxmlnodep, "s|s", &name, &name_len, &content, &content_len); - - child = xmlNewChild(nodep, NULL, name, content); - - if (!child) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, child, &ret); -} -/* }}} */ - -/* {{{ proto bool domxml_node_set_content(string content) - Sets content of a node */ -PHP_FUNCTION(domxml_node_set_content) -{ - zval *id; - xmlNode *nodep; - int content_len; - char *content; - - DOMXML_PARAM_TWO(nodep, id, le_domxmlnodep, "s", &content, &content_len); - - // FIXME: another gotcha. If node has children, calling - // xmlNodeSetContent will remove the children -> we loose the zval's - // To prevent crash, append content if children are set - if (nodep->children) { - xmlNodeAddContentLen(nodep, content, content_len); - } else { - xmlNodeSetContentLen(nodep, content, content_len); - } - - /* FIXME: Actually the property 'content' of the node has to be updated - as well. Since 'content' should disappear sooner or later and being - replaces by a function 'content()' I skip this for now - */ - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string domxml_node_get_content() - Gets content of a node. - - "Read the value of a node, this can be either the text carried directly by -this node if it's a TEXT node or the aggregate string of the values carried by -this node child's (TEXT and ENTITY_REF). Entity references are substituted." - */ -PHP_FUNCTION(domxml_node_get_content) -{ - zval *id; - xmlNode *nodep; - xmlChar *mem; - - DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep); - mem = xmlNodeGetContent(nodep); - if (!mem) { - RETURN_FALSE; - } - - RETURN_STRING(mem,1); -} -/* }}} */ - - -/* End of Methods DomNode }}} */ - - -/* {{{ Methods of Class DomNotation */ - -/* {{{ proto string domxml_notation_public_id(void) - Returns public id of notation node */ -PHP_FUNCTION(domxml_notation_public_id) -{ - zval *id; - xmlNotationPtr nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnotationp); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) (nodep->PublicID), 1); -} -/* }}} */ - -/* {{{ proto string domxml_notation_system_id(void) - Returns system ID of notation node */ -PHP_FUNCTION(domxml_notation_system_id) -{ - zval *id; - xmlNotationPtr nodep; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnotationp); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) (nodep->SystemID), 1); -} -/* }}} */ - -/* End of Methods DomNotation }}} */ - - -/* {{{ Methods of Class DomElement */ - -/* {{{ proto object domxml_element(string name) - Constructor of DomElement */ -PHP_FUNCTION(domxml_element) -{ - zval *rv; - xmlNode *node; - int ret, name_len; - char *name; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - node = xmlNewNode(NULL, name); - if (!node) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, node, &ret); -} - -/* }}} */ - -/* {{{ proto string domxml_elem_tagname(void) - Returns tag name of element node */ -PHP_FUNCTION(domxml_elem_tagname) -{ - zval *id; - xmlNode *nodep; - - DOMXML_NO_ARGS(); - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlelementp); - - DOMXML_NO_ARGS(); - - RETURN_STRING((char *) (nodep->name), 1); -} -/* }}} */ - -/* {{{ proto string domxml_elem_get_attribute(string attrname) - Returns value of given attribute */ -PHP_FUNCTION(domxml_elem_get_attribute) -{ - zval *id; - xmlNode *nodep; - char *name, *value; - int name_len; - - DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len); - - value = xmlGetProp(nodep, name); - if (!value) { - RETURN_EMPTY_STRING(); - } else { - RETURN_STRING(value, 1); - } -} -/* }}} */ - -/* {{{ proto bool domxml_elem_set_attribute(string attrname, string value) - Sets value of given attribute */ -PHP_FUNCTION(domxml_elem_set_attribute) -{ - zval *id, *rv; - xmlNode *nodep; - xmlAttr *attr; - int ret, name_len, value_len; - char *name, *value; - - DOMXML_PARAM_FOUR(nodep, id, le_domxmlelementp, "ss", &name, &name_len, &value, &value_len); - - attr = xmlSetProp(nodep, name, value); - if (!attr) { - php_error(E_WARNING, "%s(): no such attribute '%s'", get_active_function_name(TSRMLS_C), name); - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) attr, &ret); -} -/* }}} */ - -/* {{{ proto string domxml_elem_remove_attribute(string attrname) - Removes given attribute */ -PHP_FUNCTION(domxml_elem_remove_attribute) -{ - zval *id; - xmlNode *nodep; - xmlAttr *attrp; - int name_len; - char *name; - - DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len); - attrp = xmlHasProp(nodep,name); - if (attrp == NULL) - { - RETURN_FALSE; - } - xmlUnlinkNode((xmlNodePtr)attrp); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string domxml_elem_get_attribute_node(string attrname) - Returns value of given attribute */ -PHP_FUNCTION(domxml_elem_get_attribute_node) -{ - zval *id, *rv; - xmlNode *nodep; - xmlAttr *attrp; - int name_len, ret; - char *name; - - DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len); - attrp = xmlHasProp(nodep,name); - if (attrp == NULL) - { - RETURN_FALSE; - } - DOMXML_RET_OBJ(rv, (xmlNodePtr) attrp, &ret); -} -/* }}} */ - -/* {{{ proto bool domxml_elem_set_attribute_node(int attr) - Sets value of given attribute */ -PHP_FUNCTION(domxml_elem_set_attribute_node) -{ - zval *id, *arg1; - xmlNode *nodep; - xmlAttr *attrp; - - DOMXML_NOT_IMPLEMENTED(); - - if ((ZEND_NUM_ARGS() == 1) && getParameters(ht, 1, &arg1) == SUCCESS) { - id = getThis(); - nodep = php_dom_get_object(id, le_domxmlelementp, 0 TSRMLS_CC); - attrp = php_dom_get_object(arg1, le_domxmlattrp, 0 TSRMLS_CC); - } else { - WRONG_PARAM_COUNT; - } - - /* FIXME: not implemented */ - - RETURN_TRUE; -} -/* }}} */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ proto string domxml_doc_get_elements_by_tagname(string tagname [,object xpathctx_handle] ) - Returns array with nodes with given tagname in document or empty array, if not found*/ -PHP_FUNCTION(domxml_doc_get_elements_by_tagname) -{ - zval *id, *rv, *contextnode = NULL,*ctxpin = NULL; - xmlXPathContextPtr ctxp; - xmlDocPtr docp; - - xmlXPathObjectPtr xpathobjp; - xmlNode *contextnodep; - int name_len; - char *str,*name; - - contextnode = NULL; - contextnodep = NULL; - - DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|oo", &name, &name_len,&ctxpin,&contextnodep); - - /* if no xpath_context was submitted, create a new one */ - if (ctxpin == NULL) { - ctxp = xmlXPathNewContext(docp); - } else { - DOMXML_GET_OBJ(ctxp, ctxpin, le_xpathctxp); - } - - if (contextnode) { - DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep); - } - ctxp->node = contextnodep; - str = (char*) emalloc((name_len+3) * sizeof(char)) ; - if (str == NULL) { - php_error(E_WARNING, "%s(): cannot allocate memory for string", get_active_function_name(TSRMLS_C)); - } - sprintf(str ,"//%s",name); - - xpathobjp = xmlXPathEval(str, ctxp); - efree(str); - ctxp->node = NULL; - if (!xpathobjp) { - RETURN_FALSE; - } - MAKE_STD_ZVAL(rv); - - if(array_init(rv) != SUCCESS) - { - php_error(E_WARNING, "%s(): cannot create required array", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - switch (Z_TYPE_P(xpathobjp)) { - - case XPATH_NODESET: - { - int i; - xmlNodeSetPtr nodesetp; - - if (NULL == (nodesetp = xpathobjp->nodesetval)) { - zval_dtor(rv); - RETURN_FALSE; - } - - for (i = 0; i < nodesetp->nodeNr; i++) { - xmlNodePtr node = nodesetp->nodeTab[i]; - zval *child; - int retnode; - - /* construct a node object */ - child = php_domobject_new(node, &retnode TSRMLS_CC); - zend_hash_next_index_insert(Z_ARRVAL_P(rv), &child, sizeof(zval *), NULL); - } - - break; - } - default: - break; - } - - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto string domxml_doc_get_element_by_id(string id [,object xpathctx_handle] ) - Returns element for given id or false if not found */ -PHP_FUNCTION(domxml_doc_get_element_by_id) -{ - zval *id, *rv, *contextnode = NULL, *ctxpin = NULL; - xmlXPathContextPtr ctxp ; - xmlDocPtr docp; - - xmlXPathObjectPtr xpathobjp; - xmlNode *contextnodep; - int name_len; - char *str, *name; - - contextnode = NULL; - contextnodep = NULL; - - DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|oo", &name, &name_len,&ctxpin,&contextnodep); - - /* if no xpath_context was submitted, create a new one */ - if (ctxpin == NULL) { - ctxp = xmlXPathNewContext(docp); - } else { - DOMXML_GET_OBJ(ctxp, ctxpin, le_xpathctxp); - } - - if (contextnode) { - DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep); - } - ctxp->node = contextnodep; - str = (char*) emalloc((name_len+14) * sizeof(char)) ; - if (str == NULL) { - php_error(E_WARNING, "%s(): cannot allocate memory for string", get_active_function_name(TSRMLS_C)); - } - sprintf(str ,"//*[@ID = '%s']",name); - xpathobjp = xmlXPathEval(str, ctxp); - efree(str); - ctxp->node = NULL; - if (!xpathobjp) { - RETURN_FALSE; - } - - switch (Z_TYPE_P(xpathobjp)) { - - case XPATH_NODESET: - { - xmlNodeSetPtr nodesetp; - - if (NULL == (nodesetp = xpathobjp->nodesetval)) { - zval_dtor(rv); - RETURN_FALSE; - } - - if (nodesetp->nodeNr > 0) { - xmlNodePtr node = nodesetp->nodeTab[0]; - int retnode; - rv = php_domobject_new(node, &retnode TSRMLS_CC); - SEPARATE_ZVAL(&rv); - } - else { - /*return false, if no nodes were found */ - RETURN_FALSE; - } - - break; - } - default: - break; - } - - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ -#endif - -/* {{{ proto string domxml_elem_get_elements_by_tagname(string tagname) - Returns array with nodes with given tagname in element or empty array, if not found */ -PHP_FUNCTION(domxml_elem_get_elements_by_tagname) -{ - zval *id,*rv; - xmlNode *nodep; - int name_len,i; - char *name; - xmlNodeSet *nodesetp; - - DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len); - - MAKE_STD_ZVAL(rv); - - if(array_init(rv) != SUCCESS) { - php_error(E_WARNING, "%s(): cannot create required array", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - nodesetp = php_get_elements_by_tagname(nodep,name); - - if(nodesetp) { - for (i = 0; i < nodesetp->nodeNr; i++) { - xmlNodePtr node = nodesetp->nodeTab[i]; - zval *child; - int retnode; - - child = php_domobject_new(node, &retnode TSRMLS_CC); - zend_hash_next_index_insert(Z_ARRVAL_P(rv), &child, sizeof(zval *), NULL); - } - } - *return_value = *rv; - FREE_ZVAL(rv); - -} -/* }}} */ - -/* End of Methods DomElement }}} */ - - -/* {{{ Methods of Class DomDocumentType */ - -/* {{{ proto array domxml_doctype_name(void) - Returns name of DocumentType */ -PHP_FUNCTION(domxml_doctype_name) -{ - zval *id; - xmlNodePtr attrp; - - DOMXML_NO_ARGS(); - - DOMXML_GET_THIS_OBJ(attrp, id, le_domxmldoctypep); - - RETURN_STRING((char *) (attrp->name), 1); -} -/* }}} */ - -/* End of Methods DomElementType }}} */ - - -/* {{{ Methods of Class DomDocument */ - -/* {{{ proto object domxml_doc_doctype(void) - Returns DomDocumentType */ -PHP_FUNCTION(domxml_doc_doctype) -{ - zval *id, *rv; - xmlDtdPtr dtd; - xmlDocPtr docp; - int ret; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - DOMXML_NO_ARGS(); - - dtd = xmlGetIntSubset(docp); - - DOMXML_RET_OBJ(rv, (xmlNodePtr) dtd, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_implementation(void) - Returns DomeDOMImplementation */ -PHP_FUNCTION(domxml_doc_implementation) -{ -/* zval *id; - xmlDocPtr docp;*/ - - DOMXML_NOT_IMPLEMENTED(); - -/* - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - rv = php_domobject_new(node, &ret TSRMLS_CC); - SEPARATE_ZVAL(&rv); - *return_value = *rv; -*/ -} -/* }}} */ - -/* {{{ proto array domxml_doc_document_element(void) - Returns root node of document */ -PHP_FUNCTION(domxml_doc_document_element) -{ - zval *id; - xmlDoc *docp; - xmlNode *node; - int ret; - - id = getThis(); - - if (!id) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &id) == FAILURE) { - return; - } - } - - DOMXML_GET_OBJ(docp, id, le_domxmldocp); - - node = docp->children; - if (!node) { - RETURN_FALSE; - } - - while (node) { - if (Z_TYPE_P(node) == XML_ELEMENT_NODE) { - zval *rv; - DOMXML_RET_OBJ(rv, node, &ret); - return; - } - node = node->next; - } -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_element(string name) - Creates new element node */ -PHP_FUNCTION(domxml_doc_create_element) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, name_len; - char *name; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - - node = xmlNewNode(NULL, name); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_text_node(string name) - Creates new text node */ -PHP_FUNCTION(domxml_doc_create_text_node) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, content_len; - char *content; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - - node = xmlNewTextLen(content, content_len); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_comment(string name) - Creates new comment node */ -PHP_FUNCTION(domxml_doc_create_comment) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, content_len; - char *content; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - - node = xmlNewComment(content); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_attribute(string name) - Creates new attribute node */ -PHP_FUNCTION(domxml_doc_create_attribute) -{ - zval *id, *rv; - xmlAttrPtr node; - xmlDocPtr docp; - int ret, name_len, value_len; - char *name, *value; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &value, &value_len) == FAILURE) { - return; - } - - node = xmlNewProp(NULL, name, value); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, (xmlNodePtr) node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_cdata_section(string name) - Creates new cdata node */ -PHP_FUNCTION(domxml_doc_create_cdata_section) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, content_len; - char *content; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - - node = xmlNewCDataBlock(docp, content, content_len); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_entity_reference(string name) - Creates new cdata node */ -PHP_FUNCTION(domxml_doc_create_entity_reference) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, name_len; - char *name; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) { - return; - } - node = xmlNewReference(docp, name); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_create_processing_instruction(string name) - Creates new processing_instruction node */ -PHP_FUNCTION(domxml_doc_create_processing_instruction) -{ - zval *id, *rv; - xmlNode *node; - xmlDocPtr docp; - int ret, name_len, content_len; - char *name, *content; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &content, &content_len) == FAILURE) { - return; - } - - node = xmlNewPI(name, content); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_doc_imported_node(object node, bool recursive) - Creates new element node */ -PHP_FUNCTION(domxml_doc_imported_node) -{ - zval *arg1, *id, *rv; - xmlNodePtr node, srcnode; - xmlDocPtr docp; - int ret, recursive = 0; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - // FIXME: which object type to expect? - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|l", &arg1, &recursive) == FAILURE) { - return; - } - - DOMXML_GET_OBJ(srcnode, arg1, le_domxmlnodep); - - node = xmlCopyNode(srcnode, recursive); - if (!node) { - RETURN_FALSE; - } - node->doc = docp; /* Not enough because other nodes in the tree are not set */ - - DOMXML_RET_OBJ(rv, node, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_dtd(void) - Returns DTD of document */ -PHP_FUNCTION(domxml_intdtd) -{ - zval *id, *rv; - xmlDoc *docp; - xmlDtd *dtd; - int ret; - - DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp); - - dtd = xmlGetIntSubset(docp); - if (!dtd) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) dtd, &ret); -} -/* }}} */ - -/* {{{ proto string domxml_dump_mem(object doc_handle [, int format]) - Dumps document into string and optionally formats it */ -PHP_FUNCTION(domxml_dump_mem) -{ - zval *id; - xmlDoc *docp; - xmlChar *mem; - int format = 0; - int size; - - DOMXML_PARAM_ONE(docp, id, le_domxmldocp,"|l", &format); - if (format) { - xmlKeepBlanksDefault(0); - xmlDocDumpFormatMemory(docp, &mem, &size, format); - } else { - xmlDocDumpMemory(docp, &mem, &size); - } - - if (!size) { - RETURN_FALSE; - } - RETURN_STRINGL(mem, size, 1); -} -/* }}} */ - -/* {{{ proto int domxml_dump_mem_file(object doc_handle [, int filename [, int compressmode]]) - Dumps document into file and uses compression if specified. Returns false on error, otherwise the length of the xml-document (uncompressed) */ -PHP_FUNCTION(domxml_dump_mem_file) -{ - zval *id; - xmlDoc *docp; - int file_len, bytes; - int format = 0; - int compressmode = 0; - char *file; - DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|ll", &file, &file_len, &compressmode,&format); - - xmlSetCompressMode (compressmode); - - if (format) { - xmlKeepBlanksDefault(0); - bytes = xmlSaveFormatFile(file,docp,format); - } else { - bytes = xmlSaveFile(file,docp); - } - - if (bytes == -1) { - RETURN_FALSE; - } - RETURN_LONG(bytes); -} -/* }}} */ - -/* {{{ proto string domxml_dump_node(object doc_handle, object node_handle [, int format [, int level]]) - Dumps node into string */ -PHP_FUNCTION(domxml_dump_node) -{ - zval *id, *nodep; - xmlDocPtr docp; - xmlNodePtr elementp; - xmlChar *mem ; - xmlBufferPtr buf; - int level = 0; - int format = 0; - - DOMXML_PARAM_THREE(docp, id, le_domxmldocp,"o|ll",&nodep,&format,&level); - - DOMXML_GET_OBJ(elementp, nodep, le_domxmlnodep); - - if (Z_TYPE_P(elementp) == XML_DOCUMENT_NODE || Z_TYPE_P(elementp) == XML_HTML_DOCUMENT_NODE ) { - php_error(E_WARNING, "%s(): cannot dump element with a document node", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - buf = xmlBufferCreate(); - if (!buf) { - php_error(E_WARNING, "%s(): could fetch buffer", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - xmlNodeDump(buf, docp, elementp,level,format); - - mem = (xmlChar*) xmlBufferContent(buf); - - if (!mem) { - xmlBufferFree(buf); - RETURN_FALSE; - } - RETVAL_STRING(mem, 1); - - xmlBufferFree(buf); - -} -/* }}} */ - - -/* {{{ proto object xmldoc(string xmldoc [, bool from_file]) - Creates DOM object of XML document */ -PHP_FUNCTION(xmldoc) -{ - zval *rv; - xmlDoc *docp; - int ret; - char *buffer; - int buffer_len; - zend_bool from_file = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &buffer, &buffer_len, &from_file) == FAILURE) { - return; - } - - if (from_file) { - docp = xmlParseFile(buffer); - } else { - docp = xmlParseDoc(buffer); - } - if (!docp) - RETURN_FALSE; - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -} -/* }}} */ - -/* {{{ proto object xmldocfile(string filename) - Creates DOM object of XML document in file */ -PHP_FUNCTION(xmldocfile) -{ - zval *rv; - xmlDoc *docp; - int ret, file_len; - char *file; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { - return; - } - - docp = xmlParseFile(file); - if (!docp) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); - - add_property_resource(return_value, "doc", ret); - if (docp->name) - add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1); - if (docp->URL) - add_property_stringl(return_value, "url", (char *) docp->URL, strlen(docp->URL), 1); - add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1); - if (docp->encoding) - add_property_stringl(return_value, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); - add_property_long(return_value, "standalone", docp->standalone); - add_property_long(return_value, "type", Z_TYPE_P(docp)); - add_property_long(return_value, "compression", docp->compression); - add_property_long(return_value, "charset", docp->charset); - zend_list_addref(ret); -} -/* }}} */ - -#if defined(LIBXML_HTML_ENABLED) -/* {{{ proto string domxml_html_dump_mem([int doc_handle]) - Dumps document into string as HTML */ -PHP_FUNCTION(domxml_html_dump_mem) -{ - zval *id; - xmlDoc *docp; - xmlChar *mem; - int size; - - DOMXML_PARAM_NONE(docp, id, le_domxmldocp); - - htmlDocDumpMemory(docp, &mem, &size); - if (!size) { - RETURN_FALSE; - } - RETURN_STRINGL(mem, size, 1); -} -/* }}} */ - -/* {{{ proto object html_doc(string html_doc [, bool from_file]) - Creates DOM object of HTML document */ -PHP_FUNCTION(html_doc) -{ - zval *rv; - xmlDoc *docp; - int ret; - char *buffer; - int buffer_len; - zend_bool from_file = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &buffer, &buffer_len, &from_file) == FAILURE) { - return; - } - - if (from_file) { - docp = htmlParseFile(buffer, NULL); - } else { - docp = htmlParseDoc(buffer, NULL); - } - if (!docp) - RETURN_FALSE; - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -} -/* }}} */ - -/* {{{ proto object html_doc_file(string filename) - Creates DOM object of HTML document in file */ -PHP_FUNCTION(html_doc_file) -{ - zval *rv; - xmlDoc *docp; - int ret, file_len; - char *file; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { - return; - } - - docp = htmlParseFile(file, NULL); - if (!docp) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); - - add_property_resource(return_value, "doc", ret); - if (docp->name) - add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1); - if (docp->URL) - add_property_stringl(return_value, "url", (char *) docp->URL, strlen(docp->URL), 1); - if (docp->version) - add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1); -/* add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1);*/ - if (docp->encoding) - add_property_stringl(return_value, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); - add_property_long(return_value, "standalone", docp->standalone); - add_property_long(return_value, "type", Z_TYPE_P(docp)); - add_property_long(return_value, "compression", docp->compression); - add_property_long(return_value, "charset", docp->charset); - zend_list_addref(ret); -} -/* }}} */ -#endif /* defined(LIBXML_HTML_ENABLED) */ - -/* {{{ proto bool domxml_substitute_entities_default(bool enable) - Set and return the previous value for default entity support */ -PHP_FUNCTION(domxml_substitute_entities_default) -{ - zend_bool enable; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &enable) == FAILURE) { - return; - } - - RETURN_BOOL(xmlSubstituteEntitiesDefault(enable)); -} -/* }}} */ - -/* {{{ proto bool domxml_node_text_concat(string content) - Add string tocontent of a node */ -PHP_FUNCTION(domxml_node_text_concat) -{ - zval *id; - xmlNode *nodep; - char *content; - int content_len; - - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &content, &content_len) == FAILURE) { - return; - } - - if (content_len) - xmlTextConcat(nodep, content, content_len); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto object domxml_add_root(string name) - Adds root node to document */ -PHP_FUNCTION(domxml_add_root) -{ - zval *id, *rv; - xmlDoc *docp; - xmlNode *nodep; - int ret, name_len; - char *name; - - DOMXML_PARAM_TWO(docp, id, le_domxmldocp, "s", &name, &name_len); - - nodep = xmlNewDocNode(docp, NULL, name, NULL); - if (!nodep) { - RETURN_FALSE; - } - - xmlDocSetRootElement(docp, nodep); - - DOMXML_RET_OBJ(rv, nodep, &ret); -} -/* }}} */ - -/* {{{ proto object domxml_new_xmldoc(string version) - Creates new xmldoc */ -PHP_FUNCTION(domxml_new_xmldoc) -{ - zval *rv; - xmlDoc *docp; - int ret, buf_len; - char *buf; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { - return; - } - - docp = xmlNewDoc(buf); - if (!docp) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -} -/* }}} */ - -#ifdef newcode -/* {{{ proto int node_namespace([int node]) - Returns list of namespaces */ -static int node_namespace(zval **attributes, xmlNode *nodep TSRMLS_DC) -{ - xmlNs *ns; - - /* Get the children of the current node */ - ns = nodep->ns; - if (!ns) { - return -1; - } - - /* create an php array for the children */ - MAKE_STD_ZVAL(*attributes); - if (array_init(*attributes) == FAILURE) { - return -1; - } - - while (ns) { - zval *pattr; - int ret; - - pattr = php_domobject_new((xmlNodePtr) ns, &ret TSRMLS_CC); - SEPARATE_ZVAL(&pattr); - -/* if(!ret) { */ - if (ns->href) - add_property_stringl(pattr, "href", (char *) ns->href, strlen(ns->href), 1); - if (ns->prefix) - add_property_stringl(pattr, "prefix", (char *) ns->prefix, strlen(ns->prefix), 1); - add_property_long(pattr, "type", Z_TYPE_P(ns)); -/* } */ - - zend_hash_next_index_insert(Z_ARRVAL_PP(attributes), &pattr, sizeof(zval *), NULL); - ns = ns->next; - } - return 0; -} -/* }}} */ -#endif - -/* We don't have a type zval. **attributes is also very unusual. */ - -/* {{{ proto int node_attributes(zval **attributes, int node) - Returns list of children nodes */ -static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC) -{ - xmlAttr *attr; - int count = 0; - - /* Get the children of the current node */ - if (Z_TYPE_P(nodep) != XML_ELEMENT_NODE) - return -1; - attr = nodep->properties; - if (!attr) - return -1; - - /* create an php array for the children */ - MAKE_STD_ZVAL(*attributes); - array_init(*attributes); - - while (attr) { - zval *pattr; - int ret; - - pattr = php_domobject_new((xmlNodePtr) attr, &ret TSRMLS_CC); - /** XXX FIXME XXX */ -/* if(0 <= (n = node_children(&children, attr->children TSRMLS_CC))) { - zend_hash_update(Z_OBJPROP_P(value), "children", sizeof("children"), (void *) &children, sizeof(zval *), NULL); - } -*/ add_property_string(pattr, "name", (char *) (attr->name), 1); - add_property_string(pattr, "value", xmlNodeGetContent((xmlNodePtr) attr), 1); - zend_hash_next_index_insert(Z_ARRVAL_PP(attributes), &pattr, sizeof(zval *), NULL); - attr = attr->next; - count++; - } - return count; -} -/* }}} */ - -/* {{{ proto int node_children([int node]) - Returns list of children nodes */ -static int node_children(zval **children, xmlNode *nodep TSRMLS_DC) -{ - zval *mchildren, *attributes; - /* zval *namespace; */ - xmlNode *last; - int count = 0; - - /* Get the children of the current node */ - last = nodep; - if (!last) { - return -1; - } - - /* create an php array for the children */ - MAKE_STD_ZVAL(*children); - array_init(*children); - - while (last) { - zval *child; - int ret; - - if (NULL != (child = php_domobject_new(last, &ret TSRMLS_CC))) { - zend_hash_next_index_insert(Z_ARRVAL_PP(children), &child, sizeof(zval *), NULL); - - /* Get the namespace of the current node and add it as a property */ - /* XXX FIXME XXX */ -/* - if(!node_namespace(&namespace, last)) - zend_hash_update(Z_OBJPROP_P(child), "namespace", sizeof("namespace"), (void *) &namespace, sizeof(zval *), NULL); -*/ - - /* Get the attributes of the current node and add it as a property */ - if (node_attributes(&attributes, last TSRMLS_CC) >= 0) - zend_hash_update(Z_OBJPROP_P(child), "attributes", sizeof("attributes"), (void *) &attributes, sizeof(zval *), NULL); - - /* Get recursively the children of the current node and add it as a property */ - if (node_children(&mchildren, last->children TSRMLS_CC) >= 0) - zend_hash_update(Z_OBJPROP_P(child), "children", sizeof("children"), (void *) &mchildren, sizeof(zval *), NULL); - - count++; - } - last = last->next; - } - return count; -} -/* }}} */ - -/* {{{ proto object xmltree(string xmltree) - Creates a tree of PHP objects from an XML document */ -PHP_FUNCTION(xmltree) -{ - zval *children, *rv; - xmlDoc *docp; - xmlNode *root; - int ret, buf_len; - char *buf; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) { - return; - } - - /* Create a new xml document */ - docp = xmlParseDoc(buf); - if (!docp) { - RETURN_FALSE; - } - - /* get the root and add as a property to the document */ - root = docp->children; - if (!root) { - xmlFreeDoc(docp); - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); - - /* The root itself maybe an array. Though you may not have two Elements - as root, you may have a comment, pi and and element as root. - Thanks to Paul DuBois for pointing me at this. - */ - if (node_children(&children, root TSRMLS_CC) >= 0) { - zend_hash_update(Z_OBJPROP_P(return_value), "children",sizeof("children"), (void *) &children, sizeof(zval *), NULL); - } -/* xmlFreeDoc(docp); */ -} -/* }}} */ - -#if defined(LIBXML_XPATH_ENABLED) -/* {{{ proto bool xpath_init(void) - Initializing XPath environment */ -PHP_FUNCTION(xpath_init) -{ - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - xmlXPathInit(); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ php_xpathptr_new_context() - */ -static void php_xpathptr_new_context(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval *id, *rv; - xmlXPathContextPtr ctx; - xmlDocPtr docp; - int ret; - - DOMXML_PARAM_NONE(docp, id, le_domxmldocp); - -#if defined(LIBXML_XPTR_ENABLED) - if (mode == PHP_XPTR) - ctx = xmlXPtrNewContext(docp, NULL, NULL); - else -#endif - ctx = xmlXPathNewContext(docp); - if (!ctx) { - RETURN_FALSE; - } - - rv = php_xpathcontext_new(ctx, &ret TSRMLS_CC); - DOMXML_RET_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object xpath_new_context([int doc_handle]) - Creates new XPath context */ -PHP_FUNCTION(xpath_new_context) -{ - php_xpathptr_new_context(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH); -} -/* }}} */ - -/* {{{ proto object xptr_new_context([int doc_handle]) - Creates new XPath context */ -PHP_FUNCTION(xptr_new_context) -{ - php_xpathptr_new_context(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPTR); -} -/* }}} */ - -/* {{{ php_xpathptr_eval() - */ -static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr) -{ - zval *id, *rv, *contextnode = NULL; - xmlXPathContextPtr ctxp; - xmlXPathObjectPtr xpathobjp; - xmlNode *contextnodep; - int ret, str_len; - char *str; - - contextnode = NULL; - contextnodep = NULL; - - if (NULL == (id = getThis())) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os|o", &id, &str, &str_len, &contextnode) == FAILURE) { - return; - } - } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|o", &str, &str_len, &contextnode) == FAILURE) { - return; - } - } - - ctxp = php_xpath_get_context(id, le_xpathctxp, 0 TSRMLS_CC); - if (!ctxp) { - php_error(E_WARNING, "%s(): cannot fetch XPATH context", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - if (contextnode) { - DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep); - } - ctxp->node = contextnodep; - -#if defined(LIBXML_XPTR_ENABLED) - if (mode == PHP_XPTR) { - xpathobjp = xmlXPtrEval(BAD_CAST str, ctxp); - } else { -#endif - if (expr) { - xpathobjp = xmlXPathEvalExpression(str, ctxp); - } else { - xpathobjp = xmlXPathEval(str, ctxp); - } -#if defined(LIBXML_XPTR_ENABLED) - } -#endif - - ctxp->node = NULL; - if (!xpathobjp) { - RETURN_FALSE; - } - - if (NULL == (rv = php_xpathobject_new(xpathobjp, &ret TSRMLS_CC))) { - php_error(E_WARNING, "%s(): cannot create required XPATH objcet", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - SEPARATE_ZVAL(&rv); - - add_property_long(rv, "type", Z_TYPE_P(xpathobjp)); - - switch (Z_TYPE_P(xpathobjp)) { - - case XPATH_UNDEFINED: - break; - - case XPATH_NODESET: - { - int i; - zval *arr; - xmlNodeSetPtr nodesetp; - - MAKE_STD_ZVAL(arr); - if (array_init(arr) == FAILURE) { - zval_dtor(rv); - RETURN_FALSE; - } - - if (NULL == (nodesetp = xpathobjp->nodesetval)) { - zval_dtor(rv); - RETURN_FALSE; - } - - for (i = 0; i < nodesetp->nodeNr; i++) { - xmlNodePtr node = nodesetp->nodeTab[i]; - zval *child; - int retnode; - - /* construct a node object */ - child = php_domobject_new(node, &retnode TSRMLS_CC); - zend_hash_next_index_insert(Z_ARRVAL_P(arr), &child, sizeof(zval *), NULL); - } - zend_hash_update(Z_OBJPROP_P(rv), "nodeset", sizeof("nodeset"), (void *) &arr, sizeof(zval *), NULL); - break; - } - - case XPATH_BOOLEAN: - add_property_bool(rv, "value", xpathobjp->boolval); - break; - - case XPATH_NUMBER: - add_property_double(rv, "value", xpathobjp->floatval); - break; - - case XPATH_STRING: - add_property_string(rv, "value", xpathobjp->stringval, 1); - break; - - case XPATH_POINT: - break; - - case XPATH_RANGE: - break; - - case XPATH_LOCATIONSET: - break; - - case XPATH_USERS: - break; - - case XPATH_XSLT_TREE: - break; - } - - *return_value = *rv; - FREE_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object xpath_eval([object xpathctx_handle,] string str) - Evaluates the XPath Location Path in the given string */ -PHP_FUNCTION(xpath_eval) -{ - php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH, 0); -} -/* }}} */ - -/* {{{ proto object xpath_eval_expression([object xpathctx_handle,] string str) - Evaluates the XPath expression in the given string */ -PHP_FUNCTION(xpath_eval_expression) -{ - php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPATH, 1); -} -/* }}} */ - -/* {{{ proto bool xpath_register_ns([object xpathctx_handle,] string namespace_prefix, string namespace_uri) - Registeres the given namespace in the passed XPath context */ -PHP_FUNCTION(xpath_register_ns) -{ - /* - TODO: - - automagically register all namespaces when creating a new context - */ - - int prefix_len, uri_len, result; - xmlXPathContextPtr ctxp; - char *prefix, *uri, *uri_static; - zval *id; - - DOMXML_PARAM_FOUR(ctxp, id, le_xpathctxp, "ss", &prefix, &prefix_len, &uri, &uri_len); - - /* set the context node to NULL - what is a context node anyway? */ - ctxp->node = NULL; - - /* - this is a hack - libxml2 doesn't copy the URI, it simply uses the string - given in the parameter - which is normally deallocated after the function - */ - uri_static = estrndup(uri, uri_len); - result = xmlXPathRegisterNs(ctxp, prefix, uri_static); - - if (0 == result) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ -#endif /* defined(LIBXML_XPATH_ENABLED) */ - -#if defined(LIBXML_XPTR_ENABLED) -/* {{{ proto int xptr_eval([int xpathctx_handle,] string str) - Evaluates the XPtr Location Path in the given string */ -PHP_FUNCTION(xptr_eval) -{ - php_xpathptr_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_XPTR, 0); -} -/* }}} */ -#endif /* LIBXML_XPTR_ENABLED */ - -/* {{{ proto string domxml_version(void) - Get XML library version */ -PHP_FUNCTION(domxml_version) -{ - RETURN_STRING(LIBXML_DOTTED_VERSION, 1); -} -/* }}} */ - -#if HAVE_DOMXSLT -static zval *php_xsltstylesheet_new(xsltStylesheetPtr obj, int *found TSRMLS_DC) -{ - zval *wrapper; - int rsrc_type; - - if (! found) { - *found = 0; - } - - if (!obj) { - MAKE_STD_ZVAL(wrapper); - ZVAL_NULL(wrapper); - return wrapper; - } - - if ((wrapper = (zval *) dom_object_get_data((void *) obj))) { - zval_add_ref(&wrapper); - *found = 1; - return wrapper; - } - - MAKE_STD_ZVAL(wrapper); - - object_init_ex(wrapper, domxsltstylesheet_class_entry); - rsrc_type = le_domxsltstylesheetp; - php_xsltstylesheet_set_object(wrapper, (void *) obj, rsrc_type); - - return (wrapper); -} - -/* {{{ proto object domxml_xslt_stylesheet(string xsltstylesheet) - Creates XSLT Stylesheet object from string */ -PHP_FUNCTION(domxml_xslt_stylesheet) -{ - zval *rv; - xmlDocPtr docp; - xsltStylesheetPtr sheetp; - int ret; - char *buffer; - int buffer_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) { - RETURN_FALSE; - } - - docp = xmlParseDoc(buffer); - - if (!docp) - RETURN_FALSE; - - sheetp = xsltParseStylesheetDoc(docp); - - if (!sheetp) - RETURN_FALSE; - - rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); - DOMXML_RET_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object domxml_xslt_stylesheet_doc(object xmldoc) - Creates XSLT Stylesheet object from DOM Document object */ -PHP_FUNCTION(domxml_xslt_stylesheet_doc) -{ - zval *rv, *idxml; - xmlDocPtr docp; - xmlDocPtr newdocp; - xsltStylesheetPtr sheetp; - int ret; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &idxml) == FAILURE) { - RETURN_FALSE; - } - - DOMXML_GET_OBJ(docp, idxml, le_domxmldocp); - - newdocp = xmlCopyDoc(docp, 1); - - if (!newdocp) - RETURN_FALSE; - - sheetp = xsltParseStylesheetDoc(newdocp); - - if (!sheetp) - RETURN_FALSE; - - rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); - DOMXML_RET_ZVAL(rv); -} -/* }}} */ - -/* {{{ proto object domxml_xslt_stylesheet_file(string filename) - Creates XSLT Stylesheet object from file */ -PHP_FUNCTION(domxml_xslt_stylesheet_file) -{ - zval *rv; - xsltStylesheetPtr sheetp; - int ret, file_len; - char *file; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { - RETURN_FALSE; - } - - sheetp = xsltParseStylesheetFile(file); - - if (!sheetp) - RETURN_FALSE; - - rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC); - DOMXML_RET_ZVAL(rv); -} -/* }}} */ - -/* {{{ php_domxslt_string_to_xpathexpr() - Translates a string to a XPath Expression */ -static char *php_domxslt_string_to_xpathexpr(const char *str TSRMLS_DC) -{ - const xmlChar *string = (const xmlChar *)str; - - xmlChar *value; - - if (xmlStrchr(string, '"')) { - if (xmlStrchr(string, '\'')) { - php_error(E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes) in %s", - get_active_function_name(TSRMLS_C)); - return NULL; - } - value = xmlStrdup((const xmlChar *)"'"); - value = xmlStrcat(value, string); - value = xmlStrcat(value, (const xmlChar *)"'"); - } else { - value = xmlStrdup((const xmlChar *)"\""); - value = xmlStrcat(value, string); - value = xmlStrcat(value, (const xmlChar *)"\""); - } - - return (char *)value; -} - -/* {{{ php_domxslt_make_params() - Translates a PHP array to a libxslt parameters array */ -static char **php_domxslt_make_params(zval *idvars, int xpath_params TSRMLS_DC) -{ - HashTable *parht; - int parsize; - zval **value; - char *xpath_expr, *string_key = NULL; - ulong num_key; - char **params = NULL; - int i = 0; - - parht = HASH_OF(idvars); - parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *); - params = (char **)emalloc(parsize); - memset((char *)params, 0, parsize); - - for (zend_hash_internal_pointer_reset(parht); - zend_hash_get_current_data(parht, (void **)&value) == SUCCESS; - zend_hash_move_forward(parht)) { - - if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { - php_error(E_WARNING, "Invalid argument or parameter array to %s", - get_active_function_name(TSRMLS_C)); - return NULL; - } - else { - SEPARATE_ZVAL(value); - convert_to_string_ex(value); - - if (!xpath_params) { - xpath_expr = php_domxslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC); - } - else { - xpath_expr = Z_STRVAL_PP(value); - } - - if (xpath_expr) { - params[i++] = string_key; - params[i++] = xpath_expr; - } - } - } - - params[i++] = NULL; - - return params; -} - -/* {{{ proto object domxml_xslt_process(object xslstylesheet, object xmldoc [, array xslt_parameters [, bool xpath_parameters]]) - Perform an XSLT transformation */ -PHP_FUNCTION(domxml_xslt_process) -{ -/* TODO: - - test memory deallocation - - test other stuff - - check xsltsp->errors ??? -*/ - zval *rv, *idxsl, *idxml, *idparams = NULL; - zend_bool xpath_params = 0; - xsltStylesheetPtr xsltstp; - xmlDocPtr xmldocp; - xmlDocPtr docp; - char **params = NULL; - int ret; - - DOMXML_GET_THIS(idxsl); - - xsltstp = php_xsltstylesheet_get_object(idxsl, le_domxsltstylesheetp, 0 TSRMLS_CC); - if (!xsltstp) { - php_error(E_WARNING, "%s(): underlying object missing", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|ab", &idxml, &idparams, &xpath_params) == FAILURE) { - RETURN_FALSE; - } - - DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp); - - if (idparams) { - params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC); - } - - docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params); - - if (params) { - efree(params); - } - - if (!docp) { - RETURN_FALSE; - } - - DOMXML_RET_OBJ(rv, (xmlNodePtr) docp, &ret); -} -/* }}} */ - -/* {{{ proto string domxml_xslt_version(void) - Get XSLT library version */ -PHP_FUNCTION(domxml_xslt_version) -{ - RETURN_STRING(LIBXSLT_DOTTED_VERSION, 1); -} -/* }}} */ -#endif /* HAVE_DOMXSLT */ - -#endif /* HAVE_DOMXML */ - -/* - * 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/domxml/php_domxml.h b/ext/domxml/php_domxml.h deleted file mode 100644 index 618b50b1171..00000000000 --- a/ext/domxml/php_domxml.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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$ */ - -#ifndef PHP_DOMXML_H -#define PHP_DOMXML_H - -#if HAVE_DOMXML -#include -#include -#include -#if defined(LIBXML_HTML_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPATH_ENABLED) -#include -#include -#endif -#if defined(LIBXML_XPTR_ENABLED) -#include -#endif -#if HAVE_DOMXSLT -#include -#include -#include -#include -#if HAVE_DOMEXSLT -#include -#include -#endif -#endif - -extern zend_module_entry domxml_module_entry; -#define domxml_module_ptr &domxml_module_entry - -/* directory functions */ -PHP_MINIT_FUNCTION(domxml); -PHP_RINIT_FUNCTION(domxml); -PHP_MINFO_FUNCTION(domxml); -PHP_FUNCTION(domxml_version); -PHP_FUNCTION(xmldoc); -PHP_FUNCTION(xmldocfile); -#if defined(LIBXML_HTML_ENABLED) -PHP_FUNCTION(html_doc); -PHP_FUNCTION(html_doc_file); -#endif -PHP_FUNCTION(xmltree); -PHP_FUNCTION(domxml_new_xmldoc); -PHP_FUNCTION(domxml_substitute_entities_default); - -/* Class Document methods */ -PHP_FUNCTION(domxml_doc_doctype); -PHP_FUNCTION(domxml_doc_implementation); -PHP_FUNCTION(domxml_doc_document_element); -PHP_FUNCTION(domxml_doc_create_element); -PHP_FUNCTION(domxml_doc_create_text_node); -PHP_FUNCTION(domxml_doc_create_comment); -PHP_FUNCTION(domxml_doc_create_processing_instruction); -PHP_FUNCTION(domxml_doc_create_attribute); -PHP_FUNCTION(domxml_doc_create_cdata_section); -PHP_FUNCTION(domxml_doc_create_entity_reference); -PHP_FUNCTION(domxml_doc_imported_node); -PHP_FUNCTION(domxml_add_root); -PHP_FUNCTION(domxml_intdtd); -PHP_FUNCTION(domxml_dump_mem); -PHP_FUNCTION(domxml_dump_mem_file); -PHP_FUNCTION(domxml_dump_node); - -#if defined(LIBXML_HTML_ENABLED) -PHP_FUNCTION(domxml_html_dump_mem); -#endif - -/* Class DocumentType methods */ -PHP_FUNCTION(domxml_doctype_name); -PHP_FUNCTION(domxml_doctype_entities); -PHP_FUNCTION(domxml_doctype_notations); -PHP_FUNCTION(domxml_doctype_public_id); -PHP_FUNCTION(domxml_doctype_system_id); -PHP_FUNCTION(domxml_doctype_internal_subset); - -/* Class Notation methods */ -PHP_FUNCTION(domxml_notation_public_id); -PHP_FUNCTION(domxml_notation_system_id); - -/* Class Node methods */ -PHP_FUNCTION(domxml_node_attributes); -PHP_FUNCTION(domxml_node_children); -PHP_FUNCTION(domxml_node_first_child); -PHP_FUNCTION(domxml_node_last_child); -PHP_FUNCTION(domxml_node_next_sibling); -PHP_FUNCTION(domxml_node_previous_sibling); -PHP_FUNCTION(domxml_node_owner_document); -PHP_FUNCTION(domxml_node_insert_before); -PHP_FUNCTION(domxml_node_append_child); -PHP_FUNCTION(domxml_node_add_child); -PHP_FUNCTION(domxml_node_has_attributes); -PHP_FUNCTION(domxml_node_has_child_nodes); -PHP_FUNCTION(domxml_node_parent); -PHP_FUNCTION(domxml_node_prefix); -PHP_FUNCTION(domxml_node); -PHP_FUNCTION(domxml_clone_node); -PHP_FUNCTION(domxml_node_unlink_node); -PHP_FUNCTION(domxml_node_replace_node); -PHP_FUNCTION(domxml_node_new_child); -PHP_FUNCTION(domxml_node_set_content); -PHP_FUNCTION(domxml_node_get_content); -PHP_FUNCTION(domxml_node_text_concat); -PHP_FUNCTION(domxml_node_set_name); -PHP_FUNCTION(domxml_node_name); -PHP_FUNCTION(domxml_node_type); -PHP_FUNCTION(domxml_node_value); -PHP_FUNCTION(domxml_is_blank_node); - -/* Class Attribute methods */ -PHP_FUNCTION(domxml_attr_name); -PHP_FUNCTION(domxml_attr_value); -PHP_FUNCTION(domxml_attr_specified); - -/* Class Element methods */ -PHP_FUNCTION(domxml_element); -PHP_FUNCTION(domxml_elem_tagname); -PHP_FUNCTION(domxml_elem_get_attribute); -PHP_FUNCTION(domxml_elem_set_attribute); -PHP_FUNCTION(domxml_elem_remove_attribute); -PHP_FUNCTION(domxml_elem_get_attribute_node); -PHP_FUNCTION(domxml_elem_set_attribute_node); -PHP_FUNCTION(domxml_elem_get_elements_by_tagname); -/* Class CData methods */ -PHP_FUNCTION(domxml_cdata_length); - -/* Class Notation methods */ -PHP_FUNCTION(domxml_notation_public_id); -PHP_FUNCTION(domxml_notation_system_id); - -/* Class Entity methods */ -PHP_FUNCTION(domxml_entity_public_id); -PHP_FUNCTION(domxml_entity_system_id); -PHP_FUNCTION(domxml_entity_notation_name); - -/* Class ProcessingInstructions */ -PHP_FUNCTION(domxml_pi_target); -PHP_FUNCTION(domxml_pi_data); - -/* Class XPathContext methods */ -#if defined(LIBXML_XPATH_ENABLED) -PHP_FUNCTION(xpath_init); -PHP_FUNCTION(xpath_new_context); -PHP_FUNCTION(xpath_eval); -PHP_FUNCTION(xpath_eval_expression); -PHP_FUNCTION(xpath_register_ns); -PHP_FUNCTION(domxml_doc_get_elements_by_tagname); -PHP_FUNCTION(domxml_doc_get_element_by_id); -#endif -#if defined(LIBXML_XPTR_ENABLED) -PHP_FUNCTION(xptr_new_context); -PHP_FUNCTION(xptr_eval); -#endif -PHP_FUNCTION(domxml_test); - -/* DOMXSLT functions */ -#if HAVE_DOMXSLT -PHP_FUNCTION(domxml_xslt_stylesheet); -PHP_FUNCTION(domxml_xslt_stylesheet_doc); -PHP_FUNCTION(domxml_xslt_stylesheet_file); -PHP_FUNCTION(domxml_xslt_process); -PHP_FUNCTION(domxml_xslt_version); -#endif - -#else -#define domxml_module_ptr NULL -#endif /* HAVE_DOMXML */ -#define phpext_domxml_ptr domxml_module_ptr - -#endif /* _PHP_DIR_H */ diff --git a/ext/dotnet/CREDITS b/ext/dotnet/CREDITS deleted file mode 100644 index 154522c6f86..00000000000 --- a/ext/dotnet/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dotnet -Sam Ruby diff --git a/ext/dotnet/EXPERIMENTAL b/ext/dotnet/EXPERIMENTAL deleted file mode 100644 index 6443e996464..00000000000 --- a/ext/dotnet/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/dotnet/README b/ext/dotnet/README deleted file mode 100644 index 8cad7bab8fe..00000000000 --- a/ext/dotnet/README +++ /dev/null @@ -1,32 +0,0 @@ -Warning -======= - -This support is EXPERIMENTAL. In fact, it integrates code that -Microsoft labels as pre-beta. Use at your own risk. - -Build instructions -================== - -Download and install the .NET Framework SDK Technology Preview from -http://msdn.microsoft.com/net/#sdk. Once installed, copy Mscoree.h -(typically found in C:\Program Files\NGWSSDK\Include to ext\dotnet). -Do not simply add the NGWSSDK\Include directory to the include path -as this will cause compilation failures. - -Download and unzip the source to the dm.net COM Moniker from -http://staff.develop.com/jasonw/clr/readme.htm. Copy mscorlib.h -to ext\dotnet. There is no need to register the clrmonsrv.dll as -it is not used. - -At this point, the dotnet project can be built like any other -project, from either VisualStudio 6's GUI or from the command line. -Example command line invocation: - - msdev dotnet.dsp /MAKE "dotnet - Win32 Debug_TS" - -Execution instructions: -======================= - -Add "extension=php_dotnet.dll" into php.ini. - -Sample program can be found at dotnet.php diff --git a/ext/dotnet/dotnet.cpp b/ext/dotnet/dotnet.cpp deleted file mode 100644 index f507f3d2f35..00000000000 --- a/ext/dotnet/dotnet.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sam Ruby | - | Harald Radi | - +----------------------------------------------------------------------+ - */ - -/* - * This module implements support for Microsoft .Net components. - */ - -/* - * 28.1.2001 - * use external unicode conversion functions - * - * harald radi - */ - -#ifdef PHP_WIN32 - -#include -#include -#include - -extern "C" -{ -#include "php.h" -#include "ext/standard/info.h" -} - -#include "ext/com/conversion.h" -#include "ext/com/php_COM.h" - -#include "Mscoree.h" -#include "mscorlib.h" - -using namespace mscorlib; - -static ICorRuntimeHost *pHost; -static mscorlib::_AppDomain *pDomain; - -static zend_class_entry dotnet_class_entry; -static int codepage; - -HRESULT dotnet_init() { - HRESULT hr; - - hr = CoCreateInstance(CLSID_CorRuntimeHost, NULL, CLSCTX_ALL, - IID_ICorRuntimeHost, (void **)&pHost); - if (FAILED(hr)) return hr; - - hr = pHost->Start(); - if (FAILED(hr)) return hr; - - IUnknown *uDomain; - hr = pHost->GetDefaultDomain(&uDomain); - if (FAILED(hr)) return hr; - - hr = uDomain->QueryInterface(__uuidof(_AppDomain), (void**) &pDomain); - if (FAILED(hr)) return -1; - - uDomain->Release(); - - return ERROR_SUCCESS; -} - -HRESULT dotnet_create(OLECHAR *assembly, OLECHAR *datatype, comval *obj TSRMLS_DC) { - HRESULT hr; - - _ObjectHandle *pHandle; - hr = pDomain->CreateInstance(_bstr_t(assembly), _bstr_t(datatype), &pHandle); - if (FAILED(hr)) return hr; - if (!pHandle) return hr; - - _variant_t unwrapped; - hr = pHandle->Unwrap(&unwrapped); - pHandle->Release(); - if (FAILED(hr)) return hr; - - php_COM_set(obj, &unwrapped.pdispVal, TRUE TSRMLS_CC); - return ERROR_SUCCESS; -} - -void dotnet_term() { - if (pHost) pHost->Stop(); - if (pHost) pHost->Release(); - if (pDomain) pDomain->Release(); - - pHost = 0; - pDomain = 0; -} - -/* {{{ proto int dotnet_load(string assembly_name [, string datatype_name, int codepage]) - Loads a DOTNET module */ -PHP_FUNCTION(dotnet_load) -{ - HRESULT hr; - pval *assembly_name, *datatype_name, *code_page; - OLECHAR *assembly, *datatype; - comval *obj; - - switch(ZEND_NUM_ARGS()) - { - case 2: - getParameters(ht, 2, &assembly_name, &datatype_name); - codepage = CP_ACP; - break; - case 3: - getParameters(ht, 3, &assembly_name, &datatype_name, &code_page); - - convert_to_long(code_page); - codepage = Z_LVAL_P(code_page); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - convert_to_string(assembly_name); - assembly = php_char_to_OLECHAR(Z_STRVAL_P(assembly_name), Z_STRLEN_P(assembly_name), codepage TSRMLS_CC); - - convert_to_string(datatype_name); - datatype = php_char_to_OLECHAR(Z_STRVAL_P(datatype_name), Z_STRLEN_P(datatype_name), codepage TSRMLS_CC); - - ALLOC_COM(obj); - - /* obtain IDispatch */ - hr = dotnet_create(assembly, datatype, obj TSRMLS_CC); - efree(assembly); - efree(datatype); - if (FAILED(hr)) { - char *error_message; - error_message = php_COM_error_message(hr TSRMLS_CC); - php_error(E_WARNING, "Error obtaining .Net class for %s in assembly %s: %s", datatype_name->value.str.val, assembly_name->value.str.val, error_message); - LocalFree(error_message); - efree(obj); - RETURN_FALSE; - } - if (C_DISPATCH(obj) == NULL) { - php_error(E_WARNING, "Unable to locate %s in assembly %s", datatype_name->value.str.val, assembly_name->value.str.val); - efree(obj); - RETURN_FALSE; - } - - RETURN_LONG(zend_list_insert(obj, IS_COM)); -} -/* }}} */ - - -void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) -{ - pval *object = property_reference->object; - zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data; - - if (zend_llist_count(property_reference->elements_list)==1 - && !strcmp(Z_STRVAL(function_name->element), "dotnet")) { /* constructor */ - pval *object_handle; - - PHP_FN(dotnet_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (!Z_LVAL_P(return_value)) { - ZVAL_FALSE(object); - return; - } - ALLOC_ZVAL(object_handle); - *object_handle = *return_value; - pval_copy_constructor(object_handle); - INIT_PZVAL(object_handle); - zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); - pval_destructor(&function_name->element); - } else { - php_COM_call_function_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, property_reference); - } -} - -void php_register_DOTNET_class(TSRMLS_D) -{ - INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL, - php_DOTNET_call_function_handler, - php_COM_get_property_handler, - php_COM_set_property_handler); - - zend_register_internal_class(&dotnet_class_entry TSRMLS_CC); -} - -function_entry DOTNET_functions[] = { - {NULL, NULL, NULL} -}; - -static PHP_MINFO_FUNCTION(DOTNET) -{ - php_info_print_table_start(); - php_info_print_table_row(2, ".NET support", "enabled"); - php_info_print_table_end(); -} - -PHP_MINIT_FUNCTION(DOTNET) -{ - HRESULT hr; - - if (FAILED(hr = dotnet_init())) { - return hr; - } - - php_register_DOTNET_class(TSRMLS_C); - return SUCCESS; -} - - -PHP_MSHUTDOWN_FUNCTION(DOTNET) -{ - dotnet_term(); - return SUCCESS; -} - - -zend_module_entry dotnet_module_entry = { - STANDARD_MODULE_HEADER, - "dotnet", DOTNET_functions, PHP_MINIT(DOTNET), PHP_MSHUTDOWN(DOTNET), NULL, NULL, PHP_MINFO(DOTNET), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -BEGIN_EXTERN_C() -ZEND_GET_MODULE(dotnet) -END_EXTERN_C() - -#endif diff --git a/ext/dotnet/dotnet.dsp b/ext/dotnet/dotnet.dsp deleted file mode 100644 index a0b151f68aa..00000000000 --- a/ext/dotnet/dotnet.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dotnet" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dotnet - 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 "dotnet.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 "dotnet.mak" CFG="dotnet - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dotnet - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dotnet - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dotnet - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dotnet - 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)" == "dotnet - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release/php_dotnet.dll" /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Release" - -!ELSEIF "$(CFG)" == "dotnet - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "..\..\Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug/php_dotnet.dll" /pdbtype:sept /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Debug" - -!ELSEIF "$(CFG)" == "dotnet - 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 /I "..\.." /I "..\..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /FR /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FR /YX /FD /D /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dotnet.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ELSEIF "$(CFG)" == "dotnet - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "..\..\Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dotnet.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ENDIF - -# Begin Target - -# Name "dotnet - Win32 Release" -# Name "dotnet - Win32 Debug" -# Name "dotnet - Win32 Debug_TS" -# Name "dotnet - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\dotnet.cpp -# End Source File -# Begin Source File - -SOURCE=.\..\..\win32\winutil.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_dotnet.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README -# End Source File -# End Target -# End Project diff --git a/ext/dotnet/dotnet.php b/ext/dotnet/dotnet.php deleted file mode 100644 index 3b0b67c02fa..00000000000 --- a/ext/dotnet/dotnet.php +++ /dev/null @@ -1,8 +0,0 @@ -Push(".Net"); - $stack->Push("Hello "); - - echo $stack->Pop() . $stack->Pop(); -?> diff --git a/ext/dotnet/php_dotnet.h b/ext/dotnet/php_dotnet.h deleted file mode 100644 index b56af145e2d..00000000000 --- a/ext/dotnet/php_dotnet.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef PHP_DOTNET_H -#define PHP_DOTNET_H - -#if WIN32|WINNT - -PHP_MINIT_FUNCTION(DOTNET); -PHP_MSHUTDOWN_FUNCTION(DOTNET); -PHP_FUNCTION(DOTNET_load); - -extern zend_module_entry DOTNET_module_entry; -#define DOTNET_module_ptr &DOTNET_module_entry - -#else - -#define DOTNET_module_ptr NULL - -#endif /* Win32|WINNT */ - -#define phpext_DOTNET_ptr DOTNET_module_ptr - -#endif /* PHP_DOTNET_H */ diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c deleted file mode 100644 index 02e39e401fe..00000000000 --- a/ext/ereg/ereg.c +++ /dev/null @@ -1,658 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Jim Winstead | - | Jaakko Hyvätti | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#include -#include "php.h" -#include "php_string.h" -#include "reg.h" -#include "ext/standard/info.h" - -#ifdef ZTS -int reg_globals_id; -#else -static php_reg_globals reg_globals; -#endif - -typedef struct { - regex_t preg; - int cflags; -} reg_cache; - -/* {{{ _php_regcomp - */ -static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) -{ - int r = 0; - int patlen = strlen(pattern); - reg_cache *rc = NULL; - TSRMLS_FETCH(); - - if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == FAILURE || - rc->cflags != cflags) { - r = regcomp(preg, pattern, cflags); - if(!r) { - reg_cache rcp; - - rcp.cflags = cflags; - memcpy(&rcp.preg, preg, sizeof(*preg)); - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, - (void *) &rcp, sizeof(rcp), NULL); - } - } else { - memcpy(preg, &rc->preg, sizeof(*preg)); - } - - return r; -} -/* }}} */ - -static void _free_reg_cache(reg_cache *rc) -{ - regfree(&rc->preg); -} - -#undef regfree -#define regfree(a); -#undef regcomp -#define regcomp(a, b, c) _php_regcomp(a, b, c) - -static void php_reg_init_globals(php_reg_globals *reg_globals TSRMLS_DC) -{ - zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); -} - -PHP_MINIT_FUNCTION(regex) -{ -#ifdef ZTS - ts_allocate_id(®_globals_id, sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL); -#else - php_reg_init_globals(®_globals TSRMLS_CC); -#endif - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(regex) -{ - zend_hash_destroy(®(ht_rc)); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(regex) -{ -#if HSREGEX - php_info_print_table_row(2, "Regex Library", "Bundled library enabled"); -#else - php_info_print_table_row(2, "Regex Library", "System library enabled"); -#endif -} - - -/* {{{ php_reg_eprint - * php_reg_eprint - convert error number to name - */ -static void php_reg_eprint(int err, regex_t *re) { - char *buf = NULL, *message = NULL; - size_t len; - size_t buf_len; - -#ifdef REG_ITOA - /* get the length of the message */ - buf_len = regerror(REG_ITOA | err, re, NULL, 0); - if (buf_len) { - buf = (char *)emalloc(buf_len * sizeof(char)); - if (!buf) return; /* fail silently */ - /* finally, get the error message */ - regerror(REG_ITOA | err, re, buf, buf_len); - } -#else - buf_len = 0; -#endif - len = regerror(err, re, NULL, 0); - if (len) { - message = (char *)emalloc((buf_len + len + 2) * sizeof(char)); - if (!message) { - return; /* fail silently */ - } - if (buf_len) { - snprintf(message, buf_len, "%s: ", buf); - buf_len += 1; /* so pointer math below works */ - } - /* drop the message into place */ - regerror(err, re, message + buf_len, len); - - php_error(E_WARNING, "%s", message); - } - - STR_FREE(buf); - STR_FREE(message); -} -/* }}} */ - -/* {{{ php_ereg - */ -static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **regex, /* Regular expression */ - **findin, /* String to apply expression to */ - **array = NULL; /* Optional register array */ - regex_t re; - regmatch_t *subs; - int err, match_len, string_len; - uint i; - int copts = 0; - off_t start, end; - char *buf = NULL; - char *string = NULL; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (icase) - copts |= REG_ICASE; - - if (argc == 2) - copts |= REG_NOSUB; - - /* compile the regular expression from the supplied regex */ - if (Z_TYPE_PP(regex) == IS_STRING) { - err = regcomp(&re, Z_STRVAL_PP(regex), REG_EXTENDED | copts); - } else { - /* we convert numbers to integers and treat them as a string */ - if (Z_TYPE_PP(regex) == IS_DOUBLE) - convert_to_long_ex(regex); /* get rid of decimal places */ - convert_to_string_ex(regex); - /* don't bother doing an extended regex with just a number */ - err = regcomp(&re, Z_STRVAL_PP(regex), copts); - } - - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - /* make a copy of the string we're looking in */ - convert_to_string_ex(findin); - string = estrndup(Z_STRVAL_PP(findin), Z_STRLEN_PP(findin)); - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - if (!subs) { - php_error(E_WARNING, "Unable to allocate memory in php_ereg"); - RETURN_FALSE; - } - - /* actually execute the regular expression */ - err = regexec(&re, string, re.re_nsub+1, subs, 0); - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - efree(subs); - RETURN_FALSE; - } - match_len = 1; - - if (array && err != REG_NOMATCH) { - match_len = (int) (subs[0].rm_eo - subs[0].rm_so); - string_len = Z_STRLEN_PP(findin) + 1; - - buf = emalloc(string_len); - if (!buf) { - php_error(E_WARNING, "Unable to allocate memory in php_ereg"); - regfree(&re); - efree(subs); - RETURN_FALSE; - } - - zval_dtor(*array); /* start with clean array */ - array_init(*array); - - for (i = 0; i <= re.re_nsub; i++) { - start = subs[i].rm_so; - end = subs[i].rm_eo; - if (start != -1 && end > 0 && start < string_len && end < string_len && start < end) { - add_index_stringl(*array, i, string+start, end-start, 1); - } else { - add_index_bool(*array, i, 0); - } - } - efree(buf); - } - - efree(subs); - efree(string); - if (err == REG_NOMATCH) { - RETVAL_FALSE; - } else { - if (match_len == 0) - match_len = 1; - RETVAL_LONG(match_len); - } - regfree(&re); -} -/* }}} */ - -/* {{{ proto int ereg(string pattern, string string [, array registers]) - Regular expression match */ -PHP_FUNCTION(ereg) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int eregi(string pattern, string string [, array registers]) - Case-insensitive regular expression match */ -PHP_FUNCTION(eregi) -{ - php_ereg(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_reg_replace - * this is the meat and potatoes of regex replacement! */ -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) -{ - regex_t re; - regmatch_t *subs; - - char *buf, /* buf is where we build the replaced string */ - *nbuf, /* nbuf is used when we grow the buffer */ - *walkbuf; /* used to walk buf when replacing backrefs */ - const char *walk; /* used to walk replacement string for backrefs */ - int buf_len; - int pos, tmp, string_len, new_l; - int err, copts = 0; - - string_len = strlen(string); - - if (icase) - copts = REG_ICASE; - if (extended) - copts |= REG_EXTENDED; - - err = regcomp(&re, pattern, copts); - if (err) { - php_reg_eprint(err, &re); - return ((char *) -1); - } - - - /* allocate storage for (sub-)expression-matches */ - subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1); - if (!subs) { - php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace"); - return ((char *) -1); - } - - /* start with a buffer that is twice the size of the stringo - we're doing replacements in */ - buf_len = 2 * string_len + 1; - buf = emalloc(buf_len * sizeof(char)); - if (!buf) { - php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace"); - efree(subs); - regfree(&re); - return ((char *) -1); - } - - err = pos = 0; - buf[0] = '\0'; - while (!err) { - err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0)); - - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - efree(subs); - efree(buf); - regfree(&re); - return ((char *) -1); - } - - if (!err) { - /* backref replacement is done in two passes: - 1) find out how long the string will be, and allocate buf - 2) copy the part before match, replacement and backrefs to buf - - Jaakko Hyvätti - */ - - new_l = strlen(buf) + subs[0].rm_so; /* part before the match */ - walk = replace; - while (*walk) - if ('\\' == *walk - && '0' <= walk[1] && '9' >= walk[1] - && subs[walk[1] - '0'].rm_so > -1 - && subs[walk[1] - '0'].rm_eo > -1) { - new_l += subs[walk[1] - '0'].rm_eo - - subs[walk[1] - '0'].rm_so; - walk += 2; - } else { - new_l++; - walk++; - } - - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = emalloc(buf_len); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - tmp = strlen(buf); - /* copy the part of the string before the match */ - strncat(buf, &string[pos], subs[0].rm_so); - - /* copy replacement and backrefs */ - walkbuf = &buf[tmp + subs[0].rm_so]; - walk = replace; - while (*walk) - if ('\\' == *walk - && '0' <= walk[1] && '9' >= walk[1] - && subs[walk[1] - '0'].rm_so > -1 - && subs[walk[1] - '0'].rm_eo > -1 - /* this next case shouldn't happen. it does. */ - && subs[walk[1] - '0'].rm_so < subs[walk[1] - '0'].rm_eo) { - tmp = subs[walk[1] - '0'].rm_eo - - subs[walk[1] - '0'].rm_so; - memcpy (walkbuf, - &string[pos + subs[walk[1] - '0'].rm_so], - tmp); - walkbuf += tmp; - walk += 2; - } else - *walkbuf++ = *walk++; - *walkbuf = '\0'; - - /* and get ready to keep looking for replacements */ - if (subs[0].rm_so == subs[0].rm_eo) { - if (subs[0].rm_so + pos >= string_len) - break; - new_l = strlen (buf) + 1; - if (new_l + 1 > buf_len) { - buf_len = 1 + buf_len + 2 * new_l; - nbuf = emalloc(buf_len * sizeof(char)); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - pos += subs[0].rm_eo + 1; - buf [new_l-1] = string [pos-1]; - buf [new_l] = '\0'; - } else { - pos += subs[0].rm_eo; - } - } else { /* REG_NOMATCH */ - new_l = strlen(buf) + strlen(&string[pos]); - if (new_l + 1 > buf_len) { - buf_len = new_l + 1; /* now we know exactly how long it is */ - nbuf = emalloc(buf_len * sizeof(char)); - strcpy(nbuf, buf); - efree(buf); - buf = nbuf; - } - /* stick that last bit of string on our output */ - strcat(buf, &string[pos]); - } - } - - /* don't want to leak memory .. */ - efree(subs); - regfree(&re); - - /* whew. */ - return (buf); -} -/* }}} */ - -/* {{{ php_ereg_replace - */ -static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - pval **arg_pattern, - **arg_replace, - **arg_string; - char *pattern; - char *string; - char *replace; - char *ret; - - if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(arg_pattern) == IS_STRING) { - if (Z_STRVAL_PP(arg_pattern) && Z_STRLEN_PP(arg_pattern)) - pattern = estrndup(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern)); - else - pattern = empty_string; - } else { - convert_to_long_ex(arg_pattern); - pattern = emalloc(2); - pattern[0] = (char) Z_LVAL_PP(arg_pattern); - pattern[1] = '\0'; - } - - if (Z_TYPE_PP(arg_replace) == IS_STRING) { - if (Z_STRVAL_PP(arg_replace) && Z_STRLEN_PP(arg_replace)) - replace = estrndup(Z_STRVAL_PP(arg_replace), Z_STRLEN_PP(arg_replace)); - else - replace = empty_string; - } else { - convert_to_long_ex(arg_replace); - replace = emalloc(2); - replace[0] = (char) Z_LVAL_PP(arg_replace); - replace[1] = '\0'; - } - - convert_to_string_ex(arg_string); - if (Z_STRVAL_PP(arg_string) && Z_STRLEN_PP(arg_string)) - string = estrndup(Z_STRVAL_PP(arg_string), Z_STRLEN_PP(arg_string)); - else - string = empty_string; - - /* do the actual work */ - ret = php_reg_replace(pattern, replace, string, icase, 1); - if (ret == (char *) -1) { - RETVAL_FALSE; - } else { - RETVAL_STRING(ret, 1); - STR_FREE(ret); - } - - STR_FREE(string); - STR_FREE(replace); - STR_FREE(pattern); -} -/* }}} */ - -/* {{{ proto string ereg_replace(string pattern, string replacement, string string) - Replace regular expression */ -PHP_FUNCTION(ereg_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string eregi_replace(string pattern, string replacement, string string) - Case insensitive replace regular expression */ -PHP_FUNCTION(eregi_replace) -{ - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_split - */ -static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) -{ - zval **spliton, **str, **arg_count = NULL; - regex_t re; - regmatch_t subs[1]; - char *strp, *endp; - int err, size, count = -1, copts = 0; - int argc = ZEND_NUM_ARGS(); - - if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (argc > 2) { - convert_to_long_ex(arg_count); - count = Z_LVAL_PP(arg_count); - } - - if (icase) - copts = REG_ICASE; - - convert_to_string_ex(spliton); - convert_to_string_ex(str); - - strp = Z_STRVAL_PP(str); - endp = strp + Z_STRLEN_PP(str); - - err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts); - if (err) { - php_reg_eprint(err, &re); - RETURN_FALSE; - } - - if (array_init(return_value) == FAILURE) { - regfree(&re); - RETURN_FALSE; - } - - /* churn through str, generating array entries as we go */ - while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) { - if (subs[0].rm_so == 0 && subs[0].rm_eo) { - /* match is at start of string, return empty string */ - add_next_index_stringl(return_value, empty_string, 0, 1); - /* skip ahead the length of the regex match */ - strp += subs[0].rm_eo; - } else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) { - /* No more matches */ - regfree(&re); - php_error(E_WARNING, "Invalid Regular Expression to split()"); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } else { - /* On a real match */ - - /* make a copy of the substring */ - size = subs[0].rm_so; - - /* add it to the array */ - add_next_index_stringl(return_value, strp, size, 1); - - /* point at our new starting point */ - strp = strp + subs[0].rm_eo; - } - - /* if we're only looking for a certain number of points, - stop looking once we hit it */ - if (count != -1) { - count--; - } - } - - /* see if we encountered an error */ - if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); - regfree(&re); - zend_hash_destroy(Z_ARRVAL_P(return_value)); - efree(Z_ARRVAL_P(return_value)); - RETURN_FALSE; - } - - /* otherwise we just have one last element to add to the array */ - size = endp - strp; - - add_next_index_stringl(return_value, strp, size, 1); - - regfree(&re); -} -/* }}} */ - -/* {{{ proto array split(string pattern, string string [, int limit]) - Split string into array by regular expression */ -PHP_FUNCTION(split) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto array spliti(string pattern, string string [, int limit]) - Split string into array by regular expression case-insensitive */ - -PHP_FUNCTION(spliti) -{ - php_split(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} - -/* }}} */ - -/* {{{ proto string sql_regcase(string string) - Make regular expression for case insensitive match */ -PHPAPI PHP_FUNCTION(sql_regcase) -{ - zval **string; - char *tmp; - unsigned char c; - register int i, j; - - if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &string)==FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(string); - - tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1); - - for (i = j = 0; i < Z_STRLEN_PP(string); i++) { - c = (unsigned char) Z_STRVAL_PP(string)[i]; - if(isalpha(c)) { - tmp[j++] = '['; - tmp[j++] = toupper(c); - tmp[j++] = tolower(c); - tmp[j++] = ']'; - } else { - tmp[j++] = c; - } - } - tmp[j] = 0; - - RETVAL_STRINGL(tmp, j, 1); - efree(tmp); -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h deleted file mode 100644 index 38c99837e01..00000000000 --- a/ext/ereg/php_ereg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - - -/* $Id$ */ - -#ifndef REG_H -#define REG_H - -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); - -PHP_FUNCTION(ereg); -PHP_FUNCTION(eregi); -PHP_FUNCTION(eregi_replace); -PHP_FUNCTION(ereg_replace); -PHP_FUNCTION(split); -PHP_FUNCTION(spliti); -PHPAPI PHP_FUNCTION(sql_regcase); - -typedef struct { - HashTable ht_rc; -} php_reg_globals; - -PHP_MINIT_FUNCTION(regex); -PHP_MSHUTDOWN_FUNCTION(regex); -PHP_MINFO_FUNCTION(regex); - - -#ifdef ZTS -#define REG(v) TSRMG(reg_globals_id, php_reg_globals *, v) -#else -#define REG(v) (reg_globals.v) -#endif - -#endif /* REG_H */ diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h deleted file mode 100644 index c1d1e0c232a..00000000000 --- a/ext/ereg/php_regex.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef PHP_REGEX_H -#define PHP_REGEX_H - -/* - * REGEX means: - * 0.. system regex - * 1.. bundled regex - */ - -#if REGEX -/* get aliases */ -#include "regex/regex_extra.h" -#include "regex/regex.h" - -/* get rid of aliases */ -#define PHP_NO_ALIASES -#include "regex/regex_extra.h" -#undef PHP_NO_ALIASES - -#undef _PCREPOSIX_H -#define _PCREPOSIX_H 1 - -#ifndef _REGEX_H -#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ -#endif -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#ifndef _RX_H -#define _RX_H 1 /* Try defining these for Linux to */ -#endif -#ifndef __REGEXP_LIBRARY_H__ -#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */ -#endif -#ifndef _H_REGEX -#define _H_REGEX 1 /* This one is for AIX */ -#endif -#elif REGEX == 0 -#include -#ifndef _REGEX_H_ -#define _REGEX_H_ 1 -#endif -#endif - -#endif /* PHP_REGEX_H */ diff --git a/ext/ereg/regex/COPYRIGHT b/ext/ereg/regex/COPYRIGHT deleted file mode 100644 index d43362fbfc9..00000000000 --- a/ext/ereg/regex/COPYRIGHT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. diff --git a/ext/ereg/regex/Makefile.in b/ext/ereg/regex/Makefile.in deleted file mode 100644 index 27b0331b9b8..00000000000 --- a/ext/ereg/regex/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libregex.la -LTLIBRARY_SOURCES = regcomp.c regexec.c regerror.c regfree.c - -include $(top_srcdir)/build/ltlib.mk diff --git a/ext/ereg/regex/README b/ext/ereg/regex/README deleted file mode 100644 index cea9b67b666..00000000000 --- a/ext/ereg/regex/README +++ /dev/null @@ -1,32 +0,0 @@ -alpha3.4 release. -Thu Mar 17 23:17:18 EST 1994 -henry@zoo.toronto.edu - -See WHATSNEW for change listing. - -installation notes: --------- -Read the comments at the beginning of Makefile before running. - -Utils.h contains some things that just might have to be modified on -some systems, as well as a nested include (ugh) of . - -The "fake" directory contains quick-and-dirty fakes for some header -files and routines that old systems may not have. Note also that --DUSEBCOPY will make utils.h substitute bcopy() for memmove(). - -After that, "make r" will build regcomp.o, regexec.o, regfree.o, -and regerror.o (the actual routines), bundle them together into a test -program, and run regression tests on them. No output is good output. - -"make lib" builds just the .o files for the actual routines (when -you're happy with testing and have adjusted CFLAGS for production), -and puts them together into libregex.a. You can pick up either the -library or *.o ("make lib" makes sure there are no other .o files left -around to confuse things). - -Main.c, debug.c, split.c are used for regression testing but are not part -of the RE routines themselves. - -Regex.h goes in /usr/include. All other .h files are internal only. --------- diff --git a/ext/ereg/regex/WHATSNEW b/ext/ereg/regex/WHATSNEW deleted file mode 100644 index 6e82e1dae0c..00000000000 --- a/ext/ereg/regex/WHATSNEW +++ /dev/null @@ -1,92 +0,0 @@ -New in alpha3.4: The complex bug alluded to below has been fixed (in a -slightly kludgey temporary way that may hurt efficiency a bit; this is -another "get it out the door for 4.4" release). The tests at the end of -the tests file have accordingly been uncommented. The primary sign of -the bug was that something like a?b matching ab matched b rather than ab. -(The bug was essentially specific to this exact situation, else it would -have shown up earlier.) - -New in alpha3.3: The definition of word boundaries has been altered -slightly, to more closely match the usual programming notion that "_" -is an alphabetic. Stuff used for pre-ANSI systems is now in a subdir, -and the makefile no longer alludes to it in mysterious ways. The -makefile has generally been cleaned up some. Fixes have been made -(again!) so that the regression test will run without -DREDEBUG, at -the cost of weaker checking. A workaround for a bug in some folks' - has been added. And some more things have been added to -tests, including a couple right at the end which are commented out -because the code currently flunks them (complex bug; fix coming). -Plus the usual minor cleanup. - -New in alpha3.2: Assorted bits of cleanup and portability improvement -(the development base is now a BSDI system using GCC instead of an ancient -Sun system, and the newer compiler exposed some glitches). Fix for a -serious bug that affected REs using many [] (including REG_ICASE REs -because of the way they are implemented), *sometimes*, depending on -memory-allocation patterns. The header-file prototypes no longer name -the parameters, avoiding possible name conflicts. The possibility that -some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is -now handled gracefully. "uchar" is no longer used as an internal type -name (too many people have the same idea). Still the same old lousy -performance, alas. - -New in alpha3.1: Basically nothing, this release is just a bookkeeping -convenience. Stay tuned. - -New in alpha3.0: Performance is no better, alas, but some fixes have been -made and some functionality has been added. (This is basically the "get -it out the door in time for 4.4" release.) One bug fix: regfree() didn't -free the main internal structure (how embarrassing). It is now possible -to put NULs in either the RE or the target string, using (resp.) a new -REG_PEND flag and the old REG_STARTEND flag. The REG_NOSPEC flag to -regcomp() makes all characters ordinary, so you can match a literal -string easily (this will become more useful when performance improves!). -There are now primitives to match beginnings and ends of words, although -the syntax is disgusting and so is the implementation. The REG_ATOI -debugging interface has changed a bit. And there has been considerable -internal cleanup of various kinds. - -New in alpha2.3: Split change list out of README, and moved flags notes -into Makefile. Macro-ized the name of regex(7) in regex(3), since it has -to change for 4.4BSD. Cleanup work in engine.c, and some new regression -tests to catch tricky cases thereof. - -New in alpha2.2: Out-of-date manpages updated. Regerror() acquires two -small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges -in my own test program and might be useful to others for similar purposes. -The regression test will now compile (and run) without REDEBUG. The -BRE \$ bug is fixed. Most uses of "uchar" are gone; it's all chars now. -Char/uchar parameters are now written int/unsigned, to avoid possible -portability problems with unpromoted parameters. Some unsigned casts have -been introduced to minimize portability problems with shifting into sign -bits. - -New in alpha2.1: Lots of little stuff, cleanup and fixes. The one big -thing is that regex.h is now generated, using mkh, rather than being -supplied in the distribution; due to circularities in dependencies, -you have to build regex.h explicitly by "make h". The two known bugs -have been fixed (and the regression test now checks for them), as has a -problem with assertions not being suppressed in the absence of REDEBUG. -No performance work yet. - -New in alpha2: Backslash-anything is an ordinary character, not an -error (except, of course, for the handful of backslashed metacharacters -in BREs), which should reduce script breakage. The regression test -checks *where* null strings are supposed to match, and has generally -been tightened up somewhat. Small bug fixes in parameter passing (not -harmful, but technically errors) and some other areas. Debugging -invoked by defining REDEBUG rather than not defining NDEBUG. - -New in alpha+3: full prototyping for internal routines, using a little -helper program, mkh, which extracts prototypes given in stylized comments. -More minor cleanup. Buglet fix: it's CHAR_BIT, not CHAR_BITS. Simple -pre-screening of input when a literal string is known to be part of the -RE; this does wonders for performance. - -New in alpha+2: minor bits of cleanup. Notably, the number "32" for the -word width isn't hardwired into regexec.c any more, the public header -file prototypes the functions if __STDC__ is defined, and some small typos -in the manpages have been fixed. - -New in alpha+1: improvements to the manual pages, and an important -extension, the REG_STARTEND option to regexec(). diff --git a/ext/ereg/regex/cclass.h b/ext/ereg/regex/cclass.h deleted file mode 100644 index 6227f810b72..00000000000 --- a/ext/ereg/regex/cclass.h +++ /dev/null @@ -1,30 +0,0 @@ -/* character-class table */ -static struct cclass { - char *name; - char *chars; - char *multis; -} cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - ""}, - {"blank", " \t", ""}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", ""}, - {"digit", "0123456789", ""}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - ""}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - ""}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - ""}, - {"space", "\t\n\v\f\r ", ""}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - ""}, - {"xdigit", "0123456789ABCDEFabcdef", - ""}, - {NULL, 0, ""} -}; diff --git a/ext/ereg/regex/cname.h b/ext/ereg/regex/cname.h deleted file mode 100644 index 670b2738828..00000000000 --- a/ext/ereg/regex/cname.h +++ /dev/null @@ -1,102 +0,0 @@ -/* character-name table */ -static struct cname { - char *name; - char code; -} cnames[] = { - {"NUL", '\0'}, - {"SOH", '\001'}, - {"STX", '\002'}, - {"ETX", '\003'}, - {"EOT", '\004'}, - {"ENQ", '\005'}, - {"ACK", '\006'}, - {"BEL", '\007'}, - {"alert", '\007'}, - {"BS", '\010'}, - {"backspace", '\b'}, - {"HT", '\011'}, - {"tab", '\t'}, - {"LF", '\012'}, - {"newline", '\n'}, - {"VT", '\013'}, - {"vertical-tab", '\v'}, - {"FF", '\014'}, - {"form-feed", '\f'}, - {"CR", '\015'}, - {"carriage-return", '\r'}, - {"SO", '\016'}, - {"SI", '\017'}, - {"DLE", '\020'}, - {"DC1", '\021'}, - {"DC2", '\022'}, - {"DC3", '\023'}, - {"DC4", '\024'}, - {"NAK", '\025'}, - {"SYN", '\026'}, - {"ETB", '\027'}, - {"CAN", '\030'}, - {"EM", '\031'}, - {"SUB", '\032'}, - {"ESC", '\033'}, - {"IS4", '\034'}, - {"FS", '\034'}, - {"IS3", '\035'}, - {"GS", '\035'}, - {"IS2", '\036'}, - {"RS", '\036'}, - {"IS1", '\037'}, - {"US", '\037'}, - {"space", ' '}, - {"exclamation-mark", '!'}, - {"quotation-mark", '"'}, - {"number-sign", '#'}, - {"dollar-sign", '$'}, - {"percent-sign", '%'}, - {"ampersand", '&'}, - {"apostrophe", '\''}, - {"left-parenthesis", '('}, - {"right-parenthesis", ')'}, - {"asterisk", '*'}, - {"plus-sign", '+'}, - {"comma", ','}, - {"hyphen", '-'}, - {"hyphen-minus", '-'}, - {"period", '.'}, - {"full-stop", '.'}, - {"slash", '/'}, - {"solidus", '/'}, - {"zero", '0'}, - {"one", '1'}, - {"two", '2'}, - {"three", '3'}, - {"four", '4'}, - {"five", '5'}, - {"six", '6'}, - {"seven", '7'}, - {"eight", '8'}, - {"nine", '9'}, - {"colon", ':'}, - {"semicolon", ';'}, - {"less-than-sign", '<'}, - {"equals-sign", '='}, - {"greater-than-sign", '>'}, - {"question-mark", '?'}, - {"commercial-at", '@'}, - {"left-square-bracket", '['}, - {"backslash", '\\'}, - {"reverse-solidus", '\\'}, - {"right-square-bracket", ']'}, - {"circumflex", '^'}, - {"circumflex-accent", '^'}, - {"underscore", '_'}, - {"low-line", '_'}, - {"grave-accent", '`'}, - {"left-brace", '{'}, - {"left-curly-bracket", '{'}, - {"vertical-line", '|'}, - {"right-brace", '}'}, - {"right-curly-bracket", '}'}, - {"tilde", '~'}, - {"DEL", '\177'}, - {NULL, 0}, -}; diff --git a/ext/ereg/regex/debug.c b/ext/ereg/regex/debug.c deleted file mode 100644 index c0feaeb1694..00000000000 --- a/ext/ereg/regex/debug.c +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" -#include "debug.ih" - -/* - - regprint - print a regexp for debugging - == void regprint(regex_t *r, FILE *d); - */ -void -regprint(r, d) -regex_t *r; -FILE *d; -{ - register struct re_guts *g = r->re_g; - register int i; - register int c; - register int last; - int nincat[NC]; - - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); - fprintf(d, ", first %ld last %ld", (long)g->firststate, - (long)g->laststate); - if (g->iflags&USEBOL) - fprintf(d, ", USEBOL"); - if (g->iflags&USEEOL) - fprintf(d, ", USEEOL"); - if (g->iflags&BAD) - fprintf(d, ", BAD"); - if (g->nsub > 0) - fprintf(d, ", nsub=%ld", (long)g->nsub); - if (g->must != NULL) - fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen, - g->must); - if (g->backrefs) - fprintf(d, ", backrefs"); - if (g->nplus > 0) - fprintf(d, ", nplus %ld", (long)g->nplus); - fprintf(d, "\n"); - s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } -} - -/* - - s_print - print the strip for debugging - == static void s_print(register struct re_guts *g, FILE *d); - */ -static void -s_print(g, d) -register struct re_guts *g; -FILE *d; -{ - register sop *s; - register cset *cs; - register int i; - register int done = 0; - register sop opnd; - register int col = 0; - register int last; - register sopno offset = 2; -# define GAP() { if (offset % 5 == 0) { \ - if (col > 40) { \ - fprintf(d, "\n\t"); \ - col = 0; \ - } else { \ - fprintf(d, " "); \ - col++; \ - } \ - } else \ - col++; \ - offset++; \ - } - - if (OP(g->strip[0]) != OEND) - fprintf(d, "missing initial OEND!\n"); - for (s = &g->strip[1]; !done; s++) { - opnd = OPND(*s); - switch (OP(*s)) { - case OEND: - fprintf(d, "\n"); - done = 1; - break; - case OCHAR: - if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL) - fprintf(d, "\\%c", (char)opnd); - else - fprintf(d, "%s", regchar((char)opnd)); - break; - case OBOL: - fprintf(d, "^"); - break; - case OEOL: - fprintf(d, "$"); - break; - case OBOW: - fprintf(d, "\\{"); - break; - case OEOW: - fprintf(d, "\\}"); - break; - case OANY: - fprintf(d, "."); - break; - case OANYOF: - fprintf(d, "[(%ld)", (long)opnd); - cs = &g->sets[opnd]; - last = -1; - for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ - if (CHIN(cs, i) && i < g->csetsize) { - if (last < 0) { - fprintf(d, "%s", regchar(i)); - last = i; - } - } else { - if (last >= 0) { - if (last != i-1) - fprintf(d, "-%s", - regchar(i-1)); - last = -1; - } - } - fprintf(d, "]"); - break; - case OBACK_: - fprintf(d, "(\\<%ld>", (long)opnd); - break; - case O_BACK: - fprintf(d, "<%ld>\\)", (long)opnd); - break; - case OPLUS_: - fprintf(d, "(+"); - if (OP(*(s+opnd)) != O_PLUS) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_PLUS: - if (OP(*(s-opnd)) != OPLUS_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "+)"); - break; - case OQUEST_: - fprintf(d, "(?"); - if (OP(*(s+opnd)) != O_QUEST) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_QUEST: - if (OP(*(s-opnd)) != OQUEST_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "?)"); - break; - case OLPAREN: - fprintf(d, "((<%ld>", (long)opnd); - break; - case ORPAREN: - fprintf(d, "<%ld>))", (long)opnd); - break; - case OCH_: - fprintf(d, "<"); - if (OP(*(s+opnd)) != OOR2) - fprintf(d, "<%ld>", (long)opnd); - break; - case OOR1: - if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, "|"); - break; - case OOR2: - fprintf(d, "|"); - if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH) - fprintf(d, "<%ld>", (long)opnd); - break; - case O_CH: - if (OP(*(s-opnd)) != OOR1) - fprintf(d, "<%ld>", (long)opnd); - fprintf(d, ">"); - break; - default: - fprintf(d, "!%ld(%ld)!", OP(*s), opnd); - break; - } - if (!done) - GAP(); - } -} - -/* - - regchar - make a character printable - == static char *regchar(int ch); - */ -static char * /* -> representation */ -regchar(ch) -int ch; -{ - static char buf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(buf, "%c", ch); - else - sprintf(buf, "\\%o", ch); - return(buf); -} diff --git a/ext/ereg/regex/debug.ih b/ext/ereg/regex/debug.ih deleted file mode 100644 index 5f40ff79178..00000000000 --- a/ext/ereg/regex/debug.ih +++ /dev/null @@ -1,14 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === debug.c === */ -void regprint(regex_t *r, FILE *d); -static void s_print(register struct re_guts *g, FILE *d); -static char *regchar(int ch); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/engine.c b/ext/ereg/regex/engine.c deleted file mode 100644 index 0b88dcf1ed8..00000000000 --- a/ext/ereg/regex/engine.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* - * The matching engine and friends. This file is #included by regexec.c - * after suitable #defines of a variety of macros used herein, so that - * different state representations can be used without duplicating masses - * of code. - */ - -#ifdef SNAMES -#define matcher smatcher -#define fast sfast -#define slow sslow -#define dissect sdissect -#define backref sbackref -#define step sstep -#define print sprint -#define at sat -#define match smat -#endif -#ifdef LNAMES -#define matcher lmatcher -#define fast lfast -#define slow lslow -#define dissect ldissect -#define backref lbackref -#define step lstep -#define print lprint -#define at lat -#define match lmat -#endif - -/* another structure passed up and down to avoid zillions of parameters */ -struct match { - struct re_guts *g; - int eflags; - regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ - char *offp; /* offsets work from here */ - char *beginp; /* start of string -- virtual NUL precedes */ - char *endp; /* end of string -- virtual NUL here */ - char *coldp; /* can be no match starting before here */ - char **lastpos; /* [nplus+1] */ - STATEVARS; - states st; /* current states */ - states fresh; /* states for a fresh start */ - states tmp; /* temporary */ - states empty; /* empty set of states */ -}; - -#include "engine.ih" - -#ifdef REDEBUG -#define SP(t, s, c) print(m, t, s, c, stdout) -#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) -#define NOTE(str) { if (m->eflags®_TRACE) printf("=%s\n", (str)); } -#else -#define SP(t, s, c) /* nothing */ -#define AT(t, p1, p2, s1, s2) /* nothing */ -#define NOTE(s) /* nothing */ -#endif - -/* - - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, char *string, \ - == size_t nmatch, regmatch_t pmatch[], int eflags); - */ -static int /* 0 success, REG_NOMATCH failure */ -matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; -char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register char *endp; - register size_t i; - struct match mv; - register struct match *m = &mv; - register char *dp; - const register sopno gf = g->firststate+1; /* +1 for OEND */ - const register sopno gl = g->laststate; - char *start; - char *stop; - - /* simplify the situation where possible */ - if (g->cflags®_NOSUB) - nmatch = 0; - if (eflags®_STARTEND) { - start = string + pmatch[0].rm_so; - stop = string + pmatch[0].rm_eo; - } else { - start = string; - stop = start + strlen(start); - } - if (stop < start) - return(REG_INVARG); - - /* prescreening; this does wonders for this rather slow code */ - if (g->must != NULL) { - for (dp = start; dp < stop; dp++) - if (*dp == g->must[0] && stop - dp >= g->mlen && - memcmp(dp, g->must, (size_t)g->mlen) == 0) - break; - if (dp == stop) /* we didn't find g->must */ - return(REG_NOMATCH); - } - - /* match struct setup */ - m->g = g; - m->eflags = eflags; - m->pmatch = NULL; - m->lastpos = NULL; - m->offp = string; - m->beginp = start; - m->endp = stop; - STATESETUP(m, 4); - SETUP(m->st); - SETUP(m->fresh); - SETUP(m->tmp); - SETUP(m->empty); - CLEAR(m->empty); - - /* this loop does only one repetition except for backrefs */ - for (;;) { - endp = fast(m, start, stop, gf, gl); - if (endp == NULL) { /* a miss */ - STATETEARDOWN(m); - return(REG_NOMATCH); - } - if (nmatch == 0 && !g->backrefs) - break; /* no further info needed */ - - /* where? */ - assert(m->coldp != NULL); - for (;;) { - NOTE("finding start"); - endp = slow(m, m->coldp, stop, gf, gl); - if (endp != NULL) - break; - assert(m->coldp < m->endp); - m->coldp++; - } - if (nmatch == 1 && !g->backrefs) - break; /* no further info needed */ - - /* oh my, he wants the subexpressions... */ - if (m->pmatch == NULL) - m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * - sizeof(regmatch_t)); - if (m->pmatch == NULL) { - STATETEARDOWN(m); - return(REG_ESPACE); - } - for (i = 1; i <= m->g->nsub; i++) - m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; - if (!g->backrefs && !(m->eflags®_BACKR)) { - NOTE("dissecting"); - dp = dissect(m, m->coldp, endp, gf, gl); - } else { - if (g->nplus > 0 && m->lastpos == NULL) - m->lastpos = (char **)malloc((g->nplus+1) * - sizeof(char *)); - if (g->nplus > 0 && m->lastpos == NULL) { - free(m->pmatch); - STATETEARDOWN(m); - return(REG_ESPACE); - } - NOTE("backref dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - if (dp != NULL) - break; - - /* uh-oh... we couldn't find a subexpression-level match */ - assert(g->backrefs); /* must be back references doing it */ - assert(g->nplus == 0 || m->lastpos != NULL); - for (;;) { - if (dp != NULL || endp <= m->coldp) - break; /* defeat */ - NOTE("backoff"); - endp = slow(m, m->coldp, endp-1, gf, gl); - if (endp == NULL) - break; /* defeat */ - /* try it on a shorter possibility */ -#ifndef NDEBUG - for (i = 1; i <= m->g->nsub; i++) { - assert(m->pmatch[i].rm_so == -1); - assert(m->pmatch[i].rm_eo == -1); - } -#endif - NOTE("backoff dissect"); - dp = backref(m, m->coldp, endp, gf, gl, (sopno)0); - } - assert(dp == NULL || dp == endp); - if (dp != NULL) /* found a shorter one */ - break; - - /* despite initial appearances, there is no match here */ - NOTE("false alarm"); - start = m->coldp + 1; /* recycle starting later */ - assert(start <= stop); - } - - /* fill in the details if requested */ - if (nmatch > 0) { - pmatch[0].rm_so = m->coldp - m->offp; - pmatch[0].rm_eo = endp - m->offp; - } - if (nmatch > 1) { - assert(m->pmatch != NULL); - for (i = 1; i < nmatch; i++) - if (i <= m->g->nsub) - pmatch[i] = m->pmatch[i]; - else { - pmatch[i].rm_so = -1; - pmatch[i].rm_eo = -1; - } - } - - if (m->pmatch != NULL) - free((char *)m->pmatch); - if (m->lastpos != NULL) - free((char *)m->lastpos); - STATETEARDOWN(m); - return(0); -} - -/* - - dissect - figure out what matched what, no back references - == static char *dissect(register struct match *m, char *start, \ - == char *stop, sopno startst, sopno stopst); - */ -static char * /* == stop (success) always */ -dissect(m, start, stop, startst, stopst) -register struct match *m; -char *start; -char *stop; -sopno startst; -sopno stopst; -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register char *sp; /* start of string matched by it */ - register char *stp; /* string matched by it cannot pass here */ - register char *rest; /* start of rest of string */ - register char *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register char *ssp; /* start of string matched by subsubRE */ - register char *sep; /* end of string matched by subsubRE */ - register char *oldssp; /* previous ssp */ - register char *dp; - - AT("diss", start, stop, startst, stopst); - sp = start; - for (ss = startst; ss < stopst; ss = es) { - /* identify end of subRE */ - es = ss; - switch (OP(m->g->strip[es])) { - case OPLUS_: - case OQUEST_: - es += OPND(m->g->strip[es]); - break; - case OCH_: - while (OP(m->g->strip[es]) != O_CH) - es += OPND(m->g->strip[es]); - break; - } - es++; - - /* figure out what it matched */ - switch (OP(m->g->strip[ss])) { - case OEND: - assert(nope); - break; - case OCHAR: - sp++; - break; - case OBOL: - case OEOL: - case OBOW: - case OEOW: - break; - case OANY: - case OANYOF: - sp++; - break; - case OBACK_: - case O_BACK: - assert(nope); - break; - /* cases where length of match is hard to find */ - case OQUEST_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - /* did innards match? */ - if (slow(m, sp, rest, ssub, esub) != NULL) { - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - } else /* no */ - assert(sp == rest); - sp = rest; - break; - case OPLUS_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = es - 1; - ssp = sp; - oldssp = ssp; - for (;;) { /* find last match of innards */ - sep = slow(m, ssp, rest, ssub, esub); - if (sep == NULL || sep == ssp) - break; /* failed or matched null */ - oldssp = ssp; /* on to next try */ - ssp = sep; - } - if (sep == NULL) { - /* last successful match */ - sep = ssp; - ssp = oldssp; - } - assert(sep == rest); /* must exhaust substring */ - assert(slow(m, ssp, sep, ssub, esub) == rest); - dp = dissect(m, ssp, sep, ssub, esub); - assert(dp == sep); - sp = rest; - break; - case OCH_: - stp = stop; - for (;;) { - /* how long could this one be? */ - rest = slow(m, sp, stp, ss, es); - assert(rest != NULL); /* it did match */ - /* could the rest match the rest? */ - tail = slow(m, rest, stop, es, stopst); - if (tail == stop) - break; /* yes! */ - /* no -- try a shorter match for this one */ - stp = rest - 1; - assert(stp >= sp); /* it did work */ - } - ssub = ss + 1; - esub = ss + OPND(m->g->strip[ss]) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - if (slow(m, sp, rest, ssub, esub) == rest) - break; /* it matched all of it */ - /* that one missed, try next one */ - assert(OP(m->g->strip[esub]) == OOR1); - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - dp = dissect(m, sp, rest, ssub, esub); - assert(dp == rest); - sp = rest; - break; - case O_PLUS: - case O_QUEST: - case OOR1: - case OOR2: - case O_CH: - assert(nope); - break; - case OLPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_so = sp - m->offp; - break; - case ORPAREN: - i = OPND(m->g->strip[ss]); - assert(0 < i && i <= m->g->nsub); - m->pmatch[i].rm_eo = sp - m->offp; - break; - default: /* uh oh */ - assert(nope); - break; - } - } - - assert(sp == stop); - return(sp); -} - -/* - - backref - figure out what matched what, figuring in back references - == static char *backref(register struct match *m, char *start, \ - == char *stop, sopno startst, sopno stopst, sopno lev); - */ -static char * /* == stop (success) or NULL (failure) */ -backref(m, start, stop, startst, stopst, lev) -register struct match *m; -char *start; -char *stop; -sopno startst; -sopno stopst; -sopno lev; /* PLUS nesting level */ -{ - register int i; - register sopno ss; /* start sop of current subRE */ - register char *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register char *ssp; /* start of string matched by subsubRE */ - register char *dp; - register size_t len; - register int hard; - register sop s; - register regoff_t offsave; - register cset *cs; - - AT("back", start, stop, startst, stopst); - sp = start; - - /* get as far as we can with easy stuff */ - hard = 0; - for (ss = startst; !hard && ss < stopst; ss++) - switch (OP(s = m->g->strip[ss])) { - case OCHAR: - if (sp == stop || *sp++ != (char)OPND(s)) - return(NULL); - break; - case OANY: - if (sp == stop) - return(NULL); - sp++; - break; - case OANYOF: - cs = &m->g->sets[OPND(s)]; - if (sp == stop || !CHIN(cs, *sp++)) - return(NULL); - break; - case OBOL: - if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOL: - if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) ) - { /* yes */ } - else - return(NULL); - break; - case OBOW: - if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && - !ISWORD(*(sp-1))) ) && - (sp < m->endp && ISWORD(*sp)) ) - { /* yes */ } - else - return(NULL); - break; - case OEOW: - if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || - (sp < m->endp && *sp == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp < m->endp && !ISWORD(*sp)) ) && - (sp > m->beginp && ISWORD(*(sp-1))) ) - { /* yes */ } - else - return(NULL); - break; - case O_QUEST: - break; - case OOR1: /* matches null but needs to skip */ - ss++; - s = m->g->strip[ss]; - do { - assert(OP(s) == OOR2); - ss += OPND(s); - } while (OP(s = m->g->strip[ss]) != O_CH); - /* note that the ss++ gets us past the O_CH */ - break; - default: /* have to make a choice */ - hard = 1; - break; - } - if (!hard) { /* that was it! */ - if (sp != stop) - return(NULL); - return(sp); - } - ss--; /* adjust for the for's final increment */ - - /* the hard stuff */ - AT("hard", sp, stop, ss, stopst); - s = m->g->strip[ss]; - switch (OP(s)) { - case OBACK_: /* the vilest depths */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - if (m->pmatch[i].rm_eo == -1) - return(NULL); - assert(m->pmatch[i].rm_so != -1); - len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; - assert(stop - m->beginp >= len); - if (sp > stop - len) - return(NULL); /* not enough left to match */ - ssp = m->offp + m->pmatch[i].rm_so; - if (memcmp(sp, ssp, len) != 0) - return(NULL); - while (m->g->strip[ss] != SOP(O_BACK, i)) - ss++; - return(backref(m, sp+len, stop, ss+1, stopst, lev)); - break; - case OQUEST_: /* to null or not */ - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); /* not */ - return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev)); - break; - case OPLUS_: - assert(m->lastpos != NULL); - assert(lev+1 <= m->g->nplus); - m->lastpos[lev+1] = sp; - return(backref(m, sp, stop, ss+1, stopst, lev+1)); - break; - case O_PLUS: - if (sp == m->lastpos[lev]) /* last pass matched null */ - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - /* try another pass */ - m->lastpos[lev] = sp; - dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev); - if (dp == NULL) - return(backref(m, sp, stop, ss+1, stopst, lev-1)); - else - return(dp); - break; - case OCH_: /* find the right one, if any */ - ssub = ss + 1; - esub = ss + OPND(s) - 1; - assert(OP(m->g->strip[esub]) == OOR1); - for (;;) { /* find first matching branch */ - dp = backref(m, sp, stop, ssub, esub, lev); - if (dp != NULL) - return(dp); - /* that one missed, try next one */ - if (OP(m->g->strip[esub]) == O_CH) - return(NULL); /* there is none */ - esub++; - assert(OP(m->g->strip[esub]) == OOR2); - ssub = esub + 1; - esub += OPND(m->g->strip[esub]); - if (OP(m->g->strip[esub]) == OOR2) - esub--; - else - assert(OP(m->g->strip[esub]) == O_CH); - } - break; - case OLPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_so; - m->pmatch[i].rm_so = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_so = offsave; - return(NULL); - break; - case ORPAREN: /* must undo assignment if rest fails */ - i = OPND(s); - assert(0 < i && i <= m->g->nsub); - offsave = m->pmatch[i].rm_eo; - m->pmatch[i].rm_eo = sp - m->offp; - dp = backref(m, sp, stop, ss+1, stopst, lev); - if (dp != NULL) - return(dp); - m->pmatch[i].rm_eo = offsave; - return(NULL); - break; - default: /* uh oh */ - assert(nope); - break; - } - - /* "can't happen" */ - assert(nope); - /* NOTREACHED */ - return((char *)NULL); /* dummy */ -} - -/* - - fast - step through the string at top speed - == static char *fast(register struct match *m, char *start, \ - == char *stop, sopno startst, sopno stopst); - */ -static char * /* where tentative match ended, or NULL */ -fast(m, start, stop, startst, stopst) -register struct match *m; -char *start; -char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states fresh = m->fresh; - register states tmp = m->tmp; - register char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register char *coldp; /* last p after which no match was underway */ - - CLEAR(st); - SET1(st, startst); - st = step(m->g, startst, stopst, st, NOTHING, st); - ASSIGN(fresh, st); - SP("start", st, *p); - coldp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - if (EQ(st, fresh)) - coldp = p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("boleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("boweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, fresh); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("aft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - assert(coldp != NULL); - m->coldp = coldp; - if (ISSET(st, stopst)) - return(p+1); - else - return(NULL); -} - -/* - - slow - step through the string more deliberately - == static char *slow(register struct match *m, char *start, \ - == char *stop, sopno startst, sopno stopst); - */ -static char * /* where it ended */ -slow(m, start, stop, startst, stopst) -register struct match *m; -char *start; -char *stop; -sopno startst; -sopno stopst; -{ - register states st = m->st; - register states empty = m->empty; - register states tmp = m->tmp; - register char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register char *matchp; /* last p at which a match ended */ - - AT("slow", start, stop, startst, stopst); - CLEAR(st); - SET1(st, startst); - SP("sstart", st, *p); - st = step(m->g, startst, stopst, st, NOTHING, st); - matchp = NULL; - for (;;) { - /* next character */ - lastc = c; - c = (p == m->endp) ? OUT : *p; - - /* is there an EOL and/or BOL between lastc and c? */ - flagch = '\0'; - i = 0; - if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || - (lastc == OUT && !(m->eflags®_NOTBOL)) ) { - flagch = BOL; - i = m->g->nbol; - } - if ( (c == '\n' && m->g->cflags®_NEWLINE) || - (c == OUT && !(m->eflags®_NOTEOL)) ) { - flagch = (flagch == BOL) ? BOLEOL : EOL; - i += m->g->neol; - } - if (i != 0) { - for (; i > 0; i--) - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboleol", st, c); - } - - /* how about a word boundary? */ - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && - (c != OUT && ISWORD(c)) ) { - flagch = BOW; - } - if ( (lastc != OUT && ISWORD(lastc)) && - (flagch == EOL || (c != OUT && !ISWORD(c))) ) { - flagch = EOW; - } - if (flagch == BOW || flagch == EOW) { - st = step(m->g, startst, stopst, st, flagch, st); - SP("sboweow", st, c); - } - - /* are we done? */ - if (ISSET(st, stopst)) - matchp = p; - if (EQ(st, empty) || p == stop) - break; /* NOTE BREAK OUT */ - - /* no, we must deal with this character */ - ASSIGN(tmp, st); - ASSIGN(st, empty); - assert(c != OUT); - st = step(m->g, startst, stopst, tmp, c, st); - SP("saft", st, c); - assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); - p++; - } - - return(matchp); -} - - -/* - - step - map set of states reachable before char to set reachable after - == static states step(register struct re_guts *g, sopno start, sopno stop, \ - == register states bef, int ch, register states aft); - == #define BOL (OUT+1) - == #define EOL (BOL+1) - == #define BOLEOL (BOL+2) - == #define NOTHING (BOL+3) - == #define BOW (BOL+4) - == #define EOW (BOL+5) - == #define CODEMAX (BOL+5) // highest code used - == #define NONCHAR(c) ((c) > CHAR_MAX) - == #define NNONCHAR (CODEMAX-CHAR_MAX) - */ -static states -step(g, start, stop, bef, ch, aft) -register struct re_guts *g; -sopno start; /* start state within strip */ -sopno stop; /* state after stop state within strip */ -register states bef; /* states reachable before */ -int ch; /* character or NONCHAR code */ -register states aft; /* states already known reachable after */ -{ - register cset *cs; - register sop s; - register sopno pc; - register onestate here; /* note, macros know this name */ - register sopno look; - register long i; - - for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { - s = g->strip[pc]; - switch (OP(s)) { - case OEND: - assert(pc == stop-1); - break; - case OCHAR: - /* only characters can match */ - assert(!NONCHAR(ch) || ch != (char)OPND(s)); - if (ch == (char)OPND(s)) - FWD(aft, bef, 1); - break; - case OBOL: - if (ch == BOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OEOL: - if (ch == EOL || ch == BOLEOL) - FWD(aft, bef, 1); - break; - case OBOW: - if (ch == BOW) - FWD(aft, bef, 1); - break; - case OEOW: - if (ch == EOW) - FWD(aft, bef, 1); - break; - case OANY: - if (!NONCHAR(ch)) - FWD(aft, bef, 1); - break; - case OANYOF: - cs = &g->sets[OPND(s)]; - if (!NONCHAR(ch) && CHIN(cs, ch)) - FWD(aft, bef, 1); - break; - case OBACK_: /* ignored here */ - case O_BACK: - FWD(aft, aft, 1); - break; - case OPLUS_: /* forward, this is just an empty */ - FWD(aft, aft, 1); - break; - case O_PLUS: /* both forward and back */ - FWD(aft, aft, 1); - i = ISSETBACK(aft, OPND(s)); - BACK(aft, aft, OPND(s)); - if (!i && ISSETBACK(aft, OPND(s))) { - /* oho, must reconsider loop body */ - pc -= OPND(s) + 1; - INIT(here, pc); - } - break; - case OQUEST_: /* two branches, both forward */ - FWD(aft, aft, 1); - FWD(aft, aft, OPND(s)); - break; - case O_QUEST: /* just an empty */ - FWD(aft, aft, 1); - break; - case OLPAREN: /* not significant here */ - case ORPAREN: - FWD(aft, aft, 1); - break; - case OCH_: /* mark the first two branches */ - FWD(aft, aft, 1); - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - break; - case OOR1: /* done a branch, find the O_CH */ - if (ISSTATEIN(aft, here)) { - for (look = 1; - OP(s = g->strip[pc+look]) != O_CH; - look += OPND(s)) - assert(OP(s) == OOR2); - FWD(aft, aft, look); - } - break; - case OOR2: /* propagate OCH_'s marking */ - FWD(aft, aft, 1); - if (OP(g->strip[pc+OPND(s)]) != O_CH) { - assert(OP(g->strip[pc+OPND(s)]) == OOR2); - FWD(aft, aft, OPND(s)); - } - break; - case O_CH: /* just empty */ - FWD(aft, aft, 1); - break; - default: /* ooooops... */ - assert(nope); - break; - } - } - - return(aft); -} - -#ifdef REDEBUG -/* - - print - print a set of states - == #ifdef REDEBUG - == static void print(struct match *m, char *caption, states st, \ - == int ch, FILE *d); - == #endif - */ -static void -print(m, caption, st, ch, d) -struct match *m; -char *caption; -states st; -int ch; -FILE *d; -{ - register struct re_guts *g = m->g; - register int i; - register int first = 1; - - if (!(m->eflags®_TRACE)) - return; - - fprintf(d, "%s", caption); - if (ch != '\0') - fprintf(d, " %s", pchar(ch)); - for (i = 0; i < g->nstates; i++) - if (ISSET(st, i)) { - fprintf(d, "%s%d", (first) ? "\t" : ", ", i); - first = 0; - } - fprintf(d, "\n"); -} - -/* - - at - print current situation - == #ifdef REDEBUG - == static void at(struct match *m, char *title, char *start, char *stop, \ - == sopno startst, sopno stopst); - == #endif - */ -static void -at(m, title, start, stop, startst, stopst) -struct match *m; -char *title; -char *start; -char *stop; -sopno startst; -sopno stopst; -{ - if (!(m->eflags®_TRACE)) - return; - - printf("%s %s-", title, pchar(*start)); - printf("%s ", pchar(*stop)); - printf("%ld-%ld\n", (long)startst, (long)stopst); -} - -#ifndef PCHARDONE -#define PCHARDONE /* never again */ -/* - - pchar - make a character printable - == #ifdef REDEBUG - == static char *pchar(int ch); - == #endif - * - * Is this identical to regchar() over in debug.c? Well, yes. But a - * duplicate here avoids having a debugging-capable regexec.o tied to - * a matching debug.o, and this is convenient. It all disappears in - * the non-debug compilation anyway, so it doesn't matter much. - */ -static char * /* -> representation */ -pchar(ch) -int ch; -{ - static char pbuf[10]; - - if (isprint(ch) || ch == ' ') - sprintf(pbuf, "%c", ch); - else - sprintf(pbuf, "\\%o", ch); - return(pbuf); -} -#endif -#endif - -#undef matcher -#undef fast -#undef slow -#undef dissect -#undef backref -#undef step -#undef print -#undef at -#undef match diff --git a/ext/ereg/regex/engine.ih b/ext/ereg/regex/engine.ih deleted file mode 100644 index cc98334e752..00000000000 --- a/ext/ereg/regex/engine.ih +++ /dev/null @@ -1,35 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === engine.c === */ -static int matcher(register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags); -static char *dissect(register struct match *m, char *start, char *stop, sopno startst, sopno stopst); -static char *backref(register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev); -static char *fast(register struct match *m, char *start, char *stop, sopno startst, sopno stopst); -static char *slow(register struct match *m, char *start, char *stop, sopno startst, sopno stopst); -static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft); -#define BOL (OUT+1) -#define EOL (BOL+1) -#define BOLEOL (BOL+2) -#define NOTHING (BOL+3) -#define BOW (BOL+4) -#define EOW (BOL+5) -#define CODEMAX (BOL+5) /* highest code used */ -#define NONCHAR(c) ((c) > CHAR_MAX) -#define NNONCHAR (CODEMAX-CHAR_MAX) -#ifdef REDEBUG -static void print(struct match *m, char *caption, states st, int ch, FILE *d); -#endif -#ifdef REDEBUG -static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst); -#endif -#ifdef REDEBUG -static char *pchar(int ch); -#endif - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/main.c b/ext/ereg/regex/main.c deleted file mode 100644 index 657338a2c19..00000000000 --- a/ext/ereg/regex/main.c +++ /dev/null @@ -1,510 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "main.ih" - -char *progname; -int debug = 0; -int line = 0; -int status = 0; - -int copts = REG_EXTENDED; -int eopts = 0; -regoff_t startoff = 0; -regoff_t endoff = 0; - - -extern int split(); -extern void regprint(); - -/* - - main - do the simple case, hand off to regress() for regression - */ -int main(argc, argv) -int argc; -char *argv[]; -{ - regex_t re; -# define NS 10 - regmatch_t subs[NS]; - char erbuf[100]; - int err; - size_t len; - int c; - int errflg = 0; - register int i; - extern int optind; - extern char *optarg; - - progname = argv[0]; - - while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF) - switch (c) { - case 'c': /* compile options */ - copts = options('c', optarg); - break; - case 'e': /* execute options */ - eopts = options('e', optarg); - break; - case 'S': /* start offset */ - startoff = (regoff_t)atoi(optarg); - break; - case 'E': /* end offset */ - endoff = (regoff_t)atoi(optarg); - break; - case 'x': /* Debugging. */ - debug++; - break; - case '?': - default: - errflg++; - break; - } - if (errflg) { - fprintf(stderr, "usage: %s ", progname); - fprintf(stderr, "[-c copt][-C][-d] [re]\n"); - exit(2); - } - - if (optind >= argc) { - regress(stdin); - exit(status); - } - - err = regcomp(&re, argv[optind++], copts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - regprint(&re, stdout); - - if (optind >= argc) { - regfree(&re); - exit(status); - } - - if (eopts®_STARTEND) { - subs[0].rm_so = startoff; - subs[0].rm_eo = strlen(argv[optind]) - endoff; - } - err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); - if (err) { - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); - exit(status); - } - if (!(copts®_NOSUB)) { - len = (int)(subs[0].rm_eo - subs[0].rm_so); - if (subs[0].rm_so != -1) { - if (len != 0) - printf("match `%.*s'\n", (int)len, - argv[optind] + subs[0].rm_so); - else - printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); - } - for (i = 1; i < NS; i++) - if (subs[i].rm_so != -1) - printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); - } - exit(status); -} - -/* - - regress - main loop of regression test - == void regress(FILE *in); - */ -void -regress(in) -FILE *in; -{ - char inbuf[1000]; -# define MAXF 10 - char *f[MAXF]; - int nf; - int i; - char erbuf[100]; - size_t ne; - char *badpat = "invalid regular expression"; -# define SHORT 10 - char *bpname = "REG_BADPAT"; - regex_t re; - - while (fgets(inbuf, sizeof(inbuf), in) != NULL) { - line++; - if (inbuf[0] == '#' || inbuf[0] == '\n') - continue; /* NOTE CONTINUE */ - inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */ - if (debug) - fprintf(stdout, "%d:\n", line); - nf = split(inbuf, f, MAXF, "\t\t"); - if (nf < 3) { - fprintf(stderr, "bad input, line %d\n", line); - exit(1); - } - for (i = 0; i < nf; i++) - if (strcmp(f[i], "\"\"") == 0) - f[i] = ""; - if (nf <= 3) - f[3] = NULL; - if (nf <= 4) - f[4] = NULL; - try(f[0], f[1], f[2], f[3], f[4], options('c', f[1])); - if (opt('&', f[1])) /* try with either type of RE */ - try(f[0], f[1], f[2], f[3], f[4], - options('c', f[1]) &~ REG_EXTENDED); - } - - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n", - erbuf, badpat); - status = 1; - } - ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); - if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { - fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", - erbuf, SHORT-1, badpat); - status = 1; - } - ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { - fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", - erbuf, bpname); - status = 1; - } - re.re_endp = bpname; - ne = regerror(REG_ATOI, &re, erbuf, sizeof(erbuf)); - if (atoi(erbuf) != (int)REG_BADPAT) { - fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", - erbuf, (long)REG_BADPAT); - status = 1; - } else if (ne != strlen(erbuf)+1) { - fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", - erbuf, (long)REG_BADPAT); - status = 1; - } -} - -/* - - try - try it, and report on problems - == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); - */ -void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ -{ - regex_t re; -# define NSUBS 10 - regmatch_t subs[NSUBS]; -# define NSHOULD 15 - char *should[NSHOULD]; - int nshould; - char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - register int i; - char *grump; - char f0copy[1000]; - char f2copy[1000]; - - strcpy(f0copy, f0); - re.re_endp = (opts®_PEND) ? f0copy + strlen(f0copy) : NULL; - fixstr(f0copy); - err = regcomp(&re, f0copy, opts); - if (err != 0 && (!opt('C', f1) || err != efind(f2))) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err == 0 && opt('C', f1)) { - /* unexpected success */ - fprintf(stderr, "%d: %s should have given REG_%s\n", - line, type, f2); - status = 1; - err = 1; /* so we won't try regexec */ - } - - if (err != 0) { - regfree(&re); - return; - } - - strcpy(f2copy, f2); - fixstr(f2copy); - - if (options('e', f1)®_STARTEND) { - if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL) - fprintf(stderr, "%d: bad STARTEND syntax\n", line); - subs[0].rm_so = strchr(f2, '(') - f2 + 1; - subs[0].rm_eo = strchr(f2, ')') - f2; - } - err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); - - if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { - /* unexpected error or wrong error */ - len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); - status = 1; - } else if (err != 0) { - /* nothing more to check */ - } else if (f3 == NULL) { - /* unexpected success */ - fprintf(stderr, "%d: %s exec should have failed\n", - line, type); - status = 1; - err = 1; /* just on principle */ - } else if (opts®_NOSUB) { - /* nothing more to check */ - } else if ((grump = check(f2, subs[0], f3)) != NULL) { - fprintf(stderr, "%d: %s %s\n", line, type, grump); - status = 1; - err = 1; - } - - if (err != 0 || f4 == NULL) { - regfree(&re); - return; - } - - for (i = 1; i < NSHOULD; i++) - should[i] = NULL; - nshould = split(f4, should+1, NSHOULD-1, ","); - if (nshould == 0) { - nshould = 1; - should[1] = ""; - } - for (i = 1; i < NSUBS; i++) { - grump = check(f2, subs[i], should[i]); - if (grump != NULL) { - fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); - status = 1; - err = 1; - } - } - - regfree(&re); -} - -/* - - options - pick options out of a regression-test string - == int options(int type, char *s); - */ -int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; -{ - register char *p; - register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; - - for (p = s; *p != '\0'; p++) - if (strchr(legal, *p) != NULL) - switch (*p) { - case 'b': - o &= ~REG_EXTENDED; - break; - case 'i': - o |= REG_ICASE; - break; - case 's': - o |= REG_NOSUB; - break; - case 'n': - o |= REG_NEWLINE; - break; - case 'm': - o &= ~REG_EXTENDED; - o |= REG_NOSPEC; - break; - case 'p': - o |= REG_PEND; - break; - case '^': - o |= REG_NOTBOL; - break; - case '$': - o |= REG_NOTEOL; - break; - case '#': - o |= REG_STARTEND; - break; - case 't': /* trace */ - o |= REG_TRACE; - break; - case 'l': /* force long representation */ - o |= REG_LARGE; - break; - case 'r': /* force backref use */ - o |= REG_BACKR; - break; - } - return(o); -} - -/* - - opt - is a particular option in a regression string? - == int opt(int c, char *s); - */ -int /* predicate */ -opt(c, s) -int c; -char *s; -{ - return(strchr(s, c) != NULL); -} - -/* - - fixstr - transform magic characters in strings - == void fixstr(register char *p); - */ -void -fixstr(p) -register char *p; -{ - if (p == NULL) - return; - - for (; *p != '\0'; p++) - if (*p == 'N') - *p = '\n'; - else if (*p == 'T') - *p = '\t'; - else if (*p == 'S') - *p = ' '; - else if (*p == 'Z') - *p = '\0'; -} - -/* - - check - check a substring match - == char *check(char *str, regmatch_t sub, char *should); - */ -char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; -{ - register int len; - register int shlen; - register char *p; - static char grump[500]; - register char *at = NULL; - - if (should != NULL && strcmp(should, "-") == 0) - should = NULL; - if (should != NULL && should[0] == '@') { - at = should + 1; - should = ""; - } - - /* check rm_so and rm_eo for consistency */ - if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) || - (sub.rm_so != -1 && sub.rm_eo == -1) || - (sub.rm_so != -1 && sub.rm_so < 0) || - (sub.rm_eo != -1 && sub.rm_eo < 0) ) { - sprintf(grump, "start %ld end %ld", (long)sub.rm_so, - (long)sub.rm_eo); - return(grump); - } - - /* check for no match */ - if (sub.rm_so == -1 && should == NULL) - return(NULL); - if (sub.rm_so == -1) - return("did not match"); - - /* check for in range */ - if (sub.rm_eo > strlen(str)) { - sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); - return(grump); - } - - len = (int)(sub.rm_eo - sub.rm_so); - shlen = (int)strlen(should); - p = str + sub.rm_so; - - /* check for not supposed to match */ - if (should == NULL) { - sprintf(grump, "matched `%.*s'", len, p); - return(grump); - } - - /* check for wrong match */ - if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { - sprintf(grump, "matched `%.*s' instead", len, p); - return(grump); - } - if (shlen > 0) - return(NULL); - - /* check null match in right place */ - if (at == NULL) - return(NULL); - shlen = strlen(at); - if (shlen == 0) - shlen = 1; /* force check for end-of-string */ - if (strncmp(p, at, shlen) != 0) { - sprintf(grump, "matched null at `%.20s'", p); - return(grump); - } - return(NULL); -} - -/* - - eprint - convert error number to name - == static char *eprint(int err); - */ -static char * -eprint(err) -int err; -{ - static char epbuf[100]; - size_t len; - - len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf)); - assert(len <= sizeof(epbuf)); - return(epbuf); -} - -/* - - efind - convert error name to number - == static int efind(char *name); - */ -static int -efind(name) -char *name; -{ - static char efbuf[100]; - regex_t re; - - sprintf(efbuf, "REG_%s", name); - assert(strlen(efbuf) < sizeof(efbuf)); - re.re_endp = efbuf; - (void) regerror(REG_ATOI, &re, efbuf, sizeof(efbuf)); - return(atoi(efbuf)); -} diff --git a/ext/ereg/regex/main.ih b/ext/ereg/regex/main.ih deleted file mode 100644 index 5a0118ac441..00000000000 --- a/ext/ereg/regex/main.ih +++ /dev/null @@ -1,19 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === main.c === */ -void regress(FILE *in); -void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); -int options(int type, char *s); -int opt(int c, char *s); -void fixstr(register char *p); -char *check(char *str, regmatch_t sub, char *should); -static char *eprint(int err); -static int efind(char *name); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/mkh b/ext/ereg/regex/mkh deleted file mode 100644 index 252b246c7bd..00000000000 --- a/ext/ereg/regex/mkh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -# mkh - pull headers out of C source -PATH=/bin:/usr/bin ; export PATH - -# egrep pattern to pick out marked lines -egrep='^ =([ ]|$)' - -# Sed program to process marked lines into lines for the header file. -# The markers have already been removed. Two things are done here: removal -# of backslashed newlines, and some fudging of comments. The first is done -# because -o needs to have prototypes on one line to strip them down. -# Getting comments into the output is tricky; we turn C++-style // comments -# into /* */ comments, after altering any existing */'s to avoid trouble. -peel=' /\\$/N - /\\\n[ ]*/s///g - /\/\//s;\*/;* /;g - /\/\//s;//\(.*\);/*\1 */;' - -for a -do - case "$a" in - -o) # old (pre-function-prototype) compiler - # add code to comment out argument lists - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);' - shift - ;; - -b) # funny Berkeley __P macro - peel="$peel - "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));' - shift - ;; - -s) # compiler doesn't like `static foo();' - # add code to get rid of the `static' - peel="$peel - "'/^static[ ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;' - shift - ;; - -p) # private declarations - egrep='^ ==([ ]|$)' - shift - ;; - -i) # wrap in #ifndef, argument is name - ifndef="$2" - shift ; shift - ;; - *) break - ;; - esac -done - -if test " $ifndef" != " " -then - echo "#ifndef $ifndef" - echo "#define $ifndef /* never again */" -fi -echo "/* ========= begin header generated by $0 ========= */" -echo '#ifdef __cplusplus' -echo 'extern "C" {' -echo '#endif' -for f -do - echo - echo "/* === $f === */" - egrep "$egrep" $f | sed 's/^ ==*[ ]//;s/^ ==*$//' | sed "$peel" - echo -done -echo '#ifdef __cplusplus' -echo '}' -echo '#endif' -echo "/* ========= end header generated by $0 ========= */" -if test " $ifndef" != " " -then - echo "#endif" -fi -exit 0 diff --git a/ext/ereg/regex/regcomp.c b/ext/ereg/regex/regcomp.c deleted file mode 100644 index 0b939461bd7..00000000000 --- a/ext/ereg/regex/regcomp.c +++ /dev/null @@ -1,1608 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define POSIX_MISTAKE - -#include "utils.h" -#include "regex.h" -#include "regex2.h" - -#include "cclass.h" -#include "cname.h" - -/* - * parse structure, passed up and down to avoid global variables and - * other clumsinesses - */ -struct parse { - char *next; /* next character in RE */ - char *end; /* end of string (-> NUL normally) */ - int error; /* has an error been seen? */ - sop *strip; /* malloced strip */ - sopno ssize; /* malloced strip size (allocated) */ - sopno slen; /* malloced strip length (used) */ - int ncsalloc; /* number of csets allocated */ - struct re_guts *g; -# define NPAREN 10 /* we need to remember () 1-9 for back refs */ - sopno pbegin[NPAREN]; /* -> ( ([0] unused) */ - sopno pend[NPAREN]; /* -> ) ([0] unused) */ -}; - -#include "regcomp.ih" - -static char nuls[10]; /* place to point scanner in event of error */ - -/* - * macros for use with parse structure - * BEWARE: these know that the parse structure is named `p' !!! - */ -#define PEEK() (*p->next) -#define PEEK2() (*(p->next+1)) -#define MORE() (p->next < p->end) -#define MORE2() (p->next+1 < p->end) -#define SEE(c) (MORE() && PEEK() == (c)) -#define SEETWO(a, b) (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b)) -#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) -#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) -#define NEXT() (p->next++) -#define NEXT2() (p->next += 2) -#define NEXTn(n) (p->next += (n)) -#define GETNEXT() (*p->next++) -#define SETERROR(e) seterr(p, (e)) -#define REQUIRE(co, e) (void) ((co) || SETERROR(e)) -#define MUSTSEE(c, e) (REQUIRE(MORE() && PEEK() == (c), e)) -#define MUSTEAT(c, e) (REQUIRE(MORE() && GETNEXT() == (c), e)) -#define MUSTNOTSEE(c, e) (REQUIRE(!MORE() || PEEK() != (c), e)) -#define EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd)) -#define INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(pos)+1, pos) -#define AHEAD(pos) dofwd(p, pos, HERE()-(pos)) -#define ASTERN(sop, pos) EMIT(sop, HERE()-pos) -#define HERE() (p->slen) -#define THERE() (p->slen - 1) -#define THERETHERE() (p->slen - 2) -#define DROP(n) (p->slen -= (n)) - -#ifndef NDEBUG -static int never = 0; /* for use in asserts; shuts lint up */ -#else -#define never 0 /* some s have bugs too */ -#endif - -/* - - regcomp - interface for parser and compilation - = API_EXPORT(int) regcomp(regex_t *, const char *, int); - = #define REG_BASIC 0000 - = #define REG_EXTENDED 0001 - = #define REG_ICASE 0002 - = #define REG_NOSUB 0004 - = #define REG_NEWLINE 0010 - = #define REG_NOSPEC 0020 - = #define REG_PEND 0040 - = #define REG_DUMP 0200 - */ -API_EXPORT(int) /* 0 success, otherwise REG_something */ -regcomp(preg, pattern, cflags) -regex_t *preg; -const char *pattern; -int cflags; -{ - struct parse pa; - register struct re_guts *g; - register struct parse *p = &pa; - register int i; - register size_t len; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&~REG_DUMP) -#endif - - cflags = GOODFLAGS(cflags); - if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) - return(REG_INVARG); - - if (cflags®_PEND) { - if (preg->re_endp < pattern) - return(REG_INVARG); - len = preg->re_endp - pattern; - } else - len = strlen((char *)pattern); - - /* do the mallocs early so failure handling is easy */ - g = (struct re_guts *)malloc(sizeof(struct re_guts) + - (NC-1)*sizeof(cat_t)); - if (g == NULL) - return(REG_ESPACE); - p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); - p->slen = 0; - if (p->strip == NULL) { - free((char *)g); - return(REG_ESPACE); - } - - /* set things up */ - p->g = g; - p->next = (char *)pattern; /* convenience; we do not modify it */ - p->end = p->next + len; - p->error = 0; - p->ncsalloc = 0; - for (i = 0; i < NPAREN; i++) { - p->pbegin[i] = 0; - p->pend[i] = 0; - } - g->csetsize = NC; - g->sets = NULL; - g->setbits = NULL; - g->ncsets = 0; - g->cflags = cflags; - g->iflags = 0; - g->nbol = 0; - g->neol = 0; - g->must = NULL; - g->mlen = 0; - g->nsub = 0; - g->ncategories = 1; /* category 0 is "everything else" */ - g->categories = &g->catspace[-(CHAR_MIN)]; - (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t)); - g->backrefs = 0; - - /* do it */ - EMIT(OEND, 0); - g->firststate = THERE(); - if (cflags®_EXTENDED) - p_ere(p, OUT); - else if (cflags®_NOSPEC) - p_str(p); - else - p_bre(p, OUT, OUT); - EMIT(OEND, 0); - g->laststate = THERE(); - - /* tidy up loose ends and fill things in */ - categorize(p, g); - stripsnug(p, g); - findmust(p, g); - g->nplus = pluscount(p, g); - g->magic = MAGIC2; - preg->re_nsub = g->nsub; - preg->re_g = g; - preg->re_magic = MAGIC1; -#ifndef REDEBUG - /* not debugging, so can't rely on the assert() in regexec() */ - if (g->iflags&BAD) - SETERROR(REG_ASSERT); -#endif - - /* win or lose, we're done */ - if (p->error != 0) /* lose */ - regfree(preg); - return(p->error); -} - -/* - - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); - */ -static void -p_ere(p, stop) -register struct parse *p; -int stop; /* character this ERE should end at */ -{ - register char c; - register sopno prevback = 0; - register sopno prevfwd = 0; - register sopno conc; - register int first = 1; /* is this the first alternative? */ - - for (;;) { - /* do a bunch of concatenated expressions */ - conc = HERE(); - while (MORE() && (c = PEEK()) != '|' && c != stop) - p_ere_exp(p); - (void) REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ - - if (!EAT('|')) - break; /* NOTE BREAK OUT */ - - if (first) { - INSERT(OCH_, conc); /* offset is wrong */ - prevfwd = conc; - prevback = conc; - first = 0; - } - ASTERN(OOR1, prevback); - prevback = THERE(); - AHEAD(prevfwd); /* fix previous offset */ - prevfwd = HERE(); - EMIT(OOR2, 0); /* offset is very wrong */ - } - - if (!first) { /* tail-end fixups */ - AHEAD(prevfwd); - ASTERN(O_CH, prevback); - } - - assert(!MORE() || SEE(stop)); -} - -/* - - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op - == static void p_ere_exp(register struct parse *p); - */ -static void -p_ere_exp(p) -register struct parse *p; -{ - register char c; - register sopno pos; - register int count; - register int count2; - register sopno subno; - int wascaret = 0; - - assert(MORE()); /* caller should have ensured this */ - c = GETNEXT(); - - pos = HERE(); - switch (c) { - case '(': - REQUIRE(MORE(), REG_EPAREN); - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - if (!SEE(')')) - p_ere(p, ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - MUSTEAT(')', REG_EPAREN); - break; -#ifndef POSIX_MISTAKE - case ')': /* happens only if no current unmatched ( */ - /* - * You may ask, why the ifndef? Because I didn't notice - * this until slightly too late for 1003.2, and none of the - * other 1003.2 regular-expression reviewers noticed it at - * all. So an unmatched ) is legal POSIX, at least until - * we can get it fixed. - */ - SETERROR(REG_EPAREN); - break; -#endif - case '^': - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - wascaret = 1; - break; - case '$': - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - break; - case '|': - SETERROR(REG_EMPTY); - break; - case '*': - case '+': - case '?': - SETERROR(REG_BADRPT); - break; - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case '\\': - REQUIRE(MORE(), REG_EESCAPE); - c = GETNEXT(); - ordinary(p, c); - break; - case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, c); - break; - } - - if (!MORE()) - return; - c = PEEK(); - /* we call { a repetition if followed by a digit */ - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) )) - return; /* no repetition, we're done */ - NEXT(); - - REQUIRE(!wascaret, REG_BADRPT); - switch (c) { - case '*': /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - break; - case '+': - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - break; - case '?': - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, pos); /* offset slightly wrong */ - ASTERN(OOR1, pos); /* this one's right */ - AHEAD(pos); /* fix the OCH_ */ - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - break; - case '{': - count = p_count(p); - if (EAT(',')) { - if (isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EAT('}')) { /* error heuristics */ - while (MORE() && PEEK() != '}') - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - break; - } - - if (!MORE()) - return; - c = PEEK(); - if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) ) ) - return; - SETERROR(REG_BADRPT); -} - -/* - - p_str - string (no metacharacters) "parser" - == static void p_str(register struct parse *p); - */ -static void -p_str(p) -register struct parse *p; -{ - REQUIRE(MORE(), REG_EMPTY); - while (MORE()) - ordinary(p, GETNEXT()); -} - -/* - - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(register struct parse *p, register int end1, \ - == register int end2); - * Giving end1 as OUT essentially eliminates the end1/end2 check. - * - * This implementation is a bit of a kludge, in that a trailing $ is first - * taken as an ordinary character and then revised to be an anchor. The - * only undesirable side effect is that '$' gets included as a character - * category in such cases. This is fairly harmless; not worth fixing. - * The amount of lookahead needed to avoid this kludge is excessive. - */ -static void -p_bre(p, end1, end2) -register struct parse *p; -register int end1; /* first terminating character */ -register int end2; /* second terminating character */ -{ - register sopno start = HERE(); - register int first = 1; /* first subexpression? */ - register int wasdollar = 0; - - if (EAT('^')) { - EMIT(OBOL, 0); - p->g->iflags |= USEBOL; - p->g->nbol++; - } - while (MORE() && !SEETWO(end1, end2)) { - wasdollar = p_simp_re(p, first); - first = 0; - } - if (wasdollar) { /* oops, that was a trailing anchor */ - DROP(1); - EMIT(OEOL, 0); - p->g->iflags |= USEEOL; - p->g->neol++; - } - - REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ -} - -/* - - p_simp_re - parse a simple RE, an atom possibly followed by a repetition - == static int p_simp_re(register struct parse *p, int starordinary); - */ -static int /* was the simple RE an unbackslashed $? */ -p_simp_re(p, starordinary) -register struct parse *p; -int starordinary; /* is a leading * an ordinary character? */ -{ - register int c; - register int count; - register int count2; - register sopno pos; - register int i; - register sopno subno; -# define BACKSL (1<g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_bre(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); - } - EMIT(ORPAREN, subno); - REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - case BACKSL|'}': - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - REQUIRE(starordinary, REG_BADRPT); - /* FALLTHROUGH */ - default: - ordinary(p, (char)c); /* takes off BACKSL, if any */ - break; - } - - if (EAT('*')) { /* implemented as +? */ - /* this case does not require the (y|) trick, noKLUDGE */ - INSERT(OPLUS_, pos); - ASTERN(O_PLUS, pos); - INSERT(OQUEST_, pos); - ASTERN(O_QUEST, pos); - } else if (EATTWO('\\', '{')) { - count = p_count(p); - if (EAT(',')) { - if (MORE() && isdigit(PEEK())) { - count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); - } else /* single number with comma */ - count2 = INFINITY; - } else /* just a single number */ - count2 = count; - repeat(p, pos, count, count2); - if (!EATTWO('\\', '}')) { /* error heuristics */ - while (MORE() && !SEETWO('\\', '}')) - NEXT(); - REQUIRE(MORE(), REG_EBRACE); - SETERROR(REG_BADBR); - } - } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ - return(1); - - return(0); -} - -/* - - p_count - parse a repetition count - == static int p_count(register struct parse *p); - */ -static int /* the value */ -p_count(p) -register struct parse *p; -{ - register int count = 0; - register int ndigits = 0; - - while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { - count = count*10 + (GETNEXT() - '0'); - ndigits++; - } - - REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); - return(count); -} - -/* - - p_bracket - parse a bracketed character list - == static void p_bracket(register struct parse *p); - * - * Note a significant property of this code: if the allocset() did SETERROR, - * no set operations are done. - */ -static void -p_bracket(p) -register struct parse *p; -{ - register cset *cs = allocset(p); - register int invert = 0; - - /* Dept of Truly Sickening Special-Case Kludges */ - if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { - EMIT(OBOW, 0); - NEXTn(6); - return; - } - if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) { - EMIT(OEOW, 0); - NEXTn(6); - return; - } - - if (EAT('^')) - invert++; /* make note to invert set at end */ - if (EAT(']')) - CHadd(cs, ']'); - else if (EAT('-')) - CHadd(cs, '-'); - while (MORE() && PEEK() != ']' && !SEETWO('-', ']')) - p_b_term(p, cs); - if (EAT('-')) - CHadd(cs, '-'); - MUSTEAT(']', REG_EBRACK); - - if (p->error != 0) /* don't mess things up further */ - return; - - if (p->g->cflags®_ICASE) { - register int i; - register int ci; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i) && isalpha(i)) { - ci = othercase(i); - if (ci != i) - CHadd(cs, ci); - } - if (cs->multis != NULL) - mccase(p, cs); - } - if (invert) { - register int i; - - for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i)) - CHsub(cs, i); - else - CHadd(cs, i); - if (p->g->cflags®_NEWLINE) - CHsub(cs, '\n'); - if (cs->multis != NULL) - mcinvert(p, cs); - } - - assert(cs->multis == NULL); /* xxx */ - - if (nch(p, cs) == 1) { /* optimize singleton sets */ - ordinary(p, firstch(p, cs)); - freeset(p, cs); - } else - EMIT(OANYOF, freezeset(p, cs)); -} - -/* - - p_b_term - parse one term of a bracketed character list - == static void p_b_term(register struct parse *p, register cset *cs); - */ -static void -p_b_term(p, cs) -register struct parse *p; -register cset *cs; -{ - register char c; - register char start, finish; - register int i; - - /* classify what we've got */ - switch ((MORE()) ? PEEK() : '\0') { - case '[': - c = (MORE2()) ? PEEK2() : '\0'; - break; - case '-': - SETERROR(REG_ERANGE); - return; /* NOTE RETURN */ - break; - default: - c = '\0'; - break; - } - - switch (c) { - case ':': /* character class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECTYPE); - p_b_cclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO(':', ']'), REG_ECTYPE); - break; - case '=': /* equivalence class */ - NEXT2(); - REQUIRE(MORE(), REG_EBRACK); - c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECOLLATE); - p_b_eclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); - break; - default: /* symbol, ordinary character, or range */ -/* xxx revision needed for multichar stuff */ - start = p_b_symbol(p); - if (SEE('-') && MORE2() && PEEK2() != ']') { - /* range */ - NEXT(); - if (EAT('-')) - finish = '-'; - else - finish = p_b_symbol(p); - } else - finish = start; -/* xxx what about signed chars here... */ - REQUIRE(start <= finish, REG_ERANGE); - for (i = start; i <= finish; i++) - CHadd(cs, i); - break; - } -} - -/* - - p_b_cclass - parse a character-class name and deal with it - == static void p_b_cclass(register struct parse *p, register cset *cs); - */ -static void -p_b_cclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register char *sp = p->next; - register struct cclass *cp; - register size_t len; - register char *u; - register char c; - - while (MORE() && isalpha(PEEK())) - NEXT(); - len = p->next - sp; - for (cp = cclasses; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - break; - if (cp->name == NULL) { - /* oops, didn't find it */ - SETERROR(REG_ECTYPE); - return; - } - - u = cp->chars; - while ((c = *u++) != '\0') - CHadd(cs, c); - for (u = cp->multis; *u != '\0'; u += strlen(u) + 1) - MCadd(p, cs, u); -} - -/* - - p_b_eclass - parse an equivalence-class name and deal with it - == static void p_b_eclass(register struct parse *p, register cset *cs); - * - * This implementation is incomplete. xxx - */ -static void -p_b_eclass(p, cs) -register struct parse *p; -register cset *cs; -{ - register char c; - - c = p_b_coll_elem(p, '='); - CHadd(cs, c); -} - -/* - - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(register struct parse *p); - */ -static char /* value of symbol */ -p_b_symbol(p) -register struct parse *p; -{ - register char value; - - REQUIRE(MORE(), REG_EBRACK); - if (!EATTWO('[', '.')) - return(GETNEXT()); - - /* collating symbol */ - value = p_b_coll_elem(p, '.'); - REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); - return(value); -} - -/* - - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(register struct parse *p, int endc); - */ -static char /* value of collating element */ -p_b_coll_elem(p, endc) -register struct parse *p; -int endc; /* name ended by endc,']' */ -{ - register char *sp = p->next; - register struct cname *cp; - register int len; - - while (MORE() && !SEETWO(endc, ']')) - NEXT(); - if (!MORE()) { - SETERROR(REG_EBRACK); - return(0); - } - len = p->next - sp; - for (cp = cnames; cp->name != NULL; cp++) - if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0') - return(cp->code); /* known name */ - if (len == 1) - return(*sp); /* single character */ - SETERROR(REG_ECOLLATE); /* neither */ - return(0); -} - -/* - - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); - */ -static char /* if no counterpart, return ch */ -othercase(ch) -int ch; -{ - assert(isalpha(ch)); - if (isupper(ch)) - return(tolower(ch)); - else if (islower(ch)) - return(toupper(ch)); - else /* peculiar, but could happen */ - return(ch); -} - -/* - - bothcases - emit a dualcase version of a two-case character - == static void bothcases(register struct parse *p, int ch); - * - * Boy, is this implementation ever a kludge... - */ -static void -bothcases(p, ch) -register struct parse *p; -int ch; -{ - register char *oldnext = p->next; - register char *oldend = p->end; - char bracket[3]; - - assert(othercase(ch) != ch); /* p_bracket() would recurse */ - p->next = bracket; - p->end = bracket+2; - bracket[0] = ch; - bracket[1] = ']'; - bracket[2] = '\0'; - p_bracket(p); - assert(p->next == bracket+2); - p->next = oldnext; - p->end = oldend; -} - -/* - - ordinary - emit an ordinary character - == static void ordinary(register struct parse *p, register int ch); - */ -static void -ordinary(p, ch) -register struct parse *p; -register int ch; -{ - register cat_t *cap = p->g->categories; - - if ((p->g->cflags®_ICASE) && isalpha(ch) && othercase(ch) != ch) - bothcases(p, ch); - else { - EMIT(OCHAR, (unsigned char)ch); - if (cap[ch] == 0) - cap[ch] = p->g->ncategories++; - } -} - -/* - - nonnewline - emit REG_NEWLINE version of OANY - == static void nonnewline(register struct parse *p); - * - * Boy, is this implementation ever a kludge... - */ -static void -nonnewline(p) -register struct parse *p; -{ - register char *oldnext = p->next; - register char *oldend = p->end; - char bracket[4]; - - p->next = bracket; - p->end = bracket+3; - bracket[0] = '^'; - bracket[1] = '\n'; - bracket[2] = ']'; - bracket[3] = '\0'; - p_bracket(p); - assert(p->next == bracket+3); - p->next = oldnext; - p->end = oldend; -} - -/* - - repeat - generate code for a bounded repetition, recursively if needed - == static void repeat(register struct parse *p, sopno start, int from, int to); - */ -static void -repeat(p, start, from, to) -register struct parse *p; -sopno start; /* operand from here to end of strip */ -int from; /* repeated from this number */ -int to; /* to this number of times (maybe INFINITY) */ -{ - register sopno finish = HERE(); -# define N 2 -# define INF 3 -# define REP(f, t) ((f)*8 + (t)) -# define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - register sopno copy; - - if (p->error != 0) /* head off possible runaway recursion */ - return; - - assert(from <= to); - - switch (REP(MAP(from), MAP(to))) { - case REP(0, 0): /* must be user doing this */ - DROP(finish-start); /* drop the operand */ - break; - case REP(0, 1): /* as x{1,1}? */ - case REP(0, N): /* as x{1,n}? */ - case REP(0, INF): /* as x{1,}? */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); /* offset is wrong... */ - repeat(p, start+1, 1, to); - ASTERN(OOR1, start); - AHEAD(start); /* ... fix it */ - EMIT(OOR2, 0); - AHEAD(THERE()); - ASTERN(O_CH, THERETHERE()); - break; - case REP(1, 1): /* trivial case */ - /* done */ - break; - case REP(1, N): /* as x?x{1,n-1} */ - /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */ - INSERT(OCH_, start); - ASTERN(OOR1, start); - AHEAD(start); - EMIT(OOR2, 0); /* offset very wrong... */ - AHEAD(THERE()); /* ...so fix it */ - ASTERN(O_CH, THERETHERE()); - copy = dupl(p, start+1, finish+1); - assert(copy == finish+4); - repeat(p, copy, 1, to-1); - break; - case REP(1, INF): /* as x+ */ - INSERT(OPLUS_, start); - ASTERN(O_PLUS, start); - break; - case REP(N, N): /* as xx{m-1,n-1} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to-1); - break; - case REP(N, INF): /* as xx{n-1,INF} */ - copy = dupl(p, start, finish); - repeat(p, copy, from-1, to); - break; - default: /* "can't happen" */ - SETERROR(REG_ASSERT); /* just in case */ - break; - } -} - -/* - - seterr - set an error condition - == static int seterr(register struct parse *p, int e); - */ -static int /* useless but makes type checking happy */ -seterr(p, e) -register struct parse *p; -int e; -{ - if (p->error == 0) /* keep earliest error condition */ - p->error = e; - p->next = nuls; /* try to bring things to a halt */ - p->end = nuls; - return(0); /* make the return value well-defined */ -} - -/* - - allocset - allocate a set of characters for [] - == static cset *allocset(register struct parse *p); - */ -static cset * -allocset(p) -register struct parse *p; -{ - register int no = p->g->ncsets++; - register size_t nc; - register size_t nbytes; - register cset *cs; - register size_t css = (size_t)p->g->csetsize; - register int i; - - if (no >= p->ncsalloc) { /* need another column of space */ - p->ncsalloc += CHAR_BIT; - nc = p->ncsalloc; - assert(nc % CHAR_BIT == 0); - nbytes = nc / CHAR_BIT * css; - if (p->g->sets == NULL) - p->g->sets = (cset *)malloc(nc * sizeof(cset)); - else - p->g->sets = (cset *)realloc((char *)p->g->sets, - nc * sizeof(cset)); - if (p->g->setbits == NULL) - p->g->setbits = (uch *)malloc(nbytes); - else { - p->g->setbits = (uch *)realloc((char *)p->g->setbits, - nbytes); - /* xxx this isn't right if setbits is now NULL */ - for (i = 0; i < no; i++) - p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT); - } - if (p->g->sets != NULL && p->g->setbits != NULL) - (void) memset((char *)p->g->setbits + (nbytes - css), - 0, css); - else { - no = 0; - SETERROR(REG_ESPACE); - /* caller's responsibility not to do set ops */ - } - } - - assert(p->g->sets != NULL); /* xxx */ - cs = &p->g->sets[no]; - cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); - cs->mask = 1 << ((no) % CHAR_BIT); - cs->hash = 0; - cs->smultis = 0; - cs->multis = NULL; - - return(cs); -} - -/* - - freeset - free a now-unused set - == static void freeset(register struct parse *p, register cset *cs); - */ -static void -freeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - CHsub(cs, i); - if (cs == top-1) /* recover only the easy case */ - p->g->ncsets--; -} - -/* - - freezeset - final processing on a set of characters - == static int freezeset(register struct parse *p, register cset *cs); - * - * The main task here is merging identical sets. This is usually a waste - * of time (although the hash code minimizes the overhead), but can win - * big if REG_ICASE is being used. REG_ICASE, by the way, is why the hash - * is done using addition rather than xor -- all ASCII [aA] sets xor to - * the same value! - */ -static int /* set number */ -freezeset(p, cs) -register struct parse *p; -register cset *cs; -{ - register uch h = cs->hash; - register size_t i; - register cset *top = &p->g->sets[p->g->ncsets]; - register cset *cs2; - register size_t css = (size_t)p->g->csetsize; - - /* look for an earlier one which is the same */ - for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) - if (cs2->hash == h && cs2 != cs) { - /* maybe */ - for (i = 0; i < css; i++) - if (!!CHIN(cs2, i) != !!CHIN(cs, i)) - break; /* no */ - if (i == css) - break; /* yes */ - } - - if (cs2 < top) { /* found one */ - freeset(p, cs); - cs = cs2; - } - - return((int)(cs - p->g->sets)); -} - -/* - - firstch - return first character in a set (which must have at least one) - == static int firstch(register struct parse *p, register cset *cs); - */ -static int /* character; there is no "none" value */ -firstch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - return((char)i); - assert(never); - return(0); /* arbitrary */ -} - -/* - - nch - number of characters in a set - == static int nch(register struct parse *p, register cset *cs); - */ -static int -nch(p, cs) -register struct parse *p; -register cset *cs; -{ - register size_t i; - register size_t css = (size_t)p->g->csetsize; - register int n = 0; - - for (i = 0; i < css; i++) - if (CHIN(cs, i)) - n++; - return(n); -} - -/* - - mcadd - add a collating element to a cset - == static void mcadd(register struct parse *p, register cset *cs, \ - == register char *cp); - */ -static void -mcadd(p, cs, cp) -register struct parse *p; -register cset *cs; -register char *cp; -{ - register size_t oldend = cs->smultis; - - cs->smultis += strlen(cp) + 1; - if (cs->multis == NULL) - cs->multis = malloc(cs->smultis); - else - cs->multis = realloc(cs->multis, cs->smultis); - if (cs->multis == NULL) { - SETERROR(REG_ESPACE); - return; - } - - (void) strcpy(cs->multis + oldend - 1, cp); - cs->multis[cs->smultis - 1] = '\0'; -} - -#if 0 -/* - - mcsub - subtract a collating element from a cset - == static void mcsub(register cset *cs, register char *cp); - */ -static void -mcsub(cs, cp) -register cset *cs; -register char *cp; -{ - register char *fp = mcfind(cs, cp); - register size_t len = strlen(fp); - - assert(fp != NULL); - (void) memmove(fp, fp + len + 1, - cs->smultis - (fp + len + 1 - cs->multis)); - cs->smultis -= len; - - if (cs->smultis == 0) { - free(cs->multis); - cs->multis = NULL; - return; - } - - cs->multis = realloc(cs->multis, cs->smultis); - assert(cs->multis != NULL); -} - -/* - - mcin - is a collating element in a cset? - == static int mcin(register cset *cs, register char *cp); - */ -static int -mcin(cs, cp) -register cset *cs; -register char *cp; -{ - return(mcfind(cs, cp) != NULL); -} - - -/* - - mcfind - find a collating element in a cset - == static char *mcfind(register cset *cs, register char *cp); - */ -static char * -mcfind(cs, cp) -register cset *cs; -register char *cp; -{ - register char *p; - - if (cs->multis == NULL) - return(NULL); - for (p = cs->multis; *p != '\0'; p += strlen(p) + 1) - if (strcmp(cp, p) == 0) - return(p); - return(NULL); -} -#endif - -/* - - mcinvert - invert the list of collating elements in a cset - == static void mcinvert(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mcinvert(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - mccase - add case counterparts of the list of collating elements in a cset - == static void mccase(register struct parse *p, register cset *cs); - * - * This would have to know the set of possibilities. Implementation - * is deferred. - */ -static void -mccase(p, cs) -register struct parse *p; -register cset *cs; -{ - assert(cs->multis == NULL); /* xxx */ -} - -/* - - isinsets - is this character in any sets? - == static int isinsets(register struct re_guts *g, int c); - */ -static int /* predicate */ -isinsets(g, c) -register struct re_guts *g; -int c; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc = (unsigned char)c; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc] != 0) - return(1); - return(0); -} - -/* - - samesets - are these two characters in exactly the same sets? - == static int samesets(register struct re_guts *g, int c1, int c2); - */ -static int /* predicate */ -samesets(g, c1, c2) -register struct re_guts *g; -int c1; -int c2; -{ - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc1 = (unsigned char)c1; - register unsigned uc2 = (unsigned char)c2; - - for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) - if (col[uc1] != col[uc2]) - return(0); - return(1); -} - -/* - - categorize - sort out character categories - == static void categorize(struct parse *p, register struct re_guts *g); - */ -static void -categorize(p, g) -struct parse *p; -register struct re_guts *g; -{ - register cat_t *cats = g->categories; - register int c; - register int c2; - register cat_t cat; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (cats[c] == 0 && isinsets(g, c)) { - cat = g->ncategories++; - cats[c] = cat; - for (c2 = c+1; c2 <= CHAR_MAX; c2++) - if (cats[c2] == 0 && samesets(g, c, c2)) - cats[c2] = cat; - } -} - -/* - - dupl - emit a duplicate of a bunch of sops - == static sopno dupl(register struct parse *p, sopno start, sopno finish); - */ -static sopno /* start of duplicate */ -dupl(p, start, finish) -register struct parse *p; -sopno start; /* from here */ -sopno finish; /* to this less one */ -{ - register sopno ret = HERE(); - register sopno len = finish - start; - - assert(finish >= start); - if (len == 0) - return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); - (void) memcpy((char *)(p->strip + p->slen), - (char *)(p->strip + start), (size_t)len*sizeof(sop)); - p->slen += len; - return(ret); -} - -/* - - doemit - emit a strip operator - == static void doemit(register struct parse *p, sop op, size_t opnd); - * - * It might seem better to implement this as a macro with a function as - * hard-case backup, but it's just too big and messy unless there are - * some changes to the data structures. Maybe later. - */ -static void -doemit(p, op, opnd) -register struct parse *p; -sop op; -size_t opnd; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* deal with oversize operands ("can't happen", more or less) */ - assert(opnd < 1<slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); - - /* finally, it's all reduced to the easy case */ - p->strip[p->slen++] = SOP(op, opnd); -} - -/* - - doinsert - insert a sop into the strip - == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); - */ -static void -doinsert(p, op, opnd, pos) -register struct parse *p; -sop op; -size_t opnd; -sopno pos; -{ - register sopno sn; - register sop s; - register int i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - sn = HERE(); - EMIT(op, opnd); /* do checks, ensure space */ - assert(HERE() == sn+1); - s = p->strip[sn]; - - /* adjust paren pointers */ - assert(pos > 0); - for (i = 1; i < NPAREN; i++) { - if (p->pbegin[i] >= pos) { - p->pbegin[i]++; - } - if (p->pend[i] >= pos) { - p->pend[i]++; - } - } - - memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos], - (HERE()-pos-1)*sizeof(sop)); - p->strip[pos] = s; -} - -/* - - dofwd - complete a forward reference - == static void dofwd(register struct parse *p, sopno pos, sop value); - */ -static void -dofwd(p, pos, value) -register struct parse *p; -register sopno pos; -sop value; -{ - /* avoid making error situations worse */ - if (p->error != 0) - return; - - assert(value < 1<strip[pos] = OP(p->strip[pos]) | value; -} - -/* - - enlarge - enlarge the strip - == static void enlarge(register struct parse *p, sopno size); - */ -static void -enlarge(p, size) -register struct parse *p; -register sopno size; -{ - register sop *sp; - - if (p->ssize >= size) - return; - - sp = (sop *)realloc(p->strip, size*sizeof(sop)); - if (sp == NULL) { - SETERROR(REG_ESPACE); - return; - } - p->strip = sp; - p->ssize = size; -} - -/* - - stripsnug - compact the strip - == static void stripsnug(register struct parse *p, register struct re_guts *g); - */ -static void -stripsnug(p, g) -register struct parse *p; -register struct re_guts *g; -{ - g->nstates = p->slen; - g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop)); - if (g->strip == NULL) { - SETERROR(REG_ESPACE); - g->strip = p->strip; - } -} - -/* - - findmust - fill in must and mlen with longest mandatory literal string - == static void findmust(register struct parse *p, register struct re_guts *g); - * - * This algorithm could do fancy things like analyzing the operands of | - * for common subsequences. Someday. This code is simple and finds most - * of the interesting cases. - * - * Note that must and mlen got initialized during setup. - */ -static void -findmust(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - sop *start = NULL; - register sop *newstart = NULL; - register sopno newlen; - register sop s; - register char *cp; - register sopno i; - - /* avoid making error situations worse */ - if (p->error != 0) - return; - - /* find the longest OCHAR sequence in strip */ - newlen = 0; - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OCHAR: /* sequence member */ - if (newlen == 0) /* new sequence */ - newstart = scan - 1; - newlen++; - break; - case OPLUS_: /* things that don't break one */ - case OLPAREN: - case ORPAREN: - break; - case OQUEST_: /* things that must be skipped */ - case OCH_: - scan--; - do { - scan += OPND(s); - s = *scan; - /* assert() interferes w debug printouts */ - if (OP(s) != O_QUEST && OP(s) != O_CH && - OP(s) != OOR2) { - g->iflags |= BAD; - return; - } - } while (OP(s) != O_QUEST && OP(s) != O_CH); - /* fallthrough */ - default: /* things that break a sequence */ - if (newlen > g->mlen) { /* ends one */ - start = newstart; - g->mlen = newlen; - } - newlen = 0; - break; - } - } while (OP(s) != OEND); - - if (g->mlen == 0) /* there isn't one */ - return; - - /* turn it into a character string */ - g->must = malloc((size_t)g->mlen + 1); - if (g->must == NULL) { /* argh; just forget it */ - g->mlen = 0; - return; - } - cp = g->must; - scan = start; - for (i = g->mlen; i > 0; i--) { - while (OP(s = *scan++) != OCHAR) - continue; - assert(cp < g->must + g->mlen); - *cp++ = (char)OPND(s); - } - assert(cp == g->must + g->mlen); - *cp++ = '\0'; /* just on general principles */ -} - -/* - - pluscount - count + nesting - == static sopno pluscount(register struct parse *p, register struct re_guts *g); - */ -static sopno /* nesting depth */ -pluscount(p, g) -struct parse *p; -register struct re_guts *g; -{ - register sop *scan; - register sop s; - register sopno plusnest = 0; - register sopno maxnest = 0; - - if (p->error != 0) - return(0); /* there may not be an OEND */ - - scan = g->strip + 1; - do { - s = *scan++; - switch (OP(s)) { - case OPLUS_: - plusnest++; - break; - case O_PLUS: - if (plusnest > maxnest) - maxnest = plusnest; - plusnest--; - break; - } - } while (OP(s) != OEND); - if (plusnest != 0) - g->iflags |= BAD; - return(maxnest); -} diff --git a/ext/ereg/regex/regcomp.ih b/ext/ereg/regex/regcomp.ih deleted file mode 100644 index 6efafebf602..00000000000 --- a/ext/ereg/regex/regcomp.ih +++ /dev/null @@ -1,53 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regcomp.c === */ -static void p_ere(register struct parse *p, int stop); -static void p_ere_exp(register struct parse *p); -static void p_str(register struct parse *p); -static void p_bre(register struct parse *p, register int end1, register int end2); -static int p_simp_re(register struct parse *p, int starordinary); -static int p_count(register struct parse *p); -static void p_bracket(register struct parse *p); -static void p_b_term(register struct parse *p, register cset *cs); -static void p_b_cclass(register struct parse *p, register cset *cs); -static void p_b_eclass(register struct parse *p, register cset *cs); -static char p_b_symbol(register struct parse *p); -static char p_b_coll_elem(register struct parse *p, int endc); -static char othercase(int ch); -static void bothcases(register struct parse *p, int ch); -static void ordinary(register struct parse *p, register int ch); -static void nonnewline(register struct parse *p); -static void repeat(register struct parse *p, sopno start, int from, int to); -static int seterr(register struct parse *p, int e); -static cset *allocset(register struct parse *p); -static void freeset(register struct parse *p, register cset *cs); -static int freezeset(register struct parse *p, register cset *cs); -static int firstch(register struct parse *p, register cset *cs); -static int nch(register struct parse *p, register cset *cs); -static void mcadd(register struct parse *p, register cset *cs, register char *cp); -#if 0 -static void mcsub(register cset *cs, register char *cp); -static int mcin(register cset *cs, register char *cp); -static char *mcfind(register cset *cs, register char *cp); -#endif -static void mcinvert(register struct parse *p, register cset *cs); -static void mccase(register struct parse *p, register cset *cs); -static int isinsets(register struct re_guts *g, int c); -static int samesets(register struct re_guts *g, int c1, int c2); -static void categorize(struct parse *p, register struct re_guts *g); -static sopno dupl(register struct parse *p, sopno start, sopno finish); -static void doemit(register struct parse *p, sop op, size_t opnd); -static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); -static void dofwd(register struct parse *p, sopno pos, sop value); -static void enlarge(register struct parse *p, sopno size); -static void stripsnug(register struct parse *p, register struct re_guts *g); -static void findmust(register struct parse *p, register struct re_guts *g); -static sopno pluscount(register struct parse *p, register struct re_guts *g); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/regerror.c b/ext/ereg/regex/regerror.c deleted file mode 100644 index bf71e3a8141..00000000000 --- a/ext/ereg/regex/regerror.c +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regerror.ih" - -/* - = #define REG_OKAY 0 - = #define REG_NOMATCH 1 - = #define REG_BADPAT 2 - = #define REG_ECOLLATE 3 - = #define REG_ECTYPE 4 - = #define REG_EESCAPE 5 - = #define REG_ESUBREG 6 - = #define REG_EBRACK 7 - = #define REG_EPAREN 8 - = #define REG_EBRACE 9 - = #define REG_BADBR 10 - = #define REG_ERANGE 11 - = #define REG_ESPACE 12 - = #define REG_BADRPT 13 - = #define REG_EMPTY 14 - = #define REG_ASSERT 15 - = #define REG_INVARG 16 - = #define REG_ATOI 255 // convert name to number (!) - = #define REG_ITOA 0400 // convert number to name (!) - */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - {REG_OKAY, "REG_OKAY", "no errors detected"}, - {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, - {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, - {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, - {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, - {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, - {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, - {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, - {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, - {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, - {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, - {REG_ERANGE, "REG_ERANGE", "invalid character range"}, - {REG_ESPACE, "REG_ESPACE", "out of memory"}, - {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, - {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, - {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, - {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, - {-1, "", "*** unknown regexp error code ***"}, -}; - -/* - - regerror - the interface to error numbers - = API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - */ -/* ARGSUSED */ -API_EXPORT(size_t) -regerror(errcode, preg, errbuf, errbuf_size) -int errcode; -const regex_t *preg; -char *errbuf; -size_t errbuf_size; -{ - register struct rerr *r; - register size_t len; - register int target = errcode &~ REG_ITOA; - register char *s; - char convbuf[50]; - - if (errcode == REG_ATOI) - s = regatoi(preg, convbuf); - else { - for (r = rerrs; r->code >= 0; r++) - if (r->code == target) - break; - - if (errcode®_ITOA) { - if (r->code >= 0) - (void) strcpy(convbuf, r->name); - else - sprintf(convbuf, "REG_0x%x", target); - assert(strlen(convbuf) < sizeof(convbuf)); - s = convbuf; - } else - s = r->explain; - } - - len = strlen(s) + 1; - if (errbuf_size > 0) { - if (errbuf_size > len) - (void) strcpy(errbuf, s); - else { - (void) strncpy(errbuf, s, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return(len); -} - -/* - - regatoi - internal routine to implement REG_ATOI - == static char *regatoi(const regex_t *preg, char *localbuf); - */ -static char * -regatoi(preg, localbuf) -const regex_t *preg; -char *localbuf; -{ - register struct rerr *r; - - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, preg->re_endp) == 0) - break; - if (r->code < 0) - return("0"); - - sprintf(localbuf, "%d", r->code); - return(localbuf); -} diff --git a/ext/ereg/regex/regerror.ih b/ext/ereg/regex/regerror.ih deleted file mode 100644 index 2cb668c24f0..00000000000 --- a/ext/ereg/regex/regerror.ih +++ /dev/null @@ -1,12 +0,0 @@ -/* ========= begin header generated by ./mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regerror.c === */ -static char *regatoi(const regex_t *preg, char *localbuf); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ./mkh ========= */ diff --git a/ext/ereg/regex/regex.3 b/ext/ereg/regex/regex.3 deleted file mode 100644 index 100c8a7f71c..00000000000 --- a/ext/ereg/regex/regex.3 +++ /dev/null @@ -1,502 +0,0 @@ -.TH REGEX 3 "17 May 1993" -.BY "Henry Spencer" -.de ZR -.\" one other place knows this name: the SEE ALSO section -.IR regex (7) \\$1 -.. -.SH NAME -regcomp, regexec, regerror, regfree \- regular-expression library -.SH SYNOPSIS -.ft B -.\".na -#include -.br -#include -.HP 10 -int regcomp(regex_t\ *preg, const\ char\ *pattern, int\ cflags); -.HP -int\ regexec(const\ regex_t\ *preg, const\ char\ *string, -size_t\ nmatch, regmatch_t\ pmatch[], int\ eflags); -.HP -size_t\ regerror(int\ errcode, const\ regex_t\ *preg, -char\ *errbuf, size_t\ errbuf_size); -.HP -void\ regfree(regex_t\ *preg); -.\".ad -.ft -.SH DESCRIPTION -These routines implement POSIX 1003.2 regular expressions (``RE''s); -see -.ZR . -.I Regcomp -compiles an RE written as a string into an internal form, -.I regexec -matches that internal form against a string and reports results, -.I regerror -transforms error codes from either into human-readable messages, -and -.I regfree -frees any dynamically-allocated storage used by the internal form -of an RE. -.PP -The header -.I -declares two structure types, -.I regex_t -and -.IR regmatch_t , -the former for compiled internal forms and the latter for match reporting. -It also declares the four functions, -a type -.IR regoff_t , -and a number of constants with names starting with ``REG_''. -.PP -.I Regcomp -compiles the regular expression contained in the -.I pattern -string, -subject to the flags in -.IR cflags , -and places the results in the -.I regex_t -structure pointed to by -.IR preg . -.I Cflags -is the bitwise OR of zero or more of the following flags: -.IP REG_EXTENDED \w'REG_EXTENDED'u+2n -Compile modern (``extended'') REs, -rather than the obsolete (``basic'') REs that -are the default. -.IP REG_BASIC -This is a synonym for 0, -provided as a counterpart to REG_EXTENDED to improve readability. -.IP REG_NOSPEC -Compile with recognition of all special characters turned off. -All characters are thus considered ordinary, -so the ``RE'' is a literal string. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -REG_EXTENDED and REG_NOSPEC may not be used -in the same call to -.IR regcomp . -.IP REG_ICASE -Compile for matching that ignores upper/lower case distinctions. -See -.ZR . -.IP REG_NOSUB -Compile for matching that need only report success or failure, -not what was matched. -.IP REG_NEWLINE -Compile for newline-sensitive matching. -By default, newline is a completely ordinary character with no special -meaning in either REs or strings. -With this flag, -`[^' bracket expressions and `.' never match newline, -a `^' anchor matches the null string after any newline in the string -in addition to its normal function, -and the `$' anchor matches the null string before any newline in the -string in addition to its normal function. -.IP REG_PEND -The regular expression ends, -not at the first NUL, -but just before the character pointed to by the -.I re_endp -member of the structure pointed to by -.IR preg . -The -.I re_endp -member is of type -.IR const\ char\ * . -This flag permits inclusion of NULs in the RE; -they are considered ordinary characters. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -When successful, -.I regcomp -returns 0 and fills in the structure pointed to by -.IR preg . -One member of that structure -(other than -.IR re_endp ) -is publicized: -.IR re_nsub , -of type -.IR size_t , -contains the number of parenthesized subexpressions within the RE -(except that the value of this member is undefined if the -REG_NOSUB flag was used). -If -.I regcomp -fails, it returns a non-zero error code; -see DIAGNOSTICS. -.PP -.I Regexec -matches the compiled RE pointed to by -.I preg -against the -.IR string , -subject to the flags in -.IR eflags , -and reports results using -.IR nmatch , -.IR pmatch , -and the returned value. -The RE must have been compiled by a previous invocation of -.IR regcomp . -The compiled form is not altered during execution of -.IR regexec , -so a single compiled RE can be used simultaneously by multiple threads. -.PP -By default, -the NUL-terminated string pointed to by -.I string -is considered to be the text of an entire line, minus any terminating -newline. -The -.I eflags -argument is the bitwise OR of zero or more of the following flags: -.IP REG_NOTBOL \w'REG_STARTEND'u+2n -The first character of -the string -is not the beginning of a line, so the `^' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_NOTEOL -The NUL terminating -the string -does not end a line, so the `$' anchor should not match before it. -This does not affect the behavior of newlines under REG_NEWLINE. -.IP REG_STARTEND -The string is considered to start at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_so\fR -and to have a terminating NUL located at -\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_eo\fR -(there need not actually be a NUL at that location), -regardless of the value of -.IR nmatch . -See below for the definition of -.IR pmatch -and -.IR nmatch . -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Note that a non-zero \fIrm_so\fR does not imply REG_NOTBOL; -REG_STARTEND affects only the location of the string, -not how it is matched. -.PP -See -.ZR -for a discussion of what is matched in situations where an RE or a -portion thereof could match any of several substrings of -.IR string . -.PP -Normally, -.I regexec -returns 0 for success and the non-zero code REG_NOMATCH for failure. -Other non-zero error codes may be returned in exceptional situations; -see DIAGNOSTICS. -.PP -If REG_NOSUB was specified in the compilation of the RE, -or if -.I nmatch -is 0, -.I regexec -ignores the -.I pmatch -argument (but see below for the case where REG_STARTEND is specified). -Otherwise, -.I pmatch -points to an array of -.I nmatch -structures of type -.IR regmatch_t . -Such a structure has at least the members -.I rm_so -and -.IR rm_eo , -both of type -.I regoff_t -(a signed arithmetic type at least as large as an -.I off_t -and a -.IR ssize_t ), -containing respectively the offset of the first character of a substring -and the offset of the first character after the end of the substring. -Offsets are measured from the beginning of the -.I string -argument given to -.IR regexec . -An empty substring is denoted by equal offsets, -both indicating the character following the empty substring. -.PP -The 0th member of the -.I pmatch -array is filled in to indicate what substring of -.I string -was matched by the entire RE. -Remaining members report what substring was matched by parenthesized -subexpressions within the RE; -member -.I i -reports subexpression -.IR i , -with subexpressions counted (starting at 1) by the order of their opening -parentheses in the RE, left to right. -Unused entries in the array\(emcorresponding either to subexpressions that -did not participate in the match at all, or to subexpressions that do not -exist in the RE (that is, \fIi\fR\ > \fIpreg\fR\->\fIre_nsub\fR)\(emhave both -.I rm_so -and -.I rm_eo -set to \-1. -If a subexpression participated in the match several times, -the reported substring is the last one it matched. -(Note, as an example in particular, that when the RE `(b*)+' matches `bbb', -the parenthesized subexpression matches each of the three `b's and then -an infinite number of empty strings following the last `b', -so the reported substring is one of the empties.) -.PP -If REG_STARTEND is specified, -.I pmatch -must point to at least one -.I regmatch_t -(even if -.I nmatch -is 0 or REG_NOSUB was specified), -to hold the input offsets for REG_STARTEND. -Use for output is still entirely controlled by -.IR nmatch ; -if -.I nmatch -is 0 or REG_NOSUB was specified, -the value of -.IR pmatch [0] -will not be changed by a successful -.IR regexec . -.PP -.I Regerror -maps a non-zero -.I errcode -from either -.I regcomp -or -.I regexec -to a human-readable, printable message. -If -.I preg -is non-NULL, -the error code should have arisen from use of -the -.I regex_t -pointed to by -.IR preg , -and if the error code came from -.IR regcomp , -it should have been the result from the most recent -.I regcomp -using that -.IR regex_t . -.RI ( Regerror -may be able to supply a more detailed message using information -from the -.IR regex_t .) -.I Regerror -places the NUL-terminated message into the buffer pointed to by -.IR errbuf , -limiting the length (including the NUL) to at most -.I errbuf_size -bytes. -If the whole message won't fit, -as much of it as will fit before the terminating NUL is supplied. -In any case, -the returned value is the size of buffer needed to hold the whole -message (including terminating NUL). -If -.I errbuf_size -is 0, -.I errbuf -is ignored but the return value is still correct. -.PP -If the -.I errcode -given to -.I regerror -is first ORed with REG_ITOA, -the ``message'' that results is the printable name of the error code, -e.g. ``REG_NOMATCH'', -rather than an explanation thereof. -If -.I errcode -is REG_ATOI, -then -.I preg -shall be non-NULL and the -.I re_endp -member of the structure it points to -must point to the printable name of an error code; -in this case, the result in -.I errbuf -is the decimal digits of -the numeric value of the error code -(0 if the name is not recognized). -REG_ITOA and REG_ATOI are intended primarily as debugging facilities; -they are extensions, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -Be warned also that they are considered experimental and changes are possible. -.PP -.I Regfree -frees any dynamically-allocated storage associated with the compiled RE -pointed to by -.IR preg . -The remaining -.I regex_t -is no longer a valid compiled RE -and the effect of supplying it to -.I regexec -or -.I regerror -is undefined. -.PP -None of these functions references global variables except for tables -of constants; -all are safe for use from multiple threads if the arguments are safe. -.SH IMPLEMENTATION CHOICES -There are a number of decisions that 1003.2 leaves up to the implementor, -either by explicitly saying ``undefined'' or by virtue of them being -forbidden by the RE grammar. -This implementation treats them as follows. -.PP -See -.ZR -for a discussion of the definition of case-independent matching. -.PP -There is no particular limit on the length of REs, -except insofar as memory is limited. -Memory usage is approximately linear in RE size, and largely insensitive -to RE complexity, except for bounded repetitions. -See BUGS for one short RE using them -that will run almost any system out of memory. -.PP -A backslashed character other than one specifically given a magic meaning -by 1003.2 (such magic meanings occur only in obsolete [``basic''] REs) -is taken as an ordinary character. -.PP -Any unmatched [ is a REG_EBRACK error. -.PP -Equivalence classes cannot begin or end bracket-expression ranges. -The endpoint of one range cannot begin another. -.PP -RE_DUP_MAX, the limit on repetition counts in bounded repetitions, is 255. -.PP -A repetition operator (?, *, +, or bounds) cannot follow another -repetition operator. -A repetition operator cannot begin an expression or subexpression -or follow `^' or `|'. -.PP -`|' cannot appear first or last in a (sub)expression or after another `|', -i.e. an operand of `|' cannot be an empty subexpression. -An empty parenthesized subexpression, `()', is legal and matches an -empty (sub)string. -An empty string is not a legal RE. -.PP -A `{' followed by a digit is considered the beginning of bounds for a -bounded repetition, which must then follow the syntax for bounds. -A `{' \fInot\fR followed by a digit is considered an ordinary character. -.PP -`^' and `$' beginning and ending subexpressions in obsolete (``basic'') -REs are anchors, not ordinary characters. -.SH SEE ALSO -grep(1), regex(7) -.PP -POSIX 1003.2, sections 2.8 (Regular Expression Notation) -and -B.5 (C Binding for Regular Expression Matching). -.SH DIAGNOSTICS -Non-zero error codes from -.I regcomp -and -.I regexec -include the following: -.PP -.nf -.ta \w'REG_ECOLLATE'u+3n -REG_NOMATCH regexec() failed to match -REG_BADPAT invalid regular expression -REG_ECOLLATE invalid collating element -REG_ECTYPE invalid character class -REG_EESCAPE \e applied to unescapable character -REG_ESUBREG invalid backreference number -REG_EBRACK brackets [ ] not balanced -REG_EPAREN parentheses ( ) not balanced -REG_EBRACE braces { } not balanced -REG_BADBR invalid repetition count(s) in { } -REG_ERANGE invalid character range in [ ] -REG_ESPACE ran out of memory -REG_BADRPT ?, *, or + operand invalid -REG_EMPTY empty (sub)expression -REG_ASSERT ``can't happen''\(emyou found a bug -REG_INVARG invalid argument, e.g. negative-length string -.fi -.SH HISTORY -Written by Henry Spencer at University of Toronto, -henry@zoo.toronto.edu. -.SH BUGS -This is an alpha release with known defects. -Please report problems. -.PP -There is one known functionality bug. -The implementation of internationalization is incomplete: -the locale is always assumed to be the default one of 1003.2, -and only the collating elements etc. of that locale are available. -.PP -The back-reference code is subtle and doubts linger about its correctness -in complex cases. -.PP -.I Regexec -performance is poor. -This will improve with later releases. -.I Nmatch -exceeding 0 is expensive; -.I nmatch -exceeding 1 is worse. -.I Regexec -is largely insensitive to RE complexity \fIexcept\fR that back -references are massively expensive. -RE length does matter; in particular, there is a strong speed bonus -for keeping RE length under about 30 characters, -with most special characters counting roughly double. -.PP -.I Regcomp -implements bounded repetitions by macro expansion, -which is costly in time and space if counts are large -or bounded repetitions are nested. -An RE like, say, -`((((a{1,100}){1,100}){1,100}){1,100}){1,100}' -will (eventually) run almost any existing machine out of swap space. -.PP -There are suspected problems with response to obscure error conditions. -Notably, -certain kinds of internal overflow, -produced only by truly enormous REs or by multiply nested bounded repetitions, -are probably not handled well. -.PP -Due to a mistake in 1003.2, things like `a)b' are legal REs because `)' is -a special character only in the presence of a previous unmatched `('. -This can't be fixed until the spec is fixed. -.PP -The standard's definition of back references is vague. -For example, does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'? -Until the standard is clarified, -behavior in such cases should not be relied on. -.PP -The implementation of word-boundary matching is a bit of a kludge, -and bugs may lurk in combinations of word-boundary matching and anchoring. diff --git a/ext/ereg/regex/regex.7 b/ext/ereg/regex/regex.7 deleted file mode 100644 index d89012bda1d..00000000000 --- a/ext/ereg/regex/regex.7 +++ /dev/null @@ -1,233 +0,0 @@ -.TH REGEX 7 "7 Feb 1994" -.BY "Henry Spencer" -.SH NAME -regex \- POSIX 1003.2 regular expressions -.SH DESCRIPTION -Regular expressions (``RE''s), -as defined in POSIX 1003.2, come in two forms: -modern REs (roughly those of -.IR egrep ; -1003.2 calls these ``extended'' REs) -and obsolete REs (roughly those of -.IR ed ; -1003.2 ``basic'' REs). -Obsolete REs mostly exist for backward compatibility in some old programs; -they will be discussed at the end. -1003.2 leaves some aspects of RE syntax and semantics open; -`\(dg' marks decisions on these aspects that -may not be fully portable to other 1003.2 implementations. -.PP -A (modern) RE is one\(dg or more non-empty\(dg \fIbranches\fR, -separated by `|'. -It matches anything that matches one of the branches. -.PP -A branch is one\(dg or more \fIpieces\fR, concatenated. -It matches a match for the first, followed by a match for the second, etc. -.PP -A piece is an \fIatom\fR possibly followed -by a single\(dg `*', `+', `?', or \fIbound\fR. -An atom followed by `*' matches a sequence of 0 or more matches of the atom. -An atom followed by `+' matches a sequence of 1 or more matches of the atom. -An atom followed by `?' matches a sequence of 0 or 1 matches of the atom. -.PP -A \fIbound\fR is `{' followed by an unsigned decimal integer, -possibly followed by `,' -possibly followed by another unsigned decimal integer, -always followed by `}'. -The integers must lie between 0 and RE_DUP_MAX (255\(dg) inclusive, -and if there are two of them, the first may not exceed the second. -An atom followed by a bound containing one integer \fIi\fR -and no comma matches -a sequence of exactly \fIi\fR matches of the atom. -An atom followed by a bound -containing one integer \fIi\fR and a comma matches -a sequence of \fIi\fR or more matches of the atom. -An atom followed by a bound -containing two integers \fIi\fR and \fIj\fR matches -a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom. -.PP -An atom is a regular expression enclosed in `()' (matching a match for the -regular expression), -an empty set of `()' (matching the null string)\(dg, -a \fIbracket expression\fR (see below), `.' -(matching any single character), `^' (matching the null string at the -beginning of a line), `$' (matching the null string at the -end of a line), a `\e' followed by one of the characters -`^.[$()|*+?{\e' -(matching that character taken as an ordinary character), -a `\e' followed by any other character\(dg -(matching that character taken as an ordinary character, -as if the `\e' had not been present\(dg), -or a single character with no other significance (matching that character). -A `{' followed by a character other than a digit is an ordinary -character, not the beginning of a bound\(dg. -It is illegal to end an RE with `\e'. -.PP -A \fIbracket expression\fR is a list of characters enclosed in `[]'. -It normally matches any single character from the list (but see below). -If the list begins with `^', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -If two characters in the list are separated by `\-', this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. `[0-9]' in ASCII matches any decimal digit. -It is illegal\(dg for two ranges to share an -endpoint, e.g. `a-c-e'. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal `]' in the list, make it the first character -(following a possible `^'). -To include a literal `\-', make it the first or last character, -or the second endpoint of a range. -To use a literal `\-' as the first endpoint of a range, -enclose it in `[.' and `.]' to make it a collating element (see below). -With the exception of these and some combinations using `[' (see next -paragraphs), all other special characters, including `\e', lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in `[.' and `.]' stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression containing a multi-character collating element -can thus match more than one character, -e.g. if the collating sequence includes a `ch' collating element, -then the RE `[[.ch.]]*c' matches the first five characters -of `chchcc'. -.PP -Within a bracket expression, a collating element enclosed in `[=' and -`=]' is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `[.' and `.]'.) -For example, if o and \o'o^' are the members of an equivalence class, -then `[[=o=]]', `[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous. -An equivalence class may not\(dg be an endpoint -of a range. -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in `[:' and `:]' stands for the list of all characters belonging to that -class. -Standard character class names are: -.PP -.RS -.nf -.ta 3c 6c 9c -alnum digit punct -alpha graph space -blank lower upper -cntrl print xdigit -.fi -.RE -.PP -These stand for the character classes defined in -.IR ctype (3). -A locale may provide others. -A character class may not be used as an endpoint of a range. -.PP -There are two special cases\(dg of bracket expressions: -the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at -the beginning and end of a word respectively. -A word is defined as a sequence of -word characters -which is neither preceded nor followed by -word characters. -A word character is an -.I alnum -character (as defined by -.IR ctype (3)) -or an underscore. -This is an extension, -compatible with but not specified by POSIX 1003.2, -and should be used with -caution in software intended to be portable to other systems. -.PP -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -it matches the longest. -Subexpressions also match the longest possible substrings, subject to -the constraint that the whole match be as long as possible, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that higher-level subexpressions thus take priority over -their lower-level component subexpressions. -.PP -Match lengths are measured in characters, not collating elements. -A null string is considered longer than no match at all. -For example, -`bb*' matches the three middle characters of `abbbc', -`(wee|week)(knights|nights)' matches all ten characters of `weeknights', -when `(.*).*' is matched against `abc' the parenthesized subexpression -matches all three characters, and -when `(a*)*' is matched against `bc' both the whole RE and the parenthesized -subexpression match the null string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -e.g. `x' becomes `[xX]'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that (e.g.) `[x]' -becomes `[xX]' and `[^x]' becomes `[^xX]'. -.PP -No particular limit is imposed on the length of REs\(dg. -Programs intended to be portable should not employ REs longer -than 256 bytes, -as an implementation can refuse to accept such REs and remain -POSIX-compliant. -.PP -Obsolete (``basic'') regular expressions differ in several respects. -`|', `+', and `?' are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are `\e{' and `\e}', -with `{' and `}' by themselves ordinary characters. -The parentheses for nested subexpressions are `\e(' and `\e)', -with `(' and `)' by themselves ordinary characters. -`^' is an ordinary character except at the beginning of the -RE or\(dg the beginning of a parenthesized subexpression, -`$' is an ordinary character except at the end of the -RE or\(dg the end of a parenthesized subexpression, -and `*' is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `^'). -Finally, there is one new type of atom, a \fIback reference\fR: -`\e' followed by a non-zero decimal digit \fId\fR -matches the same sequence of characters -matched by the \fId\fRth parenthesized subexpression -(numbering subexpressions by the positions of their opening parentheses, -left to right), -so that (e.g.) `\e([bc]\e)\e1' matches `bb' or `cc' but not `bc'. -.SH SEE ALSO -regex(3) -.PP -POSIX 1003.2, section 2.8 (Regular Expression Notation). -.SH BUGS -Having two kinds of REs is a botch. -.PP -The current 1003.2 spec says that `)' is an ordinary character in -the absence of an unmatched `('; -this was an unintentional result of a wording error, -and change is likely. -Avoid relying on it. -.PP -Back references are a dreadful botch, -posing major problems for efficient implementations. -They are also somewhat vaguely defined -(does -`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?). -Avoid using them. -.PP -1003.2's specification of case-independent matching is vague. -The ``one case implies all cases'' definition given above -is current consensus among implementors as to the right interpretation. -.PP -The syntax for word boundaries is incredibly ugly. diff --git a/ext/ereg/regex/regex.dsp b/ext/ereg/regex/regex.dsp deleted file mode 100644 index e8f1ad42995..00000000000 --- a/ext/ereg/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/ext/ereg/regex/regex.dsw b/ext/ereg/regex/regex.dsw deleted file mode 100644 index 7b7df8126c4..00000000000 --- a/ext/ereg/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/ext/ereg/regex/regex.h b/ext/ereg/regex/regex.h deleted file mode 100644 index b39c5e178c6..00000000000 --- a/ext/ereg/regex/regex.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _HSREGEX_H_ -#define _HSREGEX_H_ -#ifndef _HSREGEX_H -#define _HSREGEX_H /* never again */ -/* ========= begin header generated by ././mkh ========= */ -#ifdef __cplusplus -extern "C" { -#endif - -/* === regex2.h === */ -#ifdef WIN32 -#define API_EXPORT(type) __declspec(dllexport) type __stdcall -#else -#define API_EXPORT(type) type -#endif - -typedef off_t regoff_t; -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - - -/* === regcomp.c === */ -API_EXPORT(int) regcomp(regex_t *, const char *, int); -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - - -/* === regerror.c === */ -#define REG_OKAY 0 -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ -API_EXPORT(size_t) regerror(int, const regex_t *, char *, size_t); - - -/* === regexec.c === */ -API_EXPORT(int) regexec(const regex_t *, const char *, size_t, regmatch_t [], int); -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - - -/* === regfree.c === */ -API_EXPORT(void) regfree(regex_t *); - -#ifdef __cplusplus -} -#endif -/* ========= end header generated by ././mkh ========= */ -#endif -#endif diff --git a/ext/ereg/regex/regex.mak b/ext/ereg/regex/regex.mak deleted file mode 100644 index b87ded340b3..00000000000 --- a/ext/ereg/regex/regex.mak +++ /dev/null @@ -1,304 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on regex.dsp -!IF "$(CFG)" == "" -CFG=regex - Win32 Release -!MESSAGE No configuration specified. Defaulting to regex - Win32 Release. -!ENDIF - -!IF "$(CFG)" != "regex - Win32 Release" && "$(CFG)" != "regex - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -CPP=cl.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -OUTDIR=.\Release -INTDIR=.\Release -# Begin Custom Macros -OutDir=.\.\Release -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\ - /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Release/ -CPP_SBRS=. -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -OUTDIR=.\Debug -INTDIR=.\Debug -# Begin Custom Macros -OutDir=.\.\Debug -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ELSE - -ALL : "$(OUTDIR)\regex.lib" "$(OUTDIR)\regex.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\regcomp.obj" - -@erase "$(INTDIR)\regcomp.sbr" - -@erase "$(INTDIR)\regerror.obj" - -@erase "$(INTDIR)\regerror.sbr" - -@erase "$(INTDIR)\regexec.obj" - -@erase "$(INTDIR)\regexec.sbr" - -@erase "$(INTDIR)\regfree.obj" - -@erase "$(INTDIR)\regfree.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\regex.bsc" - -@erase "$(OUTDIR)\regex.lib" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "." /D "WIN32" /D "_DEBUG" /D\ - "_WINDOWS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\regex.pch" /YX /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\Debug/ -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\regex.bsc" -BSC32_SBRS= \ - "$(INTDIR)\regcomp.sbr" \ - "$(INTDIR)\regerror.sbr" \ - "$(INTDIR)\regexec.sbr" \ - "$(INTDIR)\regfree.sbr" - -"$(OUTDIR)\regex.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LIB32=link.exe -lib -LIB32_FLAGS=/nologo /out:"$(OUTDIR)\regex.lib" -LIB32_OBJS= \ - "$(INTDIR)\regcomp.obj" \ - "$(INTDIR)\regerror.obj" \ - "$(INTDIR)\regexec.obj" \ - "$(INTDIR)\regfree.obj" - -"$(OUTDIR)\regex.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) - $(LIB32) @<< - $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - - -!IF "$(CFG)" == "regex - Win32 Release" || "$(CFG)" == "regex - Win32 Debug" -SOURCE=.\regcomp.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regcomp.obj" : $(SOURCE) $(DEP_CPP_REGCO) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGCO=\ - ".\cclass.h"\ - ".\cname.h"\ - ".\regcomp.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regcomp.obj" "$(INTDIR)\regcomp.sbr" : $(SOURCE) $(DEP_CPP_REGCO)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regerror.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regerror.obj" : $(SOURCE) $(DEP_CPP_REGER) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGER=\ - ".\regerror.ih"\ - ".\regex.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regerror.obj" "$(INTDIR)\regerror.sbr" : $(SOURCE) $(DEP_CPP_REGER)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regexec.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regexec.obj" : $(SOURCE) $(DEP_CPP_REGEX) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGEX=\ - ".\engine.c"\ - ".\engine.ih"\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regexec.obj" "$(INTDIR)\regexec.sbr" : $(SOURCE) $(DEP_CPP_REGEX)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\regfree.c - -!IF "$(CFG)" == "regex - Win32 Release" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - - -"$(INTDIR)\regfree.obj" : $(SOURCE) $(DEP_CPP_REGFR) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -DEP_CPP_REGFR=\ - ".\regex.h"\ - ".\regex2.h"\ - ".\utils.h"\ - {$(INCLUDE)}"sys\types.h"\ - - -"$(INTDIR)\regfree.obj" "$(INTDIR)\regfree.sbr" : $(SOURCE) $(DEP_CPP_REGFR)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\engine.c - -!ENDIF - diff --git a/ext/ereg/regex/regex2.h b/ext/ereg/regex/regex2.h deleted file mode 100644 index 7cd39a59ae5..00000000000 --- a/ext/ereg/regex/regex2.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * First, the stuff that ends up in the outside-world include file - = #ifdef WIN32 - = #define API_EXPORT(type) __declspec(dllexport) type __stdcall - = #else - = #define API_EXPORT(type) type - = #endif - = - = typedef off_t regoff_t; - = typedef struct { - = int re_magic; - = size_t re_nsub; // number of parenthesized subexpressions - = const char *re_endp; // end pointer for REG_PEND - = struct re_guts *re_g; // none of your business :-) - = } regex_t; - = typedef struct { - = regoff_t rm_so; // start of match - = regoff_t rm_eo; // end of match - = } regmatch_t; - */ -/* - * internals of regex_t - */ -#define MAGIC1 ((('r'^0200)<<8) | 'e') - -/* - * The internal representation is a *strip*, a sequence of - * operators ending with an endmarker. (Some terminology etc. is a - * historical relic of earlier versions which used multiple strips.) - * Certain oddities in the representation are there to permit running - * the machinery backwards; in particular, any deviation from sequential - * flow must be marked at both its source and its destination. Some - * fine points: - * - * - OPLUS_ and O_PLUS are *inside* the loop they create. - * - OQUEST_ and O_QUEST are *outside* the bypass they create. - * - OCH_ and O_CH are *outside* the multi-way branch they create, while - * OOR1 and OOR2 are respectively the end and the beginning of one of - * the branches. Note that there is an implicit OOR2 following OCH_ - * and an implicit OOR1 preceding O_CH. - * - * In state representations, an operator's bit is on to signify a state - * immediately *preceding* "execution" of that operator. - */ -typedef long sop; /* strip operator */ -typedef long sopno; -#define OPRMASK 0x7c000000 -#define OPDMASK 0x03ffffff -#define OPSHIFT (26) -#define OP(n) ((n)&OPRMASK) -#define OPND(n) ((n)&OPDMASK) -#define SOP(op, opnd) ((op)|(opnd)) -/* operators meaning operand */ -/* (back, fwd are offsets) */ -#define OEND (1< uch [csetsize] */ - uch mask; /* bit within array */ - uch hash; /* hash code */ - size_t smultis; - char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */ -} cset; -/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */ -#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c)) -#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (c)) -#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask) -#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */ -#define MCsub(p, cs, cp) mcsub(p, cs, cp) -#define MCin(p, cs, cp) mcin(p, cs, cp) - -/* stuff for character categories */ -typedef unsigned char cat_t; - -/* - * main compiled-expression structure - */ -struct re_guts { - int magic; -# define MAGIC2 ((('R'^0200)<<8)|'E') - sop *strip; /* malloced area for strip */ - int csetsize; /* number of bits in a cset vector */ - int ncsets; /* number of csets in use */ - cset *sets; /* -> cset [ncsets] */ - uch *setbits; /* -> uch[csetsize][ncsets/CHAR_BIT] */ - int cflags; /* copy of regcomp() cflags argument */ - sopno nstates; /* = number of sops */ - sopno firststate; /* the initial OEND (normally 0) */ - sopno laststate; /* the final OEND */ - int iflags; /* internal flags */ -# define USEBOL 01 /* used ^ */ -# define USEEOL 02 /* used $ */ -# define BAD 04 /* something wrong */ - int nbol; /* number of ^ used */ - int neol; /* number of $ used */ - int ncategories; /* how many character categories */ - cat_t *categories; /* ->catspace[-CHAR_MIN] */ - char *must; /* match must contain this string */ - int mlen; /* length of must */ - size_t nsub; /* copy of re_nsub */ - int backrefs; /* does it use back references? */ - sopno nplus; /* how deep does it nest +s? */ - /* catspace must be last */ - cat_t catspace[1]; /* actually [NC] */ -}; - -/* misc utilities */ -#define OUT (CHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum(c) || (c) == '_') diff --git a/ext/ereg/regex/regex_extra.h b/ext/ereg/regex/regex_extra.h deleted file mode 100644 index 3db9e4ad1a8..00000000000 --- a/ext/ereg/regex/regex_extra.h +++ /dev/null @@ -1,23 +0,0 @@ -/* do not frame this - we must be able to include this file multiple times */ - -#undef regexec -#undef regerror -#undef regfree -#undef regcomp - -#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX)) - -#if !(WIN32|WINNT) - -#ifndef PHP_NO_ALIASES - -#define regexec php_regexec -#define regerror php_regerror -#define regfree php_regfree -#define regcomp php_regcomp - -#endif - -#endif - -#endif diff --git a/ext/ereg/regex/regexec.c b/ext/ereg/regex/regexec.c deleted file mode 100644 index 7888d02368c..00000000000 --- a/ext/ereg/regex/regexec.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * the outer shell of regexec() - * - * This file includes engine.c *twice*, after muchos fiddling with the - * macros that code uses. This lets the same code operate on two different - * representations for state sets. - */ -#include -#include -#include -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -static int nope = 0; /* for use in asserts; shuts lint up */ - -/* macros for manipulating states, small version */ -#define states unsigned -#define states1 unsigned /* for later use in regexec() decision */ -#define CLEAR(v) ((v) = 0) -#define SET0(v, n) ((v) &= ~((unsigned)1 << (n))) -#define SET1(v, n) ((v) |= (unsigned)1 << (n)) -#define ISSET(v, n) ((v) & ((unsigned)1 << (n))) -#define ASSIGN(d, s) ((d) = (s)) -#define EQ(a, b) ((a) == (b)) -#define STATEVARS int dummy /* dummy version */ -#define STATESETUP(m, n) /* nothing */ -#define STATETEARDOWN(m) /* nothing */ -#define SETUP(v) ((v) = 0) -#define onestate unsigned -#define INIT(o, n) ((o) = (unsigned)1 << (n)) -#define INC(o) ((o) <<= 1) -#define ISSTATEIN(v, o) ((v) & (o)) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) << (n)) -#define BACK(dst, src, n) ((dst) |= ((unsigned)(src)&(here)) >> (n)) -#define ISSETBACK(v, n) ((v) & ((unsigned)here >> (n))) -/* function names */ -#define SNAMES /* engine.c looks after details */ - -#include "engine.c" - -/* now undo things */ -#undef states -#undef CLEAR -#undef SET0 -#undef SET1 -#undef ISSET -#undef ASSIGN -#undef EQ -#undef STATEVARS -#undef STATESETUP -#undef STATETEARDOWN -#undef SETUP -#undef onestate -#undef INIT -#undef INC -#undef ISSTATEIN -#undef FWD -#undef BACK -#undef ISSETBACK -#undef SNAMES - -/* macros for manipulating states, large version */ -#define states char * -#define CLEAR(v) memset(v, 0, m->g->nstates) -#define SET0(v, n) ((v)[n] = 0) -#define SET1(v, n) ((v)[n] = 1) -#define ISSET(v, n) ((v)[n]) -#define ASSIGN(d, s) memcpy(d, s, m->g->nstates) -#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) -#define STATEVARS int vn; char *space -#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \ - if ((m)->space == NULL) return(REG_ESPACE); \ - (m)->vn = 0; } -#define STATETEARDOWN(m) { free((m)->space); } -#define SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) -#define onestate int -#define INIT(o, n) ((o) = (n)) -#define INC(o) ((o)++) -#define ISSTATEIN(v, o) ((v)[o]) -/* some abbreviations; note that some of these know variable names! */ -/* do "if I'm here, I can also be there" etc without branches */ -#define FWD(dst, src, n) ((dst)[here+(n)] |= (src)[here]) -#define BACK(dst, src, n) ((dst)[here-(n)] |= (src)[here]) -#define ISSETBACK(v, n) ((v)[here - (n)]) -/* function names */ -#define LNAMES /* flag */ - -#include "engine.c" - -/* - - regexec - interface for matching - = API_EXPORT(int) regexec(const regex_t *, const char *, size_t, \ - = regmatch_t [], int); - = #define REG_NOTBOL 00001 - = #define REG_NOTEOL 00002 - = #define REG_STARTEND 00004 - = #define REG_TRACE 00400 // tracing of execution - = #define REG_LARGE 01000 // force large representation - = #define REG_BACKR 02000 // force use of backref code - * - * We put this here so we can exploit knowledge of the state representation - * when choosing which matcher to call. Also, by this point the matchers - * have been prototyped. - */ -API_EXPORT(int) /* 0 success, REG_NOMATCH failure */ -regexec(preg, string, nmatch, pmatch, eflags) -const regex_t *preg; -const char *string; -size_t nmatch; -regmatch_t pmatch[]; -int eflags; -{ - register struct re_guts *g = preg->re_g; -#ifdef REDEBUG -# define GOODFLAGS(f) (f) -#else -# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND)) -#endif - - if (preg->re_magic != MAGIC1 || g->magic != MAGIC2) - return(REG_BADPAT); - assert(!(g->iflags&BAD)); - if (g->iflags&BAD) /* backstop for no-debug case */ - return(REG_BADPAT); - eflags = GOODFLAGS(eflags); - - if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE)) - return(smatcher(g, (char *)string, nmatch, pmatch, eflags)); - else - return(lmatcher(g, (char *)string, nmatch, pmatch, eflags)); -} diff --git a/ext/ereg/regex/regfree.c b/ext/ereg/regex/regfree.c deleted file mode 100644 index 9fd618a13b8..00000000000 --- a/ext/ereg/regex/regfree.c +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include -#include - -#include "utils.h" -#include "regex2.h" - -/* - - regfree - free everything - = API_EXPORT(void) regfree(regex_t *); - */ -API_EXPORT(void) -regfree(preg) -regex_t *preg; -{ - register struct re_guts *g; - - if (preg->re_magic != MAGIC1) /* oops */ - return; /* nice to complain, but hard */ - - g = preg->re_g; - if (g == NULL || g->magic != MAGIC2) /* oops again */ - return; - preg->re_magic = 0; /* mark it invalid */ - g->magic = 0; /* mark it invalid */ - - if (g->strip != NULL) - free((char *)g->strip); - if (g->sets != NULL) - free((char *)g->sets); - if (g->setbits != NULL) - free((char *)g->setbits); - if (g->must != NULL) - free(g->must); - free((char *)g); -} diff --git a/ext/ereg/regex/split.c b/ext/ereg/regex/split.c deleted file mode 100644 index 188bdb775b9..00000000000 --- a/ext/ereg/regex/split.c +++ /dev/null @@ -1,316 +0,0 @@ -#include -#include - -/* - - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); - */ -int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ -{ - register char *p = string; - register char c; /* latest character */ - register char sepc = sep[0]; - register char sepc2; - register int fn; - register char **fp = fields; - register char *sepp; - register int trimtrail; - - /* white space */ - if (sepc == '\0') { - while ((c = *p++) == ' ' || c == '\t') - continue; - p--; - trimtrail = 1; - sep = " \t"; /* note, code below knows this is 2 long */ - sepc = ' '; - } else - trimtrail = 0; - sepc2 = sep[1]; /* now we can safely pick this up */ - - /* catch empties */ - if (*p == '\0') - return(0); - - /* single separator */ - if (sepc2 == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - if (fn == 0) - break; - while ((c = *p++) != sepc) - if (c == '\0') - return(nfields - fn); - *(p-1) = '\0'; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - for (;;) { - while ((c = *p++) != sepc) - if (c == '\0') - return(fn); - fn++; - } - /* not reached */ - } - - /* two separators */ - if (sep[2] == '\0') { - fn = nfields; - for (;;) { - *fp++ = p; - fn--; - while ((c = *p++) != sepc && c != sepc2) - if (c == '\0') { - if (trimtrail && **(fp-1) == '\0') - fn++; - return(nfields - fn); - } - if (fn == 0) - break; - *(p-1) = '\0'; - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - } - /* we have overflowed the fields vector -- just count them */ - fn = nfields; - while (c != '\0') { - while ((c = *p++) == sepc || c == sepc2) - continue; - p--; - fn++; - while ((c = *p++) != '\0' && c != sepc && c != sepc2) - continue; - } - /* might have to trim trailing white space */ - if (trimtrail) { - p--; - while ((c = *--p) == sepc || c == sepc2) - continue; - p++; - if (*p != '\0') { - if (fn == nfields+1) - *p = '\0'; - fn--; - } - } - return(fn); - } - - /* n separators */ - fn = 0; - for (;;) { - if (fn < nfields) - *fp++ = p; - fn++; - for (;;) { - c = *p++; - if (c == '\0') - return(fn); - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc != '\0') /* it was a separator */ - break; - } - if (fn < nfields) - *(p-1) = '\0'; - for (;;) { - c = *p++; - sepp = sep; - while ((sepc = *sepp++) != '\0' && sepc != c) - continue; - if (sepc == '\0') /* it wasn't a separator */ - break; - } - p--; - } - - /* not reached */ -} - -#ifdef TEST_SPLIT - - -/* - * test program - * pgm runs regression - * pgm sep splits stdin lines by sep - * pgm str sep splits str by sep - * pgm str sep n splits str by sep n times - */ -int -main(argc, argv) -int argc; -char *argv[]; -{ - char buf[512]; - register int n; -# define MNF 10 - char *fields[MNF]; - - if (argc > 4) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - } - else if (argc > 3) - for (n = atoi(argv[3]); n > 0; n--) { - (void) strcpy(buf, argv[1]); - (void) split(buf, fields, MNF, argv[2]); - } - else if (argc > 2) - dosplit(argv[1], argv[2]); - else if (argc > 1) - while (fgets(buf, sizeof(buf), stdin) != NULL) { - buf[strlen(buf)-1] = '\0'; /* stomp newline */ - dosplit(buf, argv[1]); - } - else - regress(); - - exit(0); -} - -dosplit(string, seps) -char *string; -char *seps; -{ -# define NF 5 - char *fields[NF]; - register int nf; - - nf = split(string, fields, NF, seps); - print(nf, NF, fields); -} - -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; -{ - register int fn; - register int bound; - - bound = (nf > nfp) ? nfp : nf; - printf("%d:\t", nf); - for (fn = 0; fn < bound; fn++) - printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n"); -} - -#define RNF 5 /* some table entries know this */ -struct { - char *str; - char *seps; - int nf; - char *fi[RNF]; -} tests[] = { - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 5, { "abc", "def", "", "g", "" }, - " a bcd", " ", 4, { "", "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", " _", 0, { "" }, - " ", " _", 2, { "", "" }, - "x", " _", 1, { "x" }, - "x y", " _", 2, { "x", "y" }, - "ab _ cd", " _", 2, { "ab", "cd" }, - " a_b c ", " _", 5, { "", "a", "b", "c", "" }, - "a b c_d e f", " _", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " _", 6, { "", "a", "b", "c", "d " }, - - "", " _~", 0, { "" }, - " ", " _~", 2, { "", "" }, - "x", " _~", 1, { "x" }, - "x y", " _~", 2, { "x", "y" }, - "ab _~ cd", " _~", 2, { "ab", "cd" }, - " a_b c~", " _~", 5, { "", "a", "b", "c", "" }, - "a b_c d~e f", " _~", 6, { "a", "b", "c", "d", "e f" }, - "~a b c d ", " _~", 6, { "", "a", "b", "c", "d " }, - - "", " _~-", 0, { "" }, - " ", " _~-", 2, { "", "" }, - "x", " _~-", 1, { "x" }, - "x y", " _~-", 2, { "x", "y" }, - "ab _~- cd", " _~-", 2, { "ab", "cd" }, - " a_b c~", " _~-", 5, { "", "a", "b", "c", "" }, - "a b_c-d~e f", " _~-", 6, { "a", "b", "c", "d", "e f" }, - "~a-b c d ", " _~-", 6, { "", "a", "b", "c", "d " }, - - "", " ", 0, { "" }, - " ", " ", 2, { "", "" }, - "x", " ", 1, { "x" }, - "xy", " ", 1, { "xy" }, - "x y", " ", 2, { "x", "y" }, - "abc def g ", " ", 4, { "abc", "def", "g", "" }, - " a bcd", " ", 3, { "", "a", "bcd" }, - "a b c d e f", " ", 6, { "a", "b", "c", "d", "e f" }, - " a b c d ", " ", 6, { "", "a", "b", "c", "d " }, - - "", "", 0, { "" }, - " ", "", 0, { "" }, - "x", "", 1, { "x" }, - "xy", "", 1, { "xy" }, - "x y", "", 2, { "x", "y" }, - "abc def g ", "", 3, { "abc", "def", "g" }, - "\t a bcd", "", 2, { "a", "bcd" }, - " a \tb\t c ", "", 3, { "a", "b", "c" }, - "a b c d e ", "", 5, { "a", "b", "c", "d", "e" }, - "a b\tc d e f", "", 6, { "a", "b", "c", "d", "e f" }, - " a b c d e f ", "", 6, { "a", "b", "c", "d", "e f " }, - - NULL, NULL, 0, { NULL }, -}; - -regress() -{ - char buf[512]; - register int n; - char *fields[RNF+1]; - register int nf; - register int i; - register int printit; - register char *f; - - for (n = 0; tests[n].str != NULL; n++) { - (void) strcpy(buf, tests[n].str); - fields[RNF] = NULL; - nf = split(buf, fields, RNF, tests[n].seps); - printit = 0; - if (nf != tests[n].nf) { - printf("split `%s' by `%s' gave %d fields, not %d\n", - tests[n].str, tests[n].seps, nf, tests[n].nf); - printit = 1; - } else if (fields[RNF] != NULL) { - printf("split() went beyond array end\n"); - printit = 1; - } else { - for (i = 0; i < nf && i < RNF; i++) { - f = fields[i]; - if (f == NULL) - f = "(NULL)"; - if (strcmp(f, tests[n].fi[i]) != 0) { - printf("split `%s' by `%s', field %d is `%s', not `%s'\n", - tests[n].str, tests[n].seps, - i, fields[i], tests[n].fi[i]); - printit = 1; - } - } - } - if (printit) - print(nf, RNF, fields); - } -} -#endif diff --git a/ext/ereg/regex/tests b/ext/ereg/regex/tests deleted file mode 100644 index c05846177f5..00000000000 --- a/ext/ereg/regex/tests +++ /dev/null @@ -1,475 +0,0 @@ -# regular expression test set -# Lines are at least three fields, separated by one or more tabs. "" stands -# for an empty field. First field is an RE. Second field is flags. If -# C flag given, regcomp() is expected to fail, and the third field is the -# error name (minus the leading REG_). -# -# Otherwise it is expected to succeed, and the third field is the string to -# try matching it against. If there is no fourth field, the match is -# expected to fail. If there is a fourth field, it is the substring that -# the RE is expected to match. If there is a fifth field, it is a comma- -# separated list of what the subexpressions should match, with - indicating -# no match for that one. In both the fourth and fifth fields, a (sub)field -# starting with @ indicates that the (sub)expression is expected to match -# a null string followed by the stuff after the @; this provides a way to -# test where null strings match. The character `N' in REs and strings -# is newline, `S' is space, `T' is tab, `Z' is NUL. -# -# The full list of flags: -# - placeholder, does nothing -# b RE is a BRE, not an ERE -# & try it as both an ERE and a BRE -# C regcomp() error expected, third field is error name -# i REG_ICASE -# m ("mundane") REG_NOSPEC -# s REG_NOSUB (not really testable) -# n REG_NEWLINE -# ^ REG_NOTBOL -# $ REG_NOTEOL -# # REG_STARTEND (see below) -# p REG_PEND -# -# For REG_STARTEND, the start/end offsets are those of the substring -# enclosed in (). - -# basics -a & a a -abc & abc abc -abc|de - abc abc -a|b|c - abc a - -# parentheses and perversions thereof -a(b)c - abc abc -a\(b\)c b abc abc -a( C EPAREN -a( b a( a( -a\( - a( a( -a\( bC EPAREN -a\(b bC EPAREN -a(b C EPAREN -a(b b a(b a(b -# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly) -a) - a) a) -) - ) ) -# end gagging (in a just world, those *should* give EPAREN) -a) b a) a) -a\) bC EPAREN -\) bC EPAREN -a()b - ab ab -a\(\)b b ab ab - -# anchoring and REG_NEWLINE -^abc$ & abc abc -a^b - a^b -a^b b a^b a^b -a$b - a$b -a$b b a$b a$b -^ & abc @abc -$ & abc @ -^$ & "" @ -$^ - "" @ -\($\)\(^\) b "" @ -# stop retching, those are legitimate (although disgusting) -^^ - "" @ -$$ - "" @ -b$ & abNc -b$ &n abNc b -^b$ & aNbNc -^b$ &n aNbNc b -^$ &n aNNb @Nb -^$ n abc -^$ n abcN @ -$^ n aNNb @Nb -\($\)\(^\) bn aNNb @Nb -^^ n^ aNNb @Nb -$$ n aNNb @NN -^a ^ a -a$ $ a -^a ^n aNb -^b ^n aNb b -a$ $n bNa -b$ $n bNa b -a*(^b$)c* - b b -a*\(^b$\)c* b b b - -# certain syntax errors and non-errors -| C EMPTY -| b | | -* C BADRPT -* b * * -+ C BADRPT -? C BADRPT -"" &C EMPTY -() - abc @abc -\(\) b abc @abc -a||b C EMPTY -|ab C EMPTY -ab| C EMPTY -(|a)b C EMPTY -(a|)b C EMPTY -(*a) C BADRPT -(+a) C BADRPT -(?a) C BADRPT -({1}a) C BADRPT -\(\{1\}a\) bC BADRPT -(a|*b) C BADRPT -(a|+b) C BADRPT -(a|?b) C BADRPT -(a|{1}b) C BADRPT -^* C BADRPT -^* b * * -^+ C BADRPT -^? C BADRPT -^{1} C BADRPT -^\{1\} bC BADRPT - -# metacharacters, backslashes -a.c & abc abc -a[bc]d & abd abd -a\*c & a*c a*c -a\\b & a\b a\b -a\\\*b & a\*b a\*b -a\bc & abc abc -a\ &C EESCAPE -a\\bc & a\bc a\bc -\{ bC BADRPT -a\[b & a[b a[b -a[b &C EBRACK -# trailing $ is a peculiar special case for the BRE code -a$ & a a -a$ & a$ -a\$ & a -a\$ & a$ a$ -a\\$ & a -a\\$ & a$ -a\\$ & a\$ -a\\$ & a\ a\ - -# back references, ugh -a\(b\)\2c bC ESUBREG -a\(b\1\)c bC ESUBREG -a\(b*\)c\1d b abbcbbd abbcbbd bb -a\(b*\)c\1d b abbcbd -a\(b*\)c\1d b abbcbbbd -^\(.\)\1 b abc -a\([bc]\)\1d b abcdabbd abbd b -a\(\([bc]\)\2\)*d b abbccd abbccd -a\(\([bc]\)\2\)*d b abbcbd -# actually, this next one probably ought to fail, but the spec is unclear -a\(\(b\)*\2\)*d b abbbd abbbd -# here is a case that no NFA implementation does right -\(ab*\)[ab]*\1 b ababaaa ababaaa a -# check out normal matching in the presence of back refs -\(a\)\1bcd b aabcd aabcd -\(a\)\1bc*d b aabcd aabcd -\(a\)\1bc*d b aabd aabd -\(a\)\1bc*d b aabcccd aabcccd -\(a\)\1bc*[ce]d b aabcccd aabcccd -^\(a\)\1b\(c\)*cd$ b aabcccd aabcccd - -# ordinary repetitions -ab*c & abc abc -ab+c - abc abc -ab?c - abc abc -a\(*\)b b a*b a*b -a\(**\)b b ab ab -a\(***\)b bC BADRPT -*a b *a *a -**a b a a -***a bC BADRPT - -# the dreaded bounded repetitions -{ & { { -{abc & {abc {abc -{1 C BADRPT -{1} C BADRPT -a{b & a{b a{b -a{1}b - ab ab -a\{1\}b b ab ab -a{1,}b - ab ab -a\{1,\}b b ab ab -a{1,2}b - aab aab -a\{1,2\}b b aab aab -a{1 C EBRACE -a\{1 bC EBRACE -a{1a C EBRACE -a\{1a bC EBRACE -a{1a} C BADBR -a\{1a\} bC BADBR -a{,2} - a{,2} a{,2} -a\{,2\} bC BADBR -a{,} - a{,} a{,} -a\{,\} bC BADBR -a{1,x} C BADBR -a\{1,x\} bC BADBR -a{1,x C EBRACE -a\{1,x bC EBRACE -a{300} C BADBR -a\{300\} bC BADBR -a{1,0} C BADBR -a\{1,0\} bC BADBR -ab{0,0}c - abcac ac -ab\{0,0\}c b abcac ac -ab{0,1}c - abcac abc -ab\{0,1\}c b abcac abc -ab{0,3}c - abbcac abbc -ab\{0,3\}c b abbcac abbc -ab{1,1}c - acabc abc -ab\{1,1\}c b acabc abc -ab{1,3}c - acabc abc -ab\{1,3\}c b acabc abc -ab{2,2}c - abcabbc abbc -ab\{2,2\}c b abcabbc abbc -ab{2,4}c - abcabbc abbc -ab\{2,4\}c b abcabbc abbc -((a{1,10}){1,10}){1,10} - a a a,a - -# multiple repetitions -a** &C BADRPT -a++ C BADRPT -a?? C BADRPT -a*+ C BADRPT -a*? C BADRPT -a+* C BADRPT -a+? C BADRPT -a?* C BADRPT -a?+ C BADRPT -a{1}{1} C BADRPT -a*{1} C BADRPT -a+{1} C BADRPT -a?{1} C BADRPT -a{1}* C BADRPT -a{1}+ C BADRPT -a{1}? C BADRPT -a*{b} - a{b} a{b} -a\{1\}\{1\} bC BADRPT -a*\{1\} bC BADRPT -a\{1\}* bC BADRPT - -# brackets, and numerous perversions thereof -a[b]c & abc abc -a[ab]c & abc abc -a[^ab]c & adc adc -a[]b]c & a]c a]c -a[[b]c & a[c a[c -a[-b]c & a-c a-c -a[^]b]c & adc adc -a[^-b]c & adc adc -a[b-]c & a-c a-c -a[b &C EBRACK -a[] &C EBRACK -a[1-3]c & a2c a2c -a[3-1]c &C ERANGE -a[1-3-5]c &C ERANGE -a[[.-.]--]c & a-c a-c -a[1- &C ERANGE -a[[. &C EBRACK -a[[.x &C EBRACK -a[[.x. &C EBRACK -a[[.x.] &C EBRACK -a[[.x.]] & ax ax -a[[.x,.]] &C ECOLLATE -a[[.one.]]b & a1b a1b -a[[.notdef.]]b &C ECOLLATE -a[[.].]]b & a]b a]b -a[[:alpha:]]c & abc abc -a[[:notdef:]]c &C ECTYPE -a[[: &C EBRACK -a[[:alpha &C EBRACK -a[[:alpha:] &C EBRACK -a[[:alpha,:] &C ECTYPE -a[[:]:]]b &C ECTYPE -a[[:-:]]b &C ECTYPE -a[[:alph:]] &C ECTYPE -a[[:alphabet:]] &C ECTYPE -[[:alnum:]]+ - -%@a0X- a0X -[[:alpha:]]+ - -%@aX0- aX -[[:blank:]]+ - aSSTb SST -[[:cntrl:]]+ - aNTb NT -[[:digit:]]+ - a019b 019 -[[:graph:]]+ - Sa%bS a%b -[[:lower:]]+ - AabC ab -[[:print:]]+ - NaSbN aSb -[[:punct:]]+ - S%-&T %-& -[[:space:]]+ - aSNTb SNT -[[:upper:]]+ - aBCd BC -[[:xdigit:]]+ - p0f3Cq 0f3C -a[[=b=]]c & abc abc -a[[= &C EBRACK -a[[=b &C EBRACK -a[[=b= &C EBRACK -a[[=b=] &C EBRACK -a[[=b,=]] &C ECOLLATE -a[[=one=]]b & a1b a1b - -# complexities -a(((b)))c - abc abc -a(b|(c))d - abd abd -a(b*|c)d - abbd abbd -# just gotta have one DFA-buster, of course -a[ab]{20} - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and an inline expansion in case somebody gets tricky -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] - aaaaabaaaabaaaabaaaab aaaaabaaaabaaaabaaaab -# and in case somebody just slips in an NFA... -a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) - aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights -# fish for anomalies as the number of states passes 32 -12345678901234567890123456789 - a12345678901234567890123456789b 12345678901234567890123456789 -123456789012345678901234567890 - a123456789012345678901234567890b 123456789012345678901234567890 -1234567890123456789012345678901 - a1234567890123456789012345678901b 1234567890123456789012345678901 -12345678901234567890123456789012 - a12345678901234567890123456789012b 12345678901234567890123456789012 -123456789012345678901234567890123 - a123456789012345678901234567890123b 123456789012345678901234567890123 -# and one really big one, beyond any plausible word width -1234567890123456789012345678901234567890123456789012345678901234567890 - a1234567890123456789012345678901234567890123456789012345678901234567890b 1234567890123456789012345678901234567890123456789012345678901234567890 -# fish for problems as brackets go past 8 -[ab][cd][ef][gh][ij][kl][mn] - xacegikmoq acegikm -[ab][cd][ef][gh][ij][kl][mn][op] - xacegikmoq acegikmo -[ab][cd][ef][gh][ij][kl][mn][op][qr] - xacegikmoqy acegikmoq -[ab][cd][ef][gh][ij][kl][mn][op][q] - xacegikmoqy acegikmoq - -# subtleties of matching -abc & xabcy abc -a\(b\)?c\1d b acd -aBc i Abc Abc -a[Bc]*d i abBCcd abBCcd -0[[:upper:]]1 &i 0a1 0a1 -0[[:lower:]]1 &i 0A1 0A1 -a[^b]c &i abc -a[^b]c &i aBc -a[^b]c &i adc adc -[a]b[c] - abc abc -[a]b[a] - aba aba -[abc]b[abc] - abc abc -[abc]b[abd] - abd abd -a(b?c)+d - accd accd -(wee|week)(knights|night) - weeknights weeknights -(we|wee|week|frob)(knights|night|day) - weeknights weeknights -a[bc]d - xyzaaabcaababdacd abd -a[ab]c - aaabc abc -abc s abc abc -a* & b @b - -# Let's have some fun -- try to match a C comment. -# first the obvious, which looks okay at first glance... -/\*.*\*/ - /*x*/ /*x*/ -# but... -/\*.*\*/ - /*x*/y/*z*/ /*x*/y/*z*/ -# okay, we must not match */ inside; try to do that... -/\*([^*]|\*[^/])*\*/ - /*x*/ /*x*/ -/\*([^*]|\*[^/])*\*/ - /*x*/y/*z*/ /*x*/ -# but... -/\*([^*]|\*[^/])*\*/ - /*x**/y/*z*/ /*x**/y/*z*/ -# and a still fancier version, which does it right (I think)... -/\*([^*]|\*+[^*/])*\*+/ - /*x*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x*/y/*z*/ /*x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**/y/*z*/ /*x**/ -/\*([^*]|\*+[^*/])*\*+/ - /*x****/y/*z*/ /*x****/ -/\*([^*]|\*+[^*/])*\*+/ - /*x**x*/y/*z*/ /*x**x*/ -/\*([^*]|\*+[^*/])*\*+/ - /*x***x/y/*z*/ /*x***x/y/*z*/ - -# subexpressions -a(b)(c)d - abcd abcd b,c -a(((b)))c - abc abc b,b,b -a(b|(c))d - abd abd b,- -a(b*|c|e)d - abbd abbd bb -a(b*|c|e)d - acd acd c -a(b*|c|e)d - ad ad @d -a(b?)c - abc abc b -a(b?)c - ac ac @c -a(b+)c - abc abc b -a(b+)c - abbbc abbbc bbb -a(b*)c - ac ac @c -(a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de -# the regression tester only asks for 9 subexpressions -a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j -a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l - abcdefghijkl abcdefghijkl b,c,d,e,f,g,h,i,j,k -a([bc]?)c - abc abc b -a([bc]?)c - ac ac @c -a([bc]+)c - abc abc b -a([bc]+)c - abcc abcc bc -a([bc]+)bc - abcbc abcbc bc -a(bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abb abb b -a(bbb+|bb+|b)b - abbb abbb bb -a(bbb+|bb+|b)bb - abbb abbb b -(.*).* - abcdef abcdef abcdef -(a*)* - bc @b @b - -# do we get the right subexpression when it is used more than once? -a(b|c)*d - ad ad - -a(b|c)*d - abcd abcd c -a(b|c)+d - abd abd b -a(b|c)+d - abcd abcd c -a(b|c?)+d - ad ad @d -a(b|c?)+d - abcd abcd @d -a(b|c){0,0}d - ad ad - -a(b|c){0,1}d - ad ad - -a(b|c){0,1}d - abd abd b -a(b|c){0,2}d - ad ad - -a(b|c){0,2}d - abcd abcd c -a(b|c){0,}d - ad ad - -a(b|c){0,}d - abcd abcd c -a(b|c){1,1}d - abd abd b -a(b|c){1,1}d - acd acd c -a(b|c){1,2}d - abd abd b -a(b|c){1,2}d - abcd abcd c -a(b|c){1,}d - abd abd b -a(b|c){1,}d - abcd abcd c -a(b|c){2,2}d - acbd acbd b -a(b|c){2,2}d - abcd abcd c -a(b|c){2,4}d - abcd abcd c -a(b|c){2,4}d - abcbd abcbd b -a(b|c){2,4}d - abcbcd abcbcd c -a(b|c){2,}d - abcd abcd c -a(b|c){2,}d - abcbd abcbd b -a(b+|((c)*))+d - abd abd @d,@d,- -a(b+|((c)*))+d - abcd abcd @d,@d,- - -# check out the STARTEND option -[abc] &# a(b)c b -[abc] &# a(d)c -[abc] &# a(bc)d b -[abc] &# a(dc)d c -. &# a()c -b.*c &# b(bc)c bc -b.* &# b(bc)c bc -.*c &# b(bc)c bc - -# plain strings, with the NOSPEC flag -abc m abc abc -abc m xabcy abc -abc m xyz -a*b m aba*b a*b -a*b m ab -"" mC EMPTY - -# cases involving NULs -aZb & a a -aZb &p a -aZb &p# (aZb) aZb -aZ*b &p# (ab) ab -a.b &# (aZb) aZb -a.* &# (aZb)c aZb - -# word boundaries (ick) -[[:<:]]a & a a -[[:<:]]a & ba -[[:<:]]a & -a a -a[[:>:]] & a a -a[[:>:]] & ab -a[[:>:]] & a- a -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc abc -[[:<:]]a.c[[:>:]] & axcd-dayc-dazce-abc-q abc -[[:<:]]a.c[[:>:]] & axc-dayc-dazce-abc axc -[[:<:]]b.c[[:>:]] & a_bxc-byc_d-bzc-q bzc -[[:<:]].x..[[:>:]] & y_xa_-_xb_y-_xc_-axdc _xc_ -[[:<:]]a_b[[:>:]] & x_a_b - -# past problems, and suspected problems -(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A]) - A1 A1 -abcdefghijklmnop i abcdefghijklmnop abcdefghijklmnop -abcdefghijklmnopqrstuv i abcdefghijklmnopqrstuv abcdefghijklmnopqrstuv -(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN]) - CC11 CC11 -CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a - CC11 CC11 -Char \([a-z0-9_]*\)\[.* b Char xyz[k Char xyz[k xyz -a?b - ab ab --\{0,1\}[0-9]*$ b -5 -5 diff --git a/ext/ereg/regex/utils.h b/ext/ereg/regex/utils.h deleted file mode 100644 index cd4a96025f2..00000000000 --- a/ext/ereg/regex/utils.h +++ /dev/null @@ -1,25 +0,0 @@ -/* utility definitions */ - -#include "regex_extra.h" - -#ifdef _POSIX2_RE_DUP_MAX -#define DUPMAX _POSIX2_RE_DUP_MAX -#else -#define DUPMAX 255 -#endif -#define INFINITY (DUPMAX + 1) -#define NC (CHAR_MAX - CHAR_MIN + 1) -typedef unsigned char uch; - -/* switch off assertions (if not already off) if no REDEBUG */ -#ifndef REDEBUG -#ifndef NDEBUG -#define NDEBUG /* no assertions please */ -#endif -#endif -#include - -/* for old systems with bcopy() but no memmove() */ -#ifdef USEBCOPY -#define memmove(d, s, c) bcopy(s, d, c) -#endif diff --git a/ext/ereg/tests/001.phpt b/ext/ereg/tests/001.phpt deleted file mode 100644 index f63c2525184..00000000000 --- a/ext/ereg/tests/001.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -RegReplace test 1 ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abcdef diff --git a/ext/ereg/tests/002.phpt b/ext/ereg/tests/002.phpt deleted file mode 100644 index a9b7aaa00a8..00000000000 --- a/ext/ereg/tests/002.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -RegReplace test 2 ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abc diff --git a/ext/ereg/tests/003.phpt b/ext/ereg/tests/003.phpt deleted file mode 100644 index edd9c059692..00000000000 --- a/ext/ereg/tests/003.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -ereg_replace single-quote test ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -'test diff --git a/ext/ereg/tests/004.phpt b/ext/ereg/tests/004.phpt deleted file mode 100644 index 1f60ff49005..00000000000 --- a/ext/ereg/tests/004.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -simple ereg test ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -ok -ok diff --git a/ext/ereg/tests/005.phpt b/ext/ereg/tests/005.phpt deleted file mode 100644 index 78c0a0912ab..00000000000 --- a/ext/ereg/tests/005.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Test Regular expression register support in ereg ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -32 -This is a nice and simple string -is -is diff --git a/ext/ereg/tests/006.phpt b/ext/ereg/tests/006.phpt deleted file mode 100644 index 50b6dbfd3ae..00000000000 --- a/ext/ereg/tests/006.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Test ereg_replace of start-of-line ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -That is a nice and simple string diff --git a/ext/ereg/tests/007.phpt b/ext/ereg/tests/007.phpt deleted file mode 100644 index b2646f842f6..00000000000 --- a/ext/ereg/tests/007.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Test empty result buffer in reg_replace ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -strlen($b)=0 diff --git a/ext/ereg/tests/008.phpt b/ext/ereg/tests/008.phpt deleted file mode 100644 index db61d1ca071..00000000000 --- a/ext/ereg/tests/008.phpt +++ /dev/null @@ -1,10 +0,0 @@ ---TEST-- -Test back-references in regular expressions ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -123 abc +-|= diff --git a/ext/ereg/tests/009.phpt b/ext/ereg/tests/009.phpt deleted file mode 100644 index 4996ef4c973..00000000000 --- a/ext/ereg/tests/009.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Test split() ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -4 -this -is -a -test diff --git a/ext/ereg/tests/010.phpt b/ext/ereg/tests/010.phpt deleted file mode 100644 index 30d28fd02f5..00000000000 --- a/ext/ereg/tests/010.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -Long back references ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abc2222222222def2222222222 diff --git a/ext/ereg/tests/011.phpt b/ext/ereg/tests/011.phpt deleted file mode 100644 index 4eda774f584..00000000000 --- a/ext/ereg/tests/011.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -\0 back reference ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abcdef123ghi diff --git a/ext/ereg/tests/012.phpt b/ext/ereg/tests/012.phpt deleted file mode 100644 index d5342c7436b..00000000000 --- a/ext/ereg/tests/012.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -nonexisting back reference ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abcdef\1ghi diff --git a/ext/ereg/tests/013.phpt b/ext/ereg/tests/013.phpt deleted file mode 100644 index ec3329fa7c6..00000000000 --- a/ext/ereg/tests/013.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -escapes in replace string ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abcdef\g\\hi\ diff --git a/ext/ereg/tests/014.phpt b/ext/ereg/tests/014.phpt deleted file mode 100644 index ec4d19ed0e4..00000000000 --- a/ext/ereg/tests/014.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -backreferences not replaced recursively ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -\2 diff --git a/ext/ereg/tests/015.phpt b/ext/ereg/tests/015.phpt deleted file mode 100644 index 961a60fa76c..00000000000 --- a/ext/ereg/tests/015.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -replace empty matches ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -zabc123 diff --git a/ext/ereg/tests/016.phpt b/ext/ereg/tests/016.phpt deleted file mode 100644 index a24816f1823..00000000000 --- a/ext/ereg/tests/016.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -test backslash handling in regular expressions ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -abc123abc diff --git a/ext/exif/CREDITS b/ext/exif/CREDITS deleted file mode 100644 index 94de97e5b09..00000000000 --- a/ext/exif/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -EXIF -Rasmus Lerdorf, Marcus Boerger diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 deleted file mode 100644 index f1fcced8974..00000000000 --- a/ext/exif/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(exif, whether to enable EXIF support, -[ --enable-exif Enable EXIF support]) - -if test "$PHP_EXIF" != "no"; then - AC_DEFINE(HAVE_EXIF, 1, [Whether you want exif support]) - PHP_NEW_EXTENSION(exif, exif.c, $ext_shared) -fi diff --git a/ext/exif/example.php b/ext/exif/example.php deleted file mode 100644 index e34dc05f6d4..00000000000 --- a/ext/exif/example.php +++ /dev/null @@ -1,23 +0,0 @@ - - - -exif_read_data example - - -\n" : "Image contains headers
"; -$exif = exif_read_data ('tests/test2.jpg',0,true); -foreach($exif as $key=>$section) { - foreach($section as $name=>$val) { - echo "$key.$name: $val
\n"; - } -} -?> - - \ No newline at end of file diff --git a/ext/exif/exif.c b/ext/exif/exif.c deleted file mode 100644 index 0b10231bea8..00000000000 --- a/ext/exif/exif.c +++ /dev/null @@ -1,3263 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* ToDos - * - * JIS encoding for comments - * See if example images from http://www.exif.org have illegal - * thumbnail sizes or if code is corrupt. - * Create/Update exif headers. - * Create/Remove/Update image thumbnails. - */ - -/* Security - * - * At current time i do not see any security problems but a potential - * attacker could generate an image with recursive ifd pointers...(Marcus) - */ - -/* Fragments of the code in this module were borrowed from the public domain - * jhead.c package with the author's consent. - * - * The original header from the jhead.c file was: - * - * -------------------------------------------------------------------------- - * Program to pull the information out of various types of EFIF digital - * camera files and show it in a reasonably consistent way - * - * Version 0.9 - * - * Compiles with MSVC on Windows, or with GCC on Linux - * - * Compileing under linux: Must include math library. - * Use: cc -lm -O3 -o jhead jhead.c - * - * Matthias Wandel, Dec 1999 - April 2000 - * -------------------------------------------------------------------------- - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_EXIF - -/* When EXIF_DEBUG is defined the module generates a lot of debug messages - * that help understanding what is going on. This can and should be used - * while extending the module as it shows if you are at the right position. - * You are always considered to have a copy of TIFF6.0 and EXIF2.10 standard. - */ -#undef EXIF_DEBUG - -#include "php_exif.h" -#include -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_image.h" -#include "ext/standard/info.h" - -typedef unsigned char uchar; - -#ifndef TRUE - #define TRUE 1 - #define FALSE 0 -#endif - -#ifndef max - #define max(a,b) ((a)>(b) ? (a) : (b)) -#endif - -/* {{{ exif_functions[] - */ -function_entry exif_functions[] = { - PHP_FE(exif_read_data, NULL) - PHP_FALIAS(read_exif_data, exif_read_data, NULL) - PHP_FE(exif_tagname, NULL) - PHP_FE(exif_thumbnail, NULL) - PHP_FE(exif_imagetype, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define EXIF_VERSION "1.3 $Id$" - -PHP_MINFO_FUNCTION(exif); - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(exif) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "EXIF Support", "enabled" ); - php_info_print_table_row(2, "EXIF Version", EXIF_VERSION ); - php_info_print_table_row(2, "Supported EXIF Version", "02100"); - php_info_print_table_row(2, "Supported filetypes", "JPEG,TIFF"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION(exif) - Get the size of an image as 4-element array */ -PHP_MINIT_FUNCTION(exif) -{ - REGISTER_LONG_CONSTANT("IMAGETYPE_GIF", IMAGE_FILETYPE_GIF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_JPEG", IMAGE_FILETYPE_JPEG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_PNG", IMAGE_FILETYPE_PNG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_SWF", IMAGE_FILETYPE_SWF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_PSD", IMAGE_FILETYPE_PSD, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_BMP", IMAGE_FILETYPE_BMP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_TIFF_II", IMAGE_FILETYPE_TIFF_II, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_TIFF_MM", IMAGE_FILETYPE_TIFF_MM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_JPC", IMAGE_FILETYPE_JPC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_JP2", IMAGE_FILETYPE_JP2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_JPX", IMAGE_FILETYPE_JPX, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMAGETYPE_JB2", IMAGE_FILETYPE_JB2, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} -/* }}} */ - -/* {{{ exif_module_entry - */ -zend_module_entry exif_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "exif", - exif_functions, - ZEND_MODULE_STARTUP_N(exif), NULL, - NULL, NULL, - PHP_MINFO(exif), - EXIF_VERSION, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_EXIF -ZEND_GET_MODULE(exif) -#endif - -/* {{{ php_strnlen - * get length of string if buffer if less than buffer size or buffer size */ -static size_t php_strnlen( char* str, size_t maxlen) { - size_t len = 0; - - if ( str && maxlen && *str) { - do { - len++; - } while ( --maxlen && *(++str)); - } - return len; -} -/* }}} */ - -/* {{{ error messages -*/ -static const char * EXIF_ERROR_EALLOC = "Cannot allocate memory for all data"; -static const char * EXIF_ERROR_FILEEOF = "Unexpected end of file reached"; -static const char * EXIF_ERROR_CORRUPT = "File structure corrupted"; -static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached"; - -#define EXIF_ERRLOG_EALLOC php_error(E_ERROR,EXIF_ERROR_EALLOC); -#define EXIF_ERRLOG_FILEEOF php_error(E_WARNING,EXIF_ERROR_FILEEOF); -#define EXIF_ERRLOG_CORRUPT php_error(E_WARNING,EXIF_ERROR_CORRUPT); -#define EXIF_ERRLOG_THUMBEOF php_error(E_WARNING,EXIF_ERROR_THUMBEOF); -/* }}} */ - -/* {{{ format description defines - Describes format descriptor -*/ -static int php_tiff_bytes_per_format[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; -#define NUM_FORMATS 12 - -#define TAG_FMT_BYTE 1 -#define TAG_FMT_STRING 2 -#define TAG_FMT_USHORT 3 -#define TAG_FMT_ULONG 4 -#define TAG_FMT_URATIONAL 5 -#define TAG_FMT_SBYTE 6 -#define TAG_FMT_UNDEFINED 7 -#define TAG_FMT_SSHORT 8 -#define TAG_FMT_SLONG 9 -#define TAG_FMT_SRATIONAL 10 -#define TAG_FMT_SINGLE 11 -#define TAG_FMT_DOUBLE 12 - -#ifdef EXIF_DEBUG -static char *exif_get_tagformat(int format) -{ - switch(format) { - case TAG_FMT_BYTE: return "BYTE"; - case TAG_FMT_STRING: return "STRING"; - case TAG_FMT_USHORT: return "USHORT"; - case TAG_FMT_ULONG: return "ULONG"; - case TAG_FMT_URATIONAL: return "URATIONAL"; - case TAG_FMT_SBYTE: return "SBYTE"; - case TAG_FMT_UNDEFINED: return "UNDEFINED"; - case TAG_FMT_SSHORT: return "SSHORT"; - case TAG_FMT_SLONG: return "SLONG"; - case TAG_FMT_SRATIONAL: return "SRATIONAL"; - case TAG_FMT_SINGLE: return "SINGLE"; - case TAG_FMT_DOUBLE: return "DOUBLE"; - } - return "*Illegal"; -} -#endif - -/* Describes tag values */ -#define TAG_TIFF_COMMENT 0x00FE /* SHOUDLNT HAPPEN */ -#define TAG_NEW_SUBFILE 0x00FE /* New version of subfile tag */ -#define TAG_SUBFILE_TYPE 0x00FF /* Old version of subfile tag */ -#define TAG_IMAGEWIDTH 0x0100 -#define TAG_IMAGEHEIGHT 0x0101 -#define TAG_BITS_PER_SAMPLE 0x0102 -#define TAG_COMPRESSION 0x0103 -#define TAG_PHOTOMETRIC_INTERPRETATION 0x0106 -#define TAG_TRESHHOLDING 0x0107 -#define TAG_CELL_WIDTH 0x0108 -#define TAG_CELL_HEIGHT 0x0109 -#define TAG_STRIP_OFFSETS 0x0111 -#define TAG_FILL_ORDER 0x010A -#define TAG_DOCUMENT_NAME 0x010D -#define TAG_IMAGE_DESCRIPTION 0x010E -#define TAG_MAKE 0x010F -#define TAG_MODEL 0x0110 -#define TAG_STRIP_OFFSETS 0x0111 -#define TAG_ORIENTATION 0x0112 -#define TAG_SAMPLES_PER_PIXEL 0x0115 -#define TAG_ROWS_PER_STRIP 0x0116 -#define TAG_STRIP_BYTE_COUNTS 0x0117 -#define TAG_MIN_SAMPPLE_VALUE 0x0118 -#define TAG_MAX_SAMPLE_VALUE 0x0119 -#define TAG_X_RESOLUTION 0x011A -#define TAG_Y_RESOLUTION 0x011B -#define TAG_PLANAR_CONFIGURATION 0x011C -#define TAG_PAGE_NAME 0x011D -#define TAG_X_POSITION 0x011E -#define TAG_Y_POSITION 0x011F -#define TAG_FREE_OFFSETS 0x0120 -#define TAG_FREE_BYTE_COUNTS 0x0121 -#define TAG_GRAY_RESPONSE_UNIT 0x0122 -#define TAG_GRAY_RESPONSE_CURVE 0x0123 -#define TAG_RESOLUTION_UNIT 0x0128 -#define TAG_PAGE_NUMBER 0x0129 -#define TAG_TRANSFER_FUNCTION 0x012D -#define TAG_SOFTWARE 0x0131 -#define TAG_DATETIME 0x0132 -#define TAG_ARTIST 0x013B -#define TAG_HOST_COMPUTER 0x013C -#define TAG_PREDICATOR 0x013D -#define TAG_WHITE_POINT 0x013E -#define TAG_PRIMARY_CHROMATICITIES 0x013F -#define TAG_COLOR_MAP 0x0140 -#define TAG_HALFTONE_HINTS 0x0141 -#define TAG_TILE_WIDTH 0x0142 -#define TAG_TILE_LENGTH 0x0143 -#define TAG_TILE_OFFSETS 0x0144 -#define TAG_TILE_BYTE_COUNTS 0x0145 -#define TAG_INK_SETMPUTER 0x014C -#define TAG_NUMBER_OF_INKS 0x014E -#define TAG_INK_NAMES 0x014D -#define TAG_DOT_RANGE 0x0150 -#define TAG_TARGET_PRINTER 0x0151 -#define TAG_EXTRA_SAMPLE 0x0152 -#define TAG_SAMPLE_FORMAT 0x0153 -#define TAG_S_MIN_SAMPLE_VALUE 0x0154 -#define TAG_S_MAX_SAMPLE_VALUE 0x0155 -#define TAG_TRANSFER_RANGE 0x0156 -#define TAG_JPEG_PROC 0x0200 -#define TAG_JPEG_INTERCHANGE_FORMAT 0x0201 -#define TAG_JPEG_INTERCHANGE_FORMAT_LEN 0x0202 -#define TAG_JPEG_RESTART_INTERVAL 0x0203 -#define TAG_JPEG_LOSSLESS_PREDICTOR 0x0205 -#define TAG_JPEG_POINT_TRANSFORMS 0x0206 -#define TAG_JPEG_Q_TABLES 0x0207 -#define TAG_JPEG_DC_TABLES 0x0208 -#define TAG_JPEG_AC_TABLES 0x0209 -#define TAG_YCC_COEFFICIENTS 0x0211 -#define TAG_YCC_SUB_SAMPLING 0x0212 -#define TAG_YCC_POSITIONING 0x0213 -#define TAG_REFERENCE_BLACK_WHITE 0x0214 -#define TAG_COPYRIGHT 0x8298 -#define TAG_EXPOSURETIME 0x829A -#define TAG_FNUMBER 0x829D -#define TAG_EXIF_IFD_POINTER 0x8769 -#define TAG_GPS_IFD_POINTER 0x8825 -#define TAG_ISOSPEED 0x8827 -#define TAG_EXIFVERSION 0x9000 -#define TAG_SHUTTERSPEED 0x9201 -#define TAG_APERTURE 0x9202 -#define TAG_DATETIME_ORIGINAL 0x9003 -#define TAG_MAXAPERTURE 0x9205 -#define TAG_SUBJECT_DISTANCE 0x9206 -#define TAG_LIGHT_SOURCE 0x9208 -#define TAG_FLASH 0x9209 -#define TAG_FOCALLENGTH 0x920A -#define TAG_MARKER_NOTE 0x927C -#define TAG_USERCOMMENT 0x9286 -#define TAG_FLASH_PIX_VERSION 0xA000 -#define TAG_COLOR_SPACE 0xA001 -#define TAG_COMP_IMAGEWIDTH 0xA002 /* compressed images only */ -#define TAG_COMP_IMAGEHEIGHT 0xA003 -#define TAG_INTEROP_IFD_POINTER 0xA005 /* IFD pointer */ -#define TAG_FOCALPLANEXRES 0xA20E -#define TAG_FOCALPLANEUNITS 0xA210 - -/* Olympus specific tags */ -#define TAG_OLYMPUS_SPECIALMODE 0x0200 -#define TAG_OLYMPUS_JPEGQUAL 0x0201 -#define TAG_OLYMPUS_MACRO 0x0202 -#define TAG_OLYMPUS_DIGIZOOM 0x0204 -#define TAG_OLYMPUS_SOFTWARERELEASE 0x0207 -#define TAG_OLYMPUS_PICTINFO 0x0208 -#define TAG_OLYMPUS_CAMERAID 0x0209 -/* end Olympus specific tags */ - -/* Internal */ -#define TAG_NONE -1 /* note that -1 <> 0xFFFF */ -#define TAG_COMPUTED_VALUE -2 - -/* Values for TAG_PHOTOMETRIC_INTERPRETATION */ -#define PMI_BLACK_IS_ZERO 0 -#define PMI_WHITE_IS_ZERO 1 -#define PMI_RGB 2 -#define PMI_PALETTE_COLOR 3 -#define PMI_TRANSPARENCY_MASK 4 -#define PMI_SEPARATED 5 -#define PMI_YCBCR 6 -#define PMI_CIELAB 8 - -/* }}} */ - -/* {{{ TabTable[] - */ - -static const struct { - unsigned short Tag; - char *Desc; -} TagTable[] = { - { 0x00FE, "NewSubFile"}, - { 0x00FF, "SubFile"}, - { 0x0100, "ImageWidth"}, - { 0x0101, "ImageLength"}, - { 0x0102, "BitsPerSample"}, - { 0x0103, "Compression"}, - { 0x0106, "PhotometricInterpretation"}, - { 0x010A, "FillOrder"}, - { 0x010D, "DocumentName"}, - { 0x010E, "ImageDescription"}, - { 0x010F, "Make"}, - { 0x0110, "Model"}, - { 0x0111, "StripOffsets"}, - { 0x0112, "Orientation"}, - { 0x0115, "SamplesPerPixel"}, - { 0x0116, "RowsPerStrip"}, - { 0x0117, "StripByteCounts"}, - { 0x0118, "MinSampleValue"}, - { 0x0119, "MaxSampleValue"}, - { 0x011A, "XResolution"}, - { 0x011B, "YResolution"}, - { 0x011C, "PlanarConfiguration"}, - { 0x011D, "PageName"}, - { 0x011E, "XPosition"}, - { 0x011F, "YPosition"}, - { 0x0120, "FreeOffsets"}, - { 0x0121, "FreeByteCounts"}, - { 0x0122, "GrayResponseUnit"}, - { 0x0123, "GrayResponseCurve"}, - { 0x0124, "T4Options"}, - { 0x0125, "T6Options"}, - { 0x0128, "ResolutionUnit"}, - { 0x0129, "PageNumber"}, - { 0x012D, "TransferFunction"}, - { 0x0131, "Software"}, - { 0x0132, "DateTime"}, - { 0x013B, "Artist"}, - { 0x013C, "HostComputer"}, - { 0x013D, "Predictor"}, - { 0x013E, "WhitePoint"}, - { 0x013F, "PrimaryChromaticities"}, - { 0x0140, "ColorMap"}, - { 0x0141, "HalfToneHints"}, - { 0x0142, "TileWidth"}, - { 0x0143, "TileLength"}, - { 0x0144, "TileOffsets"}, - { 0x0145, "TileByteCounts"}, - { 0x014C, "InkSet"}, - { 0x014D, "InkNames"}, - { 0x014E, "NumberOfInks"}, - { 0x0150, "DotRange"}, - { 0x0151, "TargetPrinter"}, - { 0x0152, "ExtraSample"}, - { 0x0153, "SampleFormat"}, - { 0x0154, "SMinSampleValue"}, - { 0x0155, "SMaxSampleValue"}, - { 0x0156, "TransferRange"}, - { 0x0200, "JPEGProc"}, - { 0x0201, "JPEGInterchangeFormat"}, - { 0x0202, "JPEGInterchangeFormatLength"}, - { 0x0203, "JPEGRestartInterval"}, - { 0x0205, "JPEGLosslessPredictors"}, - { 0x0206, "JPEGPointTransforms"}, - { 0x0207, "JPEGQTables"}, - { 0x0208, "JPEGDCTables"}, - { 0x0209, "JPEGACTables"}, - { 0x0211, "YCbCrCoefficients"}, - { 0x0212, "YCbCrSubSampling"}, - { 0x0213, "YCbCrPositioning"}, - { 0x0214, "ReferenceBlackWhite"}, - { 0x1000, "RelatedImageFileFormat"}, - { 0x828D, "CFARepeatPatternDim"}, - { 0x828E, "CFAPattern"}, - { 0x828F, "BatteryLevel"}, - { 0x8298, "Copyright"}, - { 0x829A, "ExposureTime"}, - { 0x829D, "FNumber"}, - { 0x83BB, "IPTC/NAA"}, - { 0x8769, "Exif_IFD_Pointer"}, - { 0x8773, "InterColorProfile"}, - { 0x8822, "ExposureProgram"}, - { 0x8824, "SpectralSensitivity"}, - { 0x8825, "GPS_IFD_Pointer"}, - { 0x8827, "ISOSpeedRatings"}, - { 0x8828, "OECF"}, - { 0x9000, "ExifVersion"}, - { 0x9003, "DateTimeOriginal"}, - { 0x9004, "DateTimeDigitized"}, - { 0x9101, "ComponentsConfiguration"}, - { 0x9102, "CompressedBitsPerPixel"}, - { 0x9201, "ShutterSpeedValue"}, - { 0x9202, "ApertureValue"}, - { 0x9203, "BrightnessValue"}, - { 0x9204, "ExposureBiasValue"}, - { 0x9205, "MaxApertureValue"}, - { 0x9206, "SubjectDistance"}, - { 0x9207, "MeteringMode"}, - { 0x9208, "LightSource"}, - { 0x9209, "Flash"}, - { 0x920A, "FocalLength"}, - { 0x920B, "FlashEnergy"}, /* 0xA20B in JPEG */ - { 0x920C, "SpatialFrequencyResponse"}, /* 0xA20C - - */ - { 0x920E, "FocalPlaneXResolution"}, /* 0xA20E - - */ - { 0x920F, "FocalPlaneYResolution"}, /* 0xA20F - - */ - { 0x9210, "FocalPlaneResolutionUnit"}, /* 0xA210 - - */ - { 0x9214, "SubjectLocation"}, /* 0xA214 - - */ - { 0x9215, "ExposureIndex"}, /* 0xA215 - - */ - { 0x9217, "SensingMethod"}, /* 0xA217 - - */ - { 0x927C, "MakerNote"}, - { 0x9286, "UserComment"}, - { 0x9290, "SubSecTime"}, - { 0x9291, "SubSecTimeOriginal"}, - { 0x9292, "SubSecTimeDigitized"}, - { 0xA000, "FlashPixVersion"}, - { 0xA001, "ColorSpace"}, - { 0xA002, "ExifImageWidth"}, - { 0xA003, "ExifImageLength"}, - { 0xA005, "InteroperabilityOffset"}, - { 0xA20B, "FlashEnergy"}, /* 0x920B in TIFF/EP */ - { 0xA20C, "SpatialFrequencyResponse"}, /* 0x920C - - */ - { 0xA20E, "FocalPlaneXResolution"}, /* 0x920E - - */ - { 0xA20F, "FocalPlaneYResolution"}, /* 0x920F - - */ - { 0xA210, "FocalPlaneResolutionUnit"}, /* 0x9210 - - */ - { 0xA214, "SubjectLocation"}, /* 0x9214 - - */ - { 0xA215, "ExposureIndex"}, /* 0x9215 - - */ - { 0xA217, "SensingMethod"}, /* 0x9217 - - */ - { 0xA300, "FileSource"}, - { 0xA301, "SceneType"}, - {TAG_NONE, "no tag value"}, - {TAG_COMPUTED_VALUE, "computed value"}, - { 0, ""} /* Important for exif_get_tagname() IF value != "" functionresult is != false */ -} ; - -/* }}} */ - -/* {{{ exif_get_tagname - Get headername for tag_num or NULL if not defined */ -static char * exif_get_tagname(int tag_num, char *ret, int len) -{ - int i,t; - char tmp[32]; - - for (i=0;;i++) { - if ( (t=TagTable[i].Tag) == tag_num || !t) { - if (ret && len) { - if ( !t) break; - strncpy(ret,TagTable[i].Desc,abs(len)); - if ( len<0) { - len = -len; - ret[len-1]='\0'; - for(i=strlen(ret);i=32) - { - buf[p++] = c; - } else { - buf[p++] = '?'; - } - } - } - buf[sizeof(buf)-1]=0; - return buf; -} -#endif -/* }}} */ - -/* {{{ php_jpg_get16 - Get 16 bits motorola order (always) for jpeg header stuff. -*/ -static int php_jpg_get16(void *value) -{ - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; -} -/* }}} */ - -/* {{{ php_ifd_get16u - * Convert a 16 bit unsigned value from file's native byte order */ -static int php_ifd_get16u(void *value, int motorola_intel) -{ - if (motorola_intel) { - return (((uchar *)value)[0] << 8) | ((uchar *)value)[1]; - } else { - return (((uchar *)value)[1] << 8) | ((uchar *)value)[0]; - } -} -/* }}} */ - -/* {{{ php_ifd_get16s - * Convert a 16 bit signed value from file's native byte order */ -static signed short php_ifd_get16s(void *value, int motorola_intel) -{ - return (signed short)php_ifd_get16u(value, motorola_intel); -} -/* }}} */ - -/* {{{ php_ifd_get32s - * Convert a 32 bit signed value from file's native byte order */ -static int php_ifd_get32s(void *value, int motorola_intel) -{ - if (motorola_intel) { - return ((( char *)value)[0] << 24) - | (((uchar *)value)[1] << 16) - | (((uchar *)value)[2] << 8 ) - | (((uchar *)value)[3] ); - } else { - return ((( char *)value)[3] << 24) - | (((uchar *)value)[2] << 16) - | (((uchar *)value)[1] << 8 ) - | (((uchar *)value)[0] ); - } -} -/* }}} */ - -/* {{{ php_ifd_get32u - * Write 32 bit unsigned value to data */ -static unsigned php_ifd_get32u(void *value, int motorola_intel) -{ - return (unsigned)php_ifd_get32s(value, motorola_intel) & 0xffffffff; -} -/* }}} */ - -/* {{{ php_ifd_set16u - * Write 16 bit unsigned value to data */ -static void php_ifd_set16u(char *data, unsigned int value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF00) >> 8; - data[1] = (value & 0x00FF); - } else { - data[1] = (value & 0xFF00) >> 8; - data[0] = (value & 0x00FF); - } -} -/* }}} */ - -/* {{{ php_ifd_set32u - * Convert a 32 bit unsigned value from file's native byte order */ -static void php_ifd_set32u(char *data, size_t value, int motorola_intel) -{ - if (motorola_intel) { - data[0] = (value & 0xFF000000) >> 24; - data[1] = (value & 0x00FF0000) >> 16; - data[2] = (value & 0x0000FF00) >> 8; - data[3] = (value & 0x000000FF); - } else { - data[3] = (value & 0xFF000000) >> 24; - data[2] = (value & 0x00FF0000) >> 16; - data[1] = (value & 0x0000FF00) >> 8; - data[0] = (value & 0x000000FF); - } -} -/* }}} */ - -/* {{{ exif_convert_any_format - * Evaluate number, be it int, rational, or float from directory. */ -static double exif_convert_any_format(void *value, int format, int motorola_intel) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return (double)php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return (double)php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return (signed short)php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: - php_error(E_NOTICE, "Found value of type single"); - return (double)*(float *)value; - case TAG_FMT_DOUBLE: - php_error(E_NOTICE, "Found value of type double"); - return *(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ exif_convert_any_to_int - * Evaluate number, be it int, rational, or float from directory. */ -static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel) -{ - int s_den; - unsigned u_den; - - switch(format) { - case TAG_FMT_SBYTE: return *(signed char *)value; - case TAG_FMT_BYTE: return *(uchar *)value; - - case TAG_FMT_USHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_ULONG: return php_ifd_get32u(value, motorola_intel); - - case TAG_FMT_URATIONAL: - u_den = php_ifd_get32u(4+(char *)value, motorola_intel); - if (u_den == 0) { - return 0; - } else { - return php_ifd_get32u(value, motorola_intel) / u_den; - } - - case TAG_FMT_SRATIONAL: - s_den = php_ifd_get32s(4+(char *)value, motorola_intel); - if (s_den == 0) { - return 0; - } else { - return php_ifd_get32s(value, motorola_intel) / s_den; - } - - case TAG_FMT_SSHORT: return php_ifd_get16u(value, motorola_intel); - case TAG_FMT_SLONG: return php_ifd_get32s(value, motorola_intel); - - /* Not sure if this is correct (never seen float used in Exif format) */ - case TAG_FMT_SINGLE: - php_error(E_NOTICE, "Found value of type single"); - return *(float *)value; - case TAG_FMT_DOUBLE: - php_error(E_NOTICE, "Found value of type double"); - return *(double *)value; - } - return 0; -} -/* }}} */ - -/* {{{ struct image_info_value, image_info_list -*/ -#ifndef WORD -#define WORD short -#endif -#ifndef DWORD -#define DWORD int -#endif - -typedef struct { - int num; - int den; -} signed_rational; - -typedef struct { - unsigned int num; - unsigned int den; -} unsigned_rational; - -typedef union _image_info_value { - char *s; - unsigned u; - int i; - float f; - double d; - signed_rational sr; - unsigned_rational ur; - union _image_info_value *list; -} image_info_value; - -typedef struct { - WORD tag; - WORD format; - DWORD length; - DWORD dummy; /* value ptr of tiff directory entry */ - char *name; - image_info_value value; -} image_info_data; - -typedef struct { - int count; - image_info_data *list; -} image_info_list; -/* }}} */ - -/* {{{ exif_get_sectionname - Returns the name of a section -*/ -#define SECTION_FILE 0 -#define SECTION_COMPUTED 1 -#define SECTION_ANY_TAG 2 -#define SECTION_IFD0 3 -#define SECTION_THUMBNAIL 4 -#define SECTION_COMMENT 5 -#define SECTION_APP0 6 -#define SECTION_EXIF 7 -#define SECTION_FPIX 8 -#define SECTION_GPS 9 -#define SECTION_INTEROP 10 -#define SECTION_APP12 11 -#define SECTION_COUNT 12 - -#define FOUND_FILE (1<2) sections[len-2] = '\0'; - return sections; -} -/* }}} */ - -/* {{{ struct image_info_type - This structure stores Exif header image elements in a simple manner - Used to store camera data as extracted from the various ways that it can be - stored in a nexif header -*/ - -typedef struct { - int type; - size_t size; - uchar *data; -} file_section; - -typedef struct { - int count; - file_section *list; -} file_section_list; - -typedef struct { - image_filetype filetype; - size_t width, height; - size_t size; - size_t offset; - char *data; -} thumbnail_data; - -/* EXIF standard defines Copyright as " [ '\0' ] ['\0']" */ -/* This structure is used to store a section of a Jpeg file. */ -typedef struct { - FILE *infile; - char *FileName; - time_t FileDateTime; - size_t FileSize; - image_filetype FileType; - int Height, Width; - int IsColor; - - float ApertureFNumber; - float ExposureTime; - double FocalplaneUnits; - float CCDWidth; - double FocalplaneXRes; - size_t ExifImageWidth; - float FocalLength; - float Distance; - - int motorola_intel; /* 1 Motorola; 0 Intel */ - - char *UserComment; - char *UserCommentEncoding; - char *Copyright; - char *CopyrightPhotographer; - char *CopyrightEditor; - - thumbnail_data Thumbnail; - /* other */ - int sections_found; /* FOUND_ */ - image_info_list info_list[SECTION_COUNT]; - /* for parsing */ - int read_thumbnail; - int read_all; - /* internal */ - file_section_list file; -} image_info_type; -/* }}} */ - -/* {{{ jpeg_sof_info - */ -typedef struct { - int bits_per_sample; - size_t width; - size_t height; - int num_components; -} jpeg_sof_info; -/* }}} */ - -/* {{{ exif_file_sections_add - Add a file_section to image_info - returns the used block or -1. if size>0 and data == NULL buffer of size is allocated -*/ -int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t size, uchar *data) -{ - file_section *tmp; - int count = ImageInfo->file.count; - - tmp = erealloc(ImageInfo->file.list,(count+1)*sizeof(file_section)); - if ( tmp == NULL) return 0; - ImageInfo->file.list = tmp; - ImageInfo->file.list[count].type = type; - if ( !size) { - data = NULL; - } else if ( data == NULL) { - if ( (data = emalloc(size)) == NULL) { - return -1; - } - } - ImageInfo->file.list[count].data = data; - ImageInfo->file.list[count].size = size; - ImageInfo->file.count = count+1; - return count; -} -/* }}} */ - -/* {{{ exif_file_section_add - Discard all file_sections in ImageInfo -*/ -int exif_file_sections_free(image_info_type *ImageInfo) -{ - int i; - - if ( ImageInfo->file.count) { - for (i=0;ifile.count-1;i++) - { - if ( ImageInfo->file.list[i].data) - { - efree(ImageInfo->file.list[i].data); - } - } - } - if ( ImageInfo->file.list) - { - efree(ImageInfo->file.list); - } - ImageInfo->file.count = 0; - return TRUE; -} -/* }}} */ - -/* {{{ exif_iif_add_value - Add a value to image_info -*/ -void exif_iif_add_value( image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel) -{ - int index; - image_info_value *info_value; - image_info_data *info_data; - image_info_data *list; - - list = erealloc(image_info->info_list[section_index].list,(image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - if ( !list) { - EXIF_ERRLOG_EALLOC - return; - } - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = tag; - info_data->format = format; - info_data->length = length; - info_data->name = estrdup(name); - if ( !info_data->name) { - EXIF_ERRLOG_EALLOC - return; - } - info_value = &info_data->value; - - switch (format) { - case TAG_FMT_STRING: - if ( value) { - length = php_strnlen(value,length); - info_data->length = length; - info_value->s = estrndup(value,length); - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - if ( !info_value->s) { - EXIF_ERRLOG_EALLOC - info_data->length = 0; - return; - } - break; - - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - info_data->tag = TAG_FMT_UNDEFINED;/* otherwise not freed from memory */ - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if ( length<1) - break; - if ( format==TAG_FMT_BYTE && length==1) - { - info_value->u = *(uchar*)value; - break; - } - if ( format==TAG_FMT_SBYTE && length==1) - { - info_value->i = *(char*)value; - info_data->length = 0; - break; - } - case TAG_FMT_UNDEFINED: - if ( value) { - info_value->s = estrndup(value,length); - } else { - info_data->length = 0; - info_value->s = estrdup(""); - } - if ( !info_value->s) { - EXIF_ERRLOG_EALLOC - return; - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - if ( length==0) { - break; - } else - if ( length>1) { - info_data->value.list = emalloc(length*sizeof(image_info_value)); - if ( !info_data->value.list) { - EXIF_ERRLOG_EALLOC - return; - } - } else { - info_value = &info_data->value; - } - for (index=0; index1) { - info_value = &info_data->value.list[index]; - } - switch (format) { - case TAG_FMT_USHORT: - info_value->u = php_ifd_get16u(value,motorola_intel); - break; - - case TAG_FMT_ULONG: - info_value->u = php_ifd_get32u(value,motorola_intel); - break; - - case TAG_FMT_URATIONAL: - info_value->ur.num = php_ifd_get32u(value, motorola_intel); - info_value->ur.den = php_ifd_get32u(4+(char *)value, motorola_intel); - break; - - case TAG_FMT_SSHORT: - info_value->i = php_ifd_get16s(value,motorola_intel); - break; - - case TAG_FMT_SLONG: - info_value->i = php_ifd_get32s(value,motorola_intel); - break; - - case TAG_FMT_SRATIONAL: - info_value->sr.num = php_ifd_get32u(value, motorola_intel); - info_value->sr.den = php_ifd_get32u(4+(char *)value, motorola_intel); - break; - - case TAG_FMT_SINGLE: - php_error(E_WARNING, "Found value of type single"); - info_value->f = (double)*(float *)value; - - case TAG_FMT_DOUBLE: - php_error(E_WARNING, "Found value of type double"); - info_value->d = *(double *)value; - break; - } - } - } - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_tag - Add a tag from IFD to image_info -*/ -void exif_iif_add_tag( image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value) -{ - exif_iif_add_value( image_info, section_index, name, tag, format, length, value, image_info->motorola_intel); -} -/* }}} */ - -/* {{{ exif_iif_add_int - Add an int value to image_info -*/ -void exif_iif_add_int( image_info_type *image_info, int section_index, char *name, int value) -{ - image_info_data *info_data; - image_info_data *list; - - list = erealloc(image_info->info_list[section_index].list,(image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - if ( !list) { - EXIF_ERRLOG_EALLOC - return; - } - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_SLONG; - info_data->length = 1; - info_data->name = estrdup(name); - if ( !info_data->name) { - EXIF_ERRLOG_EALLOC - return; - } - info_data->value.i = value; - image_info->sections_found |= 1<info_list[section_index].count++; -} -/* }}} */ - -/* {{{ exif_iif_add_str - Add a string value to image_info MUST BE NUL TERMINATED -*/ -void exif_iif_add_str( image_info_type *image_info, int section_index, char *name, char *value, ...) -{ - image_info_data *info_data; - image_info_data *list; - char tmp[1024]; - va_list arglist; - - va_start( arglist, value ); - if ( value) vsnprintf( tmp, sizeof(tmp), value, arglist); - va_end( arglist); - - if ( value) { - - list = erealloc(image_info->info_list[section_index].list,(image_info->info_list[section_index].count+1)*sizeof(image_info_data)); - if ( !list) { - EXIF_ERRLOG_EALLOC - return; - } - image_info->info_list[section_index].list = list; - - info_data = &image_info->info_list[section_index].list[image_info->info_list[section_index].count]; - info_data->tag = TAG_NONE; - info_data->format = TAG_FMT_STRING; - info_data->length = 1; - info_data->name = estrdup(name); - if ( !info_data->name) { - EXIF_ERRLOG_EALLOC - return; - } - info_data->value.s = estrdup(tmp); - if ( !info_data->value.s) { - EXIF_ERRLOG_EALLOC - return; - } - image_info->sections_found |= 1<info_list[section_index].count++; - } -} -/* }}} */ - -/* {{{ exif_iif_free - Free memory allocated for image_info -*/ -void exif_iif_free( image_info_type *image_info, int section_index) -{ - int i; - void *f; /* faster */ - - if (image_info->info_list[section_index].count) - { - for (i=0; i < image_info->info_list[section_index].count; i++) - { - if ( (f=image_info->info_list[section_index].list[i].name) != NULL) - { - efree(f); - } - switch(image_info->info_list[section_index].list[i].format) - { - case TAG_FMT_SBYTE: - case TAG_FMT_BYTE: - /* in contrast to strings bytes do not need to allocate buffer for NULL if length==0 */ - if (image_info->info_list[section_index].list[i].length<=1) - break; - default: - case TAG_FMT_UNDEFINED: - case TAG_FMT_STRING: - if ( (f=image_info->info_list[section_index].list[i].value.s) != NULL) - { - efree(f); - } - break; - - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - case TAG_FMT_URATIONAL: - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - case TAG_FMT_SRATIONAL: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - /* nothing to do here */ - break; - } - } - if ( (f=image_info->info_list[section_index].list) != NULL) - { - efree(f); - } - } -} -/* }}} */ - -/* {{{ add_assoc_image_info - * Add image_info to associative array value. */ -void add_assoc_image_info( pval *value, int sub_array, image_info_type *image_info, int section_index) -{ - char buffer[64], *val, *name, uname[64]; - int i, ap, l, b, idx=0, done, unknown=0; - image_info_value *info_value; - image_info_data *info_data; - pval *tmpi, *array; - - if ( image_info->info_list[section_index].count) - { - - if ( sub_array) { - MAKE_STD_ZVAL(tmpi); - array_init(tmpi); - } else { - tmpi = value; - } - - for(i=0; iinfo_list[section_index].count; i++) - { - done = 0; - info_data = &image_info->info_list[section_index].list[i]; - info_value = &info_data->value; - if ( !(name = info_data->name)) { - sprintf(uname,"%d", unknown++); - name = uname; - } - if (info_data->length==0) - { - add_assoc_null(tmpi, name); - } else { - switch (info_data->format) - { - default: - /* Standard says more types possible but skip them... - * but allow users to handle data if they know how to - * So not return but use type UNDEFINED - * return; - */ - case TAG_FMT_UNDEFINED: - if ( !info_value->s) { - add_assoc_stringl(tmpi, name, "", 0, 1); - } else { - add_assoc_stringl(tmpi, name, info_value->s, info_data->length, 1); - } - break; - - case TAG_FMT_STRING: - if ( !(val = info_value->s)) val = ""; - if (section_index==SECTION_COMMENT) { - add_index_string(tmpi, idx++, val, 1); - } else { - add_assoc_string(tmpi, name, val, 1); - } - break; - - case TAG_FMT_URATIONAL: - case TAG_FMT_SRATIONAL: - case TAG_FMT_BYTE: - case TAG_FMT_SBYTE: - case TAG_FMT_USHORT: - case TAG_FMT_SSHORT: - case TAG_FMT_SINGLE: - case TAG_FMT_DOUBLE: - case TAG_FMT_ULONG: - case TAG_FMT_SLONG: - /* now the rest, first see if it becomes an array */ - if ( (l = info_data->length) > 1) { - array = NULL; - MAKE_STD_ZVAL(array); - array_init(array); - } - for(ap=0; ap1) { - info_value = &info_data->value.list[ap]; - } - switch (info_data->format) - { - case TAG_FMT_BYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b])); - } - break; - } - case TAG_FMT_USHORT: - case TAG_FMT_ULONG: - if (l==1) { - add_assoc_long(tmpi, name, (int)info_value->u); - } else { - add_index_long(array, ap, (int)info_value->u); - } - break; - - case TAG_FMT_URATIONAL: - sprintf(buffer,"%i/%i", info_value->ur.num, info_value->ur.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SBYTE: - if (l>1) { - info_value = &info_data->value; - for (b=0;bs[b]); - } - break; - } - case TAG_FMT_SSHORT: - case TAG_FMT_SLONG: - if (l==1) { - add_assoc_long(tmpi, name, info_value->i); - } else { - add_index_long(array, ap, info_value->i); - } - break; - - case TAG_FMT_SRATIONAL: - sprintf(buffer,"%i/%i", info_value->sr.num, info_value->sr.den); - if (l==1) { - add_assoc_string(tmpi, name, buffer, 1); - } else { - add_index_string(array, ap, buffer, 1); - } - break; - - case TAG_FMT_SINGLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->f); - } else { - add_index_double(array, ap, info_value->f); - } - break; - - case TAG_FMT_DOUBLE: - if (l==1) { - add_assoc_double(tmpi, name, info_value->d); - } else { - add_index_double(array, ap, info_value->d); - } - break; - } - info_value = &info_data->value.list[ap]; - } - if ( l>1) { - add_assoc_zval(tmpi, name, array); - } - break; - } - } - } - if ( sub_array) { - add_assoc_zval(value, exif_get_sectionname(section_index), tmpi); - } - } -} -/* }}} */ - -/* {{{ Markers - JPEG markers consist of one or more 0xFF bytes, followed by a marker - code byte (which is not an FF). Here are the marker codes of interest - in this program. (See jdmarker.c for a more complete list.) -*/ - -#define M_TEM 0x01 /* temp for arithmetic coding */ -#define M_RES 0x02 /* reserved */ -#define M_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_DHT 0xC4 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_JPEG 0x08 /* reserved for extensions */ -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_DAC 0xCC /* arithmetic table */ -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_RST0 0xD0 /* restart segment */ -#define M_RST1 0xD1 -#define M_RST2 0xD2 -#define M_RST3 0xD3 -#define M_RST4 0xD4 -#define M_RST5 0xD5 -#define M_RST6 0xD6 -#define M_RST7 0xD7 -#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ -#define M_EOI 0xD9 /* End Of Image (end of datastream) */ -#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ -#define M_DQT 0xDB -#define M_DNL 0xDC -#define M_DRI 0xDD -#define M_DHP 0xDE -#define M_EXP 0xDF -#define M_APP0 0xE0 -#define M_EXIF 0xE1 /* Exif Attribute Information */ -#define M_APP2 0xE2 /* Flash Pix Extension Data? */ -#define M_APP3 0xE3 -#define M_APP4 0xE4 -#define M_APP5 0xE5 -#define M_APP6 0xE6 -#define M_APP7 0xE7 -#define M_APP8 0xE8 -#define M_APP9 0xE9 -#define M_APP10 0xEA -#define M_APP11 0xEB -#define M_APP12 0xEC -#define M_APP13 0xED /* IPTC International Press Telecommunications Council */ -#define M_APP14 0xEE -#define M_APP15 0xEF -#define M_JPG0 0xF0 -#define M_JPG1 0xF1 -#define M_JPG2 0xF2 -#define M_JPG3 0xF3 -#define M_JPG4 0xF4 -#define M_JPG5 0xF5 -#define M_JPG6 0xF6 -#define M_JPG7 0xF7 -#define M_JPG8 0xF8 -#define M_JPG9 0xF9 -#define M_JPG10 0xFA -#define M_JPG11 0xFB -#define M_JPG12 0xFC -#define M_JPG13 0xFD -#define M_COM 0xFE /* COMment */ - -#define M_PSEUDO 0x123 /* Extra value. */ - -/* }}} */ - -/* {{{ jpeg2000 markers - */ -/* Markers x30 - x3F do not have a segment */ -/* Markers x00, x01, xFE, xC0 - xDF ISO/IEC 10918-1 -> M_ */ -/* Markers xF0 - xF7 ISO/IEC 10918-3 */ -/* Markers xF7 - xF8 ISO/IEC 14495-1 */ -/* XY=Main/Tile-header:(R:required, N:not_allowed, O:optional, L:last_marker) */ -#define JC_SOC 0x4F /* NN, Start of codestream */ -#define JC_SIZ 0x51 /* RN, Image and tile size */ -#define JC_COD 0x52 /* RO, Codeing style defaulte */ -#define JC_COC 0x53 /* OO, Coding style component */ -#define JC_TLM 0x55 /* ON, Tile part length main header */ -#define JC_PLM 0x57 /* ON, Packet length main header */ -#define JC_PLT 0x58 /* NO, Packet length tile part header */ -#define JC_QCD 0x5C /* RO, Quantization default */ -#define JC_QCC 0x5D /* OO, Quantization component */ -#define JC_RGN 0x5E /* OO, Region of interest */ -#define JC_POD 0x5F /* OO, Progression order default */ -#define JC_PPM 0x60 /* ON, Packed packet headers main header */ -#define JC_PPT 0x61 /* NO, Packet packet headers tile part header */ -#define JC_CME 0x64 /* OO, Comment: "LL E " E=0:binary, E=1:ascii */ -#define JC_SOT 0x90 /* NR, Start of tile */ -#define JC_SOP 0x91 /* NO, Start of packeter default */ -#define JC_EPH 0x92 /* NO, End of packet header */ -#define JC_SOD 0x93 /* NL, Start of data */ -#define JC_EOC 0xD9 /* NN, End of codestream */ -/* }}} */ - -/* {{{ exif_process_COM - Process a COM marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -static void exif_process_COM (image_info_type *image_info, uchar *value, int length) -{ - exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value); -} -/* }}} */ - -/* {{{ exif_process_COM - Process a COM marker. - We want to print out the marker contents as legible text; - we must guard against random junk and varying newline representations. -*/ -static void exif_process_CME (image_info_type *image_info, uchar *value, int length) -{ - if (length>3) { - switch(value[2]) { - case 0: - exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value); - break; - case 1: - exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value); - break; - default: - php_error(E_NOTICE,"Undefined JPEG2000 comment encoding"); - break; - } - } else { - exif_iif_add_tag( image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL); - php_error(E_NOTICE,"JPEG2000 comment section to small"); - } -} -/* }}} */ - -/* {{{ exif_process_SOFn - * Process a SOFn marker. This is useful for the image dimensions */ -static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result) -{ -/* 0xFF SOSn SectLen(2) Bits(1) Height(2) Width(2) Channels(1) 3*Channels (1) */ - result->bits_per_sample = Data[2]; - result->height = php_jpg_get16(Data+3); - result->width = php_jpg_get16(Data+5); - result->num_components = Data[7]; - -/* switch (marker) { - case M_SOF0: process = "Baseline"; break; - case M_SOF1: process = "Extended sequential"; break; - case M_SOF2: process = "Progressive"; break; - case M_SOF3: process = "Lossless"; break; - case M_SOF5: process = "Differential sequential"; break; - case M_SOF6: process = "Differential progressive"; break; - case M_SOF7: process = "Differential lossless"; break; - case M_SOF9: process = "Extended sequential, arithmetic coding"; break; - case M_SOF10: process = "Progressive, arithmetic coding"; break; - case M_SOF11: process = "Lossless, arithmetic coding"; break; - case M_SOF13: process = "Differential sequential, arithmetic coding"; break; - case M_SOF14: process = "Differential progressive, arithmetic coding"; break; - case M_SOF15: process = "Differential lossless, arithmetic coding"; break; - default: process = "Unknown"; break; - }*/ -} -/* }}} */ - -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *DirStart, char *OffsetBase, unsigned IFDlength, int sub_section_index); - -/* {{{ exif_get_markername - Get name of marker */ -//#ifdef EXIF_DEBUG -char * exif_get_markername(int marker) -{ - switch(marker) { - case 0xC0: return "SOF0"; - case 0xC1: return "SOF1"; - case 0xC2: return "SOF2"; - case 0xC3: return "SOF3"; - case 0xC4: return "DHT"; - case 0xC5: return "SOF5"; - case 0xC6: return "SOF6"; - case 0xC7: return "SOF7"; - case 0xC9: return "SOF9"; - case 0xCA: return "SOF10"; - case 0xCB: return "SOF11"; - case 0xCD: return "SOF13"; - case 0xCE: return "SOF14"; - case 0xCF: return "SOF15"; - case 0xD8: return "SOI"; - case 0xD9: return "EOI"; - case 0xDA: return "SOS"; - case 0xDB: return "DQT"; - case 0xDC: return "DNL"; - case 0xDD: return "DRI"; - case 0xDE: return "DHP"; - case 0xDF: return "EXP"; - case 0xE0: return "APP0"; - case 0xE1: return "EXIF"; - case 0xE2: return "FPIX"; - case 0xE3: return "APP3"; - case 0xE4: return "APP4"; - case 0xE5: return "APP5"; - case 0xE6: return "APP6"; - case 0xE7: return "APP7"; - case 0xE8: return "APP8"; - case 0xE9: return "APP9"; - case 0xEA: return "APP10"; - case 0xEB: return "APP11"; - case 0xEC: return "APP12"; - case 0xED: return "APP13"; - case 0xEE: return "APP14"; - case 0xEF: return "APP15"; - case 0xF0: return "JPG0"; - case 0xFD: return "JPG13"; - case 0xFE: return "COM"; - case 0x01: return "TEM"; - } - return "Unknown"; -} -//#endif -/* }}} */ - -/* {{{ proto string|false exif_tagname(index) - Get headername for index or false if not defined */ -PHP_FUNCTION(exif_tagname) -{ - pval **p_num; - int tag, ac = ZEND_NUM_ARGS(); - char *szTemp; - - if ((ac < 1 || ac > 1) || zend_get_parameters_ex(ac, &p_num) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(p_num); - tag = Z_LVAL_PP(p_num); - szTemp = exif_get_tagname(tag,NULL,0); - if ( tag<0 || !szTemp || !szTemp[0]) { - RETURN_BOOL(FALSE); - } else { - RETURN_STRING(szTemp, 1) - } -} -/* }}} */ - -/* {{{ exif_ifd_make_value - * Create a value for an ifd from an info_data pointer */ -static void* exif_ifd_make_value( image_info_data *info_data,int motorola_intel) { - size_t byte_count; - char *value_ptr, *data_ptr; - int i; - - image_info_value *info_value; - - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - value_ptr = emalloc(max(byte_count,4)); - if ( !value_ptr) { - EXIF_ERRLOG_EALLOC - return NULL; - } - memset(value_ptr,0,4); - if ( !info_data->length) { - return value_ptr; - } - if ( info_data->format == TAG_FMT_UNDEFINED || info_data->format == TAG_FMT_STRING - || ( byte_count>1 && (info_data->format == TAG_FMT_BYTE || info_data->format == TAG_FMT_SBYTE))) - { - memmove( value_ptr, info_data->value.s, byte_count); - return value_ptr; - } else if (info_data->format == TAG_FMT_BYTE) { - *value_ptr = info_data->value.u; - return value_ptr; - } else if (info_data->format == TAG_FMT_SBYTE) { - *value_ptr = info_data->value.i; - return value_ptr; - } else { - data_ptr = value_ptr; - for(i=0; ilength; i++) { - if ( info_data->length==1) { - info_value = &info_data->value; - } else { - info_value = &info_data->value.list[i]; - } - switch( info_data->format) { - case TAG_FMT_USHORT: - php_ifd_set16u( data_ptr, info_value->u, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_ULONG: - php_ifd_set32u( data_ptr, info_value->u, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_SSHORT: - php_ifd_set16u( data_ptr, info_value->i, motorola_intel); - data_ptr += 2; - break; - case TAG_FMT_SLONG: - php_ifd_set32u( data_ptr, info_value->i, motorola_intel); - data_ptr += 4; - break; - case TAG_FMT_URATIONAL: - php_ifd_set32u( data_ptr, info_value->sr.num, motorola_intel); - php_ifd_set32u( data_ptr+4, info_value->sr.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SRATIONAL: - php_ifd_set32u( data_ptr, info_value->ur.num, motorola_intel); - php_ifd_set32u( data_ptr+4, info_value->ur.den, motorola_intel); - data_ptr += 8; - break; - case TAG_FMT_SINGLE: - memmove( data_ptr, &info_data->value.f, byte_count); - data_ptr += 4; - break; - case TAG_FMT_DOUBLE: - memmove( data_ptr, &info_data->value.d, byte_count); - data_ptr += 8; - break; - } - } - } - return value_ptr; -} -/* }}} */ - -/* {{{ exif_thumbnail_build - * Check and build thumbnail */ -static void exif_thumbnail_build(image_info_type *ImageInfo) { - size_t new_size, new_move, new_value; - char *new_data; - void *value_ptr; - int i, byte_count; - image_info_list *info_list; - image_info_data *info_data; - #ifdef EXIF_DEBUG - char tagname[64]; - #endif - - if ( !ImageInfo->read_thumbnail || !ImageInfo->Thumbnail.offset || !ImageInfo->Thumbnail.size) - { - return; /* ignore this call */ - } - switch(ImageInfo->Thumbnail.filetype) { - default: - case IMAGE_FILETYPE_JPEG: - /* done */ - break; - case IMAGE_FILETYPE_TIFF_II: - case IMAGE_FILETYPE_TIFF_MM: - info_list = &ImageInfo->info_list[SECTION_THUMBNAIL]; - new_size = 8 + 2 + info_list->count * 12 + 4; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"thumbnail: size of signature + directory(%d): 0x%02X", info_list->count, new_size); - #endif - new_value= new_size; /* offset for ifd values outside ifd directory */ - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - if ( byte_count > 4) { - new_size += byte_count; - } - } - new_move = new_size; - new_data = erealloc(ImageInfo->Thumbnail.data,ImageInfo->Thumbnail.size+new_size); - if (!ImageInfo->Thumbnail.data) { - EXIF_ERRLOG_EALLOC - efree(ImageInfo->Thumbnail.data); - ImageInfo->Thumbnail.data = NULL; - ImageInfo->Thumbnail.size = 0; - return; - } - ImageInfo->Thumbnail.data = new_data; - memmove(ImageInfo->Thumbnail.data + new_move, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); - ImageInfo->Thumbnail.size += new_size; - /* fill in data */ - if ( ImageInfo->motorola_intel) { - memmove( new_data, "MM\x00\x2a\x00\x00\x00\x08", 8); - } else { - memmove( new_data, "II\x2a\x00\x08\x00\x00\x00", 8); - } - new_data += 8; - php_ifd_set16u( new_data, info_list->count, ImageInfo->motorola_intel); - new_data += 2; - for (i=0; icount; i++) { - info_data = &info_list->list[i]; - byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag,tagname,-12), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count); - #endif - if ( info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) { - php_ifd_set16u( new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u( new_data + 2, TAG_FMT_ULONG, ImageInfo->motorola_intel); - php_ifd_set32u( new_data + 4, 1, ImageInfo->motorola_intel); - php_ifd_set32u( new_data + 8, new_move, ImageInfo->motorola_intel); - } else { - php_ifd_set16u( new_data + 0, info_data->tag, ImageInfo->motorola_intel); - php_ifd_set16u( new_data + 2, info_data->format, ImageInfo->motorola_intel); - php_ifd_set32u( new_data + 4, info_data->length, ImageInfo->motorola_intel); - value_ptr = exif_ifd_make_value( info_data, ImageInfo->motorola_intel); - if ( !value_ptr) { - EXIF_ERRLOG_EALLOC - efree(ImageInfo->Thumbnail.data); - ImageInfo->Thumbnail.data = NULL; - ImageInfo->Thumbnail.size = 0; - return; - } - if ( byte_count <= 4) { - memmove( new_data+8, value_ptr, 4); - } else { - php_ifd_set32u( new_data+8, new_value, ImageInfo->motorola_intel); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"thumbnail: writing with value offset: 0x%04X + 0x%02X", new_value, byte_count); - #endif - memmove( ImageInfo->Thumbnail.data+new_value, value_ptr, byte_count); - new_value += byte_count; - } - efree(value_ptr); - } - new_data += 12; - } - memset( new_data, 0, 4); /* next ifd pointer */ - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"thumbnail: created"); - #endif - break; - } -} -/* }}} */ - -/* {{{ exif_thumbnail_extract - * Grab the thumbnail, corrected */ -static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length) { - /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ - if ( !ImageInfo->read_thumbnail) - { - return; /* ignore this call */ - } - if ( ImageInfo->Thumbnail.size >= 65536 - || ImageInfo->Thumbnail.size <= 0 - || ImageInfo->Thumbnail.offset <= 0) - { - php_error(E_WARNING, "Illegal thumbnail size/offset"); - return; - } - /* Check to make sure we are not going to go past the ExifLength */ - if ( (ImageInfo->Thumbnail.offset + ImageInfo->Thumbnail.size) > length) { - EXIF_ERRLOG_THUMBEOF - return; - } - ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); - if (!ImageInfo->Thumbnail.data) { - EXIF_ERRLOG_EALLOC - } - exif_thumbnail_build( ImageInfo); -} -/* }}} */ - -/* {{{ exif_process_undefined - * Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */ -static int exif_process_undefined(char **result,char *value,size_t byte_count) { - /* we cannot use strlcpy - here the problem is that we have to copy NUL - * chars up to byte_count, we also have to add a single NUL character to - * force end of string. - * estrndup does not return length - */ - if (byte_count) { - (*result) = estrndup(value,byte_count); /* NULL @ byte_count!!! */ - if ( !*result) { - EXIF_ERRLOG_EALLOC - return 0; - } - return byte_count+1; - } - return 0; -} -/* }}} */ - -/* {{{ exif_process_string - * Copy a string in Exif header to a character string and return length of allocated buffer if any. - * In contrast to exif_process_undefined this function does allways return a string buffer */ -static int exif_process_string(char **result,char *value,size_t byte_count) { - /* we cannot use strlcpy - here the problem is that we cannot use strlen to - * determin length of string and we cannot use strlcpy with len=byte_count+1 - * because then we might get into an EXCEPTION if we exceed an allocated - * memory page...so we use php_strnlen in conjunction with memcpy and add the NUL - * char. - * estrdup would sometimes allocate more memory and does not return length - */ - if ((byte_count=php_strnlen(value,byte_count)) > 0) { - return exif_process_undefined(result,value,byte_count); - } - (*result) = estrndup("",1); /* force empty string */ - if ( !*result) { - EXIF_ERRLOG_EALLOC - return 0; - } - return byte_count+1; -} -/* }}} */ - -/* {{{ exif_process_user_comment - * Process UserComment in IFD. */ -static int exif_process_user_comment(char **pszInfoPtr,char **szEncoding,char *szValuePtr,int ByteCount) -{ - int a,l; - char mbBuffer[MB_CUR_MAX]; - - /* Copy the comment */ - if ( ByteCount>=8) { - if (!memcmp(szValuePtr, "UNICODE\0", 8)) { - /* treat JIS encoding as if it where UNICODE */ - *szEncoding= estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - l = 0; - a = 0; - while(((wchar_t*)szValuePtr)[a]) { - l += (int)wctomb( mbBuffer, *((wchar_t*)szValuePtr)); - if (sizeof(wchar_t)*a++ >= ByteCount) break; /* avoiding problems with corrupt headers */ - } - if (l>1) { - *pszInfoPtr = emalloc(l+1); - if ( !*pszInfoPtr) { - EXIF_ERRLOG_EALLOC - return 0; - } - wcstombs(*pszInfoPtr, (wchar_t*)(szValuePtr), l+1); - (*pszInfoPtr)[l] = '\0'; - return l+1; - } - return 0; - } else - if ( !memcmp(szValuePtr, "ASCII\0\0\0", 8)) { - *szEncoding= estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } else - if ( !memcmp(szValuePtr, "JIS\0\0\0\0\0", 8)) { - /* JIS should be tanslated to MB or we leave it to the user - leave it to the user */ - *szEncoding= estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } else - if ( !memcmp(szValuePtr,"\0\0\0\0\0\0\0\0",8)) { - /* 8 NULL means undefined and should be ASCII... */ - *szEncoding= estrdup((const char*)szValuePtr); - szValuePtr = szValuePtr+8; - ByteCount -= 8; - } - } - - /* Olympus has this padded with trailing spaces. Remove these first. */ - if (ByteCount>0) for (a=ByteCount-1;a && szValuePtr[a]==' ';a--) (szValuePtr)[a] = '\0'; - - /* normal text without encoding */ - return exif_process_string(pszInfoPtr,szValuePtr,ByteCount); -} -/* }}} */ - -/* {{{ exif_process_IFD_TAG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, int section_index, int ReadNextIFD) -{ - int l; - int tag, format, components; - char *value_ptr, tagname[64], cbuf[32], *outside=NULL; - size_t byte_count, offset_val, fpos, fgot; - - tag = php_ifd_get16u(dir_entry, ImageInfo->motorola_intel); - format = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - components = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel); - - if (!format || format >= NUM_FORMATS) { - /* (-1) catches illegal zero case as unsigned underflows to positive large. */ - php_error(E_WARNING, "Illegal format code in IFD: 0x%04X", format); - return TRUE; - } - - byte_count = components * php_tiff_bytes_per_format[format]; - - if (byte_count > 4) { - offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* If its bigger than 4 bytes, the dir entry contains an offset. */ - value_ptr = offset_base+offset_val; - if (offset_val+byte_count > IFDlength || value_ptr < dir_entry) { - // It is important to check for IMAGE_FILETYPE_TIFF - // JPEG does not use absolute pointers instead its pointers are relative to the start - // of the TIFF header in APP1 section. - if (offset_val<0 || offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { - if (value_ptr < dir_entry) { - /* we can read this if offset_val > 0 */ - /* some files have their values in other parts of the file */ - php_error(E_WARNING, "process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag,tagname,-12), offset_val, dir_entry); - } else { - /* this is for sure not allowed */ - /* exception are IFD pointers */ - php_error(E_WARNING, "process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag,tagname,-12), offset_val, byte_count, offset_val+byte_count, IFDlength); - } - return TRUE; - } - if ( byte_count>sizeof(cbuf)) { - // mark as outside range and get buffer - value_ptr = emalloc(byte_count); - if ( !value_ptr) { - EXIF_ERRLOG_EALLOC - return FALSE; - } - outside = value_ptr; - } else { - // in most cases we only access a small range so - // it is faster to use a static buffer there - // BUT it offers also the possibility to have - // pointers read without the need to free them - // explicitley before returning. - value_ptr = cbuf; - } - fpos = ftell(ImageInfo->infile); - fseek(ImageInfo->infile, offset_val, SEEK_SET); - fgot = ftell(ImageInfo->infile); - if ( fgot!=offset_val) { - if ( outside) efree( outside); - php_error(E_WARNING,"Wrong file pointer: 0x%08X != 0x08X", fgot, offset_val); - return FALSE; - } - fgot = fread(value_ptr, 1, byte_count, ImageInfo->infile); - fseek(ImageInfo->infile, fpos, SEEK_SET); - if ( fgotsections_found |= FOUND_ANY_TAG; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s", tag, exif_get_tagname(tag,tagname,-12), offset_val, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", format==TAG_FMT_STRING?(value_ptr?value_ptr:""):exif_get_tagformat(format)); - #endif - if (section_index==SECTION_THUMBNAIL) { - switch(tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGEWIDTH: - ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGEHEIGHT: - ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_STRIP_OFFSETS: - case TAG_JPEG_INTERCHANGE_FORMAT: - /* accept both formats */ - ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_STRIP_BYTE_COUNTS: - if ( ImageInfo->FileType == IMAGE_FILETYPE_TIFF_II || ImageInfo->FileType == IMAGE_FILETYPE_TIFF_MM) { - ImageInfo->Thumbnail.filetype = ImageInfo->FileType; - } else { - /* motorola is easier to read */ - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM; - } - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_JPEG_INTERCHANGE_FORMAT_LEN: - if ( ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) { - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG; - ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - } - break; - - } - } else { - switch(tag) { - case TAG_COPYRIGHT: - /* check for " NUL NUL" */ - if (byte_count>1 && (l=php_strnlen(value_ptr,byte_count)) > 0) { - if ( lCopyrightPhotographer = estrdup( value_ptr); - ImageInfo->CopyrightEditor = estrdup( value_ptr); - ImageInfo->Copyright = emalloc(byte_count+3); - if ( !ImageInfo->Copyright) { - EXIF_ERRLOG_EALLOC - } else { - sprintf( ImageInfo->Copyright, "%s, %s", value_ptr, value_ptr+l+1); - } - /* format = TAG_FMT_UNDEFINED; this musn't be ASCII */ - /* but we are not supposed to change this */ - /* keep in mind that image_info does not store editor value */ - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"added copyrights: %s, %s", value_ptr, value_ptr+l+1); - #endif - } else { - ImageInfo->Copyright = estrdup(value_ptr); - } - } - break; - - case TAG_USERCOMMENT: - exif_process_user_comment(&(ImageInfo->UserComment),&(ImageInfo->UserCommentEncoding),value_ptr,byte_count); - break; - - case TAG_FNUMBER: - /* Simplest way of expressing aperture, so I trust it the most. - (overwrite previously computd value if there is one) */ - ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_APERTURE: - case TAG_MAXAPERTURE: - /* More relevant info always comes earlier, so only use this field if we don't - have appropriate aperture information yet. */ - if ( ImageInfo->ApertureFNumber == 0) { - ImageInfo->ApertureFNumber - = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5); - } - break; - - case TAG_SHUTTERSPEED: - /* More complicated way of expressing exposure time, so only use - this value if we don't already have it from somewhere else. - SHUTTERSPEED comes after EXPOSURE TIME - */ - if (ImageInfo->ExposureTime == 0) { - ImageInfo->ExposureTime - = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2))); - } - break; - case TAG_EXPOSURETIME: - ImageInfo->ExposureTime = -1; - break; - - case TAG_COMP_IMAGEWIDTH: - ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_FOCALPLANEXRES: - ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_SUBJECT_DISTANCE: - /* Inidcates the distacne the autofocus camera is focused to. - Tends to be less accurate as distance increases. */ - ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel); - break; - - case TAG_FOCALPLANEUNITS: - switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) { - case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */ - case 2: - /* According to the information I was using, 2 measn meters. - But looking at the Cannon powershot's files, inches is the only - sensible value. */ - ImageInfo->FocalplaneUnits = 25.4; - break; - - case 3: ImageInfo->FocalplaneUnits = 10; break; /* centimeter */ - case 4: ImageInfo->FocalplaneUnits = 1; break; /* milimeter */ - case 5: ImageInfo->FocalplaneUnits = .001; break; /* micrometer */ - } - break; - - case TAG_EXIF_IFD_POINTER: - case TAG_GPS_IFD_POINTER: - case TAG_INTEROP_IFD_POINTER: - if ( ReadNextIFD) { - char *SubdirStart; - int sub_section_index; - switch(tag) { - case TAG_EXIF_IFD_POINTER: - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"found EXIF"); - #endif - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"found GPS"); - #endif - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"found INTEROPERABILITY"); - #endif - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - } - SubdirStart = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel); - if (SubdirStart < offset_base || SubdirStart > offset_base+IFDlength) { - php_error(E_WARNING, "Illegal IFD Pointer"); - return FALSE; - } - exif_process_IFD_in_JPEG(ImageInfo, SubdirStart, offset_base, IFDlength, sub_section_index); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"subsection %s done", exif_get_sectionname(sub_section_index)); - #endif - } - } - } - exif_iif_add_tag( ImageInfo, section_index, exif_get_tagname(tag,tagname,sizeof(tagname)), tag, format, components, value_ptr); - if ( outside) efree( outside); - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_JPEG - * Process one of the nested IFDs directories. */ -static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *DirStart, char *OffsetBase, unsigned IFDlength, int section_index) -{ - int de; - int NumDirEntries; - int NextDirOffset; - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"exif_process_IFD_in_JPEG(x%04X(=%d))", IFDlength, IFDlength); - #endif - - ImageInfo->sections_found |= FOUND_IFD0; - - NumDirEntries = php_ifd_get16u(DirStart, ImageInfo->motorola_intel); - - if ((DirStart+2+NumDirEntries*12) > (OffsetBase+IFDlength)) { - php_error(E_WARNING, "Illegal directory size: x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)DirStart+2-(int)OffsetBase, NumDirEntries, (int)DirStart+2+NumDirEntries*12-(int)OffsetBase, IFDlength); - return; - } - - for (de=0;demotorola_intel); - if (NextDirOffset) { - /* the next line seems false but here IFDlength means length of all IFDs */ - if (OffsetBase + NextDirOffset < OffsetBase || OffsetBase + NextDirOffset > OffsetBase+IFDlength) { - php_error(E_WARNING, "Illegal directory offset"); - return FALSE; - } - /* That is the IFD for the first thumbnail */ - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"expect next IFD to be thumbnail"); - #endif - if (exif_process_IFD_in_JPEG(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, IFDlength, SECTION_THUMBNAIL)) - { - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"thumbnail size: 0x%04X", ImageInfo->Thumbnail.size); - #endif - if ( ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN - && ImageInfo->Thumbnail.size - && ImageInfo->Thumbnail.offset - && ImageInfo->read_thumbnail) - { - exif_thumbnail_extract(ImageInfo, OffsetBase, IFDlength); - } - return TRUE; - } else { - return FALSE; - } - } - return TRUE; -} -/* }}} */ - -/* {{{ exif_process_TIFF_in_JPEG - Process a TIFF header in a JPEG file -*/ -static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, unsigned int length) -{ - /* set the thumbnail stuff to nothing so we can test to see if they get set up */ - if (memcmp(CharBuf, "II", 2) == 0) { - ImageInfo->motorola_intel = 0; - } else if (memcmp(CharBuf, "MM", 2) == 0) { - ImageInfo->motorola_intel = 1; - } else { - php_error(E_WARNING, "Invalid TIFF alignment marker."); - return; - } - - /* Check the next two values for correctness. */ - if (php_ifd_get16u(CharBuf+2, ImageInfo->motorola_intel) != 0x2a - || php_ifd_get32u(CharBuf+4, ImageInfo->motorola_intel) != 0x08) { - php_error(E_WARNING, "Invalid TIFF start (1)"); - return; - } - - ImageInfo->sections_found |= FOUND_IFD0; - /* First directory starts at offset 8. Offsets starts at 0. */ - exif_process_IFD_in_JPEG(ImageInfo, CharBuf+8, CharBuf, length/*-14*/, SECTION_IFD0); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"exif_process_TIFF_in_JPEG, done"); - #endif - - /* Compute the CCD width, in milimeters. */ - if (ImageInfo->FocalplaneXRes != 0) { - ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); - } -} -/* }}} */ - -/* {{{ exif_process_APP1 - Process an JPEG APP1 block marker - Describes all the drivel that most digital cameras include... -*/ -static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, unsigned int length) -{ - /* Check the APP1 for Exif Identifier Code */ - static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader, 6)) { - php_error(E_WARNING, "Incorrect APP1 Exif Identifier Code"); - return; - } - exif_process_TIFF_in_JPEG(ImageInfo,CharBuf+8,length-8); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"process Exif done"); - #endif -} -/* }}} */ - -/* {{{ exif_process_APP12 - Process an JPEG APP12 block marker used by OLYMPUS -*/ -static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, unsigned int length) -{ - int l1, l2=0; - - if ( (l1 = php_strnlen(buffer+2,length-2)) > 0) { - exif_iif_add_tag( ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); - if ( length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1,length-2-l1+1); - exif_iif_add_tag( ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1); - } - } - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"process section APP12 with l1=%d, l2=%d done", l1, l2); - #endif -} -/* }}} */ - -/* {{{ exif_scan_JPEG_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_JPEG_header(image_info_type *ImageInfo) -{ - int section, sn; - int itemlen; - int marker = 0, last_marker = M_PSEUDO, comment_correction; - int ll, lh, got; - uchar *Data; - size_t fpos, size; - jpeg_sof_info sof_info; - - for(section=0;;section++) - { - #ifdef EXIF_DEBUG - fpos = ftell(ImageInfo->infile); - php_error(E_NOTICE,"needing section %d @ 0x%08X", ImageInfo->file.count, fpos); - #endif - - /* get marker byte, swallowing possible padding */ - /* some software does not count the length bytes of COM section */ - /* one company doing so is very much envolved in JPEG... so we accept too */ - if ( last_marker==M_COM && comment_correction) comment_correction = 2; - do { - if ((marker = fgetc(ImageInfo->infile)) == EOF) - { - EXIF_ERRLOG_CORRUPT - return FALSE; - } - if ( last_marker==M_COM && comment_correction>0) - { - if ( marker!=0xFF) - { - marker = 0xff; - comment_correction--; - } else { - last_marker = M_PSEUDO; /* stop skipping 0 for M_COM */ - } - } - } while (marker == 0xff); - if ( last_marker==M_COM && comment_correction) - return M_EOI; /* ah illegal: char after COM section not 0xFF */ - - #ifdef EXIF_DEBUG - fpos = ftell(ImageInfo->infile); - #endif - if (marker == 0xff) { - /* 0xff is legal padding, but if we get that many, something's wrong. */ - php_error(E_WARNING, "too many padding bytes!"); - return FALSE; - } - - /* Read the length of the section. */ - lh = fgetc(ImageInfo->infile); - ll = fgetc(ImageInfo->infile); - - itemlen = (lh << 8) | ll; - - if (itemlen < 2) { - EXIF_ERRLOG_CORRUPT - return FALSE; - } - - if ( (sn=exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL))==-1) { - EXIF_ERRLOG_EALLOC - return FALSE; - } - Data = ImageInfo->file.list[sn].data; - - /* Store first two pre-read bytes. */ - Data[0] = (uchar)lh; - Data[1] = (uchar)ll; - - got = fread(Data+2, 1, itemlen-2, ImageInfo->infile); /* Read the whole section. */ - if (got != itemlen-2) { - php_error(E_WARNING, "error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)",got, got, itemlen-2, itemlen-2); - return FALSE; - } - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"process section(x%02X=%s) @ x%04X + x%04X(=%d)", marker, exif_get_markername(marker), fpos, itemlen, itemlen); - #endif - switch(marker) { - case M_SOS: /* stop before hitting compressed data */ - /* If reading entire image is requested, read the rest of the data. */ - if (ImageInfo->read_all) { - /* Determine how much file is left. */ - fpos = ftell(ImageInfo->infile); - size = ImageInfo->FileSize - fpos; - if ( (sn=exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL))==-1) - { - EXIF_ERRLOG_EALLOC - return FALSE; - } - Data = ImageInfo->file.list[sn].data; - got = fread(Data, 1, size, ImageInfo->infile); - if (got != size) { - EXIF_ERRLOG_FILEEOF - return FALSE; - } - } - return TRUE; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - php_error(E_WARNING, "No image in jpeg!"); - return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE; - - case M_COM: /* Comment section */ - exif_process_COM(ImageInfo, (char *)Data+2, itemlen); - break; - - case M_EXIF: - if ( !(ImageInfo->sections_found&FOUND_IFD0)) { - /*ImageInfo->sections_found |= FOUND_EXIF;*/ - /* Seen files from some 'U-lead' software with Vivitar scanner - that uses marker 31 later in the file (no clue what for!) */ - exif_process_APP1(ImageInfo, (char *)Data, itemlen); - } - break; - - case M_APP12: - exif_process_APP12(ImageInfo,(char *)Data,itemlen); - break; - - - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - exif_process_SOFn(Data, marker, &sof_info); - ImageInfo->Width = sof_info.width; - ImageInfo->Height = sof_info.height; - if (sof_info.num_components == 3) { - ImageInfo->IsColor = 1; - } else { - ImageInfo->IsColor = 0; - } - break; - default: - /* skip any other marker silently. */ - break; - } - - /* keep track of last marker */ - last_marker = marker; - } - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"exif_scan_JPEG_header, done"); - #endif - return TRUE; -} -/* }}} */ - -/* {{{ exif_scan_thumbnail - * scan JPEG in thumbnail (memory) */ -static int exif_scan_thumbnail(image_info_type *ImageInfo) -{ - uchar c, *data = ImageInfo->Thumbnail.data; - int n, marker; - size_t length=2, pos=0; - jpeg_sof_info sof_info; - - if ( !data) - { - return FALSE; /* nothing to do here */ - } - if ( memcmp(data,"\xFF\xD8\xFF",3)) - { - if ( !ImageInfo->Thumbnail.width && !ImageInfo->Thumbnail.height) - { - php_error(E_WARNING,"Thumbnail is not a jpeg image"); - } - return FALSE; - } - for (;;) { - pos += length; - if ( pos>=ImageInfo->Thumbnail.size) return FALSE; - c = data[pos++]; - if ( pos>=ImageInfo->Thumbnail.size) return FALSE; - if ( c != 0xFF) return FALSE; - n = 8; - while ( (c = data[pos++]) == 0xFF && n--) - { - if ( pos+3>=ImageInfo->Thumbnail.size) return FALSE; - /* +3 = pos++ of next check when reaching marker + 2 bytes for length */ - } - if ( c == 0xFF) return FALSE; - marker = c; - length = php_jpg_get16(data+pos); - if ( pos+length>=ImageInfo->Thumbnail.size) return FALSE; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Thumnail: process section(x%02X=%s) @ x%04X + x%04X", marker, exif_get_markername(marker), pos, length); - #endif - switch (marker) { - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - /* handle SOFn block */ - exif_process_SOFn(data+pos, marker, &sof_info); - ImageInfo->Thumbnail.height = sof_info.height; - ImageInfo->Thumbnail.width = sof_info.width; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Thumnail: size: %d * %d", sof_info.width, sof_info.height); - #endif - return TRUE; - - case M_SOS: - case M_EOI: - php_error(E_WARNING,"could not compute size of thumbnail"); - return FALSE; - break; - - default: - /* just skip */ - break; - } - } - - php_error(E_WARNING,"could not compute size of thumbnail"); - return FALSE; -} -/* }}} */ - -/* {{{ exif_process_IFD_in_TIFF - * Parse the TIFF header; */ -static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index) -{ - int i, sn, num_entries, sub_section_index; - unsigned char *dir_entry, *tmp; - size_t ifd_size, dir_size, entry_offset, next_offset, entry_length, entry_value, fgot; - int entry_tag , entry_type; - - if ( ImageInfo->FileSize >= dir_offset+2) { - if ( (sn=exif_file_sections_add(ImageInfo, M_PSEUDO, 2, NULL))==-1) { - EXIF_ERRLOG_EALLOC - return FALSE; - } - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2); - #endif - fseek(ImageInfo->infile,dir_offset,SEEK_SET); /* we do not know the order of sections */ - fread(ImageInfo->file.list[sn].data, 1, 2, ImageInfo->infile); - num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel); - dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/; - if ( ImageInfo->FileSize >= dir_offset+dir_size) { - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries); - #endif - ImageInfo->file.list[sn].size = dir_size; - if ( !(tmp = erealloc(ImageInfo->file.list[sn].data,ImageInfo->file.list[sn].size))) - { - EXIF_ERRLOG_EALLOC - return FALSE; - } - ImageInfo->file.list[sn].data = tmp; - fread(ImageInfo->file.list[sn].data+2, 1, dir_size-2, ImageInfo->infile); - /*php_error(E_NOTICE,"Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 1));*/ - next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read from TIFF done, next offset x%04X", next_offset); - #endif - /* now we have the directory we can look how long it should be */ - ifd_size = dir_size; - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - if ( entry_type > NUM_FORMATS) { - php_error(E_WARNING,"Error in TIFF: Illegal format, suppose bytes"); - entry_type = TAG_FMT_BYTE; - } - entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel) * php_tiff_bytes_per_format[entry_type]; - if ( entry_length <= 4) { - switch(entry_type) { - case TAG_FMT_USHORT: - entry_value = php_ifd_get16u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SSHORT: - entry_value = php_ifd_get16s(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_ULONG: - entry_value = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - break; - case TAG_FMT_SLONG: - entry_value = php_ifd_get32s(dir_entry+8, ImageInfo->motorola_intel); - break; - } - switch(entry_tag) { - case TAG_IMAGEWIDTH: - case TAG_COMP_IMAGEWIDTH: - ImageInfo->Width = entry_value; - break; - case TAG_IMAGEHEIGHT: - case TAG_COMP_IMAGEHEIGHT: - ImageInfo->Height = entry_value; - break; - case TAG_PHOTOMETRIC_INTERPRETATION: - switch (entry_value) { - case PMI_BLACK_IS_ZERO: - case PMI_WHITE_IS_ZERO: - case PMI_TRANSPARENCY_MASK: - ImageInfo->IsColor = 0; - break; - case PMI_RGB: - case PMI_PALETTE_COLOR: - case PMI_SEPARATED: - case PMI_YCBCR: - case PMI_CIELAB: - ImageInfo->IsColor = 1; - break; - } - break; - } - } else { - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - /* if entry needs expading ifd cache and entry is at end of current ifd cache. */ - /* otherwise there may be huge holes between two entries */ - if ( entry_offset + entry_length > dir_offset + ifd_size - && entry_offset == dir_offset + ifd_size) - { - ifd_size = entry_offset + entry_length - dir_offset; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Correcting: 0x%08X + 0x%08X - 0x%08X", entry_offset, entry_length, dir_offset); - #endif - } - } - } - if ( ImageInfo->FileSize >= dir_offset + ImageInfo->file.list[sn].size) { - if ( ifd_size > dir_size) { - ImageInfo->file.list[sn].size = ifd_size; - if ( !(tmp = erealloc(ImageInfo->file.list[sn].data,ImageInfo->file.list[sn].size))) - { - EXIF_ERRLOG_EALLOC - return FALSE; - } - ImageInfo->file.list[sn].data = tmp; - /* read values not stored in directory itself */ - if ( dir_offset + ImageInfo->file.list[sn].size > ImageInfo->FileSize) { - php_error(E_WARNING,"1 Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); - return FALSE; - } - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); - #endif - fread(ImageInfo->file.list[sn].data+dir_size, 1, ifd_size-dir_size, ImageInfo->infile); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read from TIFF, done"); - #endif - } - /* now process the tags */ - for(i=0;ifile.list[sn].data+2+i*12; - entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel); - entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel); - /*entry_length = php_ifd_get32u(dir_entry+4, ImageInfo->motorola_intel);*/ - if (entry_tag == TAG_EXIF_IFD_POINTER || - entry_tag == TAG_INTEROP_IFD_POINTER || - entry_tag == TAG_GPS_IFD_POINTER - ) - { - switch(entry_tag) { - case TAG_EXIF_IFD_POINTER: - ImageInfo->sections_found |= FOUND_EXIF; - sub_section_index = SECTION_EXIF; - break; - case TAG_GPS_IFD_POINTER: - ImageInfo->sections_found |= FOUND_GPS; - sub_section_index = SECTION_GPS; - break; - case TAG_INTEROP_IFD_POINTER: - ImageInfo->sections_found |= FOUND_INTEROP; - sub_section_index = SECTION_INTEROP; - break; - } - entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Next IFD %s at x%04X", exif_get_sectionname(sub_section_index), entry_offset); - #endif - exif_process_IFD_in_TIFF(ImageInfo,entry_offset,sub_section_index); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Next IFD %s done", exif_get_sectionname(sub_section_index)); - #endif - } else { - if ( !exif_process_IFD_TAG(ImageInfo,dir_entry,ImageInfo->file.list[sn].data-dir_offset,ifd_size,section_index,0)) { - return FALSE; - } - } - } - if (next_offset && section_index != SECTION_THUMBNAIL) { - /* this should be a thumbnail IFD */ - /* the thumbnail itself is stored at Tag=StripOffsets */ - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read next IFD (THUMBNAIL) at x%04X", next_offset); - #endif - exif_process_IFD_in_TIFF(ImageInfo,next_offset,SECTION_THUMBNAIL); - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size); - #endif - if (ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) { - ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size); - if (!ImageInfo->Thumbnail.data) { - EXIF_ERRLOG_EALLOC - } else { - fseek(ImageInfo->infile,ImageInfo->Thumbnail.offset,SEEK_SET); - fgot = fread(ImageInfo->Thumbnail.data, 1, ImageInfo->Thumbnail.size, ImageInfo->infile); - if ( fgot < ImageInfo->Thumbnail.size) - { - EXIF_ERRLOG_THUMBEOF - } - exif_thumbnail_build( ImageInfo); - } - } - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Read next IFD (THUMBNAIL) done"); - #endif - } - return TRUE; - } else { - php_error(E_WARNING,"2 Error in TIFF: filesize(x%04X) less than size of IFD(x%04X)", ImageInfo->FileSize, dir_offset+ImageInfo->file.list[sn].size); - return FALSE; - } - } else { - php_error(E_WARNING,"Error in TIFF: filesize(x%04X) less than size of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+dir_size); - return FALSE; - } - } else { - php_error(E_WARNING,"Error in TIFF: filesize(x%04X) less than start of IFD dir(x%04X)", ImageInfo->FileSize, dir_offset+2); - return FALSE; - } -} -/* }}} */ - -/* {{{ exif_scan_FILE_header - * Parse the marker stream until SOS or EOI is seen; */ -static int exif_scan_FILE_header (image_info_type *ImageInfo) -{ - unsigned char file_header[8]; - int ret = FALSE; - - ImageInfo->FileType = IMAGE_FILETYPE_UNKNOWN; - - if ( ImageInfo->FileSize >= 2) { - fseek(ImageInfo->infile, 0, SEEK_SET); - fread(file_header, 1, 2, ImageInfo->infile); - if ( (file_header[0]==0xff) && (file_header[1]==M_SOI)) { - ImageInfo->FileType = IMAGE_FILETYPE_JPEG; - if (exif_scan_JPEG_header(ImageInfo)) { - ret = TRUE; - } else { - php_error(E_WARNING, "Invalid JPEG file: '%s'", ImageInfo->FileName); - } - } else if ( ImageInfo->FileSize >= 8) { - fread(file_header+2, 1, 6, ImageInfo->infile); - if ( !memcmp(file_header,"II\x2A\x00", 4)) - { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_II; - ImageInfo->motorola_intel = 0; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"File(%s) has TIFF/II format", ImageInfo->FileName); - #endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo,php_ifd_get32u(file_header+4,ImageInfo->motorola_intel),SECTION_IFD0)) { - ret = TRUE; - } else { - php_error(E_WARNING, "Invalid TIFF file: '%s'", ImageInfo->FileName); - } - } - else - if ( !memcmp(file_header,"MM\x00\x2a", 4)) - { - ImageInfo->FileType = IMAGE_FILETYPE_TIFF_MM; - ImageInfo->motorola_intel = 1; - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"File(%s) has TIFF/MM format", ImageInfo->FileName); - #endif - ImageInfo->sections_found |= FOUND_IFD0; - if (exif_process_IFD_in_TIFF(ImageInfo,php_ifd_get32u(file_header+4,ImageInfo->motorola_intel),SECTION_IFD0)) { - ret = TRUE; - } else { - php_error(E_WARNING, "Invalid TIFF file: '%s'", ImageInfo->FileName); - } - } else { - php_error(E_WARNING,"File(%s) not supported", ImageInfo->FileName); - return FALSE; - } - } - } else { - php_error(E_WARNING,"File(%s) to small (%d)", ImageInfo->FileName, ImageInfo->FileSize); - } - return ret; -} -/* }}} */ - -/* {{{ exif_discard_imageinfo - Discard data scanned by exif_read_file. -*/ -int exif_discard_imageinfo(image_info_type *ImageInfo) -{ - int i; - - if (ImageInfo->FileName) efree(ImageInfo->FileName); - if (ImageInfo->UserComment) efree(ImageInfo->UserComment); - if (ImageInfo->UserCommentEncoding) efree(ImageInfo->UserCommentEncoding); - if (ImageInfo->Copyright) efree(ImageInfo->Copyright); - if (ImageInfo->CopyrightPhotographer) efree(ImageInfo->CopyrightPhotographer); - if (ImageInfo->CopyrightEditor) efree(ImageInfo->CopyrightEditor); - if (ImageInfo->Thumbnail.data) efree(ImageInfo->Thumbnail.data); - for (i=0; imotorola_intel = 0; - - ImageInfo->infile = VCWD_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */ - - if (ImageInfo->infile == NULL) { - php_error(E_WARNING, "Unable to open '%s'", FileName); - return FALSE; - } - - ImageInfo->FileName = php_basename(FileName, strlen(FileName), NULL, 0); - ImageInfo->read_thumbnail = read_thumbnail; - ImageInfo->read_all = read_all; - ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_UNKNOWN; - - /* Store file date/time. */ - if (VCWD_STAT(FileName, &st) >= 0) { - ImageInfo->FileDateTime = st.st_mtime; - ImageInfo->FileSize = st.st_size; - } else { - php_error(E_WARNING, "Can't get file statitics"); - return FALSE; - } - - /* Scan the JPEG headers. */ - ret = exif_scan_FILE_header(ImageInfo); - fclose(ImageInfo->infile); - return ret; -} -/* }}} */ - -/* {{{ proto array|false exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]]) - Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails */ -PHP_FUNCTION(exif_read_data) -{ - pval **p_name, **p_sections_needed, **p_sub_arrays, **p_read_thumbnail, **p_read_all; - int i, ac = ZEND_NUM_ARGS(), ret, sections_needed=0, sub_arrays=0, read_thumbnail=0, read_all=0; - image_info_type ImageInfo; - char tmp[64], *sections_str, *s; - - memset(&ImageInfo, 0, sizeof(ImageInfo)); - - if ((ac < 1 || ac > 4) || zend_get_parameters_ex(ac, &p_name, &p_sections_needed, &p_sub_arrays, &p_read_thumbnail, &p_read_all) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_name); - - if(ac >= 2) { - convert_to_string_ex(p_sections_needed); - sections_str = emalloc(strlen(Z_STRVAL_PP(p_sections_needed))+3); - if ( !sections_str) { - EXIF_ERRLOG_EALLOC - RETURN_FALSE; - } - sprintf(sections_str,",%s,",Z_STRVAL_PP(p_sections_needed)); - /* sections_str DOES start with , and SPACES are NOT allowed in names */ - s = sections_str; - while(*++s) - { - if(*s==' ') *s = ','; - } - for (i=0; i= 3) { - convert_to_long_ex(p_sub_arrays); - sub_arrays = Z_LVAL_PP(p_sub_arrays); - } - if(ac >= 4) { - convert_to_long_ex(p_read_thumbnail); - read_thumbnail = Z_LVAL_PP(p_read_thumbnail); - } - if(ac >= 5) { - convert_to_long_ex(p_read_all); - read_all = Z_LVAL_PP(p_read_all); - } - /* parameters 3,4 will be working in later versions.... */ - read_all = 0; /* just to make function work for 4.2 tree */ - - ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), read_thumbnail, read_all TSRMLS_CC); - - sections_str = exif_get_sectionlist(ImageInfo.sections_found); - - #ifdef EXIF_DEBUG - if ( sections_str) php_error(E_NOTICE,"sections found: %s", sections_str[0] ? sections_str : "None"); - #endif - - ImageInfo.sections_found |= FOUND_COMPUTED;/* do not inform about in debug*/ - - if (ret==FALSE || array_init(return_value) == FAILURE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) { - exif_discard_imageinfo(&ImageInfo); - RETURN_FALSE; - } - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"generate section FILE"); - #endif - - /* now we can add our information */ - exif_iif_add_str( &ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName); - exif_iif_add_int( &ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime); - exif_iif_add_int( &ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize); - exif_iif_add_int( &ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType); - exif_iif_add_str( &ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE"); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"generate section COMPUTED"); - #endif - - if (ImageInfo.Width>0 && ImageInfo.Height>0) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "html", "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height); - exif_iif_add_int( &ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height); - exif_iif_add_int( &ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width); - } - exif_iif_add_int( &ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor); - if (ImageInfo.FocalLength) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "FocalLength", "%4.1fmm", ImageInfo.FocalLength); - if(ImageInfo.CCDWidth) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "35mmFocalLength", "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); - } - } - if(ImageInfo.CCDWidth) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth); - } - if(ImageInfo.ExposureTime>0) { - if(ImageInfo.ExposureTime <= 0.5) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); - } else { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3f s", ImageInfo.ExposureTime); - } - } - if(ImageInfo.ApertureFNumber) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "ApertureFNumber", "f/%.1f", ImageInfo.ApertureFNumber); - } - if(ImageInfo.Distance) { - if(ImageInfo.Distance<0) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite"); - } else { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "FocusDistance", "%0.2fm", ImageInfo.Distance); - } - } - if (ImageInfo.UserComment) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserComment); - if ( ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) { - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding); - } - } - - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright); - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer); - exif_iif_add_str( &ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor); - - if ( ImageInfo.Thumbnail.size) { - if ( read_thumbnail) { - /* not exif_iif_add_str : this is a buffer */ - exif_iif_add_tag( &ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data); - } - if ( !ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) { - /* try to evaluate if thumbnail data is present */ - exif_scan_thumbnail( &ImageInfo); - } - } - if ( ImageInfo.Thumbnail.width && ImageInfo.Thumbnail.height) { - exif_iif_add_int( &ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height); - exif_iif_add_int( &ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width); - } - if ( sections_str) efree(sections_str); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"adding image infos"); - #endif - - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_FILE); - add_assoc_image_info( return_value, 1, &ImageInfo, SECTION_COMPUTED); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_IFD0); - add_assoc_image_info( return_value, 1, &ImageInfo, SECTION_THUMBNAIL); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_COMMENT); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_EXIF); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_GPS); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_INTEROP); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_FPIX); - add_assoc_image_info( return_value, sub_arrays, &ImageInfo, SECTION_APP12); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Discarding info"); - #endif - - exif_discard_imageinfo(&ImageInfo); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"read_exif_data done"); - #endif -} -/* }}} */ - -/* {{{ proto string|false exif_thumbnail(string filename [, &width, &height]) - Reads the embedded thumbnail */ -PHP_FUNCTION(exif_thumbnail) -{ - zval **p_name, **p_width, **p_height; - int ret, arg_c = ZEND_NUM_ARGS(); - image_info_type ImageInfo; - - memset(&ImageInfo, 0, sizeof(ImageInfo)); - - if ( (arg_c != 1 && arg_c != 3) || zend_get_parameters_ex(arg_c, &p_name, &p_width, &p_height) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_name); - if ( arg_c == 3) { - zval_dtor(*p_width); - zval_dtor(*p_height); - } - - ret = exif_read_file(&ImageInfo, Z_STRVAL_PP(p_name), 1, 0 TSRMLS_CC); - if (ret==FALSE) { - exif_discard_imageinfo(&ImageInfo); - RETURN_FALSE; - } - - if ( !ImageInfo.Thumbnail.data || !ImageInfo.Thumbnail.size) { - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"No thumbnail data %d %d, %d x %d", ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.width, ImageInfo.Thumbnail.height); - #endif - if ( arg_c == 3) - { - ZVAL_LONG( *p_width, ImageInfo.Thumbnail.width); - ZVAL_LONG( *p_height, ImageInfo.Thumbnail.height); - } - exif_discard_imageinfo(&ImageInfo); - RETURN_FALSE; - } - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Returning thumbnail(%d)", ImageInfo.Thumbnail.size); - #endif - - ZVAL_STRINGL( return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size, 1); - if ( arg_c == 3) - { - if ( !ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) - { - exif_scan_thumbnail( &ImageInfo); - } - ZVAL_LONG( *p_width, ImageInfo.Thumbnail.width); - ZVAL_LONG( *p_height, ImageInfo.Thumbnail.height); - } - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"Discarding info"); - #endif - - exif_discard_imageinfo(&ImageInfo); - - #ifdef EXIF_DEBUG - php_error(E_NOTICE,"exif_thumbnail done"); - #endif -} -/* }}} */ - -/* {{{ proto long getimagesize(string imagefile) - Get the type of an image */ -PHP_FUNCTION(exif_imagetype) -{ - zval **arg1; - php_stream * stream; - int rsrc_id; - int itype = 0; - - if (ZEND_NUM_ARGS() != 1) - WRONG_PARAM_COUNT; - - if (zend_get_parameters_ex(1, &arg1) == FAILURE) - WRONG_PARAM_COUNT; - - stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", IGNORE_PATH|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL TSRMLS_CC); - - if (stream == NULL) { - RETURN_FALSE; - } - - rsrc_id = ZEND_REGISTER_RESOURCE(NULL, stream, php_file_le_stream()); - - itype = itype = php_getimagetype(stream, NULL); - - zend_list_delete(rsrc_id); - - if ( itype == IMAGE_FILETYPE_UNKNOWN) { - RETURN_FALSE; - } else { - ZVAL_LONG( return_value, itype); - } -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 fdm=marker - * vim<600: sw=4 ts=4 tw=78 - */ - diff --git a/ext/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index a75a69f1393..00000000000 --- a/ext/exif/exif.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="exif" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=exif - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "exif.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "exif.mak" CFG="exif - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "exif - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "exif - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "exif - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /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 php4ts.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 php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_exif.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "exif - Win32 Release_TS" -# Name "exif - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\exif.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_exif.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h deleted file mode 100644 index c15728414e0..00000000000 --- a/ext/exif/php_exif.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Marcus Boerger | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#if HAVE_EXIF -extern zend_module_entry exif_module_entry; -#define phpext_exif_ptr &exif_module_entry - -PHP_FUNCTION(exif_read_data); -PHP_FUNCTION(exif_tagname); -PHP_FUNCTION(exif_thumbnail); -PHP_FUNCTION(exif_imagetype); -#endif diff --git a/ext/exif/test.php b/ext/exif/test.php deleted file mode 100644 index 907b9ea080a..00000000000 --- a/ext/exif/test.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/ext/exif/test.txt b/ext/exif/test.txt deleted file mode 100644 index 1c12b509e65..00000000000 --- a/ext/exif/test.txt +++ /dev/null @@ -1,365 +0,0 @@ -\n"; - echo "Thumbnail could not be extracted.\n"; - echo "
"; - } - die(); -} - -if ( !defined('IMAGETYPE_GIF')) define('IMAGETYPE_GIF',1); -if ( !defined('IMAGETYPE_JPEG')) define('IMAGETYPE_JPEG',2); -if ( !defined('IMAGETYPE_TIFF_II')) define('IMAGETYPE_TIFF_II',7); -if ( !defined('IMAGETYPE_TIFF_MM')) define('IMAGETYPE_TIFF_MM',8); - -$possible = array(); - -/****************************************************************************/ -// message function is used for debugging purpose: just to se what happens -function message($msg) { - error_log($msg,0); - echo "$msg\n"; -} - -function error_msg() { - $ret = 'O.K.'; - if (array_key_exists('php_errormsg',$GLOBALS) && strlen($GLOBALS['php_errormsg'])) { - $ret = ''.$GLOBALS['php_errormsg'].''; - $GLOBALS['php_errormsg'] = ''; - } - return $ret; -} - -/****************************************************************************/ -// private to function search_file() -function _search_file($root,&$possible,$path='') { - $sub = array(); - $cnt = 0; - $type= false; - - //error_log("search_file($root,$path)",0); - if ($dir = @opendir($root.$path.'/')) { - while (($found = @readdir($dir)) !== false) { - $type = @filetype($root.$path.'/'.$found); - //error_log("search_file($root$path):$type=$found",0); - switch( $type) { - case 'file': - $pos = strrpos($found,'.'); - if ( function_exists('exif_imagetype')) { - $type = exif_imagetype($root.$path.'/'.$found); - } else { - if ( $pos!==false) { - $type = GetImageSize($root.$path.'/'.$found); - if ( is_array($type)) { - $type = $type[2]; - } else { - $type = false; - } - } else $type = false; - } - if ( $type!==false) - { - $possible[] = array('file'=>$root.$path.'/'.$found, 'type'=>$type); - //error_log("search_file($root$path) add:$path/$found",0); - if ( ($cnt=count($possible)) % 100 == 0) { - error_log("exif test page - counting files: $cnt",0); - } - } - break; - case 'dir': - if ( $found!='.' && $found!='..') { - $sub[count($sub)] = $found; - } - break; - } - } - @closedir($dir); - foreach( $sub as $idx => $found) { - _search_file($root,$possible,$path.'/'.$found); - } - } -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function search_file() { - global $argc, $argv; - $possible = array(); - - if ( $argc > 1) { - $path = $argv[1]; - } else if ( array_key_exists('SCRIPT_FILENAME',$_SERVER)) { - $path = $_SERVER['SCRIPT_FILENAME']; - //error_log("SCRIPT_FILENAME($path)",0); - } else { - $path = $argv[0]; - //error_log("argv($path)",0); - } - if ( ($p=strpos($path,'?')) !== false) $path = substr($path,0,$p); - if ( ($p=strrpos($path,'/')) /*< strlen($path)-1*/) $path = substr($path,0,$p); - error_log("exif test page - counting files in $path"); - _search_file($path,$possible); - error_log("exif test page - counting files: ".count($possible)." done.",0); - return $possible; -} - -/****************************************************************************/ -// function: search_file($file,$ext) -// -// Searches for $file in document tree. The path is ignored. -// -function AddInfo($Name,$Value,$highlight=0) { - if (is_array($Value)) $Value = 'Array: ('.join(',',$Value).')'; - $Value = nl2br($Value); - if ( $highlight) { - $Name = "$Name"; - } else { - $Name = "$Name"; - } - return "$Name$Value \n"; -} - -$possible = search_file(); - -$title = "PHP module exif test page"; - -?> - - -<?=$title ?> - - - -

-

(c) Marcus Börger, 2002

-

-

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

-

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

-

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

-

-What to look for in detail: -

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

function exif_tagname

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

function exif_read_data for images

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

function exif_read_data is not supported

\n"; -} -?> - - \ No newline at end of file diff --git a/ext/exif/tests/001.phpt b/ext/exif/tests/001.phpt deleted file mode 100644 index 487c94d3887..00000000000 --- a/ext/exif/tests/001.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Check for exif_read_data ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- -$section) { - $accept .= $section; - foreach($section as $name=>$value) { - if ( $idx!='FILE' || $name!='FileDateTime') { - $accept .= substr($name,0,2); - $accept .= $value; - } - } -} -echo $accept; -?> ---EXPECT-- -ArrayFitest2.jpgFi1240Fi2SeANY_TAG, IFD0, THUMBNAIL, COMMENTArrayhtwidth="1" height="1"He1Wi1Is1UsExif test image.UsASCIICoPhoto (c) M.Boerger, Edited by M.Boerger.CoPhoto (c) M.BoergerCoPhoto (c) M.BoergerArrayCoPhoto (c) M.BoergerUsASCIIArrayJP134JP523Array0Comment #1.1Comment #2.2Comment #3end \ No newline at end of file diff --git a/ext/exif/tests/002.phpt b/ext/exif/tests/002.phpt deleted file mode 100644 index d9e2298a5dc..00000000000 --- a/ext/exif/tests/002.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -Check for exif_thumbnail ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -7GWgw_523_identical_523_7GWgw diff --git a/ext/exif/tests/test1.jpg b/ext/exif/tests/test1.jpg deleted file mode 100644 index 121decb65ad30078dc0a09bd23c62fb49d8a44ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmex=?U?LR#UJO6b*$~fG#Lh5@t1O zoG1cv!NH)5ABQ&u|Uz`(%4z|=H@feFY`1K~++V74TX?GMBm0U7xv`3f4znhL&pPWh=t z>8V8wt|^%%sVNFcl?X9C2FGA$Pfwr@kl_j?sl_DKK?PtW?-nLv;YKHA715xBNya8cO&6WnRVM|1c=$27*i>xMre-yl$ssAO zhZdKZiC+qRl=^9N%i+tVk3YMqPg&BsW$KYDPrfYOdi3hkuVHCrZPS)*J9h2aH*@#! z^z!!U%eNoD{`|WjC`y=ESio*#XJa)5J3-Mh?G$9NXZRX2 S{nSd8<^ON~AC2~r80`RuhC?d= diff --git a/ext/ext_skel b/ext/ext_skel deleted file mode 100755 index bbbcc164f16..00000000000 --- a/ext/ext_skel +++ /dev/null @@ -1,274 +0,0 @@ -#!/bin/sh - -givup() { - echo $* - exit 1 -} - -usage() { -echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]" -echo " [--full-xml] [--no-help]" -echo "" -echo " --extname=module module is the name of your extension" -echo " --proto=file file contains prototypes of functions to create" -echo " --stubs=file generate only function stubs in file" -echo " --xml generate xml documentation to be added to phpdoc-cvs" -echo " --full-xml generate xml documentation for a self-contained extension" -echo " (not yet implemented)" -echo " --no-help don't try to be nice and create comments in the code" -echo " and helper functions to test if the module compiled" -exit 1 -} - -if test $# = 0; then - usage -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --extname=?*) - extname=$optarg - EXTNAME=`echo $extname | tr [a-z] [A-Z]` - ;; - --proto=?*) - proto=$optarg - ;; - --stubs=*) - stubs=yes - stubfile=$optarg - ;; - --xml) - xml="yes" - ;; - --xml=?*) - xml=$optarg - ;; - --full-xml) - full_xml="yes" - ;; - --no-help) - no_help="yes" - ;; - *) - usage - ;; - esac - shift -done - -if test -d "$extname" ; then - givup "Directory $extname already exists." -fi - -test -f ext_skel || givup "ext_skel must be in the current directory" -test -d skeleton || givup "subdirectory skeleton does not exist or is not directory" - -if echo '\c' | grep -s c >/dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -if test -z "$stubs"; then - echo "Creating directory $extname" - stubfile=$extname"/function_stubs" - mkdir $extname || givup "Cannot create directory $extname" -fi - -if test -n "$proto"; then - cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f ./skeleton/create_stubs -fi - -if test -z "$stubs"; then - cd $extname - chmod 755 . - -$ECHO_N "Creating basic files:$ECHO_C" - -$ECHO_N " config.m4$ECHO_C" -cat >config.m4 < check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this - dnl if test -r \$PHP_$EXTNAME/$SEARCH_FOR; then # path given as parameter - dnl ${EXTNAME}_DIR=\$PHP_$EXTNAME - dnl else # search default path list - dnl AC_MSG_CHECKING([for $extname files in default path]) - dnl for i in \$SEARCH_PATH ; do - dnl if test -r \$i/\$SEARCH_FOR; then - dnl ${EXTNAME}_DIR=\$i - dnl AC_MSG_RESULT(found in \$i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "\$${EXTNAME}_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the $extname distribution]) - dnl fi - - dnl # --with-$extname -> add include path - dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include) - - dnl # --with-$extname -> chech for lib and symbol presence - dnl LIBNAME=$extname # you may want to change this - dnl LIBSYMBOL=$extname # you most likely want to change this - - dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) - dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm -ldl - dnl ]) - dnl - dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) - - PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared) -fi -eof - - -$ECHO_N " .cvsignore$ECHO_C" -cat >.cvsignore < sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_entries_here__/r function_entries' >> sedscript -echo '/__function_stubs_here__/r function_stubs' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_entries_here__/D' >> sedscript -echo '/__function_stubs_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo '/Remove the following/,/^\*\//D' >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi - -sed -f sedscript <../skeleton/skeleton.c > $extname.c - - -$ECHO_N " php_$extname.h$ECHO_C" -echo "s/extname/$extname/g" > sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_declarations_here__/r function_declarations' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_declarations_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi -sed -f sedscript <../skeleton/php_skeleton.h > php_$extname.h - -$ECHO_N " CREDITS$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <../skeleton/CREDITS > CREDITS - -$ECHO_N " EXPERIMENTAL$ECHO_C" -echo "s/extname/$extname/g" > sedscript -sed -f sedscript <../skeleton/EXPERIMENTAL > EXPERIMENTAL - -$ECHO_N " tests/001.phpt$ECHO_C" -mkdir tests || givup "Cannot create tests directory" -chmod 755 tests -sed -f sedscript <../skeleton/tests/001.phpt > tests/001.phpt - -if test -z "$stubs" && test -z "$no_help"; then - $ECHO_N " $extname.php$ECHO_C" - sed \ - -e "s/extname/$extname/g" \ - <../skeleton/skeleton.php \ - > $extname.php -fi - -rm sedscript - -if test -n "$proto"; then - if test -z "$stubs"; then - rm function_entries - rm function_declarations - rm function_stubs - fi - if test -f function_warning; then - rm function_warning - warning=" -NOTE! Because some arguments to functions were resources, the code generated -cannot yet be compiled without editing. Please consider this to be step 4.5 -in the instructions above. -" - fi -fi - -find . -type f | xargs chmod 644 -find . -type d | xargs chmod 755 -fi - -echo " [done]." - -if test -z "$no_help" && test -z "$stubs"; then - cat < -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fbsql - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fbsql.mak" CFG="fbsql - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fbsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fbsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fbsql - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "NDEBUG" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4nts.lib /nologo /dll /machine:I386 /out:"Release/php_fbsql.dll" /libpath:"..\..\Release" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /FR /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /FR /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php4ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib" - -!ELSEIF "$(CFG)" == "fbsql - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "\usr\FrontBase\Include" /D "NDEBUG" /D ZTS=1 /D ZEND_DEBUG=0 /D "FBSQL_EXPORTS" /D "COMPILE_DL_FBSQL" /D HAVE_FBSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WinNT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib FBCAccess.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline" - -!ENDIF - -# Begin Target - -# Name "fbsql - Win32 Release" -# Name "fbsql - Win32 Debug" -# Name "fbsql - Win32 Debug_TS" -# Name "fbsql - Win32 Release_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\php_fbsql.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fbsql.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Source File - -SOURCE=.\Readme_w32.txt -# End Source File -# End Target -# End Project diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c deleted file mode 100644 index 6b0a4c5693c..00000000000 --- a/ext/fbsql/php_fbsql.c +++ /dev/null @@ -1,3500 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http:/*www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* TODO: - * - * ? Safe mode implementation - */ - -/* SB's list: - - API for a more natural FB connect semantic - - Connect & set session - - Autoreconnect when disconnected - - Comments and cleanup - - BUGS - - Select db with no arguments - - Query with everything defaulted -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" - -#if WIN32|WINNT -#include -#else -#include -#include - -#if HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#endif - -#include "php_ini.h" - -#define HAVE_FBSQL 1 - -#if HAVE_FBSQL -#include "php_fbsql.h" -#include - -static int le_result, le_link, le_plink; - -struct PHPFBResult; -typedef struct PHPFBResult PHPFBResult; - -struct PHPFBLink; -typedef struct PHPFBLink PHPFBLink; - -/* The PHPFBLink structure represents a fbsql link. The lion is used for - a connection to a machine, it may be persistent and is reference counted. - The reason for refcounting is mostly to avoid to think, it work independent of - any wierd and unforseen allocation deallocation order. - - The PHPFBDatabse structure implements to actual connection to a FrontBase server - ot may be persistent is the link it is connected to is persistent, and refcounted - for the same reasons as above. - - The PHPFBResult structure implements a result from the FrontBase server, and does all - required buffereing from of results. - - In the PHP code the 3 above a data structures are referenced by means of integers in the - range from 1 to som configurable maximum. You can put a limit to the number of links, databases - and results. The integer identifications is implemented by insertion in the list, which is passed - as an argument to all the functions, please note the list is polymorph. - - Database objects and link objects are all reused, base on the host name user name, host name database name - user name. So connecting twice to the same database as the same user will return the same database id. - We use the same coding for that as fbsql does, explioiting the underlying implementation of the lists. - - Persistent objects are put in the persistent list as well, but only by name, if you connect to a persistent object - and it is not in the list it is simply added and get a new index, and refcounted. Tricky, tricky ... -*/ - -/* Some functions which should be exported from FBCAccess */ - -void* fbaObjectAtIndex(); -void fbaRelease(); -unsigned int fbaCount(); - -struct FBCAutoStartInfo { - FBArray* infoLines; -}; - - - -struct PHPFBResult -{ - PHPFBLink* link; /* The link for the result, may be NULL if no link */ - char* fetchHandle; /* The fetch handle, the id used by the server. */ - FBCMetaData* metaData; /* The metadata describing the result */ - FBCMetaData* ResultmetaData; /* The metadata describing the result */ - FBCRowHandler* rowHandler; /* The row handler, the Frontbase structure used for accessing rows in the result */ - unsigned int batchSize; /* The number of row to fetch when expanding the number of rows in the row handler */ - unsigned int rowCount; /* The number of rows in the results set. The number of row is not in */ - /* general known when the select is done, one typically needs to fetch all the row - to figure out how many row you got. When the rowCount is unknown the value is - 0x7ffffffff */ - int columnCount; /* Number of columns in the row set. */ - unsigned int rowIndex; /* The current row index. */ - int columnIndex; /* The current column index */ - void** row; /* The last row accessed */ - FBArray* array; /* The link may return a result set, the database list, we implement that by the */ - /* FBArray, just a list of strings. */ - FBCPList* list; /* The same special kind result just for property list from extract, schema info. */ - unsigned int selectResults; /* number of results in select */ - unsigned int currentResult; /* current result number */ - int lobMode; /* 0=Fetch data (default); 1=Fetch handle */ -}; - -struct PHPFBLink -{ - int persistent; /* persistent ? */ - char* hostName; /* Host name */ - char* userName; /* User name */ - char* userPassword; /* User password */ - char* databasePassword; /* Database password */ - char* databaseName; /* The name of the database */ - FBCExecHandler* execHandler; /* The exechandler, can be used for database operations */ - FBCDatabaseConnection* connection; /* The connection to the database */ - unsigned int affectedRows; /* Number of rows affected by the last SQL statement */ - long autoCommit; /* Enable or disable autoCommit */ - unsigned int errorNo; /* The latest error on the connection, 0 is ok. */ - char* errorText; /* The error text */ - unsigned int insert_id; /* The row index of the latest row inserted into the database */ -}; - -#define FBSQL_ASSOC 1<<0 -#define FBSQL_NUM 1<<1 -#define FBSQL_BOTH (FBSQL_ASSOC|FBSQL_NUM) - -#define FBSQL_LOCK_DEFERRED 0 -#define FBSQL_LOCK_OPTIMISTIC 1 -#define FBSQL_LOCK_PESSIMISTIC 2 // default - -#define FBSQL_ISO_READ_UNCOMMITTED 0 -#define FBSQL_ISO_READ_COMMITTED 1 -#define FBSQL_ISO_REPEATABLE_READ 2 -#define FBSQL_ISO_SERIALIZABLE 3 // default -#define FBSQL_ISO_VERSIONED 4 - -#define FBSQL_LOB_DIRECT 0 // default -#define FBSQL_LOB_HANDLE 1 // default - - -/* {{{ 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) - -/* Fontbase additions: */ - PHP_FE(fbsql_set_transaction, NULL) - PHP_FE(fbsql_autocommit, NULL) - PHP_FE(fbsql_commit, NULL) - PHP_FE(fbsql_rollback, NULL) - - PHP_FE(fbsql_create_blob, NULL) - PHP_FE(fbsql_create_clob, NULL) - PHP_FE(fbsql_set_lob_mode, NULL) - PHP_FE(fbsql_read_blob, NULL) - PHP_FE(fbsql_read_clob, NULL) - PHP_FE(fbsql_blob_size, NULL) - PHP_FE(fbsql_clob_size, NULL) - - PHP_FE(fbsql_hostname, NULL) - PHP_FE(fbsql_database, NULL) - PHP_FE(fbsql_database_password, NULL) - PHP_FE(fbsql_username, NULL) - PHP_FE(fbsql_password, NULL) - PHP_FE(fbsql_warnings, NULL) - - PHP_FE(fbsql_get_autostart_info, NULL) -// PHP_FE(fbsql_set_autostart_info, NULL) - -/* Aliases: */ - PHP_FALIAS(fbsql, fbsql_db_query, NULL) - PHP_FALIAS(fbsql_tablename, fbsql_table_name, NULL) - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry fbsql_module_entry = { - STANDARD_MODULE_HEADER, - "fbsql", - fbsql_functions, - PHP_MINIT(fbsql), - PHP_MSHUTDOWN(fbsql), - PHP_RINIT(fbsql), - PHP_RSHUTDOWN(fbsql), - PHP_MINFO(fbsql), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -ZEND_DECLARE_MODULE_GLOBALS(fbsql) - -#ifdef COMPILE_DL_FBSQL -ZEND_GET_MODULE(fbsql) -#endif - -#define CHECK_LINK(link) { \ - if (link==-1) { \ - if (FB_SQL_G(generateWarnings)) \ - php_error(E_WARNING, "FrontBase: A link to the server could not be established"); \ - RETURN_FALSE; \ - } \ -} - -static void phpfbReleaseResult (zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleaseLink (zend_rsrc_list_entry *rsrc TSRMLS_DC); -static void phpfbReleasePLink (zend_rsrc_list_entry *rsrc TSRMLS_DC); - -static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBResult* result = (PHPFBResult *)rsrc->ptr; - - if (result) - { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData); - if (result->list) fbcplRelease(result->list); - if (result->array) fbaRelease(result->array); - efree(result); - } -} - - -static void phpfbReleaseLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - efree(link); - FB_SQL_G(linkCount)--; - } -} - -static void phpfbReleasePLink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - PHPFBLink* link = (PHPFBLink *)rsrc->ptr; - - if (link) - { - if (link->hostName) free(link->hostName); - if (link->userName) free(link->userName); - if (link->userPassword) free(link->userPassword); - if (link->databasePassword) free(link->databasePassword); - if (link->databaseName) free(link->databaseName); - if (link->errorText) free(link->errorText); - if (link->connection) { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - if (link->execHandler) fbcehRelease(link->execHandler); - free(link); - FB_SQL_G(linkCount)--; - FB_SQL_G(persistentCount)--; - } -} - -static void php_fbsql_set_default_link(int id TSRMLS_DC) -{ - if (FB_SQL_G(linkIndex)!=-1) { - zend_list_delete(FB_SQL_G(linkIndex)); - } - FB_SQL_G(linkIndex) = id; - zend_list_addref(id); -} - -static int php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS) -{ - if (FB_SQL_G(linkIndex)==-1) { /* no link opened yet, implicitly open one */ - ht = 0; - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); - } - return FB_SQL_G(linkIndex); -} - - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link); - -/* {{{ PHP_INI - */ -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allowPersistent, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateInt, generateWarnings, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateInt, autoCommit, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, maxPersistent, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateInt, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateInt, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.max_results", "128", PHP_INI_SYSTEM, OnUpdateInt, maxResults, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY_EX ("fbsql.batchSize", "1000", PHP_INI_SYSTEM, OnUpdateInt, batchSize, zend_fbsql_globals, fbsql_globals, display_link_numbers) - STD_PHP_INI_ENTRY ("fbsql.default_host", NULL, PHP_INI_SYSTEM, OnUpdateString, hostName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_user", "_SYSTEM", PHP_INI_SYSTEM, OnUpdateString, userName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_password", "", PHP_INI_SYSTEM, OnUpdateString, userPassword, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database", "", PHP_INI_SYSTEM, OnUpdateString, databaseName, zend_fbsql_globals, fbsql_globals) - STD_PHP_INI_ENTRY ("fbsql.default_database_password", "", PHP_INI_SYSTEM, OnUpdateString, databasePassword, zend_fbsql_globals, fbsql_globals) -PHP_INI_END() -/* }}} */ - -static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals) -{ - fbsql_globals->persistentCount = 0; - - if (fbsql_globals->hostName==NULL) - { - char name[256]; - gethostname(name, sizeof(name)); - name[sizeof(name)-1] = 0; - fbsql_globals->hostName = strdup(name); - } - - fbsql_globals->persistentCount = 0; - fbsql_globals->linkCount = 0; -} - -PHP_MINIT_FUNCTION(fbsql) -{ - ZEND_INIT_MODULE_GLOBALS(fbsql, php_fbsql_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - fbcInitialize(); - - le_result = zend_register_list_destructors_ex(phpfbReleaseResult, NULL, "fbsql result", module_number); - le_link = zend_register_list_destructors_ex(phpfbReleaseLink, NULL, "fbsql link", module_number); - le_plink = zend_register_list_destructors_ex(NULL, phpfbReleasePLink, "fbsql plink", module_number); - Z_TYPE(fbsql_module_entry) = type; - - REGISTER_LONG_CONSTANT("FBSQL_ASSOC", FBSQL_ASSOC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NUM", FBSQL_NUM, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_BOTH", FBSQL_BOTH, CONST_CS | CONST_PERSISTENT); - - /* Register Transaction constants */ - REGISTER_LONG_CONSTANT("FBSQL_LOCK_DEFERRED", FBSQL_LOCK_DEFERRED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_OPTIMISTIC", FBSQL_LOCK_OPTIMISTIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOCK_PESSIMISTIC", FBSQL_LOCK_PESSIMISTIC, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_UNCOMMITTED", FBSQL_ISO_READ_UNCOMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_READ_COMMITTED", FBSQL_ISO_READ_COMMITTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_REPEATABLE_READ", FBSQL_ISO_REPEATABLE_READ, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_SERIALIZABLE", FBSQL_ISO_SERIALIZABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_ISO_VERSIONED", FBSQL_ISO_VERSIONED, CONST_CS | CONST_PERSISTENT); - - /* Register Status constants */ - REGISTER_LONG_CONSTANT("FBSQL_UNKNOWN", FBUnknownStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPED", FBStopped, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STARTING", FBStarting, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_RUNNING", FBRunning, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_STOPPING", FBStopping, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_NOEXEC", FBNoExec, CONST_CS | CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("FBSQL_LOB_DIRECT", FBSQL_LOB_DIRECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FBSQL_LOB_HANDLE", FBSQL_LOB_HANDLE, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(fbsql) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_RINIT_FUNCTION(fbsql) -{ - FB_SQL_G(linkIndex) = -1; - FB_SQL_G(linkCount) = FB_SQL_G(persistentCount); - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(fbsql) -{ - return SUCCESS; -} - -PHP_MINFO_FUNCTION(fbsql) -{ - char buf[32]; - - php_info_print_table_start(); - php_info_print_table_header(2, "FrontBase support", "enabled"); - - php_info_print_table_row(2, "Client API version", "2.24"); - - if (FB_SQL_G(allowPersistent)) - { - sprintf(buf, "%ld", FB_SQL_G(persistentCount)); - php_info_print_table_row(2, "Active Persistent Links", buf); - } - - sprintf(buf, "%ld", FB_SQL_G(linkCount)); - php_info_print_table_row(2, "Active Links", buf); - -/* - sprintf(buf, "%ld", FB_SQL_G(resultCount)); - php_info_print_table_row(2, "Active Results", buf); -*/ - - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} - -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) -{ - PHPFBLink* phpLink; - list_entry *lep; - char name[1024]; - char *hostName = NULL, *userName = NULL, *userPassword = NULL; - int argc = ZEND_NUM_ARGS(), create_new = 0; - zval **argv[3]; - - if ((argc < 0) || (argc > 3)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0], &argv[1], &argv[2])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_string_ex(argv[0]); - hostName = Z_STRVAL_PP(argv[0]); - } - if (argc >= 2) - { - convert_to_string_ex(argv[1]); - userName = Z_STRVAL_PP(argv[1]); - } - if (argc == 3) - { - convert_to_string_ex(argv[2]); - userPassword = Z_STRVAL_PP(argv[2]); - } - - if (hostName == NULL) hostName = FB_SQL_G(hostName); - if (userName == NULL) userName = FB_SQL_G(userName); - if (userPassword == NULL) userPassword = FB_SQL_G(userPassword); - - sprintf(name, "fbsql_%s_%s_%s", hostName, userName, userPassword); - - if (!FB_SQL_G(allowPersistent)) { - persistent=0; - } - if (persistent) { - if (zend_hash_find(&EG(persistent_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - phpLink = (PHPFBLink*)lep->ptr; - } - else { - list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if ((FB_SQL_G(maxPersistent) != -1 && FB_SQL_G(persistentCount) == FB_SQL_G(maxPersistent))) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "FrontBase persistent link limit %d exceeded ", FB_SQL_G(maxPersistent)); - RETURN_FALSE; - } - - phpLink = malloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = fbcehHandlerForHost(hostName, 128); - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - - le.ptr = phpLink; - Z_TYPE(le) = le_plink; - if (zend_hash_update(&EG(persistent_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - free(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - FB_SQL_G(persistentCount)++; - } - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_plink); - } - else - { - list_entry le; - - if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks))) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "FrontBase link limit %d exceeded ", FB_SQL_G(maxLinks)); - RETURN_FALSE; - } - - if (zend_hash_find(&EG(regular_list), name, strlen(name) + 1, (void **)&lep) == SUCCESS) - { - int type, link; - void *ptr; - - link = (int) lep->ptr; - ptr = zend_list_find(link, &type); /* check if the link is still there */ - if (ptr && (type==le_link || type==le_plink)) { - zend_list_addref(link); - Z_LVAL_P(return_value) = link; - php_fbsql_set_default_link(link TSRMLS_CC); - Z_TYPE_P(return_value) = IS_RESOURCE; - return; - } else { - zend_hash_del(&EG(regular_list), name, strlen(name) + 1); - } - phpLink = (PHPFBLink*)lep->ptr; - } - - phpLink = emalloc(sizeof(PHPFBLink)); - phpLink->persistent = persistent; - phpLink->hostName = strdup(hostName); - phpLink->userName = strdup(userName); - phpLink->userPassword = strdup(userPassword); - phpLink->databasePassword = strdup(FB_SQL_G(databasePassword)); - phpLink->databaseName = NULL; - phpLink->execHandler = fbcehHandlerForHost(hostName, 128); - phpLink->affectedRows = 0; - phpLink->autoCommit = FB_SQL_G(autoCommit); - phpLink->errorNo = 0; - phpLink->errorText = NULL; - phpLink->connection = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpLink, le_link); - - le.ptr = (void *)Z_LVAL_P(return_value); - Z_TYPE(le) = le_index_ptr; - if (zend_hash_update(&EG(regular_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE) - { - free(phpLink->hostName); - free(phpLink->userName); - free(phpLink->userPassword); - free(phpLink->databasePassword); - efree(phpLink); - RETURN_FALSE; - } - FB_SQL_G(linkCount)++; - } - php_fbsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); -} - -int phpfbFetchRow(PHPFBResult* result, unsigned int row) -{ - if (result->rowHandler == NULL) - { - void *rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (rawData == NULL) - result->rowCount = 0; - else - result->rowHandler = fbcrhInitWith(rawData, result->metaData); - } - for (;;) - { - void *rawData; - if (row >= result->rowCount && result->rowCount != 0x7fffffff) return 0; - if (fbcrhRowCount(result->rowHandler) > (unsigned int)row) return 1; - rawData = fbcdcFetch(result->link->connection, result->batchSize, result->fetchHandle); - if (!fbcrhAddBatch(result->rowHandler, rawData)) result->rowCount = fbcrhRowCount(result->rowHandler); - } - return 0; -} - - -/* {{{ proto resource fbsql_connect([string hostname [, string username [, string password]]]) - Create a connection to a database server */ -PHP_FUNCTION(fbsql_connect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto resource fbsql_pconnect([string hostname [, string username [, string password]]]) - Create a persistant connection to a database server */ -PHP_FUNCTION(fbsql_pconnect) -{ - php_fbsql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int fbsql_close([resource link_identifier]) - Close a connection to a database server */ -PHP_FUNCTION(fbsql_close) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (id==-1) { /* explicit resource number */ - zend_list_delete(Z_RESVAL_PP(fbsql_link_index)); - } - - if (id!=-1 - || (fbsql_link_index && Z_RESVAL_PP(fbsql_link_index)==FB_SQL_G(linkIndex))) { - zend_list_delete(FB_SQL_G(linkIndex)); - FB_SQL_G(linkIndex) = -1; - } - - RETURN_TRUE; -} -/* }}} */ - -static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC) -{ - unsigned port; - FBCDatabaseConnection* c; - FBCMetaData* md; - - if (!link->databaseName || strcmp(link->databaseName, databaseName)) - { - port = atoi(databaseName); - if (port>0 && port<65535) - c = fbcdcConnectToDatabaseUsingPort(link->hostName, port, link->databasePassword); - else - c = fbcdcConnectToDatabase(databaseName, link->hostName, link->databasePassword); - if (c == NULL) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, fbcdcClassErrorMessage()); - return 0; - } - md = fbcdcCreateSession(c, "PHP", link->userName, link->userPassword, link->userName); - if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error(E_WARNING, emg); - else - php_error(E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);; - free(emg); - fbcemdRelease(emd); - fbcmdRelease(md); - fbcdcClose(c); - fbcdcRelease(c); - return 0; - } - fbcmdRelease(md); - - if (c) - { - if (link->autoCommit) - md = fbcdcExecuteDirectSQL(c, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(c, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - fbcdcSetOutputCharacterSet(c, FBC_ISO8859_1); - fbcdcSetInputCharacterSet(c, FBC_ISO8859_1); - - if (link->connection) - { - fbcdcClose(link->connection); - fbcdcRelease(link->connection); - } - link->connection = c; - if (link->databaseName) free(link->databaseName); - link->databaseName = strdup(databaseName); - } - return 1; -} - -void phpfbestrdup(const char * s, int* length, char** value) -{ - int l = s?strlen(s):0; - if (value) - { - char* r = emalloc(l+1); - if (s) - strcpy(r, s); - else - r[0] = 0; - *value = r; - } - *length = l; -} - -/* {{{ proto void fbsql_set_transaction(resource link_identifier, int locking, int isolation) - Sets the transaction locking and isolation */ -PHP_FUNCTION(fbsql_set_transaction) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **Locking = NULL, **Isolation = NULL; - char strSQL[1024]; - char *strLocking[] = {"DEFERRED", "OPTIMISTIC", "PESSIMISTIC"}; - char *strIsolation[] = {"READ UNCOMMITTED", "READ NCOMMITTED", "REPEATABLE READ", "SERIALIZABLE", "VERSIONED"}; - - switch (ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &fbsql_link_index, &Locking, &Isolation)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - sprintf(strSQL, "SET TRANSACTION LOCKING %s, ISOLATION %s;", strLocking[Z_LVAL_PP(Locking)], strIsolation[Z_LVAL_PP(Isolation)]); - - md = fbcdcExecuteDirectSQL(phpLink->connection, strSQL); - fbcmdRelease(md); -} -/* }}} */ - -/* {{{ proto bool fbsql_autocommit(resource link_identifier [, bool OnOff]) - Turns on auto-commit */ -PHP_FUNCTION(fbsql_autocommit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL, **onoff = NULL; - zend_bool OnOff; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &onoff)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (onoff) - { - convert_to_boolean_ex(onoff); - OnOff = Z_BVAL_PP(onoff); - phpLink->autoCommit = OnOff; - if (OnOff) - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT TRUE;"); - else - md = fbcdcExecuteDirectSQL(phpLink->connection, "SET COMMIT FALSE;"); - fbcmdRelease(md); - } - RETURN_BOOL(phpLink->autoCommit); -} -/* }}} */ - -/* {{{ proto bool fbsql_commit([resource link_identifier]) - Commit the transaction */ -PHP_FUNCTION(fbsql_commit) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcCommit(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto int fbsql_rollback([resource link_identifier]) - Rollback all statments since last commit */ -PHP_FUNCTION(fbsql_rollback) -{ - PHPFBLink* phpLink = NULL; - FBCMetaData* md; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - md = fbcdcRollback(phpLink->connection); - - if (md) { - fbcmdRelease(md); - RETURN_TRUE; - } - else - RETURN_FALSE; -} -/* }}} */ - - -static void php_fbsql_create_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - FBCBlobHandle *lobHandle; - zval **lob_data, **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_data)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_data, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_data); - switch (lob_type) { - case 0 : // BLOB - lobHandle = fbcdcWriteBLOB(phpLink->connection, Z_STRVAL_PP(lob_data), Z_STRLEN_PP(lob_data)); - break; - case 1 : // CLOB - lobHandle = fbcdcWriteCLOB(phpLink->connection, Z_STRVAL_PP(lob_data)); - break; - } - if (lobHandle) { - RETURN_STRING(fbcbhDescription(lobHandle), 1); - fbcbhRelease(lobHandle); - } - else - RETURN_FALSE; -} - -/* {{{ proto string fbsql_create_blob(string blob_data [, resource link_identifier]) - Create a BLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_blob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_create_clob(string clob_data [, resource link_identifier]) - Create a CLOB in the database for use with an insert or update statement */ -PHP_FUNCTION(fbsql_create_clob) -{ - php_fbsql_create_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_set_lob_mode(resource result, int lob_mode) - Sets the mode for how LOB data re retreived (actual data or a handle) */ -PHP_FUNCTION(fbsql_set_lob_mode) -{ - - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **lob_mode = NULL; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &lob_mode)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(lob_mode); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->lobMode = Z_LVAL_PP(lob_mode); - - RETURN_TRUE; -} -/* }}} */ - -static void php_fbsql_read_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - long length = 0; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - length = fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle)); - if (lob_type == 0) - value = estrndup((char *)fbcdcReadBLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - else - value = estrndup((char *)fbcdcReadCLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); - if (value) { - RETURN_STRINGL(value, length, 0); - } - else { - RETURN_FALSE; - } -} - -/* {{{ proto string fbsql_read_blob(string blob_handle [, resource link_identifier]) - Read the BLOB data identified by blob_handle */ -PHP_FUNCTION(fbsql_read_blob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_read_clob(string clob_handle [, resource link_identifier]) - Read the CLOB data identified by clob_handle */ -PHP_FUNCTION(fbsql_read_clob) -{ - php_fbsql_read_lob(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -static void php_fbsql_lob_size(INTERNAL_FUNCTION_PARAMETERS, int lob_type) -{ - PHPFBLink* phpLink = NULL; - zval **lob_handle, **fbsql_link_index = NULL; - int id; - char* value = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &lob_handle)==FAILURE) { - RETURN_FALSE; - } - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 2: - if (zend_get_parameters_ex(2, &lob_handle, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(lob_handle); - - if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { - if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "The handle is invalid"); - RETURN_FALSE; - } - - RETURN_LONG(fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle))); -} - -/* {{{ proto string fbsql_blob_size(string blob_handle [, resource link_identifier]) - Get the size of a BLOB identified by blob_handle */ -PHP_FUNCTION(fbsql_blob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto string fbsql_clob_size(string clob_handle [, resource link_identifier]) - Get the size of a CLOB identified by clob_handle */ -PHP_FUNCTION(fbsql_clob_size) -{ - php_fbsql_lob_size(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_hostname(resource link_identifier [, string host_name]) - Get or set the host name used with a connection */ -PHP_FUNCTION(fbsql_hostname) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **host_name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &host_name)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (host_name) - { - convert_to_string_ex(host_name); - if (phpLink->hostName) free(phpLink->hostName); - phpLink->hostName = strdup(Z_STRVAL_PP(host_name)); - } - RETURN_STRING(phpLink->hostName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_database(resource link_identifier [, string database]) - Get or set the database name used with a connection */ -PHP_FUNCTION(fbsql_database) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &dbname)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (dbname) - { - convert_to_string_ex(dbname); - if (phpLink->databaseName) free(phpLink->databaseName); - phpLink->databaseName = strdup(Z_STRVAL_PP(dbname)); - } - RETURN_STRING(phpLink->databaseName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_database_password(resource link_identifier [, string database_password]) - Get or set the databsae password used with a connection */ -PHP_FUNCTION(fbsql_database_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **db_password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &db_password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (db_password) - { - convert_to_string_ex(db_password); - if (phpLink->databasePassword) free(phpLink->databasePassword); - phpLink->databasePassword = strdup(Z_STRVAL_PP(db_password)); - } - RETURN_STRING(phpLink->databasePassword, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_username(resource link_identifier [, string username]) - Get or set the host user used with a connection */ -PHP_FUNCTION(fbsql_username) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **username = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &username)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (username) - { - convert_to_string_ex(username); - if (phpLink->userName) free(phpLink->userName); - phpLink->userName = strdup(Z_STRVAL_PP(username)); - } - RETURN_STRING(phpLink->userName, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_password(resource link_identifier [, string password]) - Get or set the user password used with a connection */ -PHP_FUNCTION(fbsql_password) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **password = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_link_index, &password)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, -1, "FrontBase-Link", le_link, le_plink); - - if (password) - { - convert_to_string_ex(password); - if (phpLink->userPassword) free(phpLink->userPassword); - phpLink->userPassword = strdup(Z_STRVAL_PP(password)); - } - RETURN_STRING(phpLink->userPassword, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_select_db([string database_name [, resource link_identifier]]) - Select the database to open */ -PHP_FUNCTION(fbsql_select_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname; - int id; - char* name = NULL; - - switch (ZEND_NUM_ARGS()) { - case 0: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &dbname)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - break; - case 2: - if (zend_get_parameters_ex(2, &dbname, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(dbname); - name = Z_STRVAL_PP(dbname); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) - { - int port = atoi(name); - if (port == 0 || port > 64535) { - if (FB_SQL_G(generateWarnings)) { - php_error(E_WARNING, "Cannot connect to FBExec for database '%s'", name); - php_error(E_WARNING, fbcehClassErrorMessage()); - } - RETURN_FALSE; - } - } - - if (!php_fbsql_select_db(name, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_change_user(string user, string password [, string database [, resource link_identifier]]) - Change the user for a session */ -PHP_FUNCTION(fbsql_change_user) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **user, **password, **database; - int id; - char *name = NULL, *userName, *userPassword; - char buffer[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - name = FB_SQL_G(databaseName); - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &user, &password)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(3, &user, &password, &database)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - break; - case 4: - if (zend_get_parameters_ex(4, &user, &password, &database, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(database); - name = Z_STRVAL_PP(database); - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(user); - userName = Z_STRVAL_PP(user); - - convert_to_string_ex(password); - userPassword = Z_STRVAL_PP(password); - - sprintf(buffer, "SET AUTHORIZATION %s;", userName); - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, buffer, phpLink); - if (Z_LVAL_P(return_value)) - { - free(phpLink->userName); - phpLink->userName = strdup(userName); - } -} -/* }}} */ - -/* {{{ proto bool fbsql_create_db(string database_name [, resource link_identifier]) - Create a new database on the server */ -PHP_FUNCTION(fbsql_create_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBUnknownStatus) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, "")) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not create %s@%s. %s.", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Database %s@%s created -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_drop_db(string database_name [, resource link_identifier]) - Drop a database on the server */ -PHP_FUNCTION(fbsql_drop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status != FBStopped) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBUnknownStatus) txt = "nonexisting"; - else if (status == FBStarting ) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping ) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not drop %s@%s, database is %s.", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (! fbcehDeleteDatabaseNamed (phpLink->execHandler, databaseName)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not drop %s@%s. %s.", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBUnknownStatus) break; - } - if (status != FBUnknownStatus) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Database %s@%s dropped -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto bool fbsql_start_db(string database_name [, resource link_identifier]) - Start a database on the server */ -PHP_FUNCTION(fbsql_start_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if ((status != FBStopped) && (status != FBRunning) && (status != FBStarting)) - { - char* txt = "Unknown status"; - if (status == FBStopped ) txt = "stopped"; - else if (status == FBStarting) txt = "starting"; - else if (status == FBRunning ) txt = "running"; - else if (status == FBStopping) txt = "stopping"; - else if (status == FBNoExec ) txt = "no exec"; - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not start %s@%s, as database is %s.", databaseName, phpLink->hostName, txt); - RETURN_FALSE; - } - - if (status == FBStopped) - { - if (!fbcehStartDatabaseNamed (phpLink->execHandler, databaseName)) - { - char* error = fbechErrorMessage(phpLink->execHandler); - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Could not start %s@%s. %s.", databaseName, phpLink->hostName, error); - RETURN_FALSE; - } - } - - for (i=0; i < 20; i++) - { -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBRunning) break; - } - if (status != FBRunning) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Database %s@%s started -- status unknown", databaseName, phpLink->hostName); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fbsql_stop_db(string database_name [, resource link_identifier]) - Stop a database on the server */ -PHP_FUNCTION(fbsql_stop_db) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - int i, status; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - -/* printf("Stop db %x\n", phpDatabase->connection); */ - if (!fbcdcStopDatabase(phpLink->connection)) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Cannot stop database %s@%s", databaseName, phpLink->hostName); - RETURN_FALSE; - } - - for (i=0; i < 20; i++) - { - status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName); - if (status == FBStopped) break; -#ifdef PHP_WIN32 - Sleep(1000); -#else - sleep(1); -#endif - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int fbsql_db_status(string database_name [, resource link_identifier]) - Gets the status (Stopped, Starting, Running, Stopping) for a given database */ -PHP_FUNCTION(fbsql_db_status) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (phpLink->execHandler) { - RETURN_LONG(fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName)); - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ mdOk - */ -int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql) -{ - FBCDatabaseConnection* c = link->connection; - int result = 1; - TSRMLS_FETCH(); - - link->errorNo = 0; - if (link->errorText) - { - free(link->errorText); - link->errorText = NULL; - } - if (md == NULL) - { - link->errorNo = 1; - link->errorText = strdup("Connection to database server was lost"); - if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, link->errorText); - result = 0; - } - else if (fbcmdErrorsFound(md)) - { - FBCErrorMetaData* emd = fbcdcErrorMetaData(c, md); - char* emg = fbcemdAllErrorMessages(emd); - if (FB_SQL_G(generateWarnings)) - { - if (emg) - php_error(E_WARNING, "Error in statement: '%s' %s", sql, emg); - else - php_error(E_WARNING, "No message"); - } - link->errorText = strdup(emg); - link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);; - free(emg); - fbcemdRelease(emd); - result = 0; - } - return result; -} -/* }}} */ - -static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link) -{ - PHPFBResult* result = NULL; - FBCMetaData* md, *meta; - char* tp; - char* fh; - unsigned int sR = 1, cR = 0; - - meta = fbcdcExecuteDirectSQL(link->connection, sql); - - if (!mdOk(link, meta, sql)) - { - fbcmdRelease(meta); - ZVAL_BOOL(return_value, 0) - } - else { - if (fbcmdHasMetaDataArray(meta)) { - sR = fbcmdMetaDataArrayCount(meta); - md = (FBCMetaData*)fbcmdMetaDataAtIndex(meta, cR); - } - else - md = meta; - - tp = fbcmdStatementType(md); - - if ((tp[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->link = link; - result->fetchHandle = fh; - result->ResultmetaData = meta; - result->metaData = md; - result->rowHandler = NULL; - result->batchSize = FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = 0; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - result->selectResults = sR; - result->currentResult = cR; - result->lobMode = FBSQL_LOB_DIRECT; - - if (tp[0] != 'E') - { - result->columnCount = fbcmdColumnCount(md); - result->fetchHandle = fh; - result->batchSize = FB_SQL_G(batchSize); - } - else - { - char* r = fbcmdMessage(result->metaData); - fbcrhConvertToOutputCharSet(fbcdcOutputCharacterSet(link->connection), (unsigned char *)r); - if ((result->list = fbcplParse(r))) - { - result->rowCount = fbcplCount(result->list); - result->columnCount = 7; - } - } - ZEND_REGISTER_RESOURCE(return_value, result, le_result); - } - else if (tp[0] == 'I' || tp[0] == 'U') - { - if (tp[0] == 'I') link->insert_id = fbcmdRowIndex(md); - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - else if(tp[0] == 'A' || tp[0] == 'D') - { - if (sR == 1 && md) fbcmdRelease(md); - ZVAL_BOOL(return_value, 1) - } - if (link) link->affectedRows = fbcmdRowCount(md); - } -} - -/* {{{ proto resource fbsql_query(string query [, resource link_identifier]) - 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; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink); -} -/* }}} */ - -/* {{{ proto resource fbsql_db_query(string database_name, string query [, resource link_identifier]) - Send one or more SQL statements to a specified database on the server */ -PHP_FUNCTION(fbsql_db_query) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **dbname, **query; - int id; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &dbname, &query)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &dbname, &query, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(query); - convert_to_string_ex(dbname); - - if (php_fbsql_select_db(Z_STRVAL_PP(dbname), phpLink TSRMLS_CC)) { - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, Z_STRVAL_PP(query), phpLink); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto resource fbsql_list_dbs([resource link_identifier]) - Retreive a list of all databases on the server */ -PHP_FUNCTION(fbsql_list_dbs) -{ - PHPFBResult* phpResult; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - phpResult = emalloc(sizeof(PHPFBResult)); - phpResult->link = phpLink; - phpResult->fetchHandle = NULL; - phpResult->rowHandler = NULL; - phpResult->ResultmetaData = NULL; - phpResult->metaData = NULL; - phpResult->batchSize = FB_SQL_G(batchSize); - phpResult->columnCount = 1; - phpResult->rowIndex = 0; - phpResult->columnIndex = 0; - phpResult->row = NULL; - phpResult->array = fbcehAvailableDatabases(phpLink->execHandler); - phpResult->rowCount = fbaCount(phpResult->array); - phpResult->list = NULL; - - ZEND_REGISTER_RESOURCE(return_value, phpResult, le_result); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_tables(string database [, int link_identifier]) - Retreive a list of all tables from the specifoied database */ -PHP_FUNCTION(fbsql_list_tables) -{ - char* sql = "select t0.\"table_name\"from information_schema.tables t0, information_schema.SCHEMATA t1 where t0.schema_pk = t1.schema_pk and t1.\"schema_name\" = current_schema order by \"table_name\";"; - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name; - int id; - char *databaseName; - - switch (ZEND_NUM_ARGS()) { - case 1: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(1, &database_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &database_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - - if (databaseName == NULL) { - php_fbsql_select_db(FB_SQL_G(databaseName), phpLink TSRMLS_CC); - } else { - php_fbsql_select_db(databaseName, phpLink TSRMLS_CC); - } - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink); -} -/* }}} */ - -/* {{{ proto resource fbsql_list_fields(string database_name, string table_name [, resource link_identifier]) - Retrieve a list of all fields for the specified database.table */ -PHP_FUNCTION(fbsql_list_fields) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL, **database_name, **table_name; - int id; - char *databaseName, *tableName; - char sql[1024]; - - switch (ZEND_NUM_ARGS()) { - case 2: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - if (zend_get_parameters_ex(2, &database_name, &table_name)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &database_name, &table_name, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - convert_to_string_ex(database_name); - databaseName = Z_STRVAL_PP(database_name); - convert_to_string_ex(table_name); - tableName = Z_STRVAL_PP(table_name); - - if (!php_fbsql_select_db(databaseName, phpLink TSRMLS_CC)) { - RETURN_FALSE; - } - - sprintf(sql, "SELECT * FROM %s WHERE 1=0;", tableName); - - phpfbQuery(INTERNAL_FUNCTION_PARAM_PASSTHRU, sql, phpLink); -} -/* }}} */ - -/* {{{ proto string fbsql_error([resource link_identifier]) - Returns the last error string */ -PHP_FUNCTION(fbsql_error) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->errorText == NULL) { - RETURN_FALSE; - } - else { - RETURN_STRING(phpLink->errorText, 1); - } -} -/* }}} */ - -/* {{{ proto int fbsql_errno([resource link_identifier]) - Returns the last error code */ -PHP_FUNCTION(fbsql_errno) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->errorNo); -} -/* }}} */ - -/* {{{ proto bool fbsql_warnings([int flag]) - Enable or disable FrontBase warnings */ -PHP_FUNCTION(fbsql_warnings) -{ - int argc = ARG_COUNT(ht); - zval **argv[1]; - - if ((argc < 0) || (argc > 1)) WRONG_PARAM_COUNT; - if (zend_get_parameters_ex(argc, &argv[0])==FAILURE) RETURN_FALSE; - if (argc >= 1) - { - convert_to_long_ex(argv[0]); - FB_SQL_G(generateWarnings) = Z_LVAL_PP(argv[0]) != 0; - } - RETURN_BOOL(FB_SQL_G(generateWarnings)); -} -/* }}} */ - -/* {{{ proto int fbsql_affected_rows([resource link_identifier]) - Get the number of rows affected by the last statement */ -PHP_FUNCTION(fbsql_affected_rows) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->affectedRows); -} -/* }}} */ - -/* {{{ proto int fbsql_insert_id([resource link_identifier]) - Get the internal index for the last insert statement */ -PHP_FUNCTION(fbsql_insert_id) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - RETURN_LONG(phpLink->insert_id); -} -/* }}} */ - -/* {{{ phpSizeOfInt - */ -int phpSizeOfInt (int i) -{ - int s = 1; - if (i < 0) - { - s++; - i = -i; - } - while ((i = i / 10)) s++; - return s; -} -/* }}} */ - -void phpfbColumnAsString (PHPFBResult* result, int column, void* data , int* length, char** value) -{ - FBCMetaData* md = result->metaData; - const FBCDatatypeMetaData* dtmd = fbcmdDatatypeMetaDataAtIndex(md, column); - unsigned dtc = fbcdmdDatatypeCode(dtmd); - switch (dtc) - { - case FB_Boolean: - { - unsigned char v = *((unsigned char*)(data)); - if (v == 255) - phpfbestrdup("Unknown", length, value); - else if (v == 0) - phpfbestrdup("False", length, value); - else - phpfbestrdup("True", length, value); - } - break; - - case FB_PrimaryKey: - case FB_Integer: - { - int v = *((int*)data); - char b[128]; - sprintf(b, "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_SmallInteger: - { - short v = *((short*)data); - char b[128]; - sprintf(b, "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Float: - case FB_Real: - case FB_Double: - case FB_Numeric: - case FB_Decimal: - { - double v = *((double*)data); - char b[128]; - sprintf(b, "%f", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_Character: - case FB_VCharacter: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_Bit: - case FB_VBit: - { - const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column); - struct bitValue - { - unsigned int nBytes; - unsigned char* bytes; - }; - struct bitValue* ptr = data; - unsigned nBits = ptr->nBytes * 8; - - if (dtc == FB_Bit) nBits = fbcdmdLength(fbccmdDatatype(clmd)); - if (nBits %8 == 0) - { - unsigned i; - unsigned int l = nBits / 8; - *length = l*2+3+1; - if (value) - { - char* r = emalloc(l*2+3+1); - r[0] = 'X'; - r[1] = '\''; - for (i = 0; i < nBits / 8; i++) - { - char c[4]; - sprintf(c, "%02x", ptr->bytes[i]); - r[i*2+2] = c[0]; - r[i*2+3] = c[1]; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - else - { - unsigned i; - unsigned int l = nBits; - *length = l*2+3+1; - if (value) - { - char* r = emalloc(l*2+3+1); - r[0] = 'B'; - r[1] = '\''; - for (i = 0; i < nBits; i++) - { - int bit = 0; - if (i/8 < ptr->nBytes) bit = ptr->bytes[i/8] & (1<<(7-(i%8))); - r[i*2+2] = bit?'1':'0'; - } - r[i*2+2] = '\''; - r[i*2+3] = 0; - *value = r; - } - } - } - break; - - case FB_Date: - case FB_Time: - case FB_TimeTZ: - case FB_Timestamp: - case FB_TimestampTZ: - { - char* v = (char*)data; - phpfbestrdup(v, length, value); - } - break; - - case FB_YearMonth: - { - char b[128]; - int v = *((unsigned int*)data); - sprintf(b, "%d", v); - phpfbestrdup(b, length, value); - } - break; - - case FB_DayTime: - { - char b[128]; - double seconds = *((double*)data); - sprintf(b, "%f", seconds); - phpfbestrdup(b, length, value); - } - break; - - case FB_CLOB: - case FB_BLOB: - { - if (*((unsigned char*) data) == '\1') - { // Direct - *length = ((FBCBlobDirect *)data)->blobSize; - *value = estrndup((char *)((FBCBlobDirect *)data)->blobData, *length); - } - else - { - FBCBlobHandle *lobHandle; - unsigned char *bytes = (unsigned char *)data; - char *handle = (char *)(&bytes[1]); - lobHandle = fbcbhInitWithHandle(handle); - *length = fbcbhBlobSize(lobHandle); - - if (result->lobMode == FBSQL_LOB_HANDLE) { - phpfbestrdup(fbcbhDescription(lobHandle), length, value); - } - else { - if (dtc == FB_BLOB) - *value = estrndup((char *)fbcdcReadBLOB(result->link->connection, lobHandle), *length); - else - *value = estrndup((char *)fbcdcReadCLOB(result->link->connection, lobHandle), *length); - } - fbcbhRelease(lobHandle); - } - } - break; - - default: - php_error(E_ERROR, "Unimplemented type"); - break; - } -} - -/* {{{ phpfbSqlResult - */ -void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIndex, int columnIndex) -{ - void** row; - if (result->list) - { - FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list, "COLUMNS"); - FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns, result->rowIndex); - if (columnIndex == 0) - { /* Name */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "NAME"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 2) - { /* Length */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "WIDTH"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 1) - { /* Type */ - FBCPList* name = (FBCPList*)fbcplValueForKey(column, "DATATYPE"); - RETURN_STRING((char *)fbcplString((FBCPList*)name), 1); - } - else if (columnIndex == 3) - { /* Flags */ - RETURN_STRING("", 1); - } - else - { - RETURN_STRING("", 1); - } - } - else if (result->array) - { /* Special case for get dbs */ - RETURN_STRING(fbaObjectAtIndex(result->array, rowIndex), 1); - } - else if (!phpfbFetchRow(result, rowIndex)) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "No such row %d in result set %d", rowIndex, rowIndex); - RETURN_FALSE; - } - else if (columnIndex >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "No such column %d in result set %d", columnIndex, rowIndex); - RETURN_FALSE; - } - else - { - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - else if (row[columnIndex]) - { - phpfbColumnAsString(result, columnIndex, row[columnIndex], &Z_STRLEN_P(return_value), &Z_STRVAL_P(return_value)); - Z_TYPE_P(return_value) = IS_STRING; - } - else - { - RETURN_NULL(); - } - } -} -/* }}} */ - -/* {{{ proto mixed fbsql_result(int result [, int row [, mixed field]]) - ??? */ -PHP_FUNCTION(fbsql_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row = NULL, **field = NULL; - int rowIndex; - int columnIndex; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row)==FAILURE) { - RETURN_FALSE; - } - break; - case 3: - if (zend_get_parameters_ex(3, &fbsql_result_index, &row, &field)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - rowIndex = result->rowIndex; - if (row) - { - convert_to_long_ex(row); - rowIndex = Z_LVAL_PP(row); - } - - columnIndex = result->columnIndex; - if (field) - { - if ((Z_TYPE_PP(field) == IS_STRING) && (result->metaData)) - { - for (columnIndex =0; columnIndex < result->columnCount; columnIndex ++) - { - const FBCColumnMetaData* cmd = fbcmdColumnMetaDataAtIndex(result->metaData, columnIndex); - const char* lbl = fbccmdLabelName(cmd); - if (strcmp((char*)lbl, Z_STRVAL_PP(field)) == 0) break; - } - if (columnIndex == result->columnCount) RETURN_FALSE; - } - else - { - convert_to_long_ex(field); - columnIndex = Z_LVAL_PP(field); - if (columnIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Illegal column index - %d", columnIndex); - RETURN_FALSE; - } - } - } - - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, rowIndex, columnIndex); - - result->columnIndex++; - if (result->columnIndex == result->columnCount) - { - result->rowIndex++; - result->columnIndex = 0; - } -} -/* }}} */ - -/* {{{ proto int fbsql_next_result(int result) - Switch to the next result if multiple results are available */ -PHP_FUNCTION(fbsql_next_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - result->currentResult++; - if (result->currentResult < result->selectResults) { - if (result->fetchHandle) { - FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle); - fbcmdRelease(md); - } - if (result->rowHandler) fbcrhRelease(result->rowHandler); - result->metaData = (FBCMetaData*)fbcmdMetaDataAtIndex(result->ResultmetaData, result->currentResult); - result->fetchHandle = fbcmdFetchHandle(result->metaData); - result->rowHandler = NULL; - result->batchSize = FB_SQL_G(batchSize); - result->rowCount = 0x7fffffff; - result->columnCount = fbcmdColumnCount(result->metaData);; - result->rowIndex = 0; - result->columnIndex = 0; - result->row = NULL; - result->array = NULL; - result->list = NULL; - if (result->link) - result->link->affectedRows = fbcmdRowCount(result->metaData); - - RETURN_TRUE; - } - else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int fbsql_num_rows(int result) - Get number of rows */ -PHP_FUNCTION(fbsql_num_rows) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int rowCount; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->array) - rowCount = result->rowCount; - else { - rowCount = fbcmdRowCount(result->metaData); - if (rowCount == -1) - { - phpfbFetchRow(result, 0x7fffffff); - rowCount = result->rowCount; - } - } - RETURN_LONG(rowCount); -} -/* }}} */ - -/* {{{ proto int fbsql_num_fields(int result) - Get number of fields in the result set */ -PHP_FUNCTION(fbsql_num_fields) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - RETURN_LONG(result->columnCount); -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_row(resource result) - Fetch a row of data. Returns an indexed array */ -PHP_FUNCTION(fbsql_fetch_row) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_assoc(resource result) - Detch a row of data. Returns an assoc array */ -PHP_FUNCTION(fbsql_fetch_assoc) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC); -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_object(resource result [, int result_type]) - Fetch a row of data. Returns an object */ -PHP_FUNCTION(fbsql_fetch_object) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC); - if (Z_TYPE_P(return_value)==IS_ARRAY) { - object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value)); - } -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_array(resource result [, int result_type]) - Fetches a result row as an array (associative, numeric or both)*/ -PHP_FUNCTION(fbsql_fetch_array) -{ - php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH); -} -/* }}} */ - -static void _parse_list(zval** return_value, FBCPList* list) -{ - int count = fbcplCount(list); - int i,j; - - for (i=0; irowIndex; - if (((result_type & FBSQL_NUM) != FBSQL_NUM) && ((result_type & FBSQL_ASSOC) != FBSQL_ASSOC)) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH."); - RETURN_FALSE; - } - if (array_init(return_value)==FAILURE) - { - RETURN_FALSE; - } - if (result->fetchHandle == NULL) - { - if (result->array == NULL && result->list == NULL) - { - RETURN_FALSE; - } - if (result->rowIndex >= result->rowCount) - { - RETURN_FALSE; - } - if (result->list) { - char* key; - FBCPList* value; - - value = (FBCPList*)fbcplValueAtIndex(result->list, result->rowIndex); - key = (char*)fbcplKeyAtIndex(result->list, result->rowIndex); - - if (key && key[0] == 2) - key = NULL; - - if (fbcplIsDictionary(value)) { - zval *value_array; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - _parse_list(&value_array, value); - if (result_type & FBSQL_NUM || key == NULL) - { - add_index_zval(return_value, 0, value_array); - } - if (result_type & FBSQL_ASSOC && key != NULL) - { - add_assoc_zval(return_value, key, value_array); - } - } - else if (fbcplIsArray(value)) { - zval *value_array; - int valcount = fbcplCount(value); - int j; - - MAKE_STD_ZVAL(value_array); - array_init(value_array); - - for (j=0; jarray, result->rowIndex)), 0); - } - if (result_type & FBSQL_ASSOC) - { - add_assoc_string(return_value, "Database", estrdup(fbaObjectAtIndex(result->array, result->rowIndex)), 0); - } - } - } - else { - if (result->rowCount == 0) { - RETURN_FALSE; - } - if (result->rowCount == 0x7fffffff) - { - if (!phpfbFetchRow(result, result->rowIndex)) { - RETURN_FALSE; - } - } - row = fbcrhRowAtIndex(result->rowHandler, rowIndex); - if (row == NULL) - { - RETURN_FALSE; - } - for (i=0; i < result->columnCount; i++) - { - if (row[i]) - { - char* value; - unsigned int length; - unsigned int c = 0; - phpfbColumnAsString(result, i, row[i], &length, &value); - if (result_type & FBSQL_NUM) - { - add_index_stringl(return_value, i, value, length, c); - c = 1; - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_stringl(return_value, key, value, length, c); - } - } - else - { - if (result_type & FBSQL_NUM) - { - add_index_unset(return_value, i); - } - if (result_type & FBSQL_ASSOC) - { - char* key = (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, i)); - add_assoc_unset(return_value, key); - } - } - } - } - result->rowIndex++; - result->columnIndex = 0; -} - -/* {{{ proto int fbsql_data_seek(int result, int row_number) - Move the internal row counter to the specified row_number */ -PHP_FUNCTION(fbsql_data_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **row_number = NULL; - unsigned int rowIndex; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &row_number)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - convert_to_long_ex(row_number); - rowIndex = Z_LVAL_PP(row_number); - - if (rowIndex < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Illegal row_index (%i)", rowIndex); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, rowIndex); - if (rowIndex > result->rowCount) RETURN_FALSE; - result->rowIndex = rowIndex; - result->columnIndex = 0; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_fetch_lengths(int result) - Returns an array of the lengths of each column in the result set */ -PHP_FUNCTION(fbsql_fetch_lengths) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - int i; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - if (result->row == NULL) RETURN_FALSE; - if (array_init(return_value)==FAILURE) RETURN_FALSE; - for (i=0; i < result->columnCount; i++) - { - unsigned length = 0; - if (result->row[i]) phpfbColumnAsString(result, i, result->row[i], &length, NULL); - add_index_long(return_value, i, length); - } -} -/* }}} */ - -/* {{{ proto object fbsql_fetch_field(int result [, int field_index]) - Get the field properties for a specified field_index */ -PHP_FUNCTION(fbsql_fetch_field) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (object_init(return_value)==FAILURE) - { - RETURN_FALSE; - } - add_property_string(return_value, "name", (char*)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_string(return_value, "table", (char*)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "max_length", fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - add_property_string(return_value, "type", (char*)fbcdmdDatatypeString(fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - add_property_long(return_value, "not_null", !fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))); -/* Remember to add the rest */ -/* add_property_long(return_value, "primary_key", IS_PRI_KEY(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "multiple_key", (fbsql_field->flags&MULTIPLE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "unique_key", (fbsql_field->flags&UNIQUE_KEY_FLAG?1:0)); */ -/* add_property_long(return_value, "numeric", IS_NUM(Z_TYPE_P(fbsql_field))?1:0); */ -/* add_property_long(return_value, "blob", IS_BLOB(fbsql_field->flags)?1:0); */ -/* add_property_long(return_value, "unsigned", (fbsql_field->flags&UNSIGNED_FLAG?1:0)); */ -/* add_property_long(return_value, "zerofill", (fbsql_field->flags&ZEROFILL_FLAG?1:0)); */ -} -/* }}} */ - -/* {{{ proto bool fbsql_field_seek(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_seek) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - - result->columnIndex = column; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fbsql_field_name(int result [, int field_index]) - Get the column name for a specified field_index */ -PHP_FUNCTION(fbsql_field_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 0); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbccmdLabelName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); - result->columnIndex = column; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_table(int result [, int field_index]) - Get the table name for a specified field_index */ -PHP_FUNCTION(fbsql_field_table) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - RETURN_STRING((char *)fbccmdTableName(fbcmdColumnMetaDataAtIndex(result->metaData, column)), 1); -} -/* }}} */ - -/* {{{ proto string fbsql_field_len(int result [, int field_index]) - Get the column length for a specified field_index */ -PHP_FUNCTION(fbsql_field_len) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 2); - } - else if (result->metaData) - { - RETURN_LONG(fbcdmdLength(fbccmdDatatype(fbcmdColumnMetaDataAtIndex(result->metaData, column)))); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_type(int result [, int field_index]) - Get the field type for a specified field_index */ -PHP_FUNCTION(fbsql_field_type) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - if (result->list) - { - phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, result->rowIndex, 1); - } - else if (result->metaData) - { - RETURN_STRING((char *)fbcdmdDatatypeString (fbcmdDatatypeMetaDataAtIndex(result->metaData, column)), 1); - } - else - { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string fbsql_field_flags(int result [, int field_index]) - ??? */ -PHP_FUNCTION(fbsql_field_flags) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **field_index = NULL; - int column = -1; - char buf[512]; - int len; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &field_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - column = result->columnIndex; - if (field_index) - { - convert_to_long_ex(field_index); - column = Z_LVAL_PP(field_index); - if (column < 0 || column >= result->columnCount) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "%d no such column in result", column); - RETURN_FALSE; - } - } - strcpy(buf, ""); - if (!fbccmdIsNullable(fbcmdColumnMetaDataAtIndex(result->metaData, column))) { - strcat(buf, "not_null "); - } -#if 0 - if (IS_PRI_KEY(fbsql_field->flags)) { - strcat(buf, "primary_key "); - } - if (fbsql_field->flags&UNIQUE_KEY_FLAG) { - strcat(buf, "unique_key "); - } - if (fbsql_field->flags&MULTIPLE_KEY_FLAG) { - strcat(buf, "multiple_key "); - } - if (IS_BLOB(fbsql_field->flags)) { - strcat(buf, "blob "); - } - if (fbsql_field->flags&UNSIGNED_FLAG) { - strcat(buf, "unsigned "); - } - if (fbsql_field->flags&ZEROFILL_FLAG) { - strcat(buf, "zerofill "); - } - if (fbsql_field->flags&BINARY_FLAG) { - strcat(buf, "binary "); - } - if (fbsql_field->flags&ENUM_FLAG) { - strcat(buf, "enum "); - } - if (fbsql_field->flags&AUTO_INCREMENT_FLAG) { - strcat(buf, "auto_increment "); - } - if (fbsql_field->flags&TIMESTAMP_FLAG) { - strcat(buf, "timestamp "); - } -#endif - len = strlen(buf); - /* remove trailing space, if present */ - if (len && buf[len-1] == ' ') { - buf[len-1] = 0; - len--; - } - RETURN_STRING(buf, 1); -} -/* }}} */ - -/* {{{ proto string fbsql_table_name(resource result, int index) - Retreive the table name for index after a call to fbsql_list_tables() */ -PHP_FUNCTION(fbsql_table_name) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL, **table_index; - unsigned index; - char* value; - unsigned int length; - void** row; - - switch (ZEND_NUM_ARGS()) { - case 2: - if (zend_get_parameters_ex(2, &fbsql_result_index, &table_index)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(table_index); - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - index = Z_LVAL_PP(table_index); - if (index < 0) - { - if (FB_SQL_G(generateWarnings)) - php_error(E_WARNING, "Illegal index (%i)", index); - RETURN_FALSE; - } - - if (result->rowCount == 0x7fffffff) phpfbFetchRow(result, index); - if (index > result->rowCount) RETURN_FALSE; - result->rowIndex = index; - result->columnIndex = 0; - - row = fbcrhRowAtIndex(result->rowHandler, index); - phpfbColumnAsString(result, 0, row[0], &length, &value); - RETURN_STRINGL(value, length, 1); -} -/* }}} */ - -/* {{{ proto bool fbsql_free_result(resource result) - free the memory used to store a result */ -PHP_FUNCTION(fbsql_free_result) -{ - PHPFBResult* result = NULL; - zval **fbsql_result_index = NULL; - - switch (ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result); - - zend_list_delete(Z_LVAL_PP(fbsql_result_index)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array fbsql_get_autostart_info([resource link_identifier]) - ??? */ -PHP_FUNCTION(fbsql_get_autostart_info) -{ - PHPFBLink* phpLink = NULL; - zval **fbsql_link_index = NULL; - int id; - FBCAutoStartInfo* asInfo; - - switch (ZEND_NUM_ARGS()) { - case 0: - id = php_fbsql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); - CHECK_LINK(id); - break; - case 1: - if (zend_get_parameters_ex(1, &fbsql_link_index)==FAILURE) { - RETURN_FALSE; - } - id = -1; - break; - default: - WRONG_PARAM_COUNT; - break; - } - ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); - - if (phpLink->execHandler == NULL) { - if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "No valid Exec handler available for this connection"); - RETURN_FALSE; - } - else { - array_init(return_value); - asInfo = fbcehGetAutoStartInfo(phpLink->execHandler); - if (asInfo != NULL) { - unsigned i; - - for (i=0; iinfoLines); i++) { - FBArray* infoLine = fbaObjectAtIndex(asInfo->infoLines, i); -// if (fbaCount(infoLine) == 2) { -// fbaObjectAtIndex(infoLine, 0); -// fbaObjectAtIndex(infoLine, 1); -// } -// else { - add_index_string(return_value, i, fbaObjectAtIndex(infoLine, 0), 1); -// } - - } - } - } -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fbsql/php_fbsql.h b/ext/fbsql/php_fbsql.h deleted file mode 100644 index f5c41aec189..00000000000 --- a/ext/fbsql/php_fbsql.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Frank M. Kromann | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define HAVE_FBSQL 1 - -#ifndef _PHP_FBSQL_H -#define _PHP_FBSQL_H - -#if COMPILE_DL_FBSQL -#undef HAVE_FBSQL -#define HAVE_FBSQL 1 -#endif -#if HAVE_FBSQL - -extern zend_module_entry fbsql_module_entry; -#define fbsql_module_ptr &fbsql_module_entry - -#include - -PHP_MINIT_FUNCTION(fbsql); -PHP_MSHUTDOWN_FUNCTION(fbsql); -PHP_RINIT_FUNCTION(fbsql); -PHP_RSHUTDOWN_FUNCTION(fbsql); -PHP_MINFO_FUNCTION(fbsql); -PHP_FUNCTION(fbsql_connect); -PHP_FUNCTION(fbsql_pconnect); -PHP_FUNCTION(fbsql_close); -PHP_FUNCTION(fbsql_select_db); -PHP_FUNCTION(fbsql_change_user); -PHP_FUNCTION(fbsql_create_db); -PHP_FUNCTION(fbsql_drop_db); -PHP_FUNCTION(fbsql_start_db); -PHP_FUNCTION(fbsql_stop_db); -PHP_FUNCTION(fbsql_db_status); -PHP_FUNCTION(fbsql_query); -PHP_FUNCTION(fbsql_db_query); -PHP_FUNCTION(fbsql_list_dbs); -PHP_FUNCTION(fbsql_list_tables); -PHP_FUNCTION(fbsql_list_fields); -PHP_FUNCTION(fbsql_error); -PHP_FUNCTION(fbsql_errno); -PHP_FUNCTION(fbsql_affected_rows); -PHP_FUNCTION(fbsql_insert_id); -PHP_FUNCTION(fbsql_result); -PHP_FUNCTION(fbsql_next_result); -PHP_FUNCTION(fbsql_num_rows); -PHP_FUNCTION(fbsql_num_fields); -PHP_FUNCTION(fbsql_fetch_row); -PHP_FUNCTION(fbsql_fetch_array); -PHP_FUNCTION(fbsql_fetch_assoc); -PHP_FUNCTION(fbsql_fetch_object); -PHP_FUNCTION(fbsql_data_seek); -PHP_FUNCTION(fbsql_fetch_lengths); -PHP_FUNCTION(fbsql_fetch_field); -PHP_FUNCTION(fbsql_field_seek); -PHP_FUNCTION(fbsql_free_result); -PHP_FUNCTION(fbsql_field_name); -PHP_FUNCTION(fbsql_field_table); -PHP_FUNCTION(fbsql_field_len); -PHP_FUNCTION(fbsql_field_type); -PHP_FUNCTION(fbsql_field_flags); -PHP_FUNCTION(fbsql_table_name); - -PHP_FUNCTION(fbsql_set_transaction); -PHP_FUNCTION(fbsql_autocommit); -PHP_FUNCTION(fbsql_commit); -PHP_FUNCTION(fbsql_rollback); - -PHP_FUNCTION(fbsql_create_blob); -PHP_FUNCTION(fbsql_create_clob); -PHP_FUNCTION(fbsql_set_lob_mode); -PHP_FUNCTION(fbsql_read_blob); -PHP_FUNCTION(fbsql_read_clob); -PHP_FUNCTION(fbsql_blob_size); -PHP_FUNCTION(fbsql_clob_size); - -PHP_FUNCTION(fbsql_hostname); -PHP_FUNCTION(fbsql_database); -PHP_FUNCTION(fbsql_database_password); -PHP_FUNCTION(fbsql_username); -PHP_FUNCTION(fbsql_password); -PHP_FUNCTION(fbsql_warnings); - -PHP_FUNCTION(fbsql_get_autostart_info); -//PHP_FUNCTION(fbsql_set_autostart_info); - -static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type); -static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent); - -ZEND_BEGIN_MODULE_GLOBALS(fbsql) - long allowPersistent; - long generateWarnings; - long autoCommit; - long maxPersistent; - long maxLinks; - long maxConnections; - long maxResults; - long batchSize; - char *hostName; - char *databaseName; - char *databasePassword; - char *userName; - char *userPassword; - long persistentCount; - long linkCount; - long linkIndex; - -ZEND_END_MODULE_GLOBALS(fbsql) - -#ifdef ZTS -# define FB_SQL_G(v) TSRMG(fbsql_globals_id, zend_fbsql_globals *, v) -#else -# define FB_SQL_G(v) (fbsql_globals.v) -#endif - -//#ifndef ZTS // No need for external definitions -//extern fbsql_module* phpfbModule; -//#endif - -#else // HAVE_FBSQL - -#define fbsql_module_ptr NULL -#error not ok -#endif // HAVE_FBSQL - -#define phpext_fbsql_ptr fbsql_module_ptr - -#endif /* _PHP_FBSQL_H */ diff --git a/ext/fdf/CREDITS b/ext/fdf/CREDITS deleted file mode 100644 index 57c33cc4b3d..00000000000 --- a/ext/fdf/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FDF -Uwe Steinmann diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 deleted file mode 100644 index c1ef0a81a37..00000000000 --- a/ext/fdf/config.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fdftk, for FDF support, -[ --with-fdftk[=DIR] Include FDF support.]) - -if test "$PHP_FDFTK" != "no"; then - - for i in /usr /usr/local $PHP_FDFTK; do - if test -r $i/include/FdfTk.h -o -r $i/include/fdftk.h; then - FDFTK_DIR=$i - fi - done - - if test -z "$FDFTK_DIR"; then - AC_MSG_ERROR(FdfTk.h or fdftk.h not found. Please reinstall the fdftk distribution.) - fi - - PHP_ADD_INCLUDE($FDFTK_DIR/include) - - FDFLIBRARY="" - for i in fdftk FdfTk; do - PHP_CHECK_LIBRARY($i, FDFOpen, [FDFLIBRARY=$i], [], [-L$FDFTK_DIR/lib -lm]) - done - - if test -z "$FDFLIBRARY"; then - AC_MSG_ERROR(fdftk module requires >= fdftk 2.0) - fi - - AC_DEFINE(HAVE_FDFLIB,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_DIR/lib, FDFTK_SHARED_LIBADD) - - PHP_SUBST(FDFTK_SHARED_LIBADD) - PHP_NEW_EXTENSION(fdf, fdf.c, $ext_shared) -fi diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c deleted file mode 100644 index cd2e0a3245a..00000000000 --- a/ext/fdf/fdf.c +++ /dev/null @@ -1,802 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Uwe Steinmann | - | Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from - http://beta1.adobe.com/ada/acrosdk/forms.html. */ - -/* Note that there is no code from the FdfTk lib in this file */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_FDFLIB - -#include "SAPI.h" -#include "ext/standard/info.h" -#include "php_open_temporary_file.h" -#include "php_variables.h" -#include "php_fdf.h" - -static int le_fdf; - -SAPI_POST_HANDLER_FUNC(fdf_post_handler); - -/* {{{ fdf_functions[] - */ -function_entry fdf_functions[] = { - PHP_FE(fdf_open, NULL) - PHP_FE(fdf_create, NULL) - PHP_FE(fdf_close, NULL) - PHP_FE(fdf_save, NULL) - PHP_FE(fdf_get_value, NULL) - PHP_FE(fdf_set_value, NULL) - PHP_FE(fdf_next_field_name, NULL) - PHP_FE(fdf_set_ap, NULL) - PHP_FE(fdf_set_status, NULL) - PHP_FE(fdf_get_status, NULL) - PHP_FE(fdf_set_file, NULL) - PHP_FE(fdf_get_file, NULL) - PHP_FE(fdf_add_template, NULL) - PHP_FE(fdf_set_flags, NULL) - PHP_FE(fdf_set_opt, NULL) - PHP_FE(fdf_set_submit_form_action, NULL) - PHP_FE(fdf_set_javascript_action, NULL) - PHP_FE(fdf_set_encoding, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry fdf_module_entry = { - STANDARD_MODULE_HEADER, - "fdf", - fdf_functions, - PHP_MINIT(fdf), - PHP_MSHUTDOWN(fdf), - NULL, - NULL, - PHP_MINFO(fdf), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_FDF -ZEND_GET_MODULE(fdf) -#endif - - -static void phpi_FDFClose(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - FDFDoc fdf = (FDFDoc)rsrc->ptr; - - (void) FDFClose(fdf); -} - - -#define FDF_POST_CONTENT_TYPE "application/vnd.fdf" - -static sapi_post_entry php_fdf_post_entry = { - FDF_POST_CONTENT_TYPE, - sizeof(FDF_POST_CONTENT_TYPE)-1, - sapi_read_standard_form_data, - fdf_post_handler -}; - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(fdf) -{ - FDFErc err; - - 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); - - - /* Constants used by fdf_set_opt() */ - REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFID", FDFID, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFf", FDFFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetFf", FDFSetFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClearFf", FDFClearFf, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFlags", FDFFlags, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFSetF", FDFSetF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFClrF", FDFClrF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAP", FDFAP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAS", FDFAS, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAction", FDFAction, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAA", FDFAA, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFAPRef", FDFAPRef, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFIF", FDFIF, CONST_CS | CONST_PERSISTENT); - - /* Constants used by fdf_set_javascript_action() */ - REGISTER_LONG_CONSTANT("FDFEnter", FDFEnter, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFExit", FDFExit, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFDown", FDFDown, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT); - -#ifdef PHP_WIN32 - return SUCCESS; -#endif - if((err = FDFInitialize()) == FDFErcOK) return SUCCESS; - return FAILURE; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(fdf) -{ - /* need to use a PHPAPI function here because it is external module in windows */ - php_info_print_table_start(); - php_info_print_table_row(2, "FDF Support", "enabled"); - php_info_print_table_row(2, "FdfTk Version", FDFGetVersion() ); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(fdf) -{ - FDFErc err; - - /* remove handler for Acrobat FDF form post requests */ - sapi_unregister_post_entry(&php_fdf_post_entry); - -#ifdef PHP_WIN32 - return SUCCESS; -#endif - if((err = FDFFinalize()) == FDFErcOK) return SUCCESS; - return FAILURE; -} -/* }}} */ - -/* {{{ proto int fdf_open(string filename) - Opens a new FDF document */ -PHP_FUNCTION(fdf_open) -{ - zval **file; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(file); - - err = FDFOpen(Z_STRVAL_PP(file), 0, &fdf); - - if(err != FDFErcOK || !fdf) { - php_error(E_WARNING, "Could not open fdf document: %s", Z_STRVAL_PP(file)); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto int fdf_create(void) - Creates a new FDF document */ -PHP_FUNCTION(fdf_create) -{ - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - err = FDFCreate(&fdf); - - if(err != FDFErcOK || !fdf) { - php_error(E_WARNING, "Error creating new fdf document!"); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, fdf, le_fdf); -} -/* }}} */ - -/* {{{ proto bool fdf_close(int fdfdoc) - Closes the FDF document */ -PHP_FUNCTION(fdf_close) -{ - zval **fdfp; - FDFDoc fdf; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - zend_list_delete(Z_RESVAL_PP(fdfp)); -} -/* }}} */ - -/* {{{ proto string fdf_get_value(int fdfdoc, string fieldname) - Gets the value of a field as string */ -PHP_FUNCTION(fdf_get_value) -{ - zval **fdfp, **fieldname; - ASInt32 nr, size = 256; - char *buffer; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &fieldname) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - - buffer = emalloc(size); - err = FDFGetValue(fdf, Z_STRVAL_PP(fieldname), buffer, size-1, &nr); - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+1); - err = FDFGetValue(fdf, Z_STRVAL_PP(fieldname), buffer, nr, &nr); - } - - if(err != FDFErcOK) { - php_error(E_WARNING, "Error getting value of %s", Z_STRVAL_PP(fieldname)); - efree(buffer); - RETURN_FALSE; - } - - RETVAL_STRING(buffer, 1); - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool fdf_set_value(int fdfdoc, string fieldname, string value, int isname) - Sets the value of a field */ -PHP_FUNCTION(fdf_set_value) -{ - zval **fdfp, **fieldname, **value, **isname; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &value, &isname) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_string_ex(value); - convert_to_long_ex(isname); - - err = FDFSetValue(fdf, Z_STRVAL_PP(fieldname), Z_STRVAL_PP(value), (ASBool) Z_LVAL_PP(isname)); - if(err != FDFErcOK) { - php_error(E_WARNING, "Error setting field: %s to value: %s", Z_STRVAL_PP(fieldname), Z_STRVAL_PP(value)); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fdf_next_field_name(int fdfdoc [, string fieldname]) - Gets the name of the next field name or the first field name */ -PHP_FUNCTION(fdf_next_field_name) -{ - zval **fdfp, **field; - int argc=ZEND_NUM_ARGS(); - ASInt32 length=256, nr; - char *buffer=NULL, *fieldname=NULL; - FDFDoc fdf; - FDFErc err; - - if (argc > 2 || argc < 1 || zend_get_parameters_ex(argc, &fdfp, &field) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - if(argc == 2) { - convert_to_string_ex(field); - fieldname = Z_STRVAL_PP(field); - } - - buffer = emalloc(length); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buffer = erealloc(buffer, nr+1); - err = FDFNextFieldName(fdf, fieldname, buffer, length-1, &nr); - } - - if(err != FDFErcOK) { - efree(buffer); - php_error(E_WARNING,"Error getting next fieldname!"); - RETURN_FALSE; - } - - RETVAL_STRING(buffer, 1); - efree(buffer); -} -/* }}} */ - -/* {{{ proto bool fdf_set_ap(int fdfdoc, string fieldname, int face, string filename, int pagenr) - Sets the appearence of a field */ -PHP_FUNCTION(fdf_set_ap) -{ - zval **fdfp, **fieldname, **face, **filename, **pagenr; - FDFDoc fdf; - FDFErc err; - FDFAppFace facenr; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &face, &filename, &pagenr) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(face); - convert_to_string_ex(filename); - convert_to_long_ex(pagenr); - - switch(Z_LVAL_PP(face)) { - case 1: - facenr = FDFNormalAP; - break; - case 2: - facenr = FDFRolloverAP; - break; - case 3: - facenr = FDFDownAP; - break; - default: - facenr = FDFNormalAP; - } - - err = FDFSetAP(fdf, Z_STRVAL_PP(fieldname), facenr, NULL, Z_STRVAL_PP(filename), (ASInt32) Z_LVAL_PP(pagenr)); - - /* This should be made more intelligent, ie. use switch() with the - possible errors this function can return. Or create global error handler function. - */ - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting appearence of field: %s", Z_STRVAL_PP(fieldname)); - RETURN_FALSE; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool fdf_set_status(int fdfdoc, string status) - Sets the value of /Status key */ -PHP_FUNCTION(fdf_set_status) -{ - zval **fdfp, **status; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &status) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(status); - - err = FDFSetStatus(fdf, Z_STRVAL_PP(status)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting fdf document status key to: %s", Z_STRVAL_PP(status)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fdf_get_status(int fdfdoc) - Gets the value of /Status key */ -PHP_FUNCTION(fdf_get_status) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetStatus(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetStatus(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - php_error(E_WARNING,"Error getting fdf document status key!"); - efree(buf); - RETURN_FALSE; - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_set_file(int fdfdoc, string filename) - Sets the value of /F key */ -PHP_FUNCTION(fdf_set_file) -{ - zval **fdfp, **filename; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(filename); - - err = FDFSetFile(fdf, Z_STRVAL_PP(filename)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting filename key to: %s", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string fdf_get_file(int fdfdoc) - Gets the value of /F key */ -PHP_FUNCTION(fdf_get_file) -{ - zval **fdfp; - ASInt32 nr, size = 256; - char *buf; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fdfp) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - buf = emalloc(size); - err = FDFGetFile(fdf, buf, size-1, &nr); - - if(err == FDFErcBufTooShort && nr > 0 ) { - buf = erealloc(buf, nr+1); - err = FDFGetFile(fdf, buf, size-1, &nr); - } - - if(err != FDFErcOK) { - php_error(E_WARNING,"Error getting fdf document filename key!"); - efree(buf); - RETURN_FALSE; - } - - RETVAL_STRING(buf, 1); - efree(buf); -} -/* }}} */ - -/* {{{ proto bool fdf_save(int fdfdoc, string filename) - Writes out the FDF file */ -PHP_FUNCTION(fdf_save) -{ - zval **fdfp, **filename; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &filename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(filename); - err = FDFSave(fdf, Z_STRVAL_PP(filename)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error saving fdf document into filename: %s", Z_STRVAL_PP(filename)); - RETURN_FALSE; - } - - RETURN_TRUE; - -} -/* }}} */ - -/* {{{ proto bool fdf_add_template(int fdfdoc, int newpage, string filename, string template, int rename) - Adds a template into the FDF document */ -PHP_FUNCTION(fdf_add_template) -{ - zval **fdfp, **newpage, **filename, **template, **rename; - FDFDoc fdf; - FDFErc err; - pdfFileSpecRec filespec; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &newpage, &filename, &template, &rename) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_long_ex(newpage); - convert_to_string_ex(filename); - convert_to_string_ex(template); - convert_to_long_ex(rename); - - filespec.FS = NULL; - filespec.F = Z_STRVAL_PP(filename); - filespec.Mac = NULL; - filespec.DOS = NULL; - filespec.Unix = NULL; - filespec.ID[0] = NULL; - filespec.ID[1] = NULL; - filespec.bVolatile = false; - - err = FDFAddTemplate(fdf, Z_LVAL_PP(newpage), &filespec, Z_STRVAL_PP(template), Z_LVAL_PP(rename)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error adding template: %s into fdf document", Z_STRVAL_PP(template)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fdf_set_flags(int fdfdoc, string fieldname, int whichflags, int newflags) - Sets flags for a field in the FDF document */ -PHP_FUNCTION(fdf_set_flags) -{ - zval **fdfp, **fieldname, **flags, **newflags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &flags, &newflags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(flags); - convert_to_long_ex(newflags); - - err=FDFSetFlags(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(flags), Z_LVAL_PP(newflags)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting flags for field: %s", Z_STRVAL_PP(fieldname)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name) - Sets a value in the opt array for a field */ -PHP_FUNCTION(fdf_set_opt) -{ - zval **fdfp, **fieldname, **element, **value, **name; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &element, &value, &name) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(element); - convert_to_string_ex(value); - convert_to_string_ex(name); - - err = FDFSetOpt(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(element), Z_STRVAL_PP(value), Z_STRVAL_PP(name)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting FDF option for field: %s", Z_STRVAL_PP(fieldname)); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichtrigger, string url, int flags) - Sets the submit form action for a field */ -PHP_FUNCTION(fdf_set_submit_form_action) -{ - zval **fdfp, **fieldname, **trigger, **url, **flags; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &fdfp, &fieldname, &trigger, &url, &flags) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(url); - convert_to_long_ex(flags); - - err = FDFSetSubmitFormAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(url), Z_LVAL_PP(flags)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting FDF submit action for field: %s", Z_STRVAL_PP(fieldname)); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fdf_set_javascript_action(int fdfdoc, string fieldname, int whichtrigger, string script) - Sets the javascript action for a field */ -PHP_FUNCTION(fdf_set_javascript_action) -{ - zval **fdfp, **fieldname, **trigger, **script; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &fdfp, &fieldname, &trigger, &script) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(fieldname); - convert_to_long_ex(trigger); - convert_to_string_ex(script); - - err = FDFSetJavaScriptAction(fdf, Z_STRVAL_PP(fieldname), Z_LVAL_PP(trigger), Z_STRVAL_PP(script)); - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting FDF javascript action for field: %s", Z_STRVAL_PP(fieldname)); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool fdf_set_encoding(int fdf_document, string encoding) - Sets FDF encoding (either "Shift-JIS" or "Unicode") */ -PHP_FUNCTION(fdf_set_encoding) -{ - zval **fdfp, **enc; - FDFDoc fdf; - FDFErc err; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fdfp, &enc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(fdf, FDFDoc *, fdfp, -1, "fdf", le_fdf); - - convert_to_string_ex(enc); - - err = FDFSetEncoding(fdf, Z_STRVAL_PP(enc)); - - if(err != FDFErcOK) { - php_error(E_WARNING,"Error setting FDF encoding: %s", Z_STRVAL_PP(enc)); - RETURN_FALSE; - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ SAPI_POST_HANDLER_FUNC - * SAPI post handler for FDF forms */ -SAPI_POST_HANDLER_FUNC(fdf_post_handler) -{ - FILE *fp; - FDFDoc theFDF; - char *name=NULL, *value=NULL, *p, *data; - int name_len=0, value_len=0; - char *lastfieldname =NULL; - char *filename = NULL; - FDFErc err; - ASInt32 nBytes; - zval *array_ptr = (zval *) arg; - - fp=php_open_temporary_file(NULL, "fdfdata.", &filename TSRMLS_CC); - if(!fp) { - if(filename) efree(filename); - return; - } - fwrite(SG(request_info).post_data, SG(request_info).post_data_length, 1, fp); - fclose(fp); - - /* Set HTTP_FDF_DATA variable */ - data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); - SET_VAR_STRINGL("HTTP_FDF_DATA", data, SG(request_info).post_data_length); - - err = FDFOpen(filename, 0, &theFDF); - - if(err==FDFErcOK){ - name = emalloc(name_len=256); - value= emalloc(value_len=256); - while (1) { - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - if(err == FDFErcBufTooShort && nBytes >0 ) { - name = erealloc(name, name_len=(nBytes+1)); - err = FDFNextFieldName(theFDF, lastfieldname, name, name_len-1, &nBytes); - } - - if(err != FDFErcOK || nBytes == 0) break; - - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - - err = FDFGetValue(theFDF, name, NULL, 0, &nBytes); - if(err != FDFErcOK && err != FDFErcNoValue ) break; - - if(value_len0) { - err = FDFGetValue(theFDF, name, value, value_len-1, &nBytes); - if(err == FDFErcOK && nBytes != 0) { - for(p=value;*p;p++) if(*p=='\r') *p='\n'; - if(lastfieldname) efree(lastfieldname); - lastfieldname = estrdup(name); - php_register_variable(name, value, array_ptr TSRMLS_CC); - } - } - } - - FDFClose(theFDF); - VCWD_UNLINK((const char *)filename); - efree(filename); - - if(name) efree(name); - if(value) efree(value); - if(lastfieldname) efree(lastfieldname); - } -} -/* }}} */ - - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/fdf/fdf.dsp b/ext/fdf/fdf.dsp deleted file mode 100644 index 487ca42828d..00000000000 --- a/ext/fdf/fdf.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fdf" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fdf - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fdf.mak" CFG="fdf - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fdf - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fdf - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /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 php4ts.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_fdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "fdf - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /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 php4ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 php4ts_debug.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_fdf.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "fdf - Win32 Release_TS" -# Name "fdf - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\fdf.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_fdf.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/fdf/php_fdf.h b/ext/fdf/php_fdf.h deleted file mode 100644 index f099662ad79..00000000000 --- a/ext/fdf/php_fdf.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Uwe Steinmann | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_FDF_H -#define PHP_FDF_H - -#if HAVE_FDFLIB -#ifdef PHP_WIN32 -#else -#define UNIX_DEV -#endif - -#include - -extern zend_module_entry fdf_module_entry; -#define fdf_module_ptr &fdf_module_entry - -PHP_MINIT_FUNCTION(fdf); -PHP_MSHUTDOWN_FUNCTION(fdf); -PHP_MINFO_FUNCTION(fdf); - -PHP_FUNCTION(fdf_open); -PHP_FUNCTION(fdf_close); -PHP_FUNCTION(fdf_create); -PHP_FUNCTION(fdf_save); -PHP_FUNCTION(fdf_get_value); -PHP_FUNCTION(fdf_set_value); -PHP_FUNCTION(fdf_next_field_name); -PHP_FUNCTION(fdf_set_ap); -PHP_FUNCTION(fdf_get_status); -PHP_FUNCTION(fdf_set_status); -PHP_FUNCTION(fdf_set_file); -PHP_FUNCTION(fdf_get_file); -PHP_FUNCTION(fdf_add_template); -PHP_FUNCTION(fdf_set_flags); -PHP_FUNCTION(fdf_set_opt); -PHP_FUNCTION(fdf_set_submit_form_action); -PHP_FUNCTION(fdf_set_javascript_action); -PHP_FUNCTION(fdf_set_encoding); - -#else -#define fdf_module_ptr NULL -#endif -#define phpext_fdf_ptr fdf_module_ptr -#endif /* PHP_FDF_H */ diff --git a/ext/filepro/CREDITS b/ext/filepro/CREDITS deleted file mode 100644 index c272432c04b..00000000000 --- a/ext/filepro/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FilePro -Chad Robinson diff --git a/ext/filepro/config.m4 b/ext/filepro/config.m4 deleted file mode 100644 index 13f02c2125c..00000000000 --- a/ext/filepro/config.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_ARG_WITH(filepro,[],[enable_filepro=$withval]) - -PHP_ARG_ENABLE(filepro,whether to enable the bundled filePro support, -[ --enable-filepro Enable the bundled read-only filePro support.]) - -if test "$PHP_FILEPRO" = "yes"; then - AC_DEFINE(HAVE_FILEPRO, 1, [ ]) - PHP_NEW_EXTENSION(filepro, filepro.c, $ext_shared) -fi diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c deleted file mode 100644 index 27fd07bb267..00000000000 --- a/ext/filepro/filepro.c +++ /dev/null @@ -1,592 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Chad Robinson | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - filePro 4.x support developed by Chad Robinson, chadr@brttech.com - Contact Chad Robinson at BRT Technical Services Corp. for details. - filePro is a registered trademark by Fiserv, Inc. This file contains - no code or information that is not freely available from the filePro - web site at http://www.fileproplus.com/ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "safe_mode.h" -#include "fopen_wrappers.h" -#include -#ifdef PHP_WIN32 -#include -#else -#include -#endif -#include -#include "php_globals.h" - -#include "php_filepro.h" -#if HAVE_FILEPRO - -typedef struct fp_field { - char *name; - char *format; - int width; - struct fp_field *next; -} FP_FIELD; - -#ifdef THREAD_SAFE -DWORD FPTls; -static int numthreads=0; - -typedef struct fp_global_struct{ - char *fp_database; - signed int fp_fcount; - signed int fp_keysize; - FP_FIELD *fp_fieldlist; -}fp_global_struct; - -#define FP_GLOBAL(a) fp_globals->a - -#define FP_TLS_VARS \ - fp_global_struct *fp_globals; \ - fp_globals=TlsGetValue(FPTls); - -#else -#define FP_GLOBAL(a) a -#define FP_TLS_VARS -static char *fp_database = NULL; /* Database directory */ -static signed int fp_fcount = -1; /* Column count */ -static signed int fp_keysize = -1; /* Size of key records */ -static FP_FIELD *fp_fieldlist = NULL; /* List of fields */ -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(filepro) -{ -#ifdef THREAD_SAFE - fp_global_struct *fp_globals; -#ifdef COMPILE_DL_FILEPRO - CREATE_MUTEX(fp_mutex,"FP_TLS"); - SET_MUTEX(fp_mutex); - numthreads++; - if (numthreads==1){ - if ((FPTls=TlsAlloc())==0xFFFFFFFF){ - FREE_MUTEX(fp_mutex); - return 0; - }} - FREE_MUTEX(fp_mutex); -#endif - fp_globals = (fp_global_struct *) LocalAlloc(LPTR, sizeof(fp_global_struct)); - TlsSetValue(FPTls, (void *) fp_globals); -#endif - FP_GLOBAL(fp_database)=NULL; - FP_GLOBAL(fp_fcount)=-1; - FP_GLOBAL(fp_keysize)=-1; - FP_GLOBAL(fp_fieldlist)=NULL; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(filepro) -{ -#ifdef THREAD_SAFE - fp_global_struct *fp_globals; - fp_globals = TlsGetValue(FPTls); - if (fp_globals != 0) - LocalFree((HLOCAL) fp_globals); -#ifdef COMPILE_DL_FILEPRO - SET_MUTEX(fp_mutex); - numthreads--; - if (!numthreads){ - if (!TlsFree(FPTls)){ - FREE_MUTEX(fp_mutex); - return 0; - } - } - FREE_MUTEX(fp_mutex); -#endif -#endif - return SUCCESS; -} -/* }}} */ - -function_entry filepro_functions[] = { - PHP_FE(filepro, NULL) - PHP_FE(filepro_rowcount, NULL) - PHP_FE(filepro_fieldname, NULL) - PHP_FE(filepro_fieldtype, NULL) - PHP_FE(filepro_fieldwidth, NULL) - PHP_FE(filepro_fieldcount, NULL) - PHP_FE(filepro_retrieve, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry filepro_module_entry = { - STANDARD_MODULE_HEADER, - "filepro", filepro_functions, PHP_MINIT(filepro), PHP_MSHUTDOWN(filepro), NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - - -#ifdef COMPILE_DL_FILEPRO -ZEND_GET_MODULE(filepro) -#if (WIN32|WINNT) && defined(THREAD_SAFE) - -/*NOTE: You should have an odbc.def file where you -export DllMain*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - switch( ul_reason_for_call ) { - case DLL_PROCESS_ATTACH: - if ((FPTls=TlsAlloc())==0xFFFFFFFF) { - return 0; - } - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - if (!TlsFree(FPTls)) { - return 0; - } - break; - } - return 1; -} -#endif -#endif - -/* - * LONG filePro(STRING directory) - * - * Read and verify the map file. We store the field count and field info - * internally, which means we become unstable if you modify the table while - * a user is using it! We cannot lock anything since Web connections don't - * provide the ability to later unlock what we locked. Be smart, be safe. - */ -/* {{{ proto bool filepro(string directory) - Read and verify the map file */ -PHP_FUNCTION(filepro) -{ - pval *dir; - FILE *fp; - char workbuf[MAXPATHLEN]; - char readbuf[256]; - char *strtok_buf = NULL; - int i; - FP_FIELD *new_field, *tmp, *next; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dir) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string(dir); - - /* free memory */ - if (FP_GLOBAL(fp_database) != NULL) { - efree (FP_GLOBAL(fp_database)); - } - - /* free linked list of fields */ - tmp = FP_GLOBAL(fp_fieldlist); - while (tmp != NULL) { - next = tmp->next; - efree(tmp); - tmp = next; - } - - /* init the global vars */ - FP_GLOBAL(fp_database) = NULL; - FP_GLOBAL(fp_fieldlist) = NULL; - FP_GLOBAL(fp_fcount) = -1; - FP_GLOBAL(fp_keysize) = -1; - - snprintf(workbuf, sizeof(workbuf), "%s/map", Z_STRVAL_P(dir)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error(E_WARNING, "filePro: cannot open map: [%d] %s", - errno, strerror(errno)); - RETURN_FALSE; - } - if (!fgets(readbuf, sizeof(readbuf), fp)) { - fclose(fp); - php_error(E_WARNING, "filePro: cannot read map: [%d] %s", - errno, strerror(errno)); - RETURN_FALSE; - } - - /* Get the field count, assume the file is readable! */ - if (strcmp(php_strtok_r(readbuf, ":", &strtok_buf), "map")) { - php_error(E_WARNING, "filePro: map file corrupt or encrypted"); - RETURN_FALSE; - } - FP_GLOBAL(fp_keysize) = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - php_strtok_r(NULL, ":", &strtok_buf); - FP_GLOBAL(fp_fcount) = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - - /* Read in the fields themselves */ - for (i = 0; i < FP_GLOBAL(fp_fcount); i++) { - if (!fgets(readbuf, sizeof(readbuf), fp)) { - fclose(fp); - php_error(E_WARNING, "filePro: cannot read map: [%d] %s", - errno, strerror(errno)); - RETURN_FALSE; - } - new_field = emalloc(sizeof(FP_FIELD)); - new_field->next = NULL; - new_field->name = estrdup(php_strtok_r(readbuf, ":", &strtok_buf)); - new_field->width = atoi(php_strtok_r(NULL, ":", &strtok_buf)); - new_field->format = estrdup(php_strtok_r(NULL, ":", &strtok_buf)); - - /* Store in forward-order to save time later */ - if (!FP_GLOBAL(fp_fieldlist)) { - FP_GLOBAL(fp_fieldlist) = new_field; - } else { - for (tmp = FP_GLOBAL(fp_fieldlist); tmp; tmp = tmp->next) { - if (!tmp->next) { - tmp->next = new_field; - tmp = new_field; - } - } - } - } - fclose(fp); - - FP_GLOBAL(fp_database) = estrndup(Z_STRVAL_P(dir), Z_STRLEN_P(dir)); - - RETVAL_TRUE; -} -/* }}} */ - - -/* - * LONG filePro_rowcount(void) - * - * Count the used rows in the database. filePro just marks deleted records - * as deleted; they are not removed. Since no counts are maintained we need - * to go in and count records ourselves. - * - * Errors return false, success returns the row count. - */ -/* {{{ proto int filepro_rowcount(void) - Find out how many rows are in a filePro database */ -PHP_FUNCTION(filepro_rowcount) -{ - FILE *fp; - char workbuf[MAXPATHLEN]; - char readbuf[256]; - int recsize = 0, records = 0; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - recsize = FP_GLOBAL(fp_keysize) + 19; /* 20 bytes system info -1 to save time later */ - - /* Now read the records in, moving forward recsize-1 bytes each time */ - snprintf(workbuf, sizeof(workbuf), "%s/key", FP_GLOBAL(fp_database)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error(E_WARNING, "filePro: cannot open key: [%d] %s", - errno, strerror(errno)); - RETURN_FALSE; - } - while (!feof(fp)) { - if (fread(readbuf, 1, 1, fp) == 1) { - if (readbuf[0]) - records++; - fseek(fp, recsize, SEEK_CUR); - } - } - fclose(fp); - - RETVAL_LONG(records); -} -/* }}} */ - - -/* - * STRING filePro_fieldname(LONG field_number) - * - * Errors return false, success returns the name of the field. - */ -/* {{{ proto string filepro_fieldname(int fieldnumber) - Gets the name of a field */ -PHP_FUNCTION(filepro_fieldname) -{ - pval *fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_P(fno)) { - RETURN_STRING(lp->name, 1); - } - } - - php_error(E_WARNING, - "filePro: unable to locate field number %d.\n", - Z_LVAL_P(fno)); - - RETVAL_FALSE; -} -/* }}} */ - - -/* - * STRING filePro_fieldtype(LONG field_number) - * - * Errors return false, success returns the type (edit) of the field - */ -/* {{{ proto string filepro_fieldtype(int field_number) - Gets the type of a field */ -PHP_FUNCTION(filepro_fieldtype) -{ - pval *fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_P(fno)) { - RETURN_STRING(lp->format, 1); - } - } - php_error(E_WARNING, - "filePro: unable to locate field number %d.\n", - Z_LVAL_P(fno)); - RETVAL_FALSE; -} -/* }}} */ - - -/* - * STRING filePro_fieldwidth(int field_number) - * - * Errors return false, success returns the character width of the field. - */ -/* {{{ proto int filepro_fieldwidth(int field_number) - Gets the width of a field */ -PHP_FUNCTION(filepro_fieldwidth) -{ - pval *fno; - FP_FIELD *lp; - int i; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(fno); - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp; lp = lp->next, i++) { - if (i == Z_LVAL_P(fno)) { - RETURN_LONG(lp->width); - } - } - php_error(E_WARNING, - "filePro: unable to locate field number %d.\n", - Z_LVAL_P(fno)); - RETVAL_FALSE; -} -/* }}} */ - - -/* - * LONG filePro_fieldcount(void) - * - * Errors return false, success returns the field count. - */ -/* {{{ proto int filepro_fieldcount(void) - Find out how many fields are in a filePro database */ -PHP_FUNCTION(filepro_fieldcount) -{ - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - /* Read in the first line from the map file */ - RETVAL_LONG(FP_GLOBAL(fp_fcount)); -} -/* }}} */ - - -/* - * STRING filePro_retrieve(int row_number, int field_number) - * - * Errors return false, success returns the datum. - */ -/* {{{ proto string filepro_retrieve(int row_number, int field_number) - Retrieves data from a filePro database */ -PHP_FUNCTION(filepro_retrieve) -{ - pval *rno, *fno; - FP_FIELD *lp; - FILE *fp; - char workbuf[MAXPATHLEN]; - char *readbuf; - int i, fnum, rnum; - long offset; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &rno, &fno) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (!FP_GLOBAL(fp_database)) { - php_error(E_WARNING, - "filePro: must set database directory first!\n"); - RETURN_FALSE; - } - - convert_to_long(rno); - convert_to_long(fno); - - fnum = Z_LVAL_P(fno); - rnum = Z_LVAL_P(rno); - - if (rnum < 0 || fnum < 0 || fnum >= FP_GLOBAL(fp_fcount)) { - php_error(E_WARNING, "filepro: parameters out of range"); - RETURN_FALSE; - } - - offset = (rnum + 1) * (FP_GLOBAL(fp_keysize) + 20) + 20; /* Record location */ - for (i = 0, lp = FP_GLOBAL(fp_fieldlist); lp && i < fnum; lp = lp->next, i++) { - offset += lp->width; - } - if (!lp) { - php_error(E_WARNING, "filePro: cannot locate field"); - RETURN_FALSE; - } - - /* Now read the record in */ - snprintf(workbuf, sizeof(workbuf), "%s/key", FP_GLOBAL(fp_database)); - - if (PG(safe_mode) && (!php_checkuid(workbuf, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - RETURN_FALSE; - } - - if (php_check_open_basedir(workbuf TSRMLS_CC)) { - RETURN_FALSE; - } - - if (!(fp = VCWD_FOPEN(workbuf, "r"))) { - php_error(E_WARNING, "filePro: cannot open key: [%d] %s", - errno, strerror(errno)); - fclose(fp); - RETURN_FALSE; - } - fseek(fp, offset, SEEK_SET); - - readbuf = emalloc (lp->width+1); - if (fread(readbuf, lp->width, 1, fp) != 1) { - php_error(E_WARNING, "filePro: cannot read data: [%d] %s", - errno, strerror(errno)); - efree(readbuf); - fclose(fp); - RETURN_FALSE; - } - readbuf[lp->width] = '\0'; - fclose(fp); - RETURN_STRING(readbuf, 0); -} -/* }}} */ - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/filepro/filepro.dsp b/ext/filepro/filepro.dsp deleted file mode 100644 index 441b14e592f..00000000000 --- a/ext/filepro/filepro.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="filepro" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=filepro - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "filepro.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "filepro.mak" CFG="filepro - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "filepro - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "filepro - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "filepro - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FILEPRO_EXPORTS" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FILEPRO=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_filepro.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "filepro - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FILEPRO_EXPORTS" /D "COMPILE_DL_FILEPRO" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FILEPRO=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.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 php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_filepro.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "filepro - Win32 Release_TS" -# Name "filepro - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\filepro.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_filepro.h -# End Source File -# End Group -# End Target -# End Project diff --git a/ext/filepro/php_filepro.h b/ext/filepro/php_filepro.h deleted file mode 100644 index 84a0f0618b9..00000000000 --- a/ext/filepro/php_filepro.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Chad Robinson | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - filePro 4.x support developed by Chad Robinson, chadr@brttech.com - Contact Chad Robinson at BRT Technical Services Corp. for details. - filePro is a registered trademark by Fiserv, Inc. This file contains - no code or information that is not freely available from the filePro - web site at http://www.fileproplus.com/ -*/ - -#ifndef PHP_FILEPRO_H -#define PHP_FILEPRO_H -#if HAVE_FILEPRO -extern zend_module_entry filepro_module_entry; -#define phpext_filepro_ptr &filepro_module_entry - -PHP_FUNCTION(filepro); -PHP_FUNCTION(filepro_rowcount); -PHP_FUNCTION(filepro_fieldname); -PHP_FUNCTION(filepro_fieldtype); -PHP_FUNCTION(filepro_fieldwidth); -PHP_FUNCTION(filepro_fieldcount); -PHP_FUNCTION(filepro_retrieve); - -PHP_MINIT_FUNCTION(filepro); -PHP_MSHUTDOWN_FUNCTION(filepro); -#else -#define phpext_filepro_ptr NULL -#endif -#endif /* PHP_FILEPRO_H */ diff --git a/ext/fribidi/CREDITS b/ext/fribidi/CREDITS deleted file mode 100644 index d14739ac6e3..00000000000 --- a/ext/fribidi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FRIBIDI -Onn Ben-Zvi diff --git a/ext/fribidi/README b/ext/fribidi/README deleted file mode 100644 index db96b170a48..00000000000 --- a/ext/fribidi/README +++ /dev/null @@ -1,53 +0,0 @@ -Purpose -======= - -This extension is basically a wrapper for the FriBidi implementation -of the Unicode Bidi algorithm. The need for such an algorithm rises -from the bidirectional language usage done by applications. -Arabic/Hebrew embedded within English is such a case. - -Usage -===== - - The only function used is fribidi_log2vis (logical to visual). - Input: 1) The Logical string. - 2) Base direction of application - 'L' or 'R'. - 3) The char code being used, which can be one of the following - constants: - a) FRIBIDI_CHARSET_UTF8 - b) FRIBIDI_CHARSET_8859_6 - c) FRIBIDI_CHARSET_8859_8 - d) FRIBIDI_CHARSET_CP1255 - e) FRIBIDI_CHARSET_CP1256 - f) FRIBIDI_CHARSET_ISIRI_3342 - -Note: Currently, FriBidi supports the above Character Codes alone. - - Output: A Visual string. - - -Compiling -=========== -1) Static - ./configure --with-fribidi=base-directory-of-FriBidi-installation-path - (defaults to /usr/local). - -2) dl - same, just add shared, to get .... --with-fribidi=shared,base.... - -Prerequisites -============= -1) FriBidi version 0.9.0 or later must be installed. Latest version can be obtained thru - http://fribidi.sourceforge.net/ - -2) glib header files: glib.h and glibconfig.h. - -Note -===== - -The function fribidi_log2vis computes three more arrays which are currently not passed back as output. -These arrays are: - 1) mapping from the logical to the visual sting. - 2) mapping from the visual to the logical string. - 3) embedding level of characters as figured out by the FriBidi algorithm. - -The extension needs further implementation to support this. -p.s. - If you don't understand this, you probably don't need it. diff --git a/ext/fribidi/config.m4 b/ext/fribidi/config.m4 deleted file mode 100644 index f0cee962ffc..00000000000 --- a/ext/fribidi/config.m4 +++ /dev/null @@ -1,79 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(fribidi, for FriBidi support, -[ --with-fribidi[=DIR] Include fribidi support (requires FriBidi >=0.1.12).]) - -if test "$PHP_FRIBIDI" != "no"; then - -dnl if module was requested with default path of fribidi installation then -dnl $PHP_FRIBIDI will be "yes" - - if test "$PHP_FRIBIDI" = "yes"; then - PHP_FRIBIDI=/usr/local - fi - - dnl check for fribidi header files - - AC_MSG_CHECKING([for header files in "$PHP_FRIBIDI/include/fribidi"]) - if test -f $PHP_FRIBIDI/include/fribidi/fribidi.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_types.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_char_sets.h; then - FRIBIDI_INCDIR=$PHP_FRIBIDI/include/fribidi/ - AC_MSG_RESULT([found all]) - else - AC_MSG_RESULT([missing]) - fi - - dnl check for fribidi shared library - - AC_MSG_CHECKING([for libfribidi.so file in "$PHP_FRIBIDI/lib/"]) - if test -f "$PHP_FRIBIDI/lib/libfribidi.so" ; then - FRIBIDI_LIBDIR=$PHP_FRIBIDI/lib/ - AC_MSG_RESULT([found]) - else - AC_MSG_RESULT([missing]) - fi - - dnl check for glib header files - - AC_MSG_CHECKING([for glibconfig.h in "usr/lib/glib/include/"]) - if test -f /usr/lib/glib/include/glibconfig.h ; then - AC_MSG_RESULT([found]) - GLIB_INCDIR=/usr/lib/glib/include/ - else - AC_MSG_RESULT([missing]) - fi - - - dnl check for fribidi version - AC_MSG_CHECKING([for FriBidi version]) - FRIBIDI_CONFIG=$PHP_FRIBIDI/bin/fribidi-config - if test -x $FRIBIDI_CONFIG; then - fribidi_version_full=`$FRIBIDI_CONFIG --version` - fi - - fribidi_version=`echo ${fribidi_version_full} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - - if test "$fribidi_version" -ge 9000; then - AC_MSG_RESULT([$fribidi_version_full]) - else - AC_MSG_ERROR(FriBidi version 0.9.0 or later is required to compile php with FriBidi support) - fi - - - AC_MSG_CHECKING([sanity to build extension]) - if test -n "$FRIBIDI_INCDIR" && test -n "$FRIBIDI_LIBDIR" && test -n "$GLIB_INCDIR"; then - - AC_MSG_RESULT([yes]) - - PHP_ADD_INCLUDE("$FRIBIDI_INCDIR") - PHP_ADD_INCLUDE("$GLIB_INCDIR") - PHP_ADD_LIBRARY_WITH_PATH(fribidi,"$FRIBIDI_LIBDIR", FRIBIDI_SHARED_LIBADD) - - AC_DEFINE(HAVE_FRIBIDI, 1, [ ]) - PHP_NEW_EXTENSION(fribidi, fribidi.c, $ext_shared) - PHP_SUBST(FRIBIDI_SHARED_LIBADD) - else - AC_MSG_RESULT([no]) - fi -fi diff --git a/ext/fribidi/fribidi.c b/ext/fribidi/fribidi.c deleted file mode 100755 index 3ddfba8ab16..00000000000 --- a/ext/fribidi/fribidi.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Onn Ben-Zvi | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_fribidi.h" -#include "fribidi.h" - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_FRIBIDI - -/* If you declare any globals in php_fribidi.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(fribidi) -*/ - -/* True global resources - no need for thread safety here */ -/* static int le_fribidi; */ - -/* Every user visible function must have an entry in fribidi_functions[]. -*/ -function_entry fribidi_functions[] = { - PHP_FE(fribidi_log2vis, NULL) - {NULL, NULL, NULL} /* Must be the last line in fribidi_functions[] */ -}; - -zend_module_entry fribidi_module_entry = { - STANDARD_MODULE_HEADER, - "fribidi", - fribidi_functions, - PHP_MINIT(fribidi), - PHP_MSHUTDOWN(fribidi), - NULL, - NULL, - PHP_MINFO(fribidi), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_FRIBIDI -ZEND_GET_MODULE(fribidi) -#endif - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(fribidi) -{ - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8", FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6", FRIBIDI_CHARSET_ISO8859_6, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8", FRIBIDI_CHARSET_ISO8859_8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1255", FRIBIDI_CHARSET_CP1255, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1256", FRIBIDI_CHARSET_CP1256, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_ISIRI_3342", FRIBIDI_CHARSET_ISIRI_3342, CONST_CS | CONST_PERSISTENT); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(fribidi) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(fribidi) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "fribidi support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/*--------------------------------------------------------------*/ -/* Name: fribidi_log2vis */ -/* Purpose: convert a logical string to a visual one */ -/* Input: 1) The logical string. */ -/* 2) Base direction - */ -/* Possible values: */ -/* a) "L" - base language is left to right. */ -/* b) "R" - base language is right to left. */ -/* c) empty - base language is determined */ -/* automatically by the FriBiDi algorithm */ -/* 3) Character code being used - */ -/* Possible values (i.e., char sets supported) */ -/* FRIBIDI_CHARSET_UTF8 */ -/* FRIBIDI_CHARSET_8859_6 */ -/* FRIBIDI_CHARSET_8859_8 */ -/* FRIBIDI_CHARSET_CP1255 */ -/* FRIBIDI_CHARSET_CP1256 */ -/* FRIBIDI_CHARSET_ISIRI_3342 */ -/* */ -/* Output: on success: The visual string. */ -/* on failure: */ -/*--------------------------------------------------------------*/ - -/* {{{ proto string fribidi_log2vis(string str, string direction, int charset) - Convert a logical string to a visual one */ -PHP_FUNCTION(fribidi_log2vis) -{ - zval **parameter1, **parameter2, **parameter3; - - - FriBidiChar *u_logical_str, *u_visual_str; /* unicode strings .... */ - char *inString; - guchar *outString; - int len, alloc_len, utf8_len; - - - FriBidiCharType base_dir; - - guint16 *position_L_to_V_list; - guint16 *position_V_to_L_list; - guint8 *embedding_level_list; - - /* get parameters from input */ - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, ¶meter1, ¶meter2, ¶meter3) == FAILURE) { - WRONG_PARAM_COUNT; - } - - /* convert input to expected type.... */ - - convert_to_string_ex(parameter1); - convert_to_string_ex(parameter2); - convert_to_long_ex(parameter3); - - /* allocate space and prepare all local variables */ - - - len = Z_STRLEN_PP(parameter1); - - inString = estrndup(Z_STRVAL_PP(parameter1), len); - - alloc_len = len+1; - - u_logical_str = (FriBidiChar*) emalloc(sizeof(FriBidiChar)*alloc_len); - u_visual_str = (FriBidiChar*) emalloc(sizeof(FriBidiChar)*alloc_len); - - position_L_to_V_list = (guint16*) emalloc(sizeof(guint16)*alloc_len); - position_V_to_L_list = (guint16*) emalloc(sizeof(guint16)*alloc_len); - embedding_level_list = (guint8*) emalloc(sizeof(guint8)*alloc_len); - - outString = (guchar*)emalloc(sizeof(guchar)*alloc_len); - - if(inString[len-1] == '\n') { - inString[len-1] = '\0'; - } - - switch(Z_LVAL_PP(parameter3)) { - case FRIBIDI_CHARSET_UTF8: - utf8_len=fribidi_utf8_to_unicode(inString, u_logical_str); - break; - case FRIBIDI_CHARSET_ISO8859_6: - fribidi_iso8859_6_to_unicode(inString, u_logical_str); - break; - case FRIBIDI_CHARSET_ISO8859_8: - fribidi_iso8859_8_to_unicode(inString, u_logical_str); - break; - case FRIBIDI_CHARSET_CP1255: - fribidi_cp1255_to_unicode(inString, u_logical_str); - break; - case FRIBIDI_CHARSET_CP1256: - fribidi_cp1256_to_unicode(inString, u_logical_str); - break; - case FRIBIDI_CHARSET_ISIRI_3342: - fribidi_isiri_3342_to_unicode(inString, u_logical_str); - break; - default: - zend_error(E_ERROR,"unknown character set %d
", Z_LVAL_PP(parameter3)); - } - - - /* visualize the logical.... */ - - if ((Z_STRVAL_PP(parameter2))[0] == 'R') { - base_dir = FRIBIDI_TYPE_RTL; - } else if (Z_STRVAL_PP(parameter2)[0] == 'L') - base_dir = FRIBIDI_TYPE_LTR; - else - base_dir = FRIBIDI_TYPE_N; - - fribidi_log2vis(u_logical_str, len, &base_dir, u_visual_str, position_L_to_V_list, position_V_to_L_list, embedding_level_list); - - /* convert back to original char set */ - - switch(Z_LVAL_PP(parameter3)) { - case FRIBIDI_CHARSET_UTF8: - fribidi_unicode_to_utf8(u_visual_str, utf8_len , outString); - break; - case FRIBIDI_CHARSET_ISO8859_6: - fribidi_unicode_to_iso8859_6(u_visual_str, len , outString); - break; - case FRIBIDI_CHARSET_ISO8859_8: - fribidi_unicode_to_iso8859_8(u_visual_str, len , outString); - break; - case FRIBIDI_CHARSET_CP1255: - fribidi_unicode_to_cp1255(u_visual_str, len , outString); - break; - case FRIBIDI_CHARSET_CP1256: - fribidi_unicode_to_cp1256(u_visual_str, len , outString); - break; - case FRIBIDI_CHARSET_ISIRI_3342: - fribidi_unicode_to_isiri_3342(u_visual_str, len , outString); - break; - default: - zend_error(E_ERROR,"unknown character set %d
", Z_LVAL_PP(parameter3)); - } - - - efree(u_logical_str); - efree(u_visual_str); - - efree(position_L_to_V_list); - efree(position_V_to_L_list); - efree(embedding_level_list); - - RETURN_STRING(outString, 1); -} -/* }}} */ - - -#endif /* HAVE_FRIBIDI */ - -/* - * 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/fribidi/fribidi.php b/ext/fribidi/fribidi.php deleted file mode 100644 index 6a603d604ed..00000000000 --- a/ext/fribidi/fribidi.php +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/ext/fribidi/php_fribidi.h b/ext/fribidi/php_fribidi.h deleted file mode 100644 index d0498b99ea2..00000000000 --- a/ext/fribidi/php_fribidi.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Onn Ben-Zvi | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_FRIBIDI_H -#define PHP_FRIBIDI_H - -#if HAVE_FRIBIDI - -#include "fribidi.h" -#include "../standard/info.h" - -extern zend_module_entry fribidi_module_entry; -#define phpext_fribidi_ptr &fribidi_module_entry - - -typedef struct _php_fribidi_rsrc{ - guint16 *position_L_to_V_list; - guint16 *position_V_to_L_list; - guint8 *embedding_level_list; - guchar *out_string; -} php_fribidi_rsrc; - - -#ifdef PHP_WIN32 -#define PHP_FRIBIDI_API __declspec(dllexport) -#else -#define PHP_FRIBIDI_API -#endif - -PHP_MINIT_FUNCTION(fribidi); -PHP_MSHUTDOWN_FUNCTION(fribidi); -PHP_RINIT_FUNCTION(fribidi); -PHP_RSHUTDOWN_FUNCTION(fribidi); -PHP_MINFO_FUNCTION(fribidi); - -ZEND_FUNCTION(fribidi_log2vis); -/*void php_fribidi_free_rsrc(php_fribidi_rsrc* p_rsrc);*/ -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(fribidi) - int global_variable; -ZEND_END_MODULE_GLOBALS(fribidi) -*/ - -/* In every function that needs to use variables in php_fribidi_globals, - do call FRIBIDILS_FETCH(); after declaring other variables used by - that function, and always refer to them as FRIBIDIG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define FRIBIDIG(v) TSRMG(fribidi_globals_id, php_fribidi_globals *, v) -#else -#define FRIBIDIG(v) (fribidi_globals.v) -#endif - -#else - -#define phpext_fribidi_ptr NULL - -#endif - -#endif /* PHP_FRIBIDI_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/ftp/CREDITS b/ext/ftp/CREDITS deleted file mode 100644 index fdaf681c21c..00000000000 --- a/ext/ftp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FTP -Andrew Skalski diff --git a/ext/ftp/config.m4 b/ext/ftp/config.m4 deleted file mode 100644 index 3b5f3fd6419..00000000000 --- a/ext/ftp/config.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ftp,whether to enable FTP support, -[ --enable-ftp Enable FTP support]) - -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) -fi diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c deleted file mode 100644 index c3a78185340..00000000000 --- a/ext/ftp/ftp.c +++ /dev/null @@ -1,1287 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Andrew Skalski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if HAVE_FTP - -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef PHP_WIN32 -#include -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#include -#include -#endif -#include - -#if HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#include "ftp.h" -#include "ext/standard/fsock.h" - -/* sends an ftp command, returns true on success, false on error. - * it sends the string "cmd args\r\n" if args is non-null, or - * "cmd\r\n" if args is null - */ -static int ftp_putcmd( ftpbuf_t *ftp, - const char *cmd, - const char *args); - -/* wrapper around send/recv to handle timeouts */ -static int my_send(ftpbuf_t *ftp, int s, void *buf, size_t len); -static int my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len); -static int my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, - int *addrlen); - -/* reads a line the socket , returns true on success, false on error */ -static int ftp_readline(ftpbuf_t *ftp); - -/* reads an ftp response, returns true on success, false on error */ -static int ftp_getresp(ftpbuf_t *ftp); - -/* sets the ftp transfer type */ -static int ftp_type(ftpbuf_t *ftp, ftptype_t type); - -/* opens up a data stream */ -static databuf_t* ftp_getdata(ftpbuf_t *ftp); - -/* accepts the data connection, returns updated data buffer */ -static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp); - -/* closes the data connection, returns NULL */ -static databuf_t* data_close(databuf_t *data); - -/* generic file lister */ -static char** ftp_genlist(ftpbuf_t *ftp, - const char *cmd, const char *path); - -/* IP and port conversion box */ -union ipbox { - unsigned long l[2]; - unsigned short s[4]; - unsigned char c[8]; -}; - -/* {{{ ftp_open - */ -ftpbuf_t* -ftp_open(const char *host, short port, long timeout_sec) -{ - ftpbuf_t *ftp; - int size; - - - /* alloc the ftp structure */ - ftp = calloc(1, sizeof(*ftp)); - if (ftp == NULL) { - perror("calloc"); - return NULL; - } - - ftp->fd = php_hostconnect(host, (unsigned short) (port ? port : 21), SOCK_STREAM, (int) timeout_sec); - if (ftp->fd == -1) { - goto bail; - } - - /* Default Settings */ - ftp->timeout_sec = timeout_sec; - - size = sizeof(ftp->localaddr); - memset(&ftp->localaddr, 0, size); - if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) { - perror("getsockname"); - goto bail; - } - - if (!ftp_getresp(ftp) || ftp->resp != 220) { - goto bail; - } - - return ftp; - -bail: - if (ftp->fd != -1) - closesocket(ftp->fd); - free(ftp); - return NULL; -} -/* }}} */ - -/* {{{ ftp_close - */ -ftpbuf_t* -ftp_close(ftpbuf_t *ftp) -{ - if (ftp == NULL) - return NULL; - if (ftp->fd != -1) - closesocket(ftp->fd); - ftp_gc(ftp); - free(ftp); - return NULL; -} -/* }}} */ - -/* {{{ ftp_gc - */ -void -ftp_gc(ftpbuf_t *ftp) -{ - if (ftp == NULL) - return; - - free(ftp->pwd); - ftp->pwd = NULL; - free(ftp->syst); - ftp->syst = NULL; -} -/* }}} */ - -/* {{{ ftp_quit - */ -int -ftp_quit(ftpbuf_t *ftp) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "QUIT", NULL)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 221) - return 0; - - free(ftp->pwd); - ftp->pwd = NULL; - - return 1; -} -/* }}} */ - -/* {{{ ftp_login - */ -int -ftp_login(ftpbuf_t *ftp, const char *user, const char *pass) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "USER", user)) - return 0; - if (!ftp_getresp(ftp)) - return 0; - if (ftp->resp == 230) - return 1; - if (ftp->resp != 331) - return 0; - if (!ftp_putcmd(ftp, "PASS", pass)) - return 0; - if (!ftp_getresp(ftp)) - return 0; - return (ftp->resp == 230); -} -/* }}} */ - -/* {{{ ftp_reinit - */ -int -ftp_reinit(ftpbuf_t *ftp) -{ - if (ftp == NULL) - return 0; - - ftp_gc(ftp); - - if (!ftp_putcmd(ftp, "REIN", NULL)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 220) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_syst - */ -const char* -ftp_syst(ftpbuf_t *ftp) -{ - char *syst, *end; - - if (ftp == NULL) - return NULL; - - /* default to cached value */ - if (ftp->syst) - return ftp->syst; - - if (!ftp_putcmd(ftp, "SYST", NULL)) - return NULL; - if (!ftp_getresp(ftp) || ftp->resp != 215) - return NULL; - - syst = ftp->inbuf; - if ((end = strchr(syst, ' '))) - *end = 0; - ftp->syst = strdup(syst); - if (end) - *end = ' '; - - return ftp->syst; -} -/* }}} */ - -/* {{{ ftp_pwd - */ -const char* -ftp_pwd(ftpbuf_t *ftp) -{ - char *pwd, *end; - - if (ftp == NULL) - return NULL; - - /* default to cached value */ - if (ftp->pwd) - return ftp->pwd; - - if (!ftp_putcmd(ftp, "PWD", NULL)) - return NULL; - if (!ftp_getresp(ftp) || ftp->resp != 257) - return NULL; - - /* copy out the pwd from response */ - if ((pwd = strchr(ftp->inbuf, '"')) == NULL) - return NULL; - end = strrchr(++pwd, '"'); - *end = 0; - ftp->pwd = strdup(pwd); - *end = '"'; - - return ftp->pwd; -} -/* }}} */ - -/* {{{ ftp_exec - */ -int -ftp_exec(ftpbuf_t *ftp, const char *cmd) -{ - if (ftp == NULL) - return 0; - if (!ftp_putcmd(ftp, "SITE EXEC", cmd)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 200) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_chdir - */ -int -ftp_chdir(ftpbuf_t *ftp, const char *dir) -{ - if (ftp == NULL) - return 0; - - free(ftp->pwd); - ftp->pwd = NULL; - - if (!ftp_putcmd(ftp, "CWD", dir)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 250) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_cdup - */ -int -ftp_cdup(ftpbuf_t *ftp) -{ - if (ftp == NULL) - return 0; - - free(ftp->pwd); - ftp->pwd = NULL; - - if (!ftp_putcmd(ftp, "CDUP", NULL)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 250) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_mkdir - */ -char* -ftp_mkdir(ftpbuf_t *ftp, const char *dir) -{ - char *mkd, *end; - - if (ftp == NULL) - return NULL; - - if (!ftp_putcmd(ftp, "MKD", dir)) - return NULL; - if (!ftp_getresp(ftp) || ftp->resp != 257) - return NULL; - - /* copy out the dir from response */ - if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { - mkd = strdup(dir); - return mkd; - } - - end = strrchr(++mkd, '"'); - *end = 0; - mkd = strdup(mkd); - *end = '"'; - - return mkd; -} -/* }}} */ - -/* {{{ ftp_rmdir - */ -int -ftp_rmdir(ftpbuf_t *ftp, const char *dir) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "RMD", dir)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 250) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_nlist - */ -char** -ftp_nlist(ftpbuf_t *ftp, const char *path) -{ - return ftp_genlist(ftp, "NLST", path); -} -/* }}} */ - -/* {{{ ftp_list - */ -char** -ftp_list(ftpbuf_t *ftp, const char *path) -{ - return ftp_genlist(ftp, "LIST", path); -} -/* }}} */ - -/* {{{ ftp_type - */ -int -ftp_type(ftpbuf_t *ftp, ftptype_t type) -{ - char typechar[2] = "?"; - - if (ftp == NULL) - return 0; - - if (type == Z_TYPE_P(ftp)) - return 1; - - if (type == FTPTYPE_ASCII) - typechar[0] = 'A'; - else if (type == FTPTYPE_IMAGE) - typechar[0] = 'I'; - else - return 0; - - if (!ftp_putcmd(ftp, "TYPE", typechar)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 200) - return 0; - - Z_TYPE_P(ftp) = type; - - return 1; -} -/* }}} */ - -/* {{{ ftp_pasv - */ -int -ftp_pasv(ftpbuf_t *ftp, int pasv) -{ - char *ptr; - union ipbox ipbox; - unsigned long b[6]; - int n; - struct sockaddr *sa; - struct sockaddr_in *sin; - - if (ftp == NULL) - return 0; - - if (pasv && ftp->pasv == 2) - return 1; - - ftp->pasv = 0; - if (!pasv) - return 1; - - n = sizeof(ftp->pasvaddr); - memset(&ftp->pasvaddr, 0, n); - sa = (struct sockaddr *) &ftp->pasvaddr; - -#ifdef HAVE_IPV6 - if (getpeername(ftp->fd, sa, &n) < 0) - return 0; - - if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; - char *endptr, delimiter; - - /* try EPSV first */ - if (!ftp_putcmd(ftp, "EPSV", NULL)) - return 0; - if (!ftp_getresp(ftp)) - return 0; - - if (ftp->resp == 229) { - /* parse out the port */ - for (ptr = ftp->inbuf; *ptr && *ptr != '('; ptr++); - if (!*ptr) - return 0; - delimiter = *++ptr; - for (n = 0; *ptr && n < 3; ptr++) { - if (*ptr == delimiter) - n++; - } - - sin6->sin6_port = htons((unsigned short) strtol(ptr, &endptr, 10)); - if (ptr == endptr || *endptr != delimiter) - return 0; - - ftp->pasv = 2; - return 1; - } - } - - /* fall back to PASV */ -#endif - - if (!ftp_putcmd(ftp, "PASV", NULL)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 227) - return 0; - - /* parse out the IP and port */ - for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); - n = sscanf(ptr, "%lu,%lu,%lu,%lu,%lu,%lu", - &b[0], &b[1], &b[2], &b[3], &b[4], &b[5]); - if (n != 6) - return 0; - - for (n=0; n<6; n++) - ipbox.c[n] = (unsigned char) b[n]; - - sin = (struct sockaddr_in *) sa; - sin->sin_family = AF_INET; - sin->sin_addr.s_addr = ipbox.l[0]; - sin->sin_port = ipbox.s[2]; - - ftp->pasv = 2; - - return 1; -} -/* }}} */ - -/* {{{ ftp_get - */ -int -ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type) -{ - databuf_t *data = NULL; - char *ptr; - int lastch; - int rcvd; - - if (ftp == NULL) - return 0; - - if (!ftp_type(ftp, type)) { - goto bail; - } - - if ((data = ftp_getdata(ftp)) == NULL) { - goto bail; - } - - if (!ftp_putcmd(ftp, "RETR", path)) { - goto bail; - } - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { - goto bail; - } - - if ((data = data_accept(data, ftp)) == NULL) { - goto bail; - } - - lastch = 0; - while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { - goto bail; - } - - if (type == FTPTYPE_ASCII) { - for (ptr = data->buf; rcvd; rcvd--, ptr++) { - if (lastch == '\r' && *ptr != '\n') - php_stream_putc(outstream, '\r'); - if (*ptr != '\r') - php_stream_putc(outstream, *ptr); - lastch = *ptr; - } - } - else { - php_stream_write(outstream, data->buf, rcvd); - } - } - - if (type == FTPTYPE_ASCII && lastch == '\r') - php_stream_putc(outstream, '\r'); - - data = data_close(data); - - if (php_stream_error(outstream)) { - goto bail; - } - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - goto bail; - } - - return 1; -bail: - data_close(data); - return 0; -} -/* }}} */ - -/* {{{ ftp_put - */ -int -ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type) -{ - databuf_t *data = NULL; - int size; - char *ptr; - int ch; - - if (ftp == NULL) - return 0; - - if (!ftp_type(ftp, type)) - goto bail; - - if ((data = ftp_getdata(ftp)) == NULL) - goto bail; - - if (!ftp_putcmd(ftp, "STOR", path)) - goto bail; - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) - goto bail; - - if ((data = data_accept(data, ftp)) == NULL) - goto bail; - - size = 0; - ptr = data->buf; - while ((ch = php_stream_getc(instream))!=EOF && !php_stream_eof(instream)) { - /* flush if necessary */ - if (FTP_BUFSIZE - size < 2) { - if (my_send(ftp, data->fd, data->buf, size) != size) - goto bail; - ptr = data->buf; - size = 0; - } - - if (ch == '\n' && type == FTPTYPE_ASCII) { - *ptr++ = '\r'; - size++; - } - - *ptr++ = ch; - size++; - } - - if (size && my_send(ftp, data->fd, data->buf, size) != size) - goto bail; - - if (php_stream_error(instream)) - goto bail; - - data = data_close(data); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) - goto bail; - - return 1; -bail: - data_close(data); - return 0; -} -/* }}} */ - -/* {{{ ftp_size - */ -int -ftp_size(ftpbuf_t *ftp, const char *path) -{ - if (ftp == NULL) - return -1; - - if (!ftp_putcmd(ftp, "SIZE", path)) - return -1; - if (!ftp_getresp(ftp) || ftp->resp != 213) - return -1; - - return atoi(ftp->inbuf); -} -/* }}} */ - -/* {{{ ftp_mdtm - */ -time_t -ftp_mdtm(ftpbuf_t *ftp, const char *path) -{ - time_t stamp; - struct tm *gmt, tmbuf; - struct tm tm; - char *ptr; - int n; - - if (ftp == NULL) - return -1; - - if (!ftp_putcmd(ftp, "MDTM", path)) - return -1; - if (!ftp_getresp(ftp) || ftp->resp != 213) - return -1; - - /* parse out the timestamp */ - for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); - n = sscanf(ptr, "%4u%2u%2u%2u%2u%2u", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, - &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (n != 6) - return -1; - tm.tm_year -= 1900; - tm.tm_mon--; - tm.tm_isdst = -1; - - /* figure out the GMT offset */ - stamp = time(NULL); - gmt = php_gmtime_r(&stamp, &tmbuf); - gmt->tm_isdst = -1; - - /* apply the GMT offset */ - tm.tm_sec += stamp - mktime(gmt); - tm.tm_isdst = gmt->tm_isdst; - - stamp = mktime(&tm); - - return stamp; -} -/* }}} */ - -/* {{{ ftp_delete - */ -int -ftp_delete(ftpbuf_t *ftp, const char *path) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "DELE", path)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 250) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_rename - */ -int -ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "RNFR", src)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 350) - return 0; - - if (!ftp_putcmd(ftp, "RNTO", dest)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp != 250) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_site - */ -int -ftp_site(ftpbuf_t *ftp, const char *cmd) -{ - if (ftp == NULL) - return 0; - - if (!ftp_putcmd(ftp, "SITE", cmd)) - return 0; - if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) - return 0; - - return 1; -} -/* }}} */ - -/* static functions */ - -/* {{{ ftp_putcmd - */ -int -ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) -{ - int size; - char *data; - - /* build the output buffer */ - if (args && args[0]) { - /* "cmd args\r\n\0" */ - if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) - return 0; - size = sprintf(ftp->outbuf, "%s %s\r\n", cmd, args); - } - else { - /* "cmd\r\n\0" */ - if (strlen(cmd) + 3 > FTP_BUFSIZE) - return 0; - size = sprintf(ftp->outbuf, "%s\r\n", cmd); - } - - data = ftp->outbuf; - if (my_send(ftp, ftp->fd, data, size) != size) - return 0; - - return 1; -} -/* }}} */ - -/* {{{ ftp_readline - */ -int -ftp_readline(ftpbuf_t *ftp) -{ - int size, rcvd; - char *data, *eol; - - /* shift the extra to the front */ - size = FTP_BUFSIZE; - rcvd = 0; - if (ftp->extra) { - memmove(ftp->inbuf, ftp->extra, ftp->extralen); - rcvd = ftp->extralen; - } - - data = ftp->inbuf; - - do { - size -= rcvd; - for (eol = data; rcvd; rcvd--, eol++) { - if (*eol == '\r') { - *eol = 0; - ftp->extra = eol + 1; - if (rcvd > 1 && *(eol + 1) == '\n') { - ftp->extra++; - rcvd--; - } - if ((ftp->extralen = --rcvd) == 0) - ftp->extra = NULL; - return 1; - } - else if (*eol == '\n') { - *eol = 0; - ftp->extra = eol + 1; - if ((ftp->extralen = --rcvd) == 0) - ftp->extra = NULL; - return 1; - } - } - - data = eol; - if ((rcvd = my_recv(ftp, ftp->fd, data, size)) < 1) { - return 0; - } - } while (size); - - return 0; -} -/* }}} */ - -/* {{{ ftp_getresp - */ -int -ftp_getresp(ftpbuf_t *ftp) -{ - char *buf; - - if (ftp == NULL) return 0; - buf = ftp->inbuf; - ftp->resp = 0; - - while (1) { - - if (!ftp_readline(ftp)) { - return 0; - } - - /* Break out when the end-tag is found */ - if (isdigit(ftp->inbuf[0]) && - isdigit(ftp->inbuf[1]) && - isdigit(ftp->inbuf[2]) && - ftp->inbuf[3] == ' ') { - break; - } - } - - /* translate the tag */ - if (!isdigit(ftp->inbuf[0]) || - !isdigit(ftp->inbuf[1]) || - !isdigit(ftp->inbuf[2])) - { - return 0; - } - - ftp->resp = 100 * (ftp->inbuf[0] - '0') + - 10 * (ftp->inbuf[1] - '0') + - (ftp->inbuf[2] - '0'); - - memmove(ftp->inbuf, ftp->inbuf + 4, FTP_BUFSIZE - 4); - - return 1; -} -/* }}} */ - -/* {{{ my_send - */ -int -my_send(ftpbuf_t *ftp, int s, void *buf, size_t len) -{ - fd_set write_set; - struct timeval tv; - int n, size, sent; - - size = len; - while (size) { - tv.tv_sec = ftp->timeout_sec; - tv.tv_usec = 0; - - FD_ZERO(&write_set); - FD_SET(s, &write_set); - n = select(s + 1, NULL, &write_set, NULL, &tv); - if (n < 1) { -#ifndef PHP_WIN32 - if (n == 0) - errno = ETIMEDOUT; -#endif - return -1; - } - - sent = send(s, buf, size, 0); - if (sent == -1) - return -1; - - buf = (char*) buf + sent; - size -= sent; - } - - return len; -} -/* }}} */ - -/* {{{ my_recv - */ -int -my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len) -{ - fd_set read_set; - struct timeval tv; - int n; - - tv.tv_sec = ftp->timeout_sec; - tv.tv_usec = 0; - - FD_ZERO(&read_set); - FD_SET(s, &read_set); - n = select(s + 1, &read_set, NULL, NULL, &tv); - if (n < 1) { -#ifndef PHP_WIN32 - if (n == 0) - errno = ETIMEDOUT; -#endif - return -1; - } - - return recv(s, buf, len, 0); -} -/* }}} */ - -/* {{{ my_accept - */ -int -my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, int *addrlen) -{ - fd_set accept_set; - struct timeval tv; - int n; - - tv.tv_sec = ftp->timeout_sec; - tv.tv_usec = 0; - FD_ZERO(&accept_set); - FD_SET(s, &accept_set); - - n = select(s + 1, &accept_set, NULL, NULL, &tv); - if (n < 1) { -#ifndef PHP_WIN32 - if (n == 0) - errno = ETIMEDOUT; -#endif - return -1; - } - - return accept(s, addr, addrlen); -} -/* }}} */ - -/* {{{ ftp_getdata - */ -databuf_t* -ftp_getdata(ftpbuf_t *ftp) -{ - int fd = -1; - databuf_t *data; - php_sockaddr_storage addr; - struct sockaddr *sa; - int size; - union ipbox ipbox; - char arg[sizeof("255, 255, 255, 255, 255, 255")]; - struct timeval tv; - - - /* ask for a passive connection if we need one */ - if (ftp->pasv && !ftp_pasv(ftp, 1)) - return NULL; - - /* alloc the data structure */ - data = calloc(1, sizeof(*data)); - if (data == NULL) { - perror("calloc"); - return NULL; - } - data->listener = -1; - data->fd = -1; - Z_TYPE_P(data) = Z_TYPE_P(ftp); - - sa = (struct sockaddr *) &ftp->localaddr; - /* bind/listen */ - if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) { - perror("socket"); - goto bail; - } - - /* passive connection handler */ - if (ftp->pasv) { - /* clear the ready status */ - ftp->pasv = 1; - - /* connect */ - /* Win 95/98 seems not to like size > sizeof(sockaddr_in) */ - size = php_sockaddr_size(&ftp->pasvaddr); - tv.tv_sec = ftp->timeout_sec; - tv.tv_usec = 0; - if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) { - perror("connect"); - goto bail; - } - - data->fd = fd; - - return data; - } - - - /* active (normal) connection */ - - /* bind to a local address */ - php_any_addr(sa->sa_family, &addr, 0); - size = php_sockaddr_size(&addr); - - if (bind(fd, (struct sockaddr*) &addr, size) == -1) { - perror("bind"); - goto bail; - } - - if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) { - perror("getsockname"); - goto bail; - } - - if (listen(fd, 5) == -1) { - perror("listen"); - goto bail; - } - - data->listener = fd; - -#ifdef HAVE_IPV6 - if (sa->sa_family == AF_INET6) { - /* need to use EPRT */ - char eprtarg[INET6_ADDRSTRLEN + sizeof("|x||xxxxx|")]; - char out[INET6_ADDRSTRLEN]; - inet_ntop(AF_INET6, &((struct sockaddr_in6*) sa)->sin6_addr, out, sizeof(out)); - sprintf(eprtarg, "|2|%s|%hu|", out, ntohs(((struct sockaddr_in6 *) &addr)->sin6_port)); - - if (!ftp_putcmd(ftp, "EPRT", eprtarg)) - goto bail; - - if (!ftp_getresp(ftp) || ftp->resp != 200) - goto bail; - - return data; - } -#endif - - /* send the PORT */ - ipbox.l[0] = ((struct sockaddr_in*) sa)->sin_addr.s_addr; - ipbox.s[2] = ((struct sockaddr_in*) &addr)->sin_port; - sprintf(arg, "%u,%u,%u,%u,%u,%u", - ipbox.c[0], ipbox.c[1], ipbox.c[2], ipbox.c[3], - ipbox.c[4], ipbox.c[5]); - - if (!ftp_putcmd(ftp, "PORT", arg)) - goto bail; - if (!ftp_getresp(ftp) || ftp->resp != 200) - goto bail; - - return data; - -bail: - if (fd != -1) - closesocket(fd); - free(data); - return NULL; -} -/* }}} */ - -/* {{{ data_accept - */ -databuf_t* -data_accept(databuf_t *data, ftpbuf_t *ftp) -{ - php_sockaddr_storage addr; - int size; - - if (data->fd != -1) - return data; - - size = sizeof(addr); - data->fd = my_accept(ftp, data->listener, (struct sockaddr*) &addr, &size); - closesocket(data->listener); - data->listener = -1; - - if (data->fd == -1) { - free(data); - return NULL; - } - - return data; -} -/* }}} */ - -/* {{{ data_close - */ -databuf_t* -data_close(databuf_t *data) -{ - if (data == NULL) - return NULL; - if (data->listener != -1) - closesocket(data->listener); - if (data->fd != -1) - closesocket(data->fd); - free(data); - return NULL; -} -/* }}} */ - -/* {{{ ftp_genlist - */ -char** -ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path) -{ - FILE *tmpfp = NULL; - databuf_t *data = NULL; - char *ptr; - int ch, lastch; - int size, rcvd; - int lines; - char **ret = NULL; - char **entry; - char *text; - - - if ((tmpfp = tmpfile()) == NULL) - return NULL; - - if (!ftp_type(ftp, FTPTYPE_ASCII)) - goto bail; - - if ((data = ftp_getdata(ftp)) == NULL) - goto bail; - - if (!ftp_putcmd(ftp, cmd, path)) - goto bail; - if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) - goto bail; - - /* pull data buffer into tmpfile */ - if ((data = data_accept(data, ftp)) == NULL) - goto bail; - - size = 0; - lines = 0; - lastch = 0; - while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) - goto bail; - - fwrite(data->buf, rcvd, 1, tmpfp); - - size += rcvd; - for (ptr = data->buf; rcvd; rcvd--, ptr++) { - if (*ptr == '\n' && lastch == '\r') - lines++; - else - size++; - lastch = *ptr; - } - } - - data = data_close(data); - - if (ferror(tmpfp)) - goto bail; - - - - rewind(tmpfp); - - ret = malloc((lines + 1) * sizeof(char**) + size * sizeof(char*)); - if (ret == NULL) { - perror("malloc"); - goto bail; - } - - entry = ret; - text = (char*) (ret + lines + 1); - *entry = text; - lastch = 0; - while ((ch = getc(tmpfp)) != EOF) { - if (ch == '\n' && lastch == '\r') { - *(text - 1) = 0; - *++entry = text; - } - else { - *text++ = ch; - } - lastch = ch; - } - *entry = NULL; - - if (ferror(tmpfp)) - goto bail; - - fclose(tmpfp); - - if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { - free(ret); - return NULL; - } - - return ret; -bail: - data_close(data); - fclose(tmpfp); - free(ret); - return NULL; -} -/* }}} */ - -#endif /* HAVE_FTP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h deleted file mode 100644 index b201045f9bd..00000000000 --- a/ext/ftp/ftp.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrew Skalski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef FTP_H -#define FTP_H - -#include "php_network.h" - -#include -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#define FTP_DEFAULT_TIMEOUT 90 - -/* XXX this should be configurable at runtime XXX */ -#define FTP_BUFSIZE 4096 - -typedef enum ftptype { - FTPTYPE_ASCII, - FTPTYPE_IMAGE -} ftptype_t; - -typedef struct ftpbuf -{ - int fd; /* control connection */ - php_sockaddr_storage localaddr; /* local address */ - int resp; /* last response code */ - char inbuf[FTP_BUFSIZE]; /* last response text */ - char *extra; /* extra characters */ - int extralen; /* number of extra chars */ - char outbuf[FTP_BUFSIZE]; /* command output buffer */ - char *pwd; /* cached pwd */ - char *syst; /* cached system type */ - ftptype_t type; /* current transfer type */ - int pasv; /* 0=off; 1=pasv; 2=ready */ - php_sockaddr_storage pasvaddr; /* passive mode address */ - long timeout_sec; /* User configureable timeout (seconds) */ -} ftpbuf_t; - -typedef struct databuf -{ - int listener; /* listener socket */ - int fd; /* data connection */ - ftptype_t type; /* transfer type */ - char buf[FTP_BUFSIZE]; /* data buffer */ -} databuf_t; - - -/* open a FTP connection, returns ftpbuf (NULL on error) - * port is the ftp port in network byte order, or 0 for the default - */ -ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec); - -/* quits from the ftp session (it still needs to be closed) - * return true on success, false on error - */ -int ftp_quit(ftpbuf_t *ftp); - -/* frees up any cached data held in the ftp buffer */ -void ftp_gc(ftpbuf_t *ftp); - -/* close the FTP connection and return NULL */ -ftpbuf_t* ftp_close(ftpbuf_t *ftp); - -/* logs into the FTP server, returns true on success, false on error */ -int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass); - -/* reinitializes the connection, returns true on success, false on error */ -int ftp_reinit(ftpbuf_t *ftp); - -/* returns the remote system type (NULL on error) */ -const char* ftp_syst(ftpbuf_t *ftp); - -/* returns the present working directory (NULL on error) */ -const char* ftp_pwd(ftpbuf_t *ftp); - -/* exec a command [special features], return true on success, false on error */ -int ftp_exec(ftpbuf_t *ftp, const char *cmd); - -/* changes directories, return true on success, false on error */ -int ftp_chdir(ftpbuf_t *ftp, const char *dir); - -/* changes to parent directory, return true on success, false on error */ -int ftp_cdup(ftpbuf_t *ftp); - -/* creates a directory, return the directory name on success, NULL on error. - * the return value must be freed - */ -char* ftp_mkdir(ftpbuf_t *ftp, const char *dir); - -/* removes a directory, return true on success, false on error */ -int ftp_rmdir(ftpbuf_t *ftp, const char *dir); - -/* returns a NULL-terminated array of filenames in the given path - * or NULL on error. the return array must be freed (but don't - * free the array elements) - */ -char** ftp_nlist(ftpbuf_t *ftp, const char *path); - -/* returns a NULL-terminated array of lines returned by the ftp - * LIST command for the given path or NULL on error. the return - * array must be freed (but don't - * free the array elements) - */ -char** ftp_list(ftpbuf_t *ftp, const char *path); - -/* switches passive mode on or off - * returns true on success, false on error - */ -int ftp_pasv(ftpbuf_t *ftp, int pasv); - -/* retrieves a file and saves its contents to outfp - * returns true on success, false on error - */ -int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, - ftptype_t type); - -/* stores the data from a file, socket, or process as a file on the remote server - * returns true on success, false on error - */ -int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type); - -/* returns the size of the given file, or -1 on error */ -int ftp_size(ftpbuf_t *ftp, const char *path); - -/* returns the last modified time of the given file, or -1 on error */ -time_t ftp_mdtm(ftpbuf_t *ftp, const char *path); - -/* renames a file on the server */ -int ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest); - -/* deletes the file from the server */ -int ftp_delete(ftpbuf_t *ftp, const char *path); - -/* sends a SITE command to the server */ -int ftp_site(ftpbuf_t *ftp, const char *cmd); - -#endif diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c deleted file mode 100644 index 1012698966a..00000000000 --- a/ext/ftp/php_ftp.c +++ /dev/null @@ -1,770 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andrew Skalski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" - -#if HAVE_FTP - -#include "ext/standard/info.h" -#include "ext/standard/file.h" - -#include "php_ftp.h" -#include "ftp.h" - -static int le_ftpbuf; -#define le_ftpbuf_name "FTP Buffer" - -function_entry php_ftp_functions[] = { - PHP_FE(ftp_connect, NULL) - PHP_FE(ftp_login, NULL) - PHP_FE(ftp_pwd, NULL) - PHP_FE(ftp_cdup, NULL) - PHP_FE(ftp_chdir, NULL) - PHP_FE(ftp_exec, NULL) - PHP_FE(ftp_mkdir, NULL) - PHP_FE(ftp_rmdir, NULL) - PHP_FE(ftp_nlist, NULL) - PHP_FE(ftp_rawlist, NULL) - PHP_FE(ftp_systype, NULL) - PHP_FE(ftp_pasv, NULL) - PHP_FE(ftp_get, NULL) - PHP_FE(ftp_fget, NULL) - PHP_FE(ftp_put, NULL) - PHP_FE(ftp_fput, NULL) - PHP_FE(ftp_size, NULL) - PHP_FE(ftp_mdtm, NULL) - PHP_FE(ftp_rename, NULL) - PHP_FE(ftp_delete, NULL) - PHP_FE(ftp_site, NULL) - PHP_FE(ftp_close, NULL) - PHP_FE(ftp_set_option, NULL) - PHP_FE(ftp_get_option, NULL) - PHP_FALIAS(ftp_quit, ftp_close, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry php_ftp_module_entry = { - STANDARD_MODULE_HEADER, - "ftp", - php_ftp_functions, - PHP_MINIT(ftp), - NULL, - NULL, - NULL, - PHP_MINFO(ftp), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_FTP -ZEND_GET_MODULE(php_ftp) -#endif - -static void ftp_destructor_ftpbuf(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr; - - ftp_close(ftp); -} - -PHP_MINIT_FUNCTION(ftp) -{ - le_ftpbuf = zend_register_list_destructors_ex(ftp_destructor_ftpbuf, NULL, le_ftpbuf_name, module_number); - REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_BINARY", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_IMAGE", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("FTP_TIMEOUT_SEC", PHP_FTP_OPT_TIMEOUT_SEC, CONST_PERSISTENT | CONST_CS); - return SUCCESS; -} - -PHP_MINFO_FUNCTION(ftp) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "FTP support", "enabled"); - php_info_print_table_end(); -} - -#define XTYPE(xtype, mode) { \ - if (mode != FTPTYPE_ASCII && mode != FTPTYPE_IMAGE) { \ - php_error(E_WARNING, "%s(): mode must be FTP_ASCII or FTP_BINARY", get_active_function_name(TSRMLS_C)); \ - RETURN_FALSE; \ - } \ - xtype = mode; \ - } - - -/* {{{ proto resource ftp_connect(string host [, int port [, int timeout)]]) - Opens a FTP stream */ -PHP_FUNCTION(ftp_connect) -{ - ftpbuf_t *ftp; - char *host; - int host_len, port = 0; - long timeout_sec = FTP_DEFAULT_TIMEOUT; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { - return; - } - - if (timeout_sec <= 0) { - php_error(E_WARNING, "%s(): timeout has to be greater than 0", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - /* connect */ - ftp = ftp_open(host, htons((short)port), timeout_sec); - if (ftp == NULL) { - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, ftp, le_ftpbuf); -} -/* }}} */ - -/* {{{ proto bool ftp_login(resource stream, string username, string password) - Logs into the FTP server */ -PHP_FUNCTION(ftp_login) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *user, *pass; - int user_len, pass_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* log in */ - if (!ftp_login(ftp, user, pass)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string ftp_pwd(resource stream) - Returns the present working directory */ -PHP_FUNCTION(ftp_pwd) -{ - zval *z_ftp; - ftpbuf_t *ftp; - const char *pwd; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - pwd = ftp_pwd(ftp); - if (pwd == NULL) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING((char*) pwd, 1); -} -/* }}} */ - -/* {{{ proto bool ftp_cdup(resource stream) - Changes to the parent directory */ -PHP_FUNCTION(ftp_cdup) -{ - zval *z_ftp; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp_cdup(ftp)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_chdir(resource stream, string directory) - Changes directories */ -PHP_FUNCTION(ftp_chdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* change directories */ - if (!ftp_chdir(ftp, dir)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_exec(resource stream, string command) - Requests execution of a program on the FTP server */ -PHP_FUNCTION(ftp_exec) -{ - pval *z_ftp; - ftpbuf_t *ftp; - char *cmd; - int cmd_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* execute serverside command */ - if (!ftp_exec(ftp, cmd)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto string ftp_mkdir(resource stream, string directory) - Creates a directory and returns the absolute path for the new directory or false on error */ -PHP_FUNCTION(ftp_mkdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir, *tmp; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* create directorie */ - if (NULL == (tmp = ftp_mkdir(ftp, dir))) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING(tmp, 1); -} -/* }}} */ - -/* {{{ proto bool ftp_rmdir(resource stream, string directory) - Removes a directory */ -PHP_FUNCTION(ftp_rmdir) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* remove directorie */ - if (!ftp_rmdir(ftp, dir)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array ftp_nlist(resource stream, string directory) - Returns an array of filenames in the given directory */ -PHP_FUNCTION(ftp_nlist) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char **nlist, **ptr, *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get list of files */ - if (NULL == (nlist = ftp_nlist(ftp, dir))) { - RETURN_FALSE; - } - - array_init(return_value); - for (ptr = nlist; *ptr; ptr++) - add_next_index_string(return_value, *ptr, 1); - free(nlist); -} -/* }}} */ - -/* {{{ proto array ftp_rawlist(resource stream, string directory) - Returns a detailed listing of a directory as an array of output lines */ -PHP_FUNCTION(ftp_rawlist) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char **llist, **ptr, *dir; - int dir_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get raw directory listing */ - if (NULL == (llist = ftp_list(ftp, dir))) { - RETURN_FALSE; - } - - array_init(return_value); - for (ptr = llist; *ptr; ptr++) - add_next_index_string(return_value, *ptr, 1); - free(llist); -} -/* }}} */ - -/* {{{ proto string ftp_systype(resource stream) - Returns the system type identifier */ -PHP_FUNCTION(ftp_systype) -{ - zval *z_ftp; - ftpbuf_t *ftp; - const char *syst; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - syst = ftp_syst(ftp); - if (NULL == (syst = ftp_syst(ftp))) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_STRING((char*) syst, 1); -} -/* }}} */ - -/* {{{ proto bool ftp_fget(resource stream, resource fp, string remote_file, int mode) - Retrieves a file from the FTP server and writes it to an open file */ -PHP_FUNCTION(ftp_fget) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream *stream; - char *file; - int file_len, mode; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl", &z_ftp, &z_file, &file, &file_len, &mode) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - ZEND_FETCH_RESOURCE(stream, php_stream*, &z_file, -1, "File-Handle", php_file_le_stream()); - XTYPE(xtype, mode); - - if (!ftp_get(ftp, stream, file, xtype) || php_stream_error(stream)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - if (php_stream_error(stream)) { - php_error(E_WARNING, "%s(): error writing %s", get_active_function_name(TSRMLS_C), Z_STRVAL_P(z_file)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_pasv(resource stream, bool pasv) - Turns passive mode on or off */ -PHP_FUNCTION(ftp_pasv) -{ - zval *z_ftp; - ftpbuf_t *ftp; - zend_bool pasv; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &z_ftp, &pasv) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - if (!ftp_pasv(ftp, pasv ? 1 : 0)) { - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_get(resource stream, string local_file, string remote_file, int mode) - Retrieves a file from the FTP server and writes it to a local file */ -PHP_FUNCTION(ftp_get) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - php_stream * tmpstream, *outstream; - char *local, *remote; - int local_len, remote_len, mode; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl", &z_ftp, &local, &local_len, &remote, &remote_len, &mode) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - /* get to temporary file, so if there is an error, no existing - * file gets clobbered - */ - tmpstream = php_stream_fopen_tmpfile(); - if (tmpstream == NULL) { - RETURN_FALSE; - } - - if (!ftp_get(ftp, tmpstream, remote, xtype) || php_stream_error(tmpstream)) { - php_stream_close(tmpstream); - php_error(E_WARNING, "ftp_get: %s", ftp->inbuf); - RETURN_FALSE; - } - - outstream = php_stream_fopen(local, "wb", NULL TSRMLS_CC); - - if (outstream == NULL) { - php_stream_close(tmpstream); - php_error(E_WARNING, "%s(): error opening %s", get_active_function_name(TSRMLS_C), local); - RETURN_FALSE; - } - - php_stream_rewind(tmpstream); - if (php_stream_copy_to_stream(tmpstream, outstream, PHP_STREAM_COPY_ALL) == 0) { - php_error(E_WARNING, "%s(): error writing %s", get_active_function_name(TSRMLS_C), local); - RETVAL_FALSE; - } - else - RETVAL_TRUE; - - php_stream_close(tmpstream); - php_stream_close(outstream); -} -/* }}} */ - -/* {{{ proto bool ftp_fput(resource stream, string remote_file, resource fp, int mode) - Stores a file from an open file to the FTP server */ -PHP_FUNCTION(ftp_fput) -{ - zval *z_ftp, *z_file; - ftpbuf_t *ftp; - ftptype_t xtype; - int mode, remote_len; - php_stream *stream; - char *remote; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl", &z_ftp, &remote, &remote_len, &z_file, &mode) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - ZEND_FETCH_RESOURCE(stream, php_stream*, &z_file, -1, "File-Handle", php_file_le_stream()); - XTYPE(xtype, mode); - - if (!ftp_put(ftp, remote, stream, xtype)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_put(resource stream, string remote_file, string local_file, int mode) - Stores a file on the FTP server */ -PHP_FUNCTION(ftp_put) -{ - zval *z_ftp; - ftpbuf_t *ftp; - ftptype_t xtype; - char *remote, *local; - int remote_len, local_len, mode; - php_stream * instream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl", &z_ftp, &remote, &remote_len, &local, &local_len, &mode) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - XTYPE(xtype, mode); - - instream = php_stream_fopen(local, "rb", NULL TSRMLS_CC); - - if (instream == NULL) { - RETURN_FALSE; - } - - if (!ftp_put(ftp, remote, instream, xtype) || php_stream_error(instream)) { - php_stream_close(instream); - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - php_stream_close(instream); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int ftp_size(resource stream, string filename) - Returns the size of the file, or -1 on error */ -PHP_FUNCTION(ftp_size) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get file size */ - RETURN_LONG(ftp_size(ftp, file)); -} -/* }}} */ - -/* {{{ proto int ftp_mdtm(resource stream, string filename) - Returns the last modification time of the file, or -1 on error */ -PHP_FUNCTION(ftp_mdtm) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* get file mod time */ - RETURN_LONG(ftp_mdtm(ftp, file)); -} -/* }}} */ - -/* {{{ proto bool ftp_rename(resource stream, string src, string dest) - Renames the given file to a new path */ -PHP_FUNCTION(ftp_rename) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *src, *dest; - int src_len, dest_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* rename the file */ - if (!ftp_rename(ftp, src, dest)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_delete(resource stream, string file) - Deletes a file */ -PHP_FUNCTION(ftp_delete) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *file; - int file_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* delete the file */ - if (!ftp_delete(ftp, file)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ftp_site(resource stream, string cmd) - Sends a SITE command to the server */ -PHP_FUNCTION(ftp_site) -{ - zval *z_ftp; - ftpbuf_t *ftp; - char *cmd; - int cmd_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - /* send the site command */ - if (!ftp_site(ftp, cmd)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto void ftp_close(resource stream) - Closes the FTP stream */ -PHP_FUNCTION(ftp_close) -{ - zval *z_ftp; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - zend_list_delete(Z_LVAL_P(z_ftp)); -} -/* }}} */ - -/* {{{ proto bool ftp_set_option(resource stream, int option, mixed value) - Sets an FTP option */ -PHP_FUNCTION(ftp_set_option) -{ - zval *z_ftp, *z_value; - long option; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - switch (option) { - case PHP_FTP_OPT_TIMEOUT_SEC: - if (Z_TYPE_P(z_value) != IS_LONG) { - php_error(E_WARNING, "%s(): option TIMEOUT_SEC expects value of type long, %s given", - get_active_function_name(TSRMLS_C), zend_zval_type_name(z_value)); - RETURN_FALSE; - } - if (Z_LVAL_P(z_value) <= 0) { - php_error(E_WARNING, "%s(): timeout has to be greater than 0", - get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - ftp->timeout_sec = Z_LVAL_P(z_value); - RETURN_TRUE; - break; - default: - php_error(E_WARNING, "%s(): unknown option '%d'", get_active_function_name(TSRMLS_C), option); - RETURN_FALSE; - break; - } -} -/* }}} */ - -/* {{{ proto mixed ftp_get_option(resource stream, int option) - Gets an FTP option */ -PHP_FUNCTION(ftp_get_option) -{ - zval *z_ftp; - long option; - ftpbuf_t *ftp; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) { - return; - } - - ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); - - switch (option) { - case PHP_FTP_OPT_TIMEOUT_SEC: - RETURN_LONG(ftp->timeout_sec); - break; - default: - php_error(E_WARNING, "%s(): unknown option '%d'", get_active_function_name(TSRMLS_C), option); - RETURN_FALSE; - break; - } -} -/* }}} */ - -#endif /* HAVE_FTP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h deleted file mode 100644 index d5d36b96e47..00000000000 --- a/ext/ftp/php_ftp.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Andrew Skalski | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifndef _INCLUDED_FTP_H -#define _INCLUDED_FTP_H - -#if HAVE_FTP - -extern zend_module_entry php_ftp_module_entry; -#define php_ftp_module_ptr &php_ftp_module_entry - -#define PHP_FTP_OPT_TIMEOUT_SEC 0 - -PHP_MINIT_FUNCTION(ftp); -PHP_MINFO_FUNCTION(ftp); - -PHP_FUNCTION(ftp_connect); -PHP_FUNCTION(ftp_login); -PHP_FUNCTION(ftp_pwd); -PHP_FUNCTION(ftp_cdup); -PHP_FUNCTION(ftp_chdir); -PHP_FUNCTION(ftp_exec); -PHP_FUNCTION(ftp_mkdir); -PHP_FUNCTION(ftp_rmdir); -PHP_FUNCTION(ftp_nlist); -PHP_FUNCTION(ftp_rawlist); -PHP_FUNCTION(ftp_systype); -PHP_FUNCTION(ftp_pasv); -PHP_FUNCTION(ftp_get); -PHP_FUNCTION(ftp_fget); -PHP_FUNCTION(ftp_put); -PHP_FUNCTION(ftp_fput); -PHP_FUNCTION(ftp_size); -PHP_FUNCTION(ftp_mdtm); -PHP_FUNCTION(ftp_rename); -PHP_FUNCTION(ftp_delete); -PHP_FUNCTION(ftp_site); -PHP_FUNCTION(ftp_close); -PHP_FUNCTION(ftp_set_option); -PHP_FUNCTION(ftp_get_option); - -#define phpext_ftp_ptr php_ftp_module_ptr - -#else -#define php_ftp_module_ptr NULL -#endif /* HAVE_FTP */ - -#endif diff --git a/ext/gd/CREDITS b/ext/gd/CREDITS deleted file mode 100644 index 8cdeef9338d..00000000000 --- a/ext/gd/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GD imaging -Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 deleted file mode 100644 index 2cd37be17e0..00000000000 --- a/ext/gd/config.m4 +++ /dev/null @@ -1,263 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_DEFUN(PHP_GD_JPEG,[ - PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, - [ --with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix.]) - - if test "$PHP_JPEG_DIR" != "no"; then - - for i in /usr /usr/local $PHP_JPEG_DIR; do - test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i - done - - if test -z "$GD_JPEG_DIR"; then - AC_MSG_ERROR([libjpeg.(a|so) not found.]) - fi - - PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, - [ - PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD) - ],[ - AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.]) - ],[ - -L$GD_JPEG_DIR/lib - ]) - else - AC_MSG_RESULT([If configure fails try --with-jpeg-dir=]) - fi -]) - -AC_DEFUN(PHP_GD_PNG,[ - PHP_ARG_WITH(png-dir, for the location of libpng, - [ --with-png-dir=DIR GD: Set the path to libpng install prefix.]) - - if test "$PHP_PNG_DIR" != "no"; then - - for i in /usr /usr/local $PHP_PNG_DIR; do - test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i - done - - if test -z "$GD_PNG_DIR"; then - AC_MSG_ERROR([libpng.(a|so) not found.]) - fi - - if test "$PHP_ZLIB_DIR" = "no"; then - AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=]) - fi - - PHP_CHECK_LIBRARY(png,png_write_image, - [ - 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) - ],[ - 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 - ]) - - else - AC_MSG_RESULT([If configure fails try --with-png-dir= and --with-zlib-dir=]) - fi -]) - -AC_DEFUN(PHP_GD_XPM,[ - PHP_ARG_WITH(xpm-dir, for the location of libXpm, - [ --with-xpm-dir=DIR GD: Set the path to libXpm install prefix.]) - - if test "$PHP_XPM_DIR" != "no"; then - - for i in /usr /usr/local /usr/X11R6 $PHP_XPM_DIR; do - test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i - done - - if test -z "$GD_XPM_DIR"; then - AC_MSG_ERROR([libXpm.(a|so) not found.]) - fi - - PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage, - [ - 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) - ],[ - 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 - ]) - else - AC_MSG_RESULT(If configure fails try --with-xpm-dir=) - fi -]) - -AC_DEFUN(PHP_GD_FREETYPE1,[ - PHP_ARG_WITH(ttf,for FreeType 1.x support, - [ --with-ttf[=DIR] GD: Include FreeType 1.x support]) - - if test "$PHP_TTF" != "no"; then - if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then - if test -n "$PHP_TTF" ; then - for i in /usr /usr/local $PHP_TTF; do - if test -f "$i/include/freetype.h" ; then - TTF_DIR=$i - unset TTF_INC_DIR - fi - if test -f "$i/include/freetype/freetype.h"; then - TTF_DIR=$i - TTF_INC_DIR=$i/include/freetype - fi - done - fi - if test -n "$TTF_DIR" ; then - AC_DEFINE(HAVE_LIBTTF,1,[ ]) - PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib, GD_SHARED_LIBADD) - fi - if test -z "$TTF_INC_DIR"; then - TTF_INC_DIR=$TTF_DIR/include - fi - PHP_ADD_INCLUDE($TTF_INC_DIR) - else - AC_MSG_RESULT([no - FreeType 2.x is to be used instead]) - fi - fi -]) - -AC_DEFUN(PHP_GD_FREETYPE2,[ - PHP_ARG_WITH(freetype-dir, for freetype(2), - [ --with-freetype-dir=DIR GD: Set the path to freetype2 install prefix.]) - - if test "$PHP_FREETYPE_DIR" != "no"; then - for i in /usr /usr/local $PHP_FREETYPE_DIR; do - if test -f "$i/include/freetype2/freetype/freetype.h"; then - FREETYPE2_DIR=$i - FREETYPE2_INC_DIR=$i/include/freetype2/freetype - fi - done - - if test -n "$FREETYPE2_DIR" ; then - PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/lib, GD_SHARED_LIBADD) - PHP_ADD_INCLUDE($FREETYPE2_INC_DIR) - AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) - AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) - else - AC_MSG_ERROR([freetype2 not found!]) - fi - else - AC_MSG_RESULT([If configure fails try --with-freetype-dir=]) - fi -]) - -AC_DEFUN(PHP_GD_T1LIB,[ - PHP_ARG_WITH(t1lib, for T1lib support, - [ --with-t1lib[=DIR] GD: Include T1lib support.]) - - if test "$PHP_T1LIB" != "no"; then - - for i in /usr /usr/local $PHP_T1LIB; do - test -f "$i/include/t1lib.h" && GD_T1_DIR=$i - done - - if test -z "$GD_T1_DIR"; then - AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.]) - fi - - PHP_CHECK_LIBRARY(t1, T1_LoadFont, - [ - 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) - ],[ - AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.]) - ],[ - -L$GD_T1_DIR/lib - ]) - fi -]) - -AC_DEFUN(PHP_GD_TTSTR,[ - PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD, - [ --enable-gd-native-ttf GD: Enable TrueType string function.]) - - if test "$PHP_GD_NATIVE_TTF" = "yes"; then - AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) - fi -]) - -AC_DEFUN(PHP_GD_CHECK_VERSION,[ - PHP_CHECK_LIBRARY(gd, gdImageString16, [AC_DEFINE(HAVE_LIBGD13, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageGif, [AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromGd2, [AC_DEFINE(HAVE_GD_GD2, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageSetTile, [AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageSetBrush, [AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringTTF, [AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringFT, [AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageStringFTEx, [AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) -]) - - -PHP_ARG_WITH(gd, for GD support, -[ --with-gd[=DIR] Include GD support (DIR is GD's install dir).]) - -if test "$PHP_GD" != "no"; then - - PHP_NEW_EXTENSION(gd, gd.c gdcache.c gdttf.c gdt1.c, $ext_shared) - PHP_SUBST(GD_SHARED_LIBADD) - -dnl Various checks for GD features - PHP_SHLIB_SUFFIX_NAME - PHP_GD_TTSTR - PHP_GD_JPEG - PHP_GD_PNG - PHP_GD_XPM - PHP_GD_FREETYPE2 - PHP_GD_FREETYPE1 - PHP_GD_T1LIB - - if test "$PHP_GD" = "yes"; then - GD_SEARCH_PATHS="/usr/local /usr" - else - GD_SEARCH_PATHS=$PHP_GD - fi - - for j in $GD_SEARCH_PATHS; do - for i in include/gd1.3 include/gd include gd1.3 gd ""; do - test -f $j/$i/gd.h && GD_INCLUDE=$j/$i - done - - for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do - test -f $j/$i/libgd.$SHLIB_SUFFIX_NAME -o -f $j/$i/libgd.a && GD_LIB=$j/$i - done - done - - if test -n "$GD_INCLUDE" -a -n "$GD_LIB" ; then - PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD) - AC_DEFINE(HAVE_LIBGD,1,[ ]) - PHP_GD_CHECK_VERSION - else - AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval]) - fi - -dnl NetBSD package structure - if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then - GD_INCLUDE=/usr/pkg/include/gd - fi - -dnl SuSE 6.x package structure - if test -f /usr/include/gd/gd.h -a -z "$GD_INCLUDE" ; then - GD_INCLUDE=/usr/include/gd - fi - - PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE) - PHP_ADD_INCLUDE($GD_INCLUDE) - -fi diff --git a/ext/gd/gd.c b/ext/gd/gd.c deleted file mode 100644 index c839bfe2674..00000000000 --- a/ext/gd/gd.c +++ /dev/null @@ -1,3647 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Stig Bakken | - | Jim Winstead | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, - Cold Spring Harbor Labs. */ - -/* Note that there is no code from the gd package in this file */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "ext/standard/head.h" -#include -#include "SAPI.h" -#include "php_gd.h" -#include "ext/standard/info.h" - -#if HAVE_SYS_WAIT_H -# include -#endif -#if HAVE_UNISTD_H -# include -#endif -#ifdef PHP_WIN32 -# include -# include -#endif - -#if HAVE_LIBGD - -static int le_gd, le_gd_font; -#if HAVE_LIBT1 -static int le_ps_font, le_ps_enc; -#endif - -#include -#include /* 1 Tiny font */ -#include /* 2 Small font */ -#include /* 3 Medium bold font */ -#include /* 4 Large font */ -#include /* 5 Giant font */ -#ifdef ENABLE_GD_TTF -# include "gdttf.h" -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#ifdef ENABLE_GD_TTF -static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int); -#endif - -#if HAVE_LIBGD15 -/* it's >= 1.5, i.e. has IOCtx */ -#define USE_GD_IOCTX 1 -#else -#undef USE_GD_IOCTX -#endif - -#ifdef USE_GD_IOCTX -#include "gd_ctx.c" -#else -#define gdImageCreateFromGdCtx NULL -#define gdImageCreateFromGd2Ctx NULL -#define gdImageCreateFromGd2partCtx NULL -#define gdImageCreateFromGifCtx NULL -#define gdImageCreateFromJpegCtx NULL -#define gdImageCreateFromPngCtx NULL -#define gdImageCreateFromWBMPCtx NULL -typedef FILE gdIOCtx; -#define CTX_PUTC(c, fp) fputc(c, fp) -#endif - -static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC); -static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()); -static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()); -static int _php_image_type ( char data[8] ); -static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type); -static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold); - -/* {{{ gd_functions[] - */ -function_entry gd_functions[] = { - PHP_FE(imagearc, NULL) - PHP_FE(imagechar, NULL) - PHP_FE(imagecharup, NULL) - PHP_FE(imagecolorallocate, NULL) - PHP_FE(imagepalettecopy, NULL) - PHP_FE(imagecolorat, NULL) - PHP_FE(imagecolorclosest, NULL) - PHP_FE(imagecolorclosesthwb, NULL) - PHP_FE(imagecolordeallocate, NULL) - PHP_FE(imagecolorresolve, NULL) - PHP_FE(imagecolorexact, NULL) - PHP_FE(imagecolorset, NULL) - PHP_FE(imagecolortransparent, NULL) - PHP_FE(imagecolorstotal, NULL) - PHP_FE(imagecolorsforindex, NULL) - PHP_FE(imagecopy, NULL) - PHP_FE(imagecopymerge, NULL) - PHP_FE(imagecopyresized, NULL) - PHP_FE(imagecreate, NULL) - - PHP_FE(imagecreatetruecolor, NULL) - PHP_FE(imagetruecolortopalette, NULL) - PHP_FE(imagesetthickness, NULL) - PHP_FE(imageellipse, NULL) - PHP_FE(imagefilledellipse, NULL) - PHP_FE(imagefilledarc, NULL) - PHP_FE(imagealphablending, NULL) - PHP_FE(imagecolorresolvealpha, NULL) - PHP_FE(imagecolorclosestalpha, NULL) - PHP_FE(imagecolorexactalpha, NULL) - PHP_FE(imagecopyresampled, NULL) - PHP_FE(imagesettile, NULL) - - PHP_FE(imagesetbrush, NULL) - PHP_FE(imagesetstyle, NULL) - PHP_FE(imagecopymergegray, NULL) - - PHP_FE(imagecreatefromstring, NULL) -#ifdef HAVE_GD_PNG - PHP_FE(imagecreatefrompng, NULL) -#endif -#ifdef HAVE_GD_GIF_READ - PHP_FE(imagecreatefromgif, NULL) -#endif -#ifdef HAVE_GD_JPG - PHP_FE(imagecreatefromjpeg, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(imagecreatefromwbmp, NULL) -#endif -#ifdef HAVE_GD_XBM - PHP_FE(imagecreatefromxbm, NULL) -#endif -#ifdef HAVE_GD_XPM - PHP_FE(imagecreatefromxpm, NULL) -#endif - PHP_FE(imagecreatefromgd, NULL) -#ifdef HAVE_GD_GD2 - PHP_FE(imagecreatefromgd2, NULL) - PHP_FE(imagecreatefromgd2part, NULL) -#endif -#ifdef HAVE_GD_PNG - PHP_FE(imagepng, NULL) -#endif -#ifdef HAVE_GD_GIF_CREATE - PHP_FE(imagegif, NULL) -#endif -#ifdef HAVE_GD_JPG - PHP_FE(imagejpeg, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(imagewbmp, NULL) -#endif - PHP_FE(imagegd, NULL) -#ifdef HAVE_GD_GD2 - PHP_FE(imagegd2, NULL) -#endif - - PHP_FE(imagedestroy, NULL) - PHP_FE(imagegammacorrect, NULL) - PHP_FE(imagefill, NULL) - PHP_FE(imagefilledpolygon, NULL) - PHP_FE(imagefilledrectangle, NULL) - PHP_FE(imagefilltoborder, NULL) - PHP_FE(imagefontwidth, NULL) - PHP_FE(imagefontheight, NULL) - PHP_FE(imageinterlace, NULL) - PHP_FE(imageline, NULL) - PHP_FE(imageloadfont, NULL) - PHP_FE(imagepolygon, NULL) - PHP_FE(imagerectangle, NULL) - PHP_FE(imagesetpixel, NULL) - PHP_FE(imagestring, NULL) - PHP_FE(imagestringup, NULL) - PHP_FE(imagesx, NULL) - PHP_FE(imagesy, NULL) - PHP_FE(imagedashedline, NULL) -#ifdef ENABLE_GD_TTF - PHP_FE(imagettfbbox, NULL) - PHP_FE(imagettftext, NULL) - PHP_FE(imageftbbox, NULL) - PHP_FE(imagefttext, NULL) -#endif -#ifdef HAVE_LIBT1 - PHP_FE(imagepsloadfont, NULL) - /* - PHP_FE(imagepscopyfont, NULL) - */ - PHP_FE(imagepsfreefont, NULL) - PHP_FE(imagepsencodefont, NULL) - PHP_FE(imagepsextendfont, NULL) - PHP_FE(imagepsslantfont, NULL) - PHP_FE(imagepstext, NULL) - PHP_FE(imagepsbbox, NULL) -#endif - PHP_FE(imagetypes, NULL) - -#if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP) - PHP_FE(jpeg2wbmp, NULL) -#endif -#if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP) - PHP_FE(png2wbmp, NULL) -#endif -#ifdef HAVE_GD_WBMP - PHP_FE(image2wbmp, NULL) -#endif - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry gd_module_entry = { - STANDARD_MODULE_HEADER, - "gd", - gd_functions, - PHP_MINIT(gd), - NULL, - NULL, - NULL, - PHP_MINFO(gd), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_GD -ZEND_GET_MODULE(gd) -#endif - -/* {{{ php_free_gd_image - */ -static void php_free_gd_image(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - gdImageDestroy((gdImagePtr)rsrc->ptr); -} -/* }}} */ - -/* {{{ php_free_gd_font - */ -static void php_free_gd_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - gdFontPtr fp = (gdFontPtr)rsrc->ptr; - - if (fp->data) { - efree(fp->data); - } - efree(fp); -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(gd) -{ - le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number); - le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number); -#if HAVE_LIBT1 - T1_SetBitmapPad(8); - T1_InitLib(NO_LOGFILE|IGNORE_CONFIGFILE|IGNORE_FONTDATABASE); - T1_SetLogLevel(T1LOG_DEBUG); - le_ps_font = zend_register_list_destructors_ex(php_free_ps_font, NULL, "gd PS font", module_number); - le_ps_enc = zend_register_list_destructors_ex(php_free_ps_enc, NULL, "gd PS encoding", module_number); -#endif - REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT); -#ifdef gdTiled - /* special colours for gd */ - REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_STYLED", gdStyled, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_BRUSHED", gdBrushed, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_STYLEDBRUSHED", gdStyledBrushed, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_COLOR_TRANSPARENT", gdTransparent, CONST_CS | CONST_PERSISTENT); -#endif -#if HAVE_LIBGD20 - /* for imagefilledarc */ - REGISTER_LONG_CONSTANT("IMG_ARC_ROUNDED", gdArc, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_PIE", gdPie, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_CHORD", gdChord, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_NOFILL", gdNoFill, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("IMG_ARC_EDGED", gdEdged, CONST_CS | CONST_PERSISTENT); -#endif - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(gd) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "GD Support", "enabled"); - - /* need to use a PHPAPI function here because it is external module in windows */ - -#if HAVE_LIBGD20 - php_info_print_table_row(2, "GD Version", "2.0 or higher"); -#elif HAVE_GDIMAGECOLORRESOLVE - php_info_print_table_row(2, "GD Version", "1.6.2 or higher"); -#elif HAVE_LIBGD13 - php_info_print_table_row(2, "GD Version", "between 1.3 and 1.6.1"); -#else - php_info_print_table_row(2, "GD Version", "1.2"); -#endif - -#ifdef ENABLE_GD_TTF - php_info_print_table_row(2, "FreeType Support", "enabled"); -#if HAVE_LIBFREETYPE - php_info_print_table_row(2, "FreeType Linkage", "with freetype"); -#elif HAVE_LIBTTF - php_info_print_table_row(2, "FreeType Linkage", "with TTF library"); -#else - php_info_print_table_row(2, "FreeType Linkage", "with unknown library"); -#endif -#endif - -#ifdef HAVE_LIBT1 - php_info_print_table_row(2, "T1Lib Support", "enabled"); -#endif - -/* this next part is stupid ... if I knew better, I'd put them all on one row (cmv) */ - -#ifdef HAVE_GD_GIF_READ - php_info_print_table_row(2, "GIF Read Support", "enabled"); -#endif -#ifdef HAVE_GD_GIF_CREATE - php_info_print_table_row(2, "GIF Create Support", "enabled"); -#endif -#ifdef HAVE_GD_JPG - php_info_print_table_row(2, "JPG Support", "enabled"); -#endif -#ifdef HAVE_GD_PNG - php_info_print_table_row(2, "PNG Support", "enabled"); -#endif -#ifdef HAVE_GD_WBMP - php_info_print_table_row(2, "WBMP Support", "enabled"); -#endif -#ifdef HAVE_GD_XBM - php_info_print_table_row(2, "XBM Support", "enabled"); -#endif - php_info_print_table_end(); -} -/* }}} */ - -/* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */ -PHP_GD_API int phpi_get_le_gd(void) -{ - return le_gd; -} - -#ifndef HAVE_GDIMAGECOLORRESOLVE - -/* {{{ gdImageColorResolve - */ -/********************************************************************/ -/* gdImageColorResolve is a replacement for the old fragment: */ -/* */ -/* if ((color=gdImageColorExact(im,R,G,B)) < 0) */ -/* if ((color=gdImageColorAllocate(im,R,G,B)) < 0) */ -/* color=gdImageColorClosest(im,R,G,B); */ -/* */ -/* in a single function */ - -int -gdImageColorResolve(gdImagePtr im, int r, int g, int b) -{ - int c; - int ct = -1; - int op = -1; - long rd, gd, bd, dist; - long mindist = 3*255*255; /* init to max poss dist */ - - for (c = 0; c < im->colorsTotal; c++) { - if (im->open[c]) { - op = c; /* Save open slot */ - continue; /* Color not in use */ - } - rd = (long)(im->red [c] - r); - gd = (long)(im->green[c] - g); - bd = (long)(im->blue [c] - b); - dist = rd * rd + gd * gd + bd * bd; - if (dist < mindist) { - if (dist == 0) { - return c; /* Return exact match color */ - } - mindist = dist; - ct = c; - } - } - /* no exact match. We now know closest, but first try to allocate exact */ - if (op == -1) { - op = im->colorsTotal; - if (op == gdMaxColors) { /* No room for more colors */ - return ct; /* Return closest available color */ - } - im->colorsTotal++; - } - im->red [op] = r; - im->green[op] = g; - im->blue [op] = b; - im->open [op] = 0; - return op; /* Return newly allocated color */ -} -/* }}} */ - -#endif - -#define FLIPWORD(a) (((a & 0xff000000) >> 24) | ((a & 0x00ff0000) >> 8) | ((a & 0x0000ff00) << 8) | ((a & 0x000000ff) << 24)) - -/* {{{ proto int imageloadfont(string filename) - Load a new font */ -PHP_FUNCTION(imageloadfont) -{ - zval **file; - int hdr_size = sizeof(gdFont) - sizeof(char *); - int ind, body_size, n=0, b, i, body_size_check; - gdFontPtr font; - php_stream *stream; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH|IGNORE_URL_WIN|REPORT_ERRORS, NULL TSRMLS_CC); - if (stream == NULL) { - RETURN_FALSE; - } - - /* Only supports a architecture-dependent binary dump format - * at the moment. - * The file format is like this on machines with 32-byte integers: - * - * byte 0-3: (int) number of characters in the font - * byte 4-7: (int) value of first character in the font (often 32, space) - * byte 8-11: (int) pixel width of each character - * byte 12-15: (int) pixel height of each character - * bytes 16-: (char) array with character data, one byte per pixel - * in each character, for a total of - * (nchars*width*height) bytes. - */ - font = (gdFontPtr)emalloc(sizeof(gdFont)); - b = 0; - while (b < hdr_size && (n = php_stream_read(stream, (char*)&font[b], hdr_size - b))) - b += n; - if (!n) { - php_stream_close(stream); - efree(font); - if (php_stream_eof(stream)) { - php_error(E_WARNING, "ImageFontLoad: end of file while reading header"); - } else { - php_error(E_WARNING, "ImageFontLoad: error while reading header"); - } - RETURN_FALSE; - } - i = php_stream_tell(stream); - php_stream_seek(stream, 0, SEEK_END); - body_size_check = php_stream_tell(stream) - hdr_size; - php_stream_seek(stream, i, SEEK_SET); - body_size = font->w * font->h * font->nchars; - if (body_size != body_size_check) { - font->w = FLIPWORD(font->w); - font->h = FLIPWORD(font->h); - font->nchars = FLIPWORD(font->nchars); - body_size = font->w * font->h * font->nchars; - } - if (body_size != body_size_check) { - php_error(E_WARNING, "ImageFontLoad: error reading font"); - efree(font); - RETURN_FALSE; - } - - font->data = emalloc(body_size); - b = 0; - while (b < body_size && (n = php_stream_read(stream, &font->data[b], body_size - b))) - b += n; - if (!n) { - php_stream_close(stream); - efree(font->data); - efree(font); - if (php_stream_eof(stream)) { - php_error(E_WARNING, "ImageFontLoad: end of file while reading body"); - } else { - php_error(E_WARNING, "ImageFontLoad: error while reading body"); - } - RETURN_FALSE; - } - php_stream_close(stream); - - /* Adding 5 to the font index so we will never have font indices - * that overlap with the old fonts (with indices 1-5). The first - * list index given out is always 1. - */ - ind = 5 + zend_list_insert(font, le_gd_font); - - RETURN_LONG(ind); -} -/* }}} */ - -/* {{{ proto void imagesetstyle(resource im, array styles) - Set the line drawing styles for use with imageline and IMG_COLOR_STYLED. */ -PHP_FUNCTION(imagesetstyle) -{ - zval **IM, **styles; - gdImagePtr im; - int * stylearr; - int index; - HashPosition pos; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &styles) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_array_ex(styles); - - /* copy the style values in the stylearr */ - stylearr = emalloc(sizeof(int) * zend_hash_num_elements(HASH_OF(*styles))); - - zend_hash_internal_pointer_reset_ex(HASH_OF(*styles), &pos); - - for (index=0;; zend_hash_move_forward_ex(HASH_OF(*styles), &pos)) { - zval ** item; - - if (zend_hash_get_current_data_ex(HASH_OF(*styles), (void**)&item, &pos) == FAILURE) - break; - - convert_to_long_ex(item); - - stylearr[index++] = Z_LVAL_PP(item); - } - gdImageSetStyle(im, stylearr, index); - - efree(stylearr); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagecreatetruecolor(int x_size, int y_size) - Create a new true color image */ -PHP_FUNCTION(imagecreatetruecolor) -{ -#if HAVE_LIBGD20 - zval **x_size, **y_size; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(x_size); - convert_to_long_ex(y_size); - - im = gdImageCreateTrueColor(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted) - Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */ -PHP_FUNCTION(imagetruecolortopalette) -{ -#if HAVE_LIBGD20 - zval **IM, **dither, **ncolors; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &dither, &ncolors) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_boolean_ex(dither); - convert_to_long_ex(ncolors); - - gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors)); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif - -} -/* }}} */ - -/* {{{ proto void imagesetthickness(resource im, int thickness) - Set line thickness for drawing lines, ellipses, rectangles, polygons etc. */ -PHP_FUNCTION(imagesetthickness) -{ -#if HAVE_LIBGD20 - zval **IM, **thick; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &thick) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_long_ex(thick); - - gdImageSetThickness(im, Z_LVAL_PP(thick)); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif - -} -/* }}} */ - -/* {{{ proto void imageellipse(resource im, int cx, int cy, int w, int h, int color) - Draw an ellipse */ -PHP_FUNCTION(imageellipse) -{ -#if 0 && HAVE_LIBGD20 /* this function is missing from GD 2.0.1 */ - zval **IM, **cx, **cy, **w, **h, **color; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(color); - - gdImageEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto void imagefilledellipse(resource im, int cx, int cy, int w, int h, int color) - Draw an ellipse */ -PHP_FUNCTION(imagefilledellipse) -{ -#if HAVE_LIBGD20 - zval **IM, **cx, **cy, **w, **h, **color; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(color); - - gdImageFilledEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagefilledarc(int im, int cx, int cy, int w, int h, int s, int e, int col, int style) - Draw a filled partial ellipse */ -PHP_FUNCTION(imagefilledarc) -{ -#if HAVE_LIBGD20 - zval **IM, **cx, **cy, **w, **h, **ST, **E, **col, **style; - gdImagePtr im; - int e, st; - - if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(ST); - convert_to_long_ex(E); - convert_to_long_ex(col); - convert_to_long_ex(style); - - e = Z_LVAL_PP(E); - st = Z_LVAL_PP(ST); - - if (e < 0) e %= 360; - if (st < 0) st %= 360; - - gdImageFilledArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col), Z_LVAL_PP(style)); - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto void imagealphablending(resource im, bool on) - Turn alpha blending mode on or off for the given image */ -PHP_FUNCTION(imagealphablending) -{ -#if HAVE_LIBGD20 - zval **IM, **blend; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &blend) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - convert_to_boolean_ex(blend); - - gdImageAlphaBlending(im, Z_LVAL_PP(blend)); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha) - Resolve/Allocate a colour with an alpha level. Works for true colour and palette based images */ -PHP_FUNCTION(imagecolorresolvealpha) -{ -#if HAVE_LIBGD20 - zval **IM, ** red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorResolveAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif - -} -/* }}} */ - -/* {{{ proto int imagecolorclosestalpha(resource im, int red, int green, int blue, int alpha) - Find the closest matching colour with alpha transparency */ -PHP_FUNCTION(imagecolorclosestalpha) -{ -#if HAVE_LIBGD20 - zval **IM, ** red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorClosestAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagecolorexactalpha(resource im, int red, int green, int blue, int alpha) - Find exact match for colour with transparency */ -PHP_FUNCTION(imagecolorexactalpha) -{ -#if HAVE_LIBGD20 - zval **IM, **red, **green, **blue, **alpha; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - convert_to_long_ex(alpha); - - RETURN_LONG(gdImageColorExactAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagecopyresampled(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) - Copy and resize part of an image using resampling to help ensure clarity */ -PHP_FUNCTION(imagecopyresampled) -{ -#if HAVE_LIBGD20 - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; - gdImagePtr im_dst, im_src; - int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 10 || - zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(DW); - convert_to_long_ex(DH); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - dstH = Z_LVAL_PP(DH); - dstW = Z_LVAL_PP(DW); - - gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires GD 2.0 or later", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagesettile(resource image, resource tile) - Set the tile image to $tile when filling $image with the "IMG_COLOR_TILED" color */ -PHP_FUNCTION(imagesettile) -{ -#if HAVE_GD_IMAGESETTILE - zval **IM, **TILE; - gdImagePtr im, tile; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - - gdImageSetTile(im, tile); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires a more recent version of GD", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagesetbrush(resource image, resource brush) - Set the brush image to $brush when filling $image with the "IMG_COLOR_BRUSHED" color */ -PHP_FUNCTION(imagesetbrush) -{ -#if HAVE_GD_IMAGESETBRUSH - zval **IM, **TILE; - gdImagePtr im, tile; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); - - gdImageSetBrush(im, tile); - - RETURN_TRUE; -#else - zend_error(E_WARNING, "%s(): requires a more recent version of GD", get_active_function_name(TSRMLS_C)); -#endif -} -/* }}} */ - -/* {{{ proto int imagecreate(int x_size, int y_size) - Create a new image */ -PHP_FUNCTION(imagecreate) -{ - zval **x_size, **y_size; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(x_size); - convert_to_long_ex(y_size); - - im = gdImageCreate(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -} -/* }}} */ - -/* {{{ proto int imagetypes(void) - Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM */ -PHP_FUNCTION(imagetypes) -{ - int ret=0; -#ifdef HAVE_GD_GIF_CREATE - ret = 1; -#endif -#ifdef HAVE_GD_JPG - ret |= 2; -#endif -#ifdef HAVE_GD_PNG - ret |= 4; -#endif -#ifdef HAVE_GD_WBMP - ret |= 8; -#endif -#ifdef HAVE_GD_XPM - ret |= 16; -#endif - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; - } - - RETURN_LONG(ret); -} -/* }}} */ - -/* {{{ _php_image_type - */ -static const char php_sig_gd2[3] = {'g', 'd', '2'}; - -static int _php_image_type (char data[8]) -{ -#ifdef HAVE_LIBGD15 - /* Based on ext/standard/images.c */ - - if (data == NULL) - return -1; - - if (!memcmp(data, php_sig_gd2, 3)) - return PHP_GDIMG_TYPE_GD2; - else if (!memcmp(data, php_sig_jpg, 3)) - return PHP_GDIMG_TYPE_JPG; - else if (!memcmp(data, php_sig_png, 3)) { - if (!memcmp(data, php_sig_png, 8)) - return PHP_GDIMG_TYPE_PNG; - } - else if (!memcmp(data, php_sig_gif, 3)) - return PHP_GDIMG_TYPE_GIF; -#ifdef HAVE_GD_WMBP - else { - gdIOCtx *io_ctx; - io_ctx = gdNewDynamicCtx (8, data); - if (io_ctx) { - if (getmbi(gdGetC, io_ctx) == 0 && skipheader(gdGetC, io_ctx) == 0 ) { - io_ctx->free(io_ctx); - return PHP_GDIMG_TYPE_WBM; - } else - io_ctx->free(io_ctx); - } - } -#endif - return -1; -#endif -} -/* }}} */ - -/* {{{ _php_image_create_from_string - */ -gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC) -{ -#ifdef HAVE_LIBGD15 - gdImagePtr im; - gdIOCtx *io_ctx; - - io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data)); - - if(!io_ctx) { - return NULL; - } - - im = (*ioctx_func_p)(io_ctx); - if (!im) { - php_error(E_WARNING, "%s: Passed data is not in '%s' format", get_active_function_name(TSRMLS_C), tn); - return NULL; - } - - return im; -#else - return NULL; -#endif -} -/* }}} */ - -/* {{{ proto int imagecreatefromstring(string image) - Create a new image from the image stream in the string */ -PHP_FUNCTION(imagecreatefromstring) -{ -#ifdef HAVE_LIBGD15 - zval **data; - gdImagePtr im; - int imtype; - char sig[8]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &data) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(data); - memcpy(sig, Z_STRVAL_PP(data), 8); - - imtype = _php_image_type (sig); - - switch (imtype) { - case PHP_GDIMG_TYPE_JPG: -#ifdef HAVE_GD_JPG - im = _php_image_create_from_string (data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC); -#else - php_error(E_WARNING, "No JPEG support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_PNG: -#ifdef HAVE_GD_PNG - im = _php_image_create_from_string (data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC); -#else - php_error(E_WARNING, "No PNG support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_GIF: -#ifdef HAVE_GD_GIF_READ - im = _php_image_create_from_string (data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC); -#else - php_error(E_WARNING, "No GIF support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_WBM: -#ifdef HAVE_GD_WBMP - im = _php_image_create_from_string (data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC); -#else - php_error(E_WARNING, "No WBMP support in this PHP build"); - RETURN_FALSE; -#endif - break; - - case PHP_GDIMG_TYPE_GD2: -#ifdef HAVE_GD_GD2 - im = _php_image_create_from_string (data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC); -#else - php_error(E_WARNING, "No GD2 support in this PHP build"); - RETURN_FALSE; -#endif - break; - - default: - php_error(E_WARNING, "Data is not in a recognized format."); - RETURN_FALSE; - - } - if (!im) { - php_error(E_WARNING, "Couldn't create GD Image Stream out of Data"); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -#else - php_error(E_WARNING, "ImageCreateFromString: Only available with GD 1.5+"); -#endif -} -/* }}} */ - -/* {{{ _php_image_create_from - */ -static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()) -{ - zval **file, **srcx, **srcy, **width, **height; - gdImagePtr im = NULL; - char *fn=NULL; - php_stream *stream; - FILE * fp = NULL; - int argc=ZEND_NUM_ARGS(); - - if ((image_type == PHP_GDIMG_TYPE_GD2PART && argc != 4) || - argc != 1 || zend_get_parameters_ex(argc, &file, &srcx, &srcy, &width, &height) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - if (argc == 4 && image_type == PHP_GDIMG_TYPE_GD2PART) { - multi_convert_to_long_ex(4, srcx, srcy, width, height); - } - - fn = Z_STRVAL_PP(file); - - stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL TSRMLS_CC); - if (stream == NULL) { - RETURN_FALSE; - } - -#ifndef USE_GD_IOCTX - ioctx_func_p = NULL; /* don't allow sockets without IOCtx */ -#endif - - /* try and avoid allocating a FILE* if the stream is not naturally a FILE* */ - if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) { - php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS); - } - else if (ioctx_func_p) { -#ifdef USE_GD_IOCTX - /* we can create an io context */ - gdIOCtx* io_ctx; - size_t buff_size; - char *buff; - - /* needs to be malloc (persistent) - GD will free() it later */ - buff_size = php_stream_read_all(stream, &buff, 1); - - if(!buff_size) { - php_error(E_WARNING,"%s: Cannot read image data", get_active_function_name(TSRMLS_C)); - goto out_err; - } - - io_ctx = gdNewDynamicCtx(buff_size, buff); - if(!io_ctx) { - php_error(E_WARNING,"%s: Cannot allocate GD IO context", get_active_function_name(TSRMLS_C)); - goto out_err; - } - if (image_type == PHP_GDIMG_TYPE_GD2PART) { - im = (*ioctx_func_p)(io_ctx, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); - } else { - im = (*ioctx_func_p)(io_ctx); - } - io_ctx->free(io_ctx); -#endif - } - else { - /* try and force the stream to be FILE* */ - if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void**)&fp, REPORT_ERRORS)) - goto out_err; - } - - if (!im && fp) { - if (image_type == PHP_GDIMG_TYPE_GD2PART) { - im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); - } else { - im = (*func_p)(fp); - } - - fflush(fp); - } - - if (im) { - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); - return; - } - - php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name(TSRMLS_C), fn, tn); -out_err: - php_stream_close(stream); - RETURN_FALSE; - -} -/* }}} */ - -/* {{{ proto int imagecreatefromgif(string filename) - Create a new image from GIF file or URL */ -PHP_FUNCTION(imagecreatefromgif) -{ -#ifdef HAVE_GD_GIF_READ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageCreateFromGif, gdImageCreateFromGifCtx); -#else /* HAVE_GD_GIF_READ */ - php_error(E_WARNING, "ImageCreateFromGif: No GIF read support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_GIF_READ */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromjpeg(string filename) - Create a new image from JPEG file or URL */ -PHP_FUNCTION(imagecreatefromjpeg) -{ -#ifdef HAVE_GD_JPG - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageCreateFromJpeg, gdImageCreateFromJpegCtx); -#else /* HAVE_GD_JPG */ - php_error(E_WARNING, "ImageCreateFromJpeg: No JPEG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_JPG */ -} -/* }}} */ - -/* {{{ proto int imagecreatefrompng(string filename) - Create a new image from PNG file or URL */ -PHP_FUNCTION(imagecreatefrompng) -{ -#ifdef HAVE_GD_PNG - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImageCreateFromPng, gdImageCreateFromPngCtx); -#else /* HAVE_GD_PNG */ - php_error(E_WARNING, "ImageCreateFromPng: No PNG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_PNG */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromxbm(string filename) - Create a new image from XBM file or URL */ -PHP_FUNCTION(imagecreatefromxbm) -{ -#ifdef HAVE_GD_XBM - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageCreateFromXbm, NULL); -#else /* HAVE_GD_XBM */ - php_error(E_WARNING, "ImageCreateFromXbm: No XBM support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_XBM */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromxpm(string filename) - Create a new image from XPM file or URL */ -PHP_FUNCTION(imagecreatefromxpm) -{ - /* -#ifdef HAVE_GD_XPM - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm, NULL); -#else - */ - php_error(E_WARNING, "ImageCreateFromXpm: No XPM support in this PHP build"); - RETURN_FALSE; - /* -#endif - */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromwbmp(string filename) - Create a new image from WBMP file or URL */ -PHP_FUNCTION(imagecreatefromwbmp) -{ -#ifdef HAVE_GD_WBMP - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP, gdImageCreateFromWBMPCtx); -#else /* HAVE_GD_WBMP */ - php_error(E_WARNING, "ImageCreateFromWBMP: No WBMP support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_WBMP */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromgd(string filename) - Create a new image from GD file or URL */ -PHP_FUNCTION(imagecreatefromgd) -{ - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageCreateFromGd, gdImageCreateFromGdCtx); -} -/* }}} */ - -/* {{{ proto int imagecreatefromgd2(string filename) - Create a new image from GD2 file or URL */ -PHP_FUNCTION(imagecreatefromgd2) -{ -#ifdef HAVE_GD_GD2 - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageCreateFromGd2, gdImageCreateFromGd2Ctx); -#else /* HAVE_GD_GD2 */ - php_error(E_WARNING, "ImageCreateFromGd2: No GD2 support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_GD2 */ -} -/* }}} */ - -/* {{{ proto int imagecreatefromgd2part(string filename, int srcX, int srcY, int width, int height) - Create a new image from a given part of GD2 file or URL */ -PHP_FUNCTION(imagecreatefromgd2part) -{ -#ifdef HAVE_GD_GD2 - _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part, gdImageCreateFromGd2PartCtx); -#else /* HAVE_GD_GD2 */ - php_error(E_WARNING, "ImageCreateFromGd2Part: No GD2 support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_GD2 */ -} -/* }}} */ - -/* {{{ _php_image_output - */ -static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) -{ - zval **imgind, **file, **quality; - gdImagePtr im; - char *fn = NULL; - FILE *fp; - int argc = ZEND_NUM_ARGS(); - int q = -1, i; - - /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ - /* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */ - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &imgind, &file, &quality) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", le_gd); - - if (argc > 1) { - convert_to_string_ex(file); - fn = Z_STRVAL_PP(file); - if (argc == 3) { - convert_to_long_ex(quality); - q = Z_LVAL_PP(quality); - } - } - - if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { - if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) { - php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); - RETURN_FALSE; - } - - fp = VCWD_FOPEN(fn, "wb"); - if (!fp) { - php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn); - RETURN_FALSE; - } - - switch(image_type) { - case PHP_GDIMG_CONVERT_WBM: - if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255", get_active_function_name(TSRMLS_C), q); - } - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, fp, q); - break; - case PHP_GDIMG_TYPE_WBM: - for(i=0; i < gdImageColorsTotal(im); i++) { - if(gdImageRed(im, i) == 0) break; - } - (*func_p)(im, i, fp); - break; - default: - (*func_p)(im, fp); - break; - } - fflush(fp); - fclose(fp); - } else { - int b; - FILE *tmp; - char buf[4096]; - - tmp = tmpfile(); - if (tmp == NULL) { - php_error(E_WARNING, "%s: unable to open temporary file", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - switch(image_type) { - case PHP_GDIMG_CONVERT_WBM: - if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255", get_active_function_name(TSRMLS_C), q); - } - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, tmp, q); - break; - case PHP_GDIMG_TYPE_WBM: - for(i=0; i < gdImageColorsTotal(im); i++) { - if(gdImageRed(im, i) == 0) break; - } - (*func_p)(im, q, tmp); - break; - default: - (*func_p)(im, tmp); - break; - } - - fseek(tmp, 0, SEEK_SET); - -#if APACHE && defined(CHARSET_EBCDIC) - /* XXX this is unlikely to work any more thies@thieso.net */ - - /* This is a binary file already: avoid EBCDIC->ASCII conversion */ - ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); -#endif - while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) { - php_write(buf, b TSRMLS_CC); - } - - fclose(tmp); - /* the temporary file is automatically deleted */ - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagegif(int im [, string filename]) - Output GIF image to browser or file */ -PHP_FUNCTION(imagegif) -{ -#ifdef HAVE_GD_GIF_CREATE -#ifdef HAVE_GD_GIF_CTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGifCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGif); -#endif -#else /* HAVE_GD_GIF_CREATE */ - php_error(E_WARNING, "ImageGif: No GIF create support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_GIF_CREATE */ -} -/* }}} */ - -/* {{{ proto int imagepng(int im [, string filename]) - Output PNG image to browser or file */ -PHP_FUNCTION(imagepng) -{ -#ifdef HAVE_GD_PNG -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePngCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePng); -#endif -#else /* HAVE_GD_PNG */ - php_error(E_WARNING, "ImagePng: No PNG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_PNG */ -} -/* }}} */ - -/* {{{ proto int imagejpeg(int im [, string filename [, int quality]]) - Output JPEG image to browser or file */ -PHP_FUNCTION(imagejpeg) -{ -#ifdef HAVE_GD_JPG -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpegCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpeg); -#endif -#else /* HAVE_GD_JPG */ - php_error(E_WARNING, "ImageJpeg: No JPG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_JPG */ -} -/* }}} */ - -/* {{{ proto int imagewbmp(int im [, string filename, [, int foreground]]) - Output WBMP image to browser or file */ -PHP_FUNCTION(imagewbmp) -{ -#ifdef HAVE_GD_WBMP -#ifdef USE_GD_IOCTX - _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMPCtx); -#else - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMP); -#endif -#else /* HAVE_GD_WBMP */ - php_error(E_WARNING, "ImageWBMP: No WBMP support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_WBMP */ -} -/* }}} */ - -/* {{{ proto int imagegd(int im [, string filename]) - Output GD image to browser or file */ -PHP_FUNCTION(imagegd) -{ - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageGd); -} -/* }}} */ - -/* {{{ proto int imagegd2(int im [, string filename]) - Output GD2 image to browser or file */ -PHP_FUNCTION(imagegd2) -{ -#ifdef HAVE_GD_GD2 - _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageGd2); -#else /* HAVE_GD_GD2 */ - php_error(E_WARNING, "ImageGd2: No GD2 support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_GD2 */ -} -/* }}} */ - -/* {{{ proto int imagedestroy(int im) - Destroy an image */ -PHP_FUNCTION(imagedestroy) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - zend_list_delete(Z_LVAL_PP(IM)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue) - Allocate a color for an image */ -PHP_FUNCTION(imagecolorallocate) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorAllocate(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto int imagepalettecopy(int dst, int src) - Copy the palette from the src image onto the dst image */ -PHP_FUNCTION(imagepalettecopy) -{ -#if HAVE_LIBGD15 - zval **dstim, **srcim; - gdImagePtr dst, src; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dstim, &srcim) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(dst, gdImagePtr, dstim, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(src, gdImagePtr, srcim, -1, "Image", le_gd); - - gdImagePaletteCopy(dst, src); -#else - php_error(E_WARNING, "Sorry ImagePaletteCopy was introduced in GD version 1.5"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int imagecolorat(int im, int x, int y) - Get the index of the color of a pixel */ -PHP_FUNCTION(imagecolorat) -{ - zval **IM, **x, **y; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &x, &y) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - -#if HAVE_LIBGD20 - if(gdImageTrueColor(im)) { - if (im->tpixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { - RETURN_LONG(gdImageTrueColorPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y))); - } else { - php_error(E_NOTICE, "%ld,%ld is out of bounds",Z_LVAL_PP(x), Z_LVAL_PP(y)); - RETURN_FALSE; - } - } else { -#endif - if (im->pixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { -#if HAVE_LIBGD13 - RETURN_LONG(im->pixels[Z_LVAL_PP(y)][Z_LVAL_PP(x)]); -#else - RETURN_LONG(im->pixels[Z_LVAL_PP(x)][Z_LVAL_PP(y)]); -#endif - } else { - php_error(E_NOTICE, "%ld,%ld is out of bounds",Z_LVAL_PP(x), Z_LVAL_PP(y)); - RETURN_FALSE; - } -#if HAVE_LIBGD20 - } -#endif -} -/* }}} */ - -/* {{{ proto int imagecolorclosest(int im, int red, int green, int blue) - Get the index of the closest color to the specified color */ -PHP_FUNCTION(imagecolorclosest) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorClosest(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto int imagecolorclosesthwb(int im, int red, int green, int blue) - Get the index of the color which has the hue, white and blackness nearest to the given color */ -PHP_FUNCTION(imagecolorclosesthwb) -{ -#if HAVE_COLORCLOSESTHWB - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorClosestHWB(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -#else - php_error(E_WARNING, "ImageColorClosestHWB functionality was added in GD 1.8"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int imagecolordeallocate(int im, int index) - De-allocate a color for an image */ -PHP_FUNCTION(imagecolordeallocate) -{ - zval **IM, **index; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(index); - col = Z_LVAL_PP(index); - - if (col >= 0 && col < gdImageColorsTotal(im)) { - gdImageColorDeallocate(im, col); - RETURN_TRUE; - } else { - php_error(E_WARNING, "Color index out of range"); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int imagecolorresolve(int im, int red, int green, int blue) - Get the index of the specified color or its closest possible alternative */ -PHP_FUNCTION(imagecolorresolve) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorResolve(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto int imagecolorexact(int im, int red, int green, int blue) - Get the index of the specified color */ -PHP_FUNCTION(imagecolorexact) -{ - zval **IM, **red, **green, **blue; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - RETURN_LONG(gdImageColorExact(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); -} -/* }}} */ - -/* {{{ proto int imagecolorset(int im, int col, int red, int green, int blue) - Set the color for the specified palette index */ -PHP_FUNCTION(imagecolorset) -{ - zval **IM, **color, **red, **green, **blue; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &color, &red, &green, &blue) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(color); - convert_to_long_ex(red); - convert_to_long_ex(green); - convert_to_long_ex(blue); - - col = Z_LVAL_PP(color); - - if (col >= 0 && col < gdImageColorsTotal(im)) { - im->red[col] = Z_LVAL_PP(red); - im->green[col] = Z_LVAL_PP(green); - im->blue[col] = Z_LVAL_PP(blue); - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto array imagecolorsforindex(int im, int col) - Get the colors for an index */ -PHP_FUNCTION(imagecolorsforindex) -{ - zval **IM, **index; - int col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(index); - col = Z_LVAL_PP(index); -#if HAVE_LIBGD20 - if ((col >= 0 && gdImageTrueColor(im)) || (!gdImageTrueColor(im) && col >= 0 && col < gdImageColorsTotal(im))) { - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - add_assoc_long(return_value,"red", gdImageRed(im,col)); - add_assoc_long(return_value,"green", gdImageGreen(im,col)); - add_assoc_long(return_value,"blue", gdImageBlue(im,col)); - add_assoc_long(return_value,"alpha", gdImageAlpha(im,col)); - } -#else - if (col >= 0 && col < gdImageColorsTotal(im)) { - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - add_assoc_long(return_value,"red", im->red[col]); - add_assoc_long(return_value,"green", im->green[col]); - add_assoc_long(return_value,"blue", im->blue[col]); - } -#endif - else { - php_error(E_WARNING, "Color index out of range"); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int imagegammacorrect(int im, float inputgamma, float outputgamma) - Apply a gamma correction to a GD image */ -PHP_FUNCTION(imagegammacorrect) -{ - zval **IM, **inputgamma, **outputgamma; - gdImagePtr im; - int i; - double input, output; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &inputgamma, &outputgamma) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(inputgamma); - convert_to_double_ex(outputgamma); - - input = Z_DVAL_PP(inputgamma); - output = Z_DVAL_PP(outputgamma); - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - -#if HAVE_LIBGD20 - if (gdImageTrueColor(im)) { - int x, y, c; - - for (y = 0; y < gdImageSY(im); y++) { - for (x = 0; x < gdImageSX(im); x++) { - c = gdImageGetPixel(im, x, y); - gdImageSetPixel(im, x, y, - gdTrueColor( - (int)((pow((pow((gdTrueColorGetRed(c) / 255.0), input)), 1.0 / output) * 255)+.5), - (int)((pow((pow((gdTrueColorGetGreen(c) / 255.0), input)), 1.0 / output) * 255)+.5), - (int)((pow((pow((gdTrueColorGetBlue(c) / 255.0), input)), 1.0 / output) * 255)+.5) - ) - ); - } - } - RETURN_TRUE; - } -#endif - for (i = 0; i < gdImageColorsTotal(im); i++) { - im->red[i] = (int)((pow((pow((im->red[i] / 255.0), input)), 1.0 / output) * 255)+.5); - im->green[i] = (int)((pow((pow((im->green[i] / 255.0), input)), 1.0 / output) * 255)+.5); - im->blue[i] = (int)((pow((pow((im->blue[i] / 255.0), input)), 1.0 / output) * 255)+.5); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagesetpixel(int im, int x, int y, int col) - Set a single pixel */ -PHP_FUNCTION(imagesetpixel) -{ - zval **IM, **x, **y, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(col); - - gdImageSetPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imageline(int im, int x1, int y1, int x2, int y2, int col) - Draw a line */ -PHP_FUNCTION(imageline) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagedashedline(int im, int x1, int y1, int x2, int y2, int col) - Draw a dashed line */ -PHP_FUNCTION(imagedashedline) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageDashedLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagerectangle(int im, int x1, int y1, int x2, int y2, int col) - Draw a rectangle */ -PHP_FUNCTION(imagerectangle) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagefilledrectangle(int im, int x1, int y1, int x2, int y2, int col) - Draw a filled rectangle */ -PHP_FUNCTION(imagefilledrectangle) -{ - zval **IM, **x1, **y1, **x2, **y2, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x1); - convert_to_long_ex(y1); - convert_to_long_ex(x2); - convert_to_long_ex(y2); - convert_to_long_ex(col); - - gdImageFilledRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagearc(int im, int cx, int cy, int w, int h, int s, int e, int col) - Draw a partial ellipse */ -PHP_FUNCTION(imagearc) -{ - zval **IM, **cx, **cy, **w, **h, **ST, **E, **col; - gdImagePtr im; - int e, st; - - if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(cx); - convert_to_long_ex(cy); - convert_to_long_ex(w); - convert_to_long_ex(h); - convert_to_long_ex(ST); - convert_to_long_ex(E); - convert_to_long_ex(col); - - e = Z_LVAL_PP(E); - st = Z_LVAL_PP(ST); - - if (e < 0) e %= 360; - if (st < 0) st %= 360; - - gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagefilltoborder(int im, int x, int y, int border, int col) - Flood fill to specific color */ -PHP_FUNCTION(imagefilltoborder) -{ - zval **IM, **x, **y, **border, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &x, &y, &border, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(border); - convert_to_long_ex(col); - - gdImageFillToBorder(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(border), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagefill(int im, int x, int y, int col) - Flood fill */ -PHP_FUNCTION(imagefill) -{ - zval **IM, **x, **y, **col; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(x); - convert_to_long_ex(y); - convert_to_long_ex(col); - - gdImageFill(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagecolorstotal(int im) - Find out the number of colors in an image's palette */ -PHP_FUNCTION(imagecolorstotal) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageColorsTotal(im)); -} -/* }}} */ - -/* {{{ proto int imagecolortransparent(int im [, int col]) - Define a color as transparent */ -PHP_FUNCTION(imagecolortransparent) -{ - zval **IM, **COL; - gdImagePtr im; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - break; - case 2: - if (zend_get_parameters_ex(2, &IM, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_long_ex(COL); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - if (ZEND_NUM_ARGS() > 1) { - gdImageColorTransparent(im, Z_LVAL_PP(COL)); - } - - RETURN_LONG(gdImageGetTransparent(im)); -} -/* }}} */ - -/* {{{ proto int imageinterlace(int im [, int interlace]) - Enable or disable interlace */ -PHP_FUNCTION(imageinterlace) -{ - zval **IM, **INT; - gdImagePtr im; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - break; - case 2: - if (zend_get_parameters_ex(2, &IM, &INT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - convert_to_long_ex(INT); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - if (ZEND_NUM_ARGS() > 1) { - gdImageInterlace(im, Z_LVAL_PP(INT)); - } - - RETURN_LONG(gdImageGetInterlaced(im)); -} -/* }}} */ - -/* {{{ php_imagepolygon - arg = 0 normal polygon - arg = 1 filled polygon */ -/* im, points, num_points, col */ -static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) -{ - zval **IM, **POINTS, **NPOINTS, **COL; - pval **var = NULL; - gdImagePtr im; - gdPointPtr points; - int npoints, col, nelem, i; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &POINTS, &NPOINTS, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(NPOINTS); - convert_to_long_ex(COL); - - npoints = Z_LVAL_PP(NPOINTS); - col = Z_LVAL_PP(COL); - - if (Z_TYPE_PP(POINTS) != IS_ARRAY) { - php_error(E_WARNING, "2nd argument to imagepolygon not an array"); - RETURN_FALSE; - } - - nelem = zend_hash_num_elements(Z_ARRVAL_PP(POINTS)); - if (nelem < 6) { - php_error(E_WARNING, "you must have at least 3 points in your array"); - RETURN_FALSE; - } - - if (nelem < npoints * 2) { - php_error(E_WARNING, "trying to use %d points in array with only %d points", npoints, nelem/2); - RETURN_FALSE; - } - - points = (gdPointPtr) emalloc(npoints * sizeof(gdPoint)); - - for (i = 0; i < npoints; i++) { - if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) { - SEPARATE_ZVAL((var)); - convert_to_long(*var); - points[i].x = Z_LVAL_PP(var); - } - if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2) + 1, (void **) &var) == SUCCESS) { - SEPARATE_ZVAL(var); - convert_to_long(*var); - points[i].y = Z_LVAL_PP(var); - } - } - - if (filled) { - gdImageFilledPolygon(im, points, npoints, col); - } else { - gdImagePolygon(im, points, npoints, col); - } - - efree(points); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagepolygon(int im, array point, int num_points, int col) - Draw a polygon */ -PHP_FUNCTION(imagepolygon) -{ - php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int imagefilledpolygon(int im, array point, int num_points, int col) - Draw a filled polygon */ -PHP_FUNCTION(imagefilledpolygon) -{ - php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_find_gd_font - */ -static gdFontPtr php_find_gd_font(int size) -{ - gdFontPtr font; - int ind_type; - TSRMLS_FETCH(); - - switch (size) { - case 1: - font = gdFontTiny; - break; - case 2: - font = gdFontSmall; - break; - case 3: - font = gdFontMediumBold; - break; - case 4: - font = gdFontLarge; - break; - case 5: - font = gdFontGiant; - break; - default: - font = zend_list_find(size - 5, &ind_type); - if (!font || ind_type != le_gd_font) { - if (size < 1) { - font = gdFontTiny; - } else { - font = gdFontGiant; - } - } - break; - } - - return font; -} -/* }}} */ - -/* {{{ php_imagefontsize - * arg = 0 ImageFontWidth - * arg = 1 ImageFontHeight - */ -static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg) -{ - zval **SIZE; - gdFontPtr font; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &SIZE) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(SIZE); - - font = php_find_gd_font(Z_LVAL_PP(SIZE)); - RETURN_LONG(arg ? font->h : font->w); -} -/* }}} */ - -/* {{{ proto int imagefontwidth(int font) - Get font width */ -PHP_FUNCTION(imagefontwidth) -{ - php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int imagefontheight(int font) - Get font height */ -PHP_FUNCTION(imagefontheight) -{ - php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_gdimagecharup - * workaround for a bug in gd 1.2 */ -static void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) -{ - int cx, cy, px, py, fline; - cx = 0; - cy = 0; - if ((c < f->offset) || (c >= (f->offset + f->nchars))) { - return; - } - fline = (c - f->offset) * f->h * f->w; - for (py = y; (py > (y - f->w)); py--) { - for (px = x; (px < (x + f->h)); px++) { - if (f->data[fline + cy * f->w + cx]) { - gdImageSetPixel(im, px, py, color); - } - cy++; - } - cy = 0; - cx++; - } -} -/* }}} */ - -/* {{{ php_imagechar - * arg = 0 ImageChar - * arg = 1 ImageCharUp - * arg = 2 ImageString - * arg = 3 ImageStringUp - */ -static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) -{ - zval **IM, **SIZE, **X, **Y, **C, **COL; - gdImagePtr im; - int ch = 0, col, x, y, size, i, l = 0; - unsigned char *str = NULL; - gdFontPtr font; - - if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &SIZE, &X, &Y, &C, &COL) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - convert_to_long_ex(SIZE); - convert_to_long_ex(X); - convert_to_long_ex(Y); - convert_to_string_ex(C); - convert_to_long_ex(COL); - - col = Z_LVAL_PP(COL); - - if (mode < 2) { - ch = (int)((unsigned char)*(Z_STRVAL_PP(C))); - } else { - str = (unsigned char *) estrndup(Z_STRVAL_PP(C), Z_STRLEN_PP(C)); - l = strlen(str); - } - - y = Z_LVAL_PP(Y); - x = Z_LVAL_PP(X); - size = Z_LVAL_PP(SIZE); - - font = php_find_gd_font(size); - - switch(mode) { - case 0: - gdImageChar(im, font, x, y, ch, col); - break; - case 1: - php_gdimagecharup(im, font, x, y, ch, col); - break; - case 2: - for (i = 0; (i < l); i++) { - gdImageChar(im, font, x, y, (int)((unsigned char)str[i]), - col); - x += font->w; - } - break; - case 3: { - for (i = 0; (i < l); i++) { - /* php_gdimagecharup(im, font, x, y, (int)str[i], col); */ - gdImageCharUp(im, font, x, y, (int)str[i], col); - y -= font->w; - } - break; - } - } - if (str) { - efree(str); - } - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagechar(int im, int font, int x, int y, string c, int col) - Draw a character */ -PHP_FUNCTION(imagechar) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int imagecharup(int im, int font, int x, int y, string c, int col) - Draw a character rotated 90 degrees counter-clockwise */ -PHP_FUNCTION(imagecharup) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto int imagestring(int im, int font, int x, int y, string str, int col) - Draw a string horizontally */ -PHP_FUNCTION(imagestring) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); -} -/* }}} */ - -/* {{{ proto int imagestringup(int im, int font, int x, int y, string str, int col) - Draw a string vertically - rotated 90 degrees counter-clockwise */ -PHP_FUNCTION(imagestringup) -{ - php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); -} -/* }}} */ - -/* {{{ proto int imagecopy(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h) - Copy part of an image */ -PHP_FUNCTION(imagecopy) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 8 || - zend_get_parameters_ex(8, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - - gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagecopymerge(int src_im, int dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) - Merge one part of an image with another */ -PHP_FUNCTION(imagecopymerge) -{ -#if HAVE_LIBGD15 - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX, pct; - - if (ZEND_NUM_ARGS() != 9 || - zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(PCT); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - pct = Z_LVAL_PP(PCT); - - gdImageCopyMerge(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; -#else - php_error(E_WARNING, "ImageCopyMerge was introduced in GD version 1.5"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int imagecopymergegray(int src_im, int dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) - Merge one part of an image with another */ -PHP_FUNCTION(imagecopymergegray) -{ -#if HAVE_LIBGD15 - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; - gdImagePtr im_dst, im_src; - int srcH, srcW, srcY, srcX, dstY, dstX, pct; - - if (ZEND_NUM_ARGS() != 9 || - zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(PCT); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - pct = Z_LVAL_PP(PCT); - - gdImageCopyMergeGray(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); - RETURN_TRUE; -#else - php_error(E_WARNING, "%s(): was introduced in GD version 1.5", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int imagecopyresized(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) - Copy and resize part of an image */ -PHP_FUNCTION(imagecopyresized) -{ - zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; - gdImagePtr im_dst, im_src; - int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; - - if (ZEND_NUM_ARGS() != 10 || - zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); - - convert_to_long_ex(SX); - convert_to_long_ex(SY); - convert_to_long_ex(SW); - convert_to_long_ex(SH); - convert_to_long_ex(DX); - convert_to_long_ex(DY); - convert_to_long_ex(DW); - convert_to_long_ex(DH); - - srcX = Z_LVAL_PP(SX); - srcY = Z_LVAL_PP(SY); - srcH = Z_LVAL_PP(SH); - srcW = Z_LVAL_PP(SW); - dstX = Z_LVAL_PP(DX); - dstY = Z_LVAL_PP(DY); - dstH = Z_LVAL_PP(DH); - dstW = Z_LVAL_PP(DW); - - gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto int imagesx(int im) - Get image width */ -PHP_FUNCTION(imagesx) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageSX(im)); -} -/* }}} */ - -/* {{{ proto int imagesy(int im) - Get image height */ -PHP_FUNCTION(imagesy) -{ - zval **IM; - gdImagePtr im; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - - RETURN_LONG(gdImageSY(im)); -} -/* }}} */ - -#ifdef ENABLE_GD_TTF -#define TTFTEXT_DRAW 0 -#define TTFTEXT_BBOX 1 -#endif - - -/* {{{ proto array imageftbbox(int size, int angle, string font_file, string text[, array extrainfo]) - Give the bounding box of a text using fonts via freetype2 */ -PHP_FUNCTION(imageftbbox) -{ -#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1); -#else - php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto array imagefttext(int im, int size, int angle, int x, int y, int col, string font_file, string text, [array extrainfo]) - Write text to the image using fonts via freetype2 */ -PHP_FUNCTION(imagefttext) -{ -#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1); -#else - php_error(E_WARNING, "%s(): No FreeType 2 support in this PHP build", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; -#endif -} -/* }}} */ - - -/* {{{ proto array imagettfbbox(int size, int angle, string font_file, string text) - Give the bounding box of a text using TrueType fonts */ -PHP_FUNCTION(imagettfbbox) -{ -#ifdef ENABLE_GD_TTF - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 0); -#else - php_error(E_WARNING, "ImageTtfBBox: No TTF support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto array imagettftext(int im, int size, int angle, int x, int y, int col, string font_file, string text) - Write text to the image using a TrueType font */ -PHP_FUNCTION(imagettftext) -{ -#ifdef ENABLE_GD_TTF - php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 0); -#else - php_error(E_WARNING, "ImageTtfText: No TTF support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -#ifdef ENABLE_GD_TTF -/* {{{ php_imagettftext_common - */ -static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int extended) -{ - zval **IM, **PTSIZE, **ANGLE, **X, **Y, **C, **FONTNAME, **COL, **EXT = NULL; - gdImagePtr im=NULL; - int col, x, y, l=0, i, brect[8]; - double ptsize, angle; - unsigned char *str = NULL, *fontname = NULL; - char *error; - int argc; -#if HAVE_GD_STRINGFTEX - gdFTStringExtra strex; -#endif - -#if !HAVE_GD_STRINGFTEX - if (extended) { - zend_error(E_WARNING, "%s(): gdImageStringFTEx not supported in this PHP build", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } -#endif - - argc = ZEND_NUM_ARGS(); - - if (mode == TTFTEXT_BBOX) { - if ((extended && argc != 5) || (!extended && argc != 4) || - zend_get_parameters_ex(argc, &PTSIZE, &ANGLE, &FONTNAME, &C, &EXT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - } else { - if ((extended && argc != 9) || (!extended && argc != 8) || - zend_get_parameters_ex(argc, &IM, &PTSIZE, &ANGLE, &X, &Y, &COL, &FONTNAME, &C, &EXT) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); - } - - convert_to_double_ex(PTSIZE); - convert_to_double_ex(ANGLE); - convert_to_string_ex(FONTNAME); - convert_to_string_ex(C); - - if (mode == TTFTEXT_BBOX) { - im = NULL; - col = x = y = -1; - } else { - convert_to_long_ex(X); - convert_to_long_ex(Y); - convert_to_long_ex(COL); - col = Z_LVAL_PP(COL); - y = Z_LVAL_PP(Y); - x = Z_LVAL_PP(X); - -#if HAVE_GD_STRINGFTEX - if (EXT) { - /* parse extended info */ - - HashPosition pos; - - convert_to_array_ex(EXT); - memset(&strex, 0, sizeof(strex)); - - /* walk the assoc array */ - zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos); - do { - zval ** item; - char * key; - - if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, NULL, 0, &pos) == FAILURE) - continue; - - if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)&item, &pos) == FAILURE) - continue; - - if (strcmp("linespacing", key) == 0) { - convert_to_double_ex(item); - strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_PP(item); - } - - } while(zend_hash_move_forward_ex(HASH_OF(*EXT), &pos) == SUCCESS); - } -#endif - - } - - ptsize = Z_DVAL_PP(PTSIZE); - angle = Z_DVAL_PP(ANGLE) * (M_PI/180); /* convert to radians */ - - str = (unsigned char *) Z_STRVAL_PP(C); - l = strlen(str); - -#ifdef VIRTUAL_DIR - if(virtual_filepath(Z_STRVAL_PP(FONTNAME), &fontname TSRMLS_CC)) { - fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME); - } -#else - fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME); -#endif - - -#ifdef USE_GD_IMGSTRTTF -# if HAVE_GD_STRINGFTEX - if (extended) { - error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex); - } - else -# endif - -# if HAVE_GD_STRINGFT - error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str); -# elif HAVE_GD_STRINGTTF - error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y, str); -# endif - -#else /* !USE_GD_IMGSTRTTF */ - error = gdttf(im, brect, col, fontname, ptsize, angle, x, y, str); -#endif - - - if (error) { - php_error(E_WARNING, "%s", error); - RETURN_FALSE; - } - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - /* return array with the text's bounding box */ - for (i = 0; i < 8; i++) { - add_next_index_long(return_value, brect[i]); - } -} -/* }}} */ -#endif /* ENABLE_GD_TTF */ - -#if HAVE_LIBT1 - -/* {{{ php_free_ps_font - */ -void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - int *font = (int *)rsrc->ptr; - - T1_DeleteFont(*font); - efree(font); -} -/* }}} */ - -/* {{{ php_free_ps_enc - */ -void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - char **enc = (char **)rsrc->ptr; - - T1_DeleteEncoding(enc); -} -/* }}} */ - -#endif - -/* {{{ proto int imagepsloadfont(string pathname) - Load a new font from specified file */ -PHP_FUNCTION(imagepsloadfont) -{ -#if HAVE_LIBT1 - zval **file; - int f_ind, *font; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - - f_ind = T1_AddFont(Z_STRVAL_PP(file)); - - if (f_ind < 0) { - switch (f_ind) { - case -1: - php_error(E_WARNING, "Couldn't find the font file"); - RETURN_FALSE; - break; - case -2: - case -3: - php_error(E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error(E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } - } - - if (T1_LoadFont(f_ind)) { - php_error(E_WARNING, "Couldn't load the font"); - RETURN_FALSE; - } - - font = (int *) emalloc(sizeof(int)); - *font = f_ind; - ZEND_REGISTER_RESOURCE(return_value, font, le_ps_font); -#else - php_error(E_WARNING, "ImagePsLoadFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int imagepscopyfont(int font_index) - Make a copy of a font for purposes like extending or reenconding */ -/* The function in t1lib which this function uses seem to be buggy... -PHP_FUNCTION(imagepscopyfont) -{ -#if HAVE_LIBT1 - zval **fnt; - int l_ind, type; - gd_ps_font *nf_ind, *of_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_long_ex(fnt); - - of_ind = zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != le_ps_font) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - nf_ind = emalloc(sizeof(gd_ps_font)); - nf_ind->font_id = T1_CopyFont(of_ind->font_id); - - if (nf_ind->font_id < 0) { - l_ind = nf_ind->font_id; - efree(nf_ind); - switch (l_ind) { - case -1: - php_error(E_WARNING, "FontID %d is not loaded in memory", l_ind); - RETURN_FALSE; - break; - case -2: - php_error(E_WARNING, "Tried to copy a logical font"); - RETURN_FALSE; - break; - case -3: - php_error(E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error(E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } - } - - nf_ind->extend = 1; - l_ind = zend_list_insert(nf_ind, le_ps_font); - RETURN_LONG(l_ind); -#else - php_error(E_WARNING, "ImagePsCopyFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -*/ -/* }}} */ - -/* {{{ proto bool imagepsfreefont(int font_index) - Free memory used by a font */ -PHP_FUNCTION(imagepsfreefont) -{ -#if HAVE_LIBT1 - zval **fnt; - int *f_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - zend_list_delete(Z_LVAL_PP(fnt)); - RETURN_TRUE; -#else - php_error(E_WARNING, "ImagePsFreeFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto bool imagepsencodefont(int font_index, string filename) - To change a fonts character encoding vector */ -PHP_FUNCTION(imagepsencodefont) -{ -#if HAVE_LIBT1 - zval **fnt, **enc; - char **enc_vector; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &enc) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(enc); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - if ((enc_vector = T1_LoadEncoding(Z_STRVAL_PP(enc))) == NULL) { - php_error(E_WARNING, "Couldn't load encoding vector from %s", Z_STRVAL_PP(enc)); - RETURN_FALSE; - } - - T1_DeleteAllSizes(*f_ind); - if (T1_ReencodeFont(*f_ind, enc_vector)) { - T1_DeleteEncoding(enc_vector); - php_error(E_WARNING, "Couldn't reencode font"); - RETURN_FALSE; - } - zend_list_insert(enc_vector, le_ps_enc); - RETURN_TRUE; -#else - php_error(E_WARNING, "ImagePsEncodeFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto bool imagepsextendfont(int font_index, float extend) - Extend or or condense (if extend < 1) a font */ -PHP_FUNCTION(imagepsextendfont) -{ -#if HAVE_LIBT1 - zval **fnt, **ext; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &ext) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(ext); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - if (T1_ExtendFont(*f_ind, Z_DVAL_PP(ext)) != 0) RETURN_FALSE; - - RETURN_TRUE; -#else - php_error(E_WARNING, "ImagePsExtendFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto bool imagepsslantfont(int font_index, float slant) - Slant a font */ -PHP_FUNCTION(imagepsslantfont) -{ -#if HAVE_LIBT1 - zval **fnt, **slt; - int *f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &slt) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_double_ex(slt); - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - if (T1_SlantFont(*f_ind, Z_DVAL_PP(slt)) != 0) RETURN_FALSE; - RETURN_TRUE; -#else - php_error(E_WARNING, "ImagePsSlantFont: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias]) - Rasterize a string over an image */ -PHP_FUNCTION(imagepstext) -{ -#if HAVE_LIBT1 - zval **img, **str, **fnt, **sz, **fg, **bg, **sp, **px, **py, **aas, **wd, **ang; - int i, j, x, y; - int space; - int *f_ind; - int h_lines, v_lines, c_ind; - int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl, _fg, _bg; - int aa[16], aa_steps; - int width, amount_kern, add_width; - double angle, extend; - unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - gdImagePtr bg_img; - GLYPH *str_img; - T1_OUTLINE *char_path, *str_path; - T1_TMATRIX *transform = NULL; - char *_str; - - switch(ZEND_NUM_ARGS()) { - case 8: - if (zend_get_parameters_ex(8, &img, &str, &fnt, &sz, &fg, &bg, &px, &py) == FAILURE) { - RETURN_FALSE; - } - space = 0; - aa_steps = 4; - width = 0; - angle = 0; - break; - case 12: - if (zend_get_parameters_ex(12, &img, &str, &fnt, &sz, &fg, &bg, &px, &py, &sp, &wd, &ang, &aas) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sp); - convert_to_long_ex(aas); - convert_to_long_ex(wd); - convert_to_double_ex(ang); - space = Z_LVAL_PP(sp); - aa_steps = Z_LVAL_PP(aas); - width = Z_LVAL_PP(wd); - angle = Z_DVAL_PP(ang); - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, img, -1, "Image", le_gd); - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - x = Z_LVAL_PP(px); - y = Z_LVAL_PP(py); - _fg = Z_LVAL_PP(fg); - _bg = Z_LVAL_PP(bg); - - fg_rd = gdImageRed (bg_img, _fg); - fg_gr = gdImageGreen(bg_img, _fg); - fg_bl = gdImageBlue (bg_img, _fg); - - bg_rd = gdImageRed (bg_img, _bg); - bg_gr = gdImageGreen(bg_img, _bg); - bg_bl = gdImageBlue (bg_img, _bg); - - for (i = 0; i < aa_steps; i++) { - rd = bg_rd+(double)(fg_rd-bg_rd)/aa_steps*(i+1); - gr = bg_gr+(double)(fg_gr-bg_gr)/aa_steps*(i+1); - bl = bg_bl+(double)(fg_bl-bg_bl)/aa_steps*(i+1); - aa[i] = gdImageColorResolve(bg_img, rd, gr, bl); - } - - T1_AASetBitsPerPixel(8); - - switch (aa_steps) { - case 4: - T1_AASetGrayValues(0, 1, 2, 3, 4); - T1_AASetLevel(T1_AA_LOW); - break; - case 16: - T1_AAHSetGrayValues(aa_greys); - T1_AASetLevel(T1_AA_HIGH); - break; - default: - php_error(E_WARNING, "Invalid value %d as number of steps for antialiasing", aa_steps); - RETURN_FALSE; - } - - if (angle) { - transform = T1_RotateMatrix(NULL, angle); - } - - _str = Z_STRVAL_PP(str); - - if (width) { - extend = T1_GetExtend(*f_ind); - str_path = T1_GetCharOutline(*f_ind, _str[0], Z_LVAL_PP(sz), transform); - - for (i = 1; i < Z_STRLEN_PP(str); i++) { - amount_kern = (int) T1_GetKerning(*f_ind, _str[i-1], _str[i]); - amount_kern += _str[i-1] == ' ' ? space : 0; - add_width = (int) (amount_kern+width)/extend; - - char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, Z_LVAL_PP(sz), transform); - str_path = T1_ConcatOutlines(str_path, char_path); - - char_path = T1_GetCharOutline(*f_ind, _str[i], Z_LVAL_PP(sz), transform); - str_path = T1_ConcatOutlines(str_path, char_path); - } - str_img = T1_AAFillOutline(str_path, 0); - } else { - str_img = T1_AASetString(*f_ind, _str, Z_STRLEN_PP(str), space, T1_KERNING, Z_LVAL_PP(sz), transform); - } - - if (T1_errno) { - php_error(E_WARNING, "libt1 returned error %d", T1_errno); - RETURN_FALSE; - } - - h_lines = str_img->metrics.ascent - str_img->metrics.descent; - v_lines = str_img->metrics.rightSideBearing - str_img->metrics.leftSideBearing; - - for (i = 0; i < v_lines; i++) { - for (j = 0; j < h_lines; j++) { - switch (str_img->bits[j*v_lines+i]) { - case 0: - break; - default: - c_ind = aa[str_img->bits[j*v_lines+i]-1]; - gdImageSetPixel(bg_img, x+str_img->metrics.leftSideBearing+i, y-str_img->metrics.ascent+j, c_ind); - } - } - } - - if (array_init(return_value) == FAILURE) { - php_error(E_WARNING, "Couldn't initialize array for returning bounding box"); - RETURN_FALSE; - } - - add_next_index_long(return_value, str_img->metrics.leftSideBearing); - add_next_index_long(return_value, str_img->metrics.descent); - add_next_index_long(return_value, str_img->metrics.rightSideBearing); - add_next_index_long(return_value, str_img->metrics.ascent); - -#else - php_error(E_WARNING, "ImagePsText: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle]) - Return the bounding box needed by a string if rasterized */ -PHP_FUNCTION(imagepsbbox) -{ -#if HAVE_LIBT1 - zval **str, **fnt, **sz, **sp, **wd, **ang; - int i, space, add_width = 0, char_width, amount_kern; - int cur_x, cur_y, dx, dy; - int x1, y1, x2, y2, x3, y3, x4, y4; - int *f_ind; - int per_char = 0; - double angle, sin_a = 0, cos_a = 0; - BBox char_bbox, str_bbox = {0, 0, 0, 0}; - - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, &str, &fnt, &sz) == FAILURE) { - RETURN_FALSE; - } - space = 0; - break; - case 6: - if (zend_get_parameters_ex(6, &str, &fnt, &sz, &sp, &wd, &ang) == FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(sp); - convert_to_long_ex(wd); - convert_to_double_ex(ang); - space = Z_LVAL_PP(sp); - add_width = Z_LVAL_PP(wd); - angle = Z_DVAL_PP(ang) * M_PI / 180; - sin_a = sin(angle); - cos_a = cos(angle); - per_char = add_width || angle ? 1 : 0; - break; - default: - ZEND_WRONG_PARAM_COUNT(); - } - - ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); - - convert_to_string_ex(str); - convert_to_long_ex(sz); - -#define max(a, b) (a > b ? a : b) -#define min(a, b) (a < b ? a : b) -#define new_x(a, b) (int) ((a) * cos_a - (b) * sin_a) -#define new_y(a, b) (int) ((a) * sin_a + (b) * cos_a) - - if (per_char) { - space += T1_GetCharWidth(*f_ind, ' '); - cur_x = cur_y = 0; - - for (i = 0; i < Z_STRLEN_PP(str); i++) { - if (Z_STRVAL_PP(str)[i] == ' ') { - char_bbox.llx = char_bbox.lly = char_bbox.ury = 0; - char_bbox.urx = char_width = space; - } else { - char_bbox = T1_GetCharBBox(*f_ind, Z_STRVAL_PP(str)[i]); - char_width = T1_GetCharWidth(*f_ind, Z_STRVAL_PP(str)[i]); - } - amount_kern = i ? T1_GetKerning(*f_ind, Z_STRVAL_PP(str)[i-1], Z_STRVAL_PP(str)[i]) : 0; - - /* Transfer character bounding box to right place */ - x1 = new_x(char_bbox.llx, char_bbox.lly) + cur_x; - y1 = new_y(char_bbox.llx, char_bbox.lly) + cur_y; - x2 = new_x(char_bbox.llx, char_bbox.ury) + cur_x; - y2 = new_y(char_bbox.llx, char_bbox.ury) + cur_y; - x3 = new_x(char_bbox.urx, char_bbox.ury) + cur_x; - y3 = new_y(char_bbox.urx, char_bbox.ury) + cur_y; - x4 = new_x(char_bbox.urx, char_bbox.lly) + cur_x; - y4 = new_y(char_bbox.urx, char_bbox.lly) + cur_y; - - /* Find min & max values and compare them with current bounding box */ - str_bbox.llx = min(str_bbox.llx, min(x1, min(x2, min(x3, x4)))); - str_bbox.lly = min(str_bbox.lly, min(y1, min(y2, min(y3, y4)))); - str_bbox.urx = max(str_bbox.urx, max(x1, max(x2, max(x3, x4)))); - str_bbox.ury = max(str_bbox.ury, max(y1, max(y2, max(y3, y4)))); - - /* Move to the next base point */ - dx = new_x(char_width + add_width + amount_kern, 0); - dy = new_y(char_width + add_width + amount_kern, 0); - cur_x += dx; - cur_y += dy; - /* - printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", x1, y1, x2, y2, x3, y3, x4, y4, char_bbox.llx, char_bbox.lly, char_bbox.urx, char_bbox.ury, char_width, amount_kern, cur_x, cur_y, dx, dy); - */ - } - - } else { - str_bbox = T1_GetStringBBox(*f_ind, Z_STRVAL_PP(str), Z_STRLEN_PP(str), space, T1_KERNING); - } - if (T1_errno) RETURN_FALSE; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - /* - printf("%d %d %d %d\n", str_bbox.llx, str_bbox.lly, str_bbox.urx, str_bbox.ury); - */ - add_next_index_long(return_value, (int) ceil(((double) str_bbox.llx)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.lly)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.urx)*Z_LVAL_PP(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.ury)*Z_LVAL_PP(sz)/1000)); -#else - php_error(E_WARNING, "ImagePsBBox: No T1lib support in this PHP build"); - RETURN_FALSE; -#endif -} -/* }}} */ - -/* {{{ proto int image2wbmp(int im [, string filename [, int threshold]]) - Output WBMP image to browser or file */ -PHP_FUNCTION(image2wbmp) -{ -#ifdef HAVE_GD_WBMP - _php_image_output (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_CONVERT_WBM, "WBMP", _php_image_bw_convert); -#else /* HAVE_GD_WBMP */ - php_error(E_WARNING, "Image2Wbmp: No WBMP support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_WBMP */ -} -/* }}} */ - -/* {{{ proto void jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) - Convert JPEG image to WBMP image */ -PHP_FUNCTION(jpeg2wbmp) -{ -#ifdef HAVE_GD_JPG -#ifdef HAVE_GD_WBMP - _php_image_convert (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG); -#else /* HAVE_GD_WBMP */ - php_error(E_WARNING, "jpeg2wbmp: No WBMP support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_WBMP */ -#else /* HAVE_GD_JPG */ - php_error(E_WARNING, "jpeg2wbmp: No JPG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_JPG */ -} -/* }}} */ - -/* {{{ proto void png2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) - Convert PNG image to WBMP image */ -PHP_FUNCTION(png2wbmp) -{ -#ifdef HAVE_GD_PNG -#ifdef HAVE_GD_WBMP - _php_image_convert (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG); -#else /* HAVE_GD_WBMP */ - php_error(E_WARNING, "png2wbmp: No WBMP support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_WBMP */ -#else /* HAVE_GD_PNG */ - php_error(E_WARNING, "png2wbmp: No PNG support in this PHP build"); - RETURN_FALSE; -#endif /* HAVE_GD_PNG */ -} -/* }}} */ - -#ifdef HAVE_GD_WBMP -/* {{{ _php_image_bw_convert - * It converts a gd Image to bw using a threshold value */ -static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshold) -{ - gdImagePtr im_dest; - int white, black; - int color, color_org, median; - int dest_height = gdImageSY (im_org); - int dest_width = gdImageSX (im_org); - int x, y; - TSRMLS_FETCH(); - - im_dest = gdImageCreate (dest_width, dest_height); - if (im_dest == NULL) { - php_error (E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name(TSRMLS_C)); - return; - } - white = gdImageColorAllocate (im_dest, 255, 255, 255); - if( white == -1) { - php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); - return; - } - - black = gdImageColorAllocate (im_dest, 0, 0, 0); - if (black == -1) { - php_error (E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); - return; - } - - for (y = 0; y < dest_height; y++) { - for (x = 0; x < dest_width; x++) { - color_org = gdImageGetPixel (im_org, x, y); - median = (im_org->red[color_org] + im_org->green[color_org] + im_org->blue[color_org]) / 3; - if (median < threshold) { - color = black; - } - else { - color = white; - } - gdImageSetPixel (im_dest, x, y, color); - } - } -#ifdef USE_GD_IOCTX - gdImageWBMPCtx (im_dest, black, out); -#else - gdImageWBMP (im_dest, black, out); -#endif - -} -/* }}} */ - -/* {{{ _php_image_convert - * _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */ -static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) -{ - zval **f_org, **f_dest, **height, **width, **threshold; - gdImagePtr im_org, im_dest, im_tmp; - char *fn_org = NULL; - char *fn_dest = NULL; - FILE *org, *dest; - int argc; - int dest_height = -1; - int dest_width = -1; - int org_height, org_width; - int white, black; - int color, color_org, median; - int int_threshold; - int x, y; - float x_ratio, y_ratio; - - argc = ZEND_NUM_ARGS(); - if (argc != 5 || zend_get_parameters_ex(argc, &f_org, &f_dest, &height, &width, &threshold) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex (f_org); - convert_to_string_ex (f_dest); - fn_org = Z_STRVAL_PP(f_org); - fn_dest = Z_STRVAL_PP(f_dest); - convert_to_long_ex(height); - dest_height = Z_LVAL_PP(height); - convert_to_long_ex(width); - dest_width = Z_LVAL_PP(width); - convert_to_long_ex(threshold); - int_threshold = Z_LVAL_PP(threshold); - - /* Check threshold value */ - if( int_threshold < 0 || int_threshold > 8 ) { - php_error (E_WARNING, "Invalid threshold value '%d' in %s", int_threshold, get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - /* Check origin file */ - if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) { - php_error (E_WARNING, "%s: invalid origin filename '%s'", get_active_function_name(TSRMLS_C), fn_org); - RETURN_FALSE; - } - - /* Check destination file */ - if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) { - php_error (E_WARNING, "%s: invalid destination filename '%s'", get_active_function_name(TSRMLS_C), fn_dest); - RETURN_FALSE; - } - - /* Open origin file */ - org = VCWD_FOPEN(fn_org, "rb"); - if (!org) { - php_error (E_WARNING, "%s: unable to open '%s' for reading", get_active_function_name(TSRMLS_C), fn_org); - RETURN_FALSE; - } - - /* Open destination file */ - dest = VCWD_FOPEN(fn_dest, "wb"); - if (!dest) { - php_error (E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn_dest); - RETURN_FALSE; - } - - switch (image_type) { -#ifdef HAVE_GD_GIF_READ - case PHP_GDIMG_TYPE_GIF: - im_org = gdImageCreateFromGif (org); - if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid GIF file", get_active_function_name(TSRMLS_C), fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_GIF_READ */ - -#ifdef HAVE_GD_JPG - case PHP_GDIMG_TYPE_JPG: - im_org = gdImageCreateFromJpeg (org); - if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid JPEG file", get_active_function_name(TSRMLS_C), fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_JPG */ - - -#ifdef HAVE_GD_PNG - case PHP_GDIMG_TYPE_PNG: - im_org = gdImageCreateFromPng(org); - if (im_org == NULL) { - php_error (E_WARNING, "%s: unable to open '%s' Not a valid PNG file", get_active_function_name(TSRMLS_C), fn_dest); - RETURN_FALSE; - } - break; -#endif /* HAVE_GD_PNG */ - - default: - php_error(E_WARNING, "%s: Format not supported", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - break; - } - - org_width = gdImageSX (im_org); - org_height = gdImageSY (im_org); - - x_ratio = (float) org_width / (float) dest_width; - y_ratio = (float) org_height / (float) dest_height; - - if (x_ratio > 1 && y_ratio > 1) { - if (y_ratio > x_ratio) { - x_ratio = y_ratio; - } - else { - y_ratio = x_ratio; - } - dest_width = (int)(org_width / x_ratio); - dest_height = (int)(org_height / y_ratio); - } - else { - x_ratio = (float) dest_width / (float) org_width; - y_ratio = (float) dest_height / (float) org_height; - - if (y_ratio < x_ratio) { - x_ratio = y_ratio; - } - else { - y_ratio = x_ratio; - } - dest_width = (int)(org_width * x_ratio); - dest_height = (int)(org_height * y_ratio); - } - - im_tmp = gdImageCreate (dest_width, dest_height); - if (im_tmp == NULL ) { - php_error(E_WARNING, "%s: unable to allocate temporary buffer", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - gdImageCopyResized (im_tmp, im_org, 0, 0, 0, 0, dest_width, dest_height, org_width, org_height); - - gdImageDestroy(im_org); - - fclose(org); - - im_dest = gdImageCreate(dest_width, dest_height); - if (im_dest == NULL) { - php_error(E_WARNING, "%s: unable to allocate destination buffer", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - white = gdImageColorAllocate(im_dest, 255, 255, 255); - if (white == -1) { - php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - black = gdImageColorAllocate(im_dest, 0, 0, 0); - if (black == -1) { - php_error(E_WARNING, "%s: unable to allocate the colors for the destination buffer", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - int_threshold = int_threshold * 32; - - for (y = 0; y < dest_height; y++) { - for(x = 0; x < dest_width; x++) { - color_org = gdImageGetPixel (im_tmp, x, y); - median = (im_tmp->red[color_org] + im_tmp->green[color_org] + im_tmp->blue[color_org]) / 3; - if (median < int_threshold) { - color = black; - } - else { - color = white; - } - gdImageSetPixel (im_dest, x, y, color); - } - } - - gdImageDestroy (im_tmp ); - - gdImageWBMP (im_dest, black , dest); - - fflush(dest); - fclose(dest); - - gdImageDestroy( im_dest ); - - RETURN_TRUE; -} -/* }}} */ -#endif /* HAVE_GD_WBMP */ - -#endif /* HAVE_LIBGD */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/gd/gd.dsp b/ext/gd/gd.dsp deleted file mode 100644 index e8e3f99a19d..00000000000 --- a/ext/gd/gd.dsp +++ /dev/null @@ -1,203 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=gd - Win32 Release_TS GD2 -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "gd.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "gd.mak" CFG="gd - Win32 Release_TS GD2" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "gd - Win32 Release_TS GD2" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gd - Win32 Release_TS GD1" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gd - Win32 Debug_TS GD2" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gd - Win32 Debug_TS GD1" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "gd - Win32 Release_TS GD2" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Release_TS_GD2" -# PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD2" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=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 php4ts.lib freetype.lib gd.lib libjpeg.lib libtiff.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts.lib freetype2.lib gd.lib libjpeg.lib libtiff.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "gd - Win32 Release_TS GD1" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Release_TS_GD1" -# PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD1" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /FR /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /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 php4ts.lib freetype.lib gd.lib libjpeg.lib libtiff.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts.lib freetype.lib gd.lib libjpeg.lib libtiff.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Debug_TS_GD2" -# PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD2" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /FR /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 "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=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 php4ts_debug.lib gd.lib libjpeg.lib freetype.lib libtiff.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_gd.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts_debug.lib gd.lib libjpeg.lib freetype2.lib libtiff.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_gd.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD1" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "gd___Win32_Debug_TS_GD1" -# PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD1" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /FR /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 "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /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 php4ts_debug.lib gd.lib libjpeg.lib freetype.lib libtiff.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_gd.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 php4ts_debug.lib gd.lib libjpeg.lib freetype.lib libtiff.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_gd.dll" /libpath:"..\..\Debug_TS" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "gd - Win32 Release_TS GD2" -# Name "gd - Win32 Release_TS GD1" -# Name "gd - Win32 Debug_TS GD2" -# Name "gd - Win32 Debug_TS GD1" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\gd.c -# End Source File -# Begin Source File - -SOURCE=.\gdcache.c -# End Source File -# Begin Source File - -SOURCE=.\gdt1.c -# End Source File -# Begin Source File - -SOURCE=.\gdttf.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\gdcache.h -# End Source File -# Begin Source File - -SOURCE=.\gdt1.h -# End Source File -# Begin Source File - -SOURCE=.\gdttf.h -# End Source File -# Begin Source File - -SOURCE=.\php_gd.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c deleted file mode 100644 index 3c599cab65e..00000000000 --- a/ext/gd/gd_ctx.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "php_gd.h" - - -#define CTX_PUTC(c,ctx) ctx->putC(ctx, c) - -static void _php_image_output_putc(struct gdIOCtx *ctx, int c) -{ - TSRMLS_FETCH(); - php_write(&c, 1 TSRMLS_CC); -} - -static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) -{ - TSRMLS_FETCH(); - return php_write((void *)buf, l TSRMLS_CC); -} - -static void _php_image_output_ctxfree(struct gdIOCtx *ctx) -{ - if(ctx) { - efree(ctx); - } -} - -static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) -{ - zval **imgind, **file, **quality; - gdImagePtr im; - char *fn = NULL; - FILE *fp = NULL; - int argc = ZEND_NUM_ARGS(); - int q = -1, i; - gdIOCtx *ctx; - - /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ - - if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &imgind, &file, &quality) == FAILURE) - { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", phpi_get_le_gd()); - - if (argc > 1) { - convert_to_string_ex(file); - fn = Z_STRVAL_PP(file); - if (argc == 3) { - convert_to_long_ex(quality); - q = Z_LVAL_PP(quality); - } - } - - if ((argc == 2) || (argc == 3 && Z_STRLEN_PP(file))) { - if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC)) { - php_error(E_WARNING, "%s: invalid filename '%s'", get_active_function_name(TSRMLS_C), fn); - RETURN_FALSE; - } - - fp = VCWD_FOPEN(fn, "wb"); - if (!fp) { - php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(TSRMLS_C), fn); - RETURN_FALSE; - } - - ctx = gdNewFileCtx(fp); - } else { - ctx = emalloc(sizeof(gdIOCtx)); - ctx->putC = _php_image_output_putc; - ctx->putBuf = _php_image_output_putbuf; - ctx->free = _php_image_output_ctxfree; - -#if APACHE && defined(CHARSET_EBCDIC) - /* XXX this is unlikely to work any more thies@thieso.net */ - /* This is a binary file already: avoid EBCDIC->ASCII conversion */ - ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); -#endif - } - - switch(image_type) { - case PHP_GDIMG_CONVERT_WBM: - if(q<0||q>255) { - php_error(E_WARNING, "%s: invalid threshold value '%d'. It must be between 0 and 255",get_active_function_name(TSRMLS_C), q); - } - case PHP_GDIMG_TYPE_JPG: - (*func_p)(im, ctx, q); - break; - case PHP_GDIMG_TYPE_WBM: - for(i=0; i < gdImageColorsTotal(im); i++) { - if(gdImageRed(im, i) == 0) break; - } - (*func_p)(im, i, ctx); - break; - default: - (*func_p)(im, ctx); - break; - } - - ctx->free(ctx); - - if(fp) { - fflush(fp); - fclose(fp); - } - - RETURN_TRUE; -} diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c deleted file mode 100644 index b89f5610acc..00000000000 --- a/ext/gd/gdcache.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * $Id$ - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@lucent.com) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -/* This just seems unessacary */ -#if (WIN32|WINNT) -#define ENABLE_GD_TTF -#else -#include "php_config.h" -#endif -#if HAVE_LIBTTF|HAVE_LIBFREETYPE - -#include "gdcache.h" - -/*********************************************************/ -/* implementation */ -/*********************************************************/ - - -/* create a new cache */ -gdCache_head_t * -gdCacheCreate( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease ) -{ - gdCache_head_t *head; - - head = (gdCache_head_t *)malloc(sizeof(gdCache_head_t)); - head->mru = NULL; - head->size = size; - head->gdCacheTest = gdCacheTest; - head->gdCacheFetch = gdCacheFetch; - head->gdCacheRelease = gdCacheRelease; - return head; -} - -void -gdCacheDelete( gdCache_head_t *head ) -{ - gdCache_element_t *elem, *prev; - - elem = head->mru; - while(elem) { - (*(head->gdCacheRelease))(elem->userdata); - prev = elem; - elem = elem->next; - free((char *)prev); - } - free((char *)head); -} - -void * -gdCacheGet( gdCache_head_t *head, void *keydata ) -{ - int i=0; - gdCache_element_t *elem, *prev = NULL, *prevprev = NULL; - void *userdata; - - elem = head->mru; - while(elem) { - if ((*(head->gdCacheTest))(elem->userdata, keydata)) { - if (i) { /* if not already most-recently-used */ - /* relink to top of list */ - prev->next = elem->next; - elem->next = head->mru; - head->mru = elem; - } - return elem->userdata; - } - prevprev = prev; - prev = elem; - elem = elem->next; - i++; - } - userdata = (*(head->gdCacheFetch))(&(head->error), keydata); - if (! userdata) { - /* if there was an error in the fetch then don't cache */ - return NULL; - } - if (i < head->size) { /* cache still growing - add new elem */ - elem = (gdCache_element_t *)malloc(sizeof(gdCache_element_t)); - } - else { /* cache full - replace least-recently-used */ - /* preveprev becomes new end of list */ - prevprev->next = NULL; - elem = prev; - (*(head->gdCacheRelease))(elem->userdata); - } - /* relink to top of list */ - elem->next = head->mru; - head->mru = elem; - elem->userdata = userdata; - return userdata; -} - - - -/*********************************************************/ -/* test stub */ -/*********************************************************/ - - -#ifdef GDCACHE_TEST - -#include - -typedef struct { - int key; - int value; -} key_value_t; - -static int -cacheTest( void *map, void *key ) -{ - return (((key_value_t *)map)->key == *(int *)key); -} - -static void * -cacheFetch( char **error, void *key ) -{ - key_value_t *map; - - map = (key_value_t *)malloc(sizeof(key_value_t)); - map->key = *(int *)key; - map->value = 3; - - *error = NULL; - return (void *)map; -} - -static void -cacheRelease( void *map) -{ - free( (char *)map ); -} - -int -main(char *argv[], int argc) -{ - gdCache_head_t *cacheTable; - int elem, key; - - cacheTable = gdCacheCreate(3, cacheTest, cacheFetch, cacheRelease); - - key = 20; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 40; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 50; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - key = 30; - elem = *(int *)gdCacheGet(cacheTable, &key); - - gdCacheDelete(cacheTable); - - return 0; -} - -#endif - -#endif /* ENABLE_GD_TTF */ diff --git a/ext/gd/gdcache.h b/ext/gd/gdcache.h deleted file mode 100644 index 06bf0ee6ce1..00000000000 --- a/ext/gd/gdcache.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * $Id$ - * - * Caches of pointers to user structs in which the least-recently-used - * element is replaced in the event of a cache miss after the cache has - * reached a given size. - * - * John Ellson (ellson@lucent.com) Oct 31, 1997 - * - * Test this with: - * gcc -o gdcache -g -Wall -DTEST gdcache.c - * - * The cache is implemented by a singly-linked list of elements - * each containing a pointer to a user struct that is being managed by - * the cache. - * - * The head structure has a pointer to the most-recently-used - * element, and elements are moved to this position in the list each - * time they are used. The head also contains pointers to three - * user defined functions: - * - a function to test if a cached userdata matches some keydata - * - a function to provide a new userdata struct to the cache - * if there has been a cache miss. - * - a function to release a userdata struct when it is - * no longer being managed by the cache - * - * In the event of a cache miss the cache is allowed to grow up to - * a specified maximum size. After the maximum size is reached then - * the least-recently-used element is discarded to make room for the - * new. The most-recently-returned value is always left at the - * beginning of the list after retrieval. - * - * In the current implementation the cache is traversed by a linear - * search from most-recent to least-recent. This linear search - * probably limits the usefulness of this implementation to cache - * sizes of a few tens of elements. - */ - -/*********************************************************/ -/* header */ -/*********************************************************/ - -#if (!defined _OSD_POSIX) && HAVE_MALLOC_H -#include -#else -#include /* BS2000/OSD defines malloc() & friends in stdlib.h */ -#endif -#ifndef NULL -#define NULL (void *)0 -#endif - -/* user defined function templates */ -typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); -typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); -typedef void (*gdCacheReleaseFn_t)(void *userdata); - -/* element structure */ -typedef struct gdCache_element_s gdCache_element_t; -struct gdCache_element_s { - gdCache_element_t *next; - void *userdata; -}; - -/* head structure */ -typedef struct gdCache_head_s gdCache_head_t; -struct gdCache_head_s { - gdCache_element_t *mru; - int size; - char *error; - gdCacheTestFn_t gdCacheTest; - gdCacheFetchFn_t gdCacheFetch; - gdCacheReleaseFn_t gdCacheRelease; -}; - -/* function templates */ -gdCache_head_t * -gdCacheCreate( - int size, - gdCacheTestFn_t gdCacheTest, - gdCacheFetchFn_t gdCacheFetch, - gdCacheReleaseFn_t gdCacheRelease ); - -void -gdCacheDelete( gdCache_head_t *head ); - -void * -gdCacheGet( gdCache_head_t *head, void *keydata ); diff --git a/ext/gd/gdt1.c b/ext/gd/gdt1.c deleted file mode 100644 index 4a7ab86f35b..00000000000 --- a/ext/gd/gdt1.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jouni Ahto | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#if 0 /* Moved currently back to gd.c */ - -#include "php.h" -#include "php_gd.h" - -#if HAVE_LIBT1 - -void php_free_ps_font(int font_id) -{ - T1_DeleteFont(font_id); -} - -void php_free_ps_enc(char **enc) -{ - T1_DeleteEncoding(enc); -} - -/* {{{ proto int imagepsloadfont(string pathname) - Load a new font from specified file */ -PHP_FUNCTION(imagepsloadfont) -{ - zval **file; - int f_ind, l_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(file); - - f_ind = T1_AddFont(Z_STRVAL_PP(file)); - - if (f_ind < 0) { - switch (f_ind) { - case -1: - php_error(E_WARNING, "Couldn't find the font file"); - RETURN_FALSE; - break; - case -2: - case -3: - php_error(E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error(E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } - } - - T1_LoadFont(f_ind); - /* - l_ind = zend_list_insert(f_ind, T1_GLOBAL(le_ps_font)); - RETURN_LONG(l_ind); - */ - zend_list_addref(f_ind); - RETURN_LONG(f_ind); -} -/* }}} */ - -/* {{{ The function in t1lib which this function uses seem to be buggy... -proto int imagepscopyfont(int font_index) -Make a copy of a font for purposes like extending or reenconding */ -/* -PHP_FUNCTION(imagepscopyfont) -{ - pval *fnt; - int l_ind, type; - gd_ps_font *nf_ind, *of_ind; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht, 1, &fnt) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long(fnt); - - of_ind = zend_list_find(Z_LVAL_P(fnt), &type); - - if (type != GD_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_P(fnt)); - RETURN_FALSE; - } - - nf_ind = emalloc(sizeof(gd_ps_font)); - nf_ind->font_id = T1_CopyFont(of_ind->font_id); - - if (nf_ind->font_id < 0) { - l_ind = nf_ind->font_id; - efree(nf_ind); - switch (l_ind) { - case -1: - php_error(E_WARNING, "FontID %d is not loaded in memory", l_ind); - RETURN_FALSE; - break; - case -2: - php_error(E_WARNING, "Tried to copy a logical font"); - RETURN_FALSE; - break; - case -3: - php_error(E_WARNING, "Memory allocation fault in t1lib"); - RETURN_FALSE; - break; - default: - php_error(E_WARNING, "An unknown error occurred in t1lib"); - RETURN_FALSE; - break; - } - } - - nf_ind->extend = 1; - l_ind = zend_list_insert(nf_ind, GD_GLOBAL(le_ps_font)); - RETURN_LONG(l_ind); -} -*/ -/* }}} */ - -/* {{{ proto bool imagepsfreefont(int font_index) - Free memory used by a font */ -PHP_FUNCTION(imagepsfreefont) -{ - zval **fnt; - int type; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fnt); - - zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != T1_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - zend_list_delete(Z_LVAL_PP(fnt)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsencodefont(int font_index, string filename) - To change a fonts character encoding vector */ -PHP_FUNCTION(imagepsencodefont) -{ - zval **fnt, **enc; - char **enc_vector; - int type; - int f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &enc) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fnt); - convert_to_string_ex(enc); - - f_ind = zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != T1_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - if ((enc_vector = T1_LoadEncoding(Z_STRVAL_PP(enc))) == NULL) { - php_error(E_WARNING, "Couldn't load encoding vector from %s", Z_STRVAL_PP(enc)); - RETURN_FALSE; - } - - T1_DeleteAllSizes(f_ind); - if (T1_ReencodeFont(f_ind, enc_vector)) { - T1_DeleteEncoding(enc_vector); - php_error(E_WARNING, "Couldn't reencode font"); - RETURN_FALSE; - } - zend_list_insert(enc_vector, T1_GLOBAL(le_ps_enc)); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsextendfont(int font_index, float extend) - Extend or or condense (if extend < 1) a font */ -PHP_FUNCTION(imagepsextendfont) -{ - zval **fnt, **ext; - int type; - int f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &ext) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fnt); - convert_to_double_ex(ext); - - f_ind = zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != T1_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - if (T1_ExtendFont(f_ind, Z_DVAL_PP(ext)) != 0) RETURN_FALSE; - /* - f_ind->extend = Z_DVAL_P(ext); - */ - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool imagepsslantfont(int font_index, float slant) - Slant a font */ -PHP_FUNCTION(imagepsslantfont) -{ - zval **fnt, **slt; - int type; - int f_ind; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &slt) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(fnt); - convert_to_double_ex(slt); - - f_ind = zend_list_find(Z_LVAL_PP(fnt), &type); - - if (type != T1_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt)); - RETURN_FALSE; - } - - if (T1_SlantFont(f_ind, Z_DVAL_PP(slt)) != 0) RETURN_FALSE; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias]) - Rasterize a string over an image */ -PHP_FUNCTION(imagepstext) -{ - zval **img, **str, **fnt, **sz, **fg, **bg, **sp, **px, **py, **aas, **wd, **ang; - int i, j, x, y; - int space, type; - int f_ind; - int h_lines, v_lines, c_ind; - int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl; - int aa[16], aa_steps; - int width, amount_kern, add_width; - double angle; - unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - gdImagePtr bg_img; - GLYPH *str_img; - T1_OUTLINE *char_path, *str_path; - T1_TMATRIX *transform = NULL; - - switch(ZEND_NUM_ARGS()) { - case 8: - if (zend_get_parameters_ex(8, &img, &str, &fnt, &sz, &fg, &bg, &px, &py) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(str); - convert_to_long_ex(fnt); - convert_to_long_ex(sz); - convert_to_long_ex(fg); - convert_to_long_ex(bg); - convert_to_long_ex(px); - convert_to_long_ex(py); - x = Z_LVAL_PP(px); - y = Z_LVAL_PP(py); - space = 0; - aa_steps = 4; - width = 0; - angle = 0; - break; - case 12: - if (zend_get_parameters_ex(12, &img, &str, &fnt, &sz, &fg, &bg, &px, &py, &sp, &wd, &ang, &aas) == FAILURE) { - RETURN_FALSE; - } - convert_to_string_ex(str); - convert_to_long_ex(fnt); - convert_to_long_ex(sz); - convert_to_long_ex(sp); - convert_to_long_ex(fg); - convert_to_long_ex(bg); - convert_to_long_ex(px); - convert_to_long_ex(py); - x = Z_LVAL_PP(px); - y = Z_LVAL_PP(py); - convert_to_long_ex(sp); - space = Z_LVAL_PP(sp); - convert_to_long_ex(aas); - aa_steps = Z_LVAL_PP(aas); - convert_to_long_ex(wd); - width = Z_LVAL_PP(wd); - convert_to_double_ex(ang); - angle = Z_DVAL_PP(ang); - break; - default: - WRONG_PARAM_COUNT; - } - - bg_img = zend_list_find(Z_LVAL_PP(img), &type); - - if (!bg_img || type != GD_GLOBAL(le_gd)) { - php_error(E_WARNING, "Unable to find image pointer"); - RETURN_FALSE; - } - - f_ind = zend_list_find(Z_LVAL_P(fnt), &type); - - if (!f_ind || type != GD_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_P(fnt)); - RETURN_FALSE; - } - - fg_rd = gdImageRed(bg_img, Z_LVAL_P(fg)); - fg_gr = gdImageGreen(bg_img, Z_LVAL_P(fg)); - fg_bl = gdImageBlue(bg_img, Z_LVAL_P(fg)); - bg_rd = gdImageRed(bg_img, Z_LVAL_P(bg)); - bg_gr = gdImageGreen(bg_img, Z_LVAL_P(bg)); - bg_bl = gdImageBlue(bg_img, Z_LVAL_P(bg)); - - for (i = 0; i < aa_steps; i++) { - rd = bg_rd+(double)(fg_rd-bg_rd)/aa_steps*(i+1); - gr = bg_gr+(double)(fg_gr-bg_gr)/aa_steps*(i+1); - bl = bg_bl+(double)(fg_bl-bg_bl)/aa_steps*(i+1); - aa[i] = gdImageColorResolve(bg_img, rd, gr, bl); - } - - T1_AASetBitsPerPixel(8); - - switch (aa_steps) { - case 4: - T1_AASetGrayValues(0, 1, 2, 3, 4); - T1_AASetLevel(T1_AA_LOW); - break; - case 16: - T1_AAHSetGrayValues(aa_greys); - T1_AASetLevel(T1_AA_HIGH); - break; - default: - php_error(E_WARNING, "Invalid value %d as number of steps for antialiasing", aa_steps); - RETURN_FALSE; - } - - if (angle) { - transform = T1_RotateMatrix(NULL, angle); - } - - if (width) { -#ifdef HAVE_LIBT1_OUTLINE - str_path = T1_GetCharOutline(f_ind->font_id, Z_STRVAL_P(str)[0], Z_LVAL_P(sz), transform); - - for (i = 1; i < Z_STRLEN_P(str); i++) { - amount_kern = (int) T1_GetKerning(f_ind->font_id, Z_STRVAL_P(str)[i-1], Z_STRVAL_P(str)[i]); - amount_kern += Z_STRVAL_P(str)[i-1] == ' ' ? space : 0; - add_width = (int) (amount_kern+width)/f_ind->extend; - - char_path = T1_GetMoveOutline(f_ind->font_id, add_width, 0, 0, Z_LVAL_P(sz), transform); - str_path = T1_ConcatOutlines(str_path, char_path); - - char_path = T1_GetCharOutline(f_ind->font_id, Z_STRVAL_P(str)[i], Z_LVAL_P(sz), transform); - str_path = T1_ConcatOutlines(str_path, char_path); - } - str_img = T1_AAFillOutline(str_path, 0); -#else - php_error(E_WARNING, "Setting space between characters in function ImagePSText is supported only with t1lib version 0.9 or above"); - RETURN_FALSE; -#endif - } else { - str_img = T1_AASetString(f_ind->font_id, Z_STRVAL_P(str), Z_STRLEN_P(str), - space, T1_KERNING, Z_LVAL_P(sz), transform); - } - - if (T1_errno) RETURN_FALSE; - - h_lines = str_img->metrics.ascent - str_img->metrics.descent; - v_lines = str_img->metrics.rightSideBearing - str_img->metrics.leftSideBearing; - - for (i = 0; i < v_lines; i++) { - for (j = 0; j < h_lines; j++) { - switch (str_img->bits[j*v_lines+i]) { - case 0: - break; - default: - c_ind = aa[str_img->bits[j*v_lines+i]-1]; - gdImageSetPixel(bg_img, x+str_img->metrics.leftSideBearing+i, y-str_img->metrics.ascent+j, c_ind); - } - } - } - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - - add_next_index_long(return_value, str_img->metrics.leftSideBearing); - add_next_index_long(return_value, str_img->metrics.descent); - add_next_index_long(return_value, str_img->metrics.rightSideBearing); - add_next_index_long(return_value, str_img->metrics.ascent); - -} -/* }}} */ - -/* {{{ proto array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle]) - Return the bounding box needed by a string if rasterized */ -PHP_FUNCTION(imagepsbbox) -{ - pval *str, *fnt, *sz, *sp, *wd, *ang; - int i, space, add_width, char_width, amount_kern, type; - int cur_x, cur_y, dx, dy; - int x1, y1, x2, y2, x3, y3, x4, y4; - gd_ps_font *f_ind; - int per_char = 0; - double angle, sin_a, cos_a; - BBox char_bbox, str_bbox = {0, 0, 0, 0}; - - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters(ht, 3, &str, &fnt, &sz) == FAILURE) { - RETURN_FALSE; - } - convert_to_string(str); - convert_to_long(fnt); - convert_to_long(sz); - space = 0; - break; - case 6: - if (zend_get_parameters(ht, 6, &str, &fnt, &sz, &sp, &wd, &ang) == FAILURE) { - RETURN_FALSE; - } - convert_to_string(str); - convert_to_long(fnt); - convert_to_long(sz); - convert_to_long(sp); - space = Z_LVAL_P(sp); - convert_to_long(wd); - add_width = Z_LVAL_P(wd); - convert_to_double(ang); - angle = Z_DVAL_P(ang) * M_PI / 180; - sin_a = sin(angle); - cos_a = cos(angle); - per_char = add_width || angle ? 1 : 0; - break; - default: - WRONG_PARAM_COUNT; - } - - f_ind = zend_list_find(Z_LVAL_P(fnt), &type); - - if (type != GD_GLOBAL(le_ps_font)) { - php_error(E_WARNING, "%d is not a Type 1 font index", Z_LVAL_P(fnt)); - RETURN_FALSE; - } - -#define max(a, b) (a > b ? a : b) -#define min(a, b) (a < b ? a : b) -#define new_x(a, b) (int) ((a) * cos_a - (b) * sin_a) -#define new_y(a, b) (int) ((a) * sin_a + (b) * cos_a) - - if (per_char) { - space += T1_GetCharWidth(f_ind->font_id, ' '); - cur_x = cur_y = 0; - - for (i = 0; i < Z_STRLEN_P(str); i++) { - if (Z_STRVAL_P(str)[i] == ' ') { - char_bbox.llx = char_bbox.lly = char_bbox.ury = 0; - char_bbox.urx = char_width = space; - } else { - char_bbox = T1_GetCharBBox(f_ind->font_id, Z_STRVAL_P(str)[i]); - char_width = T1_GetCharWidth(f_ind->font_id, Z_STRVAL_P(str)[i]); - } - amount_kern = i ? T1_GetKerning(f_ind->font_id, Z_STRVAL_P(str)[i-1], Z_STRVAL_P(str)[i]) : 0; - - /* Transfer character bounding box to right place */ - x1 = new_x(char_bbox.llx, char_bbox.lly) + cur_x; - y1 = new_y(char_bbox.llx, char_bbox.lly) + cur_y; - x2 = new_x(char_bbox.llx, char_bbox.ury) + cur_x; - y2 = new_y(char_bbox.llx, char_bbox.ury) + cur_y; - x3 = new_x(char_bbox.urx, char_bbox.ury) + cur_x; - y3 = new_y(char_bbox.urx, char_bbox.ury) + cur_y; - x4 = new_x(char_bbox.urx, char_bbox.lly) + cur_x; - y4 = new_y(char_bbox.urx, char_bbox.lly) + cur_y; - - /* Find min & max values and compare them with current bounding box */ - str_bbox.llx = min(str_bbox.llx, min(x1, min(x2, min(x3, x4)))); - str_bbox.lly = min(str_bbox.lly, min(y1, min(y2, min(y3, y4)))); - str_bbox.urx = max(str_bbox.urx, max(x1, max(x2, max(x3, x4)))); - str_bbox.ury = max(str_bbox.ury, max(y1, max(y2, max(y3, y4)))); - - /* Move to the next base point */ - dx = new_x(char_width + add_width + amount_kern, 0); - dy = new_y(char_width + add_width + amount_kern, 0); - cur_x += dx; - cur_y += dy; - /* - printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", x1, y1, x2, y2, x3, y3, x4, y4, char_bbox.llx, char_bbox.lly, char_bbox.urx, char_bbox.ury, char_width, amount_kern, cur_x, cur_y, dx, dy); - */ - } - - } else { - str_bbox = T1_GetStringBBox(f_ind->font_id, Z_STRVAL_P(str), Z_STRLEN_P(str), space, T1_KERNING); - } - if (T1_errno) RETURN_FALSE; - - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - /* - printf("%d %d %d %d\n", str_bbox.llx, str_bbox.lly, str_bbox.urx, str_bbox.ury); - */ - add_next_index_long(return_value, (int) ceil(((double) str_bbox.llx)*Z_LVAL_P(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.lly)*Z_LVAL_P(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.urx)*Z_LVAL_P(sz)/1000)); - add_next_index_long(return_value, (int) ceil(((double) str_bbox.ury)*Z_LVAL_P(sz)/1000)); -} -/* }}} */ - -#endif /* HAVE_LIBT1 */ - -#endif /* 0 */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/gd/gdt1.h b/ext/gd/gdt1.h deleted file mode 100644 index 6252b6a95ce..00000000000 --- a/ext/gd/gdt1.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Jouni Ahto | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#if HAVE_LIBT1 - -#include - -extern void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC); -extern void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/gd/gdttf.c b/ext/gd/gdttf.c deleted file mode 100644 index 393f0bdbf79..00000000000 --- a/ext/gd/gdttf.c +++ /dev/null @@ -1,868 +0,0 @@ -/* gd interface to freetype library */ -/* */ -/* John Ellson ellson@lucent.com */ - -/* $Id$ */ - -#include "php.h" - -#if PHP_WIN32 -#include "config.w32.h" -#else -#include "php_config.h" -#endif -#if HAVE_LIBTTF && !defined(USE_GD_IMGSTRTTF) -#include -#include -#include -#include -#include -#include "gdttf.h" -#include "gdcache.h" -#include - -#ifndef HAVE_GDIMAGECOLORRESOLVE -extern int gdImageColorResolve(gdImagePtr, int, int, int); -#endif - -/* number of fonts cached before least recently used is replaced */ -#define FONTCACHESIZE 6 - -/* number of character glyphs cached per font before - least-recently-used is replaced */ -#define GLYPHCACHESIZE 120 - -/* number of bitmaps cached per glyph before - least-recently-used is replaced */ -#define BITMAPCACHESIZE 8 - -/* number of antialias color lookups cached */ -#define TWEENCOLORCACHESIZE 32 - -/* ptsize below which anti-aliasing is ineffective */ -#define MINANTIALIASPTSIZE 0 - -/* display resolution - (Not really. This has to be 72 or hinting is wrong) */ -#define RESOLUTION 72 - -/* Number of colors used for anti-aliasing */ -#undef NUMCOLORS -#define NUMCOLORS 4 - -/* Line separation as a factor of font height. - No space between if LINESPACE = 1.00 - Line separation will be rounded up to next pixel row*/ -#define LINESPACE 1.05 - -#ifndef TRUE -#define FALSE 0 -#define TRUE !FALSE -#endif - -#ifndef MAX -#define MAX(a, b) ((a)>(b)?(a):(b)) -#endif -#ifndef MIN -#define MIN(a, b) ((a)<(b)?(a):(b)) -#endif - -typedef struct { - char *fontname; /* key */ - double ptsize; /* key */ - double angle; /* key */ - double sin_a, cos_a; - TT_Engine *engine; - TT_Face face; - TT_Face_Properties properties; - TT_Instance instance; - TT_CharMap char_map_Unicode; - TT_CharMap char_map_Big5; - TT_CharMap char_map_Roman; - int have_char_map_Unicode; - int have_char_map_Big5; - int have_char_map_Roman; - TT_Matrix matrix; - TT_Instance_Metrics imetrics; - gdCache_head_t *glyphCache; -} font_t; - -typedef struct { - char *fontname; /* key */ - double ptsize; /* key */ - double angle; /* key */ - TT_Engine *engine; -} fontkey_t; - -typedef struct { - int character; /* key */ - int hinting; /* key */ - TT_Glyph glyph; - TT_Glyph_Metrics metrics; - TT_Outline outline; - TT_Pos oldx, oldy; - TT_Raster_Map Bit; - int gray_render; - int xmin, xmax, ymin, ymax; - gdCache_head_t *bitmapCache; -} glyph_t; - -typedef struct { - int character; /* key */ - int hinting; /* key */ - int gray_render; - font_t *font; -} glyphkey_t; - -typedef struct { - int xoffset; /* key */ - int yoffset; /* key */ - char *bitmap; -} bitmap_t; - -typedef struct { - int xoffset; /* key */ - int yoffset; /* key */ - glyph_t *glyph; -} bitmapkey_t; - -typedef struct { - unsigned char pixel; /* key */ - unsigned char bgcolor; /* key */ - int fgcolor; /* key */ /* -ve means no antialias */ - gdImagePtr im; /* key */ - unsigned char tweencolor; -} tweencolor_t; - -typedef struct { - unsigned char pixel; /* key */ - unsigned char bgcolor; /* key */ - int fgcolor; /* key */ /* -ve means no antialias */ - gdImagePtr im; /* key */ -} tweencolorkey_t; - -/* forward declarations so that glyphCache can be initialized by font code */ -static int glyphTest ( void *element, void *key ); -static void *glyphFetch ( char **error, void *key ); -static void glyphRelease( void *element ); - -/* forward declarations so that bitmapCache can be initialized by glyph code */ -static int bitmapTest ( void *element, void *key ); -static void *bitmapFetch ( char **error, void *key ); -static void bitmapRelease( void *element ); - -/* local prototype */ -char *gdttfchar(gdImage *im, int fg, font_t *font, int x, int y, TT_F26Dot6 x1, TT_F26Dot6 y1, TT_F26Dot6 *advance, TT_BBox **bbox, char **next); - - - -/******************************************************************** - * gdTcl_UtfToUniChar is borrowed from ... - */ -/* - * tclUtf.c -- - * - * Routines for manipulating UTF-8 strings. - * - * Copyright (c) 1997-1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tclUtf.c 1.25 98/01/28 18:02:43 - */ - -/* - *--------------------------------------------------------------------------- - * - * gdTcl_UtfToUniChar -- - * - * Extract the Tcl_UniChar represented by the UTF-8 string. Bad - * UTF-8 sequences are converted to valid Tcl_UniChars and processing - * continues. Equivalent to Plan 9 chartorune(). - * - * The caller must ensure that the source buffer is long enough that - * this routine does not run off the end and dereference non-existent - * memory looking for trail bytes. If the source buffer is known to - * be '\0' terminated, this cannot happen. Otherwise, the caller - * should call Tcl_UtfCharComplete() before calling this routine to - * ensure that enough bytes remain in the string. - * - * Results: - * *chPtr is filled with the Tcl_UniChar, and the return value is the - * number of bytes from the UTF-8 string that were consumed. - * - * Side effects: - * None. - * - *--------------------------------------------------------------------------- - */ - -#ifndef CHARSET_EBCDIC -#define ASC(ch) (ch) -#else /*CHARSET_EBCDIC*/ -#define ASC(ch) os_toascii[(unsigned char) (ch)] -#endif /*CHARSET_EBCDIC*/ - -#define Tcl_UniChar int -#define TCL_UTF_MAX 3 -static int -gdTcl_UtfToUniChar(char *str, Tcl_UniChar *chPtr) -/* str is the UTF8 next character pointer */ -/* chPtr is the int for the result */ -{ - int byte; - - /* HTML4.0 entities in decimal form, e.g. Å */ - byte = *((unsigned char *) str); - if (byte == '&') { - int i, n=0; - - byte = *((unsigned char *) (str+1)); - if (byte == '#') { - for (i = 2; i < 8; i++) { - byte = *((unsigned char *) (str+i)); - if (byte >= '0' && byte <= '9') { - n = (n * 10) + (byte - '0'); - } - else - break; - } - if (byte == ';') { - *chPtr = (Tcl_UniChar) n; - return ++i; - } - } - } - - /* - * Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones. - */ - - byte = ASC(*((unsigned char *) str)); - if (byte < 0xC0) { - /* - * Handles properly formed UTF-8 characters between 0x01 and 0x7F. - * Also treats \0 and naked trail bytes 0x80 to 0xBF as valid - * characters representing themselves. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xE0) { - if ((ASC(str[1]) & 0xC0) == 0x80) { - /* - * Two-byte-character lead-byte followed by a trail-byte. - */ - - *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (ASC(str[1]) & 0x3F)); - return 2; - } - /* - * A two-byte-character lead-byte not followed by trail-byte - * represents itself. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } else if (byte < 0xF0) { - if (((ASC(str[1]) & 0xC0) == 0x80) && ((ASC(str[2]) & 0xC0) == 0x80)) { - /* - * Three-byte-character lead byte followed by two trail bytes. - */ - - *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) - | ((ASC(str[1]) & 0x3F) << 6) | (ASC(str[2]) & 0x3F)); - return 3; - } - /* - * A three-byte-character lead-byte not followed by two trail-bytes - * represents itself. - */ - - *chPtr = (Tcl_UniChar) byte; - return 1; - } -#if TCL_UTF_MAX > 3 - else { - int ch, total, trail; - - total = totalBytes[byte]; - trail = total - 1; - if (trail > 0) { - ch = byte & (0x3F >> trail); - do { - str++; - if ((ASC(*str) & 0xC0) != 0x80) { - *chPtr = byte; - return 1; - } - ch <<= 6; - ch |= (ASC(*str) & 0x3F); - trail--; - } while (trail > 0); - *chPtr = ch; - return total; - } - } -#endif - - *chPtr = (Tcl_UniChar) byte; - return 1; -} - -/********************************************************************/ -/* font cache functions */ - -static int -fontTest ( void *element, void *key ) -{ - font_t *a=(font_t *)element; - fontkey_t *b=(fontkey_t *)key; - - return ( strcmp(a->fontname, b->fontname) == 0 - && a->ptsize == b->ptsize - && a->angle == b->angle); -} - -static void * -fontFetch ( char **error, void *key ) -{ - TT_Error err; - font_t *a; - fontkey_t *b=(fontkey_t *)key; - int i, n, map_found; - short platform, encoding; - TSRMLS_FETCH(); - - a = (font_t *)malloc(sizeof(font_t)); -#ifdef VIRTUAL_DIR - /* a->fontname will be freed in fontRelease() later on */ - if (virtual_filepath(b->fontname, &a->fontname TSRMLS_CC)) { - *error = "Could not find/open font"; - return NULL; - } -#else - a->fontname = (char *)malloc(strlen(b->fontname) + 1); - strcpy(a->fontname, b->fontname); -#endif - a->ptsize = b->ptsize; - a->angle = b->angle; - a->sin_a = sin(a->angle); - a->cos_a = cos(a->angle); - a->engine = b->engine; - if ((err = TT_Open_Face(*b->engine, a->fontname, &a->face))) { - if (err == TT_Err_Could_Not_Open_File) { - *error = "Could not find/open font"; - } - else { - *error = "Could not read font"; - } - return NULL; - } - /* get face properties and allocate preload arrays */ - TT_Get_Face_Properties(a->face, &a->properties); - - /* create instance */ - if (TT_New_Instance(a->face, &a->instance)) { - *error = "Could not create face instance"; - return NULL; - } - - if (TT_Set_Instance_Resolutions(a->instance, RESOLUTION, RESOLUTION)) { - *error = "Could not set device resolutions"; - return NULL; -map_found = 0; -a->have_char_map_Unicode = 0; -a->have_char_map_Big5 = 0; -a->have_char_map_Roman = 0; - } - - if (TT_Set_Instance_CharSize(a->instance, (TT_F26Dot6)(a->ptsize*64))) { - *error = "Could not set character size"; - return NULL; - } - - TT_Get_Instance_Metrics(a->instance, &a->imetrics); - - /* First, look for a Unicode charmap */ - n = TT_Get_CharMap_Count(a->face); - - for (i = 0; i < n; i++) { - TT_Get_CharMap_ID(a->face, i, &platform, &encoding); - if ((platform == 3 && encoding == 1) /* Windows Unicode */ - || (platform == 2 && encoding == 1) - || (platform == 0)) { /* ?? Unicode */ - TT_Get_CharMap(a->face, i, &a->char_map_Unicode); - a->have_char_map_Unicode = 1; - map_found++; - } else if (platform == 3 && encoding == 4) { /* Windows Big5 */ - TT_Get_CharMap(a->face, i, &a->char_map_Big5); - a->have_char_map_Big5 = 1; - map_found++; - } else if (platform == 1 && encoding == 0) { /* Apple Roman */ - TT_Get_CharMap(a->face, i, &a->char_map_Roman); - a->have_char_map_Roman = 1; - map_found++; - } - } - - if (! map_found) { - *error = "Unable to find a CharMap that I can handle"; - return NULL; - } - - a->matrix.xx = (TT_Fixed) (a->cos_a * (1<<16)); - a->matrix.yx = (TT_Fixed) (a->sin_a * (1<<16)); - a->matrix.xy = - a->matrix.yx; - a->matrix.yy = a->matrix.xx; - - a->glyphCache = gdCacheCreate( GLYPHCACHESIZE, - glyphTest, glyphFetch, glyphRelease); - - return (void *)a; -} - -static void -fontRelease( void *element ) -{ - font_t *a=(font_t *)element; - - gdCacheDelete(a->glyphCache); - TT_Done_Instance(a->instance); - TT_Close_Face(a->face); - free(a->fontname); - free( (char *)element ); -} - -/********************************************************************/ -/* glyph cache functions */ - -static int -glyphTest ( void *element, void *key ) -{ - glyph_t *a=(glyph_t *)element; - glyphkey_t *b=(glyphkey_t *)key; - - return (a->character == b->character - && a->hinting == b->hinting - && a->gray_render == b->gray_render); -} - -static void * -glyphFetch ( char **error, void *key ) -{ - glyph_t *a; - glyphkey_t *b=(glyphkey_t *)key; - short glyph_code; - int flags, err; - int crect[8], xmin, xmax, ymin, ymax; - double cos_a, sin_a; - - a = (glyph_t *)malloc(sizeof(glyph_t)); - a->character = b->character; - a->hinting = b->hinting; - a->gray_render = b->gray_render; - a->oldx = a->oldy = 0; - - /* create glyph container */ - if ((TT_New_Glyph(b->font->face, &a->glyph))) { - *error = "Could not create glyph container"; - return NULL; - } - - flags = TTLOAD_SCALE_GLYPH; - if (a->hinting && b->font->angle == 0.0) { - flags |= TTLOAD_HINT_GLYPH; - } - if (b->font->have_char_map_Unicode) { - glyph_code = TT_Char_Index(b->font->char_map_Unicode, a->character); - } else if (a->character < 161 && b->font->have_char_map_Roman) { - glyph_code = TT_Char_Index(b->font->char_map_Roman, a->character); - } else if ( b->font->have_char_map_Big5) { - glyph_code = TT_Char_Index(b->font->char_map_Big5, a->character); - } - if ((err=TT_Load_Glyph(b->font->instance, a->glyph, glyph_code, flags))) { - *error = "TT_Load_Glyph problem"; - return NULL; - } - - TT_Get_Glyph_Metrics(a->glyph, &a->metrics); - if (b->font->angle != 0.0) { - TT_Get_Glyph_Outline(a->glyph, &a->outline); - TT_Transform_Outline(&a->outline, &b->font->matrix); - } - - /* calculate bitmap size */ - xmin = a->metrics.bbox.xMin -64; - ymin = a->metrics.bbox.yMin -64; - xmax = a->metrics.bbox.xMax +64; - ymax = a->metrics.bbox.yMax +64; - - cos_a = b->font->cos_a; - sin_a = b->font->sin_a; - crect[0] = (int)(xmin * cos_a - ymin * sin_a); - crect[1] = (int)(xmin * sin_a + ymin * cos_a); - crect[2] = (int)(xmax * cos_a - ymin * sin_a); - crect[3] = (int)(xmax * sin_a + ymin * cos_a); - crect[4] = (int)(xmax * cos_a - ymax * sin_a); - crect[5] = (int)(xmax * sin_a + ymax * cos_a); - crect[6] = (int)(xmin * cos_a - ymax * sin_a); - crect[7] = (int)(xmin * sin_a + ymax * cos_a); - a->xmin = MIN(MIN(crect[0], crect[2]), MIN(crect[4], crect[6])); - a->xmax = MAX(MAX(crect[0], crect[2]), MAX(crect[4], crect[6])); - a->ymin = MIN(MIN(crect[1], crect[3]), MIN(crect[5], crect[7])); - a->ymax = MAX(MAX(crect[1], crect[3]), MAX(crect[5], crect[7])); - - /* allocate bitmap large enough for character */ - a->Bit.rows = (a->ymax - a->ymin + 32 + 64) / 64; - a->Bit.width = (a->xmax - a->xmin + 32 + 64) / 64; - a->Bit.flow = TT_Flow_Up; - if (a->gray_render) { - a->Bit.cols = a->Bit.width; /* 1 byte per pixel */ - } - else { - a->Bit.cols = (a->Bit.width + 7) / 8; /* 1 bit per pixel */ - } - a->Bit.cols = (a->Bit.cols + 3) & ~3; /* pad to 32 bits */ - a->Bit.size = a->Bit.rows * a->Bit.cols; /* # of bytes in buffer */ - a->Bit.bitmap = NULL; - - a->bitmapCache = gdCacheCreate( BITMAPCACHESIZE, - bitmapTest, bitmapFetch, bitmapRelease); - - return (void *)a; -} - -static void -glyphRelease( void *element ) -{ - glyph_t *a=(glyph_t *)element; - - gdCacheDelete(a->bitmapCache); - TT_Done_Glyph( a->glyph ); - free( (char *)element ); -} - -/********************************************************************/ -/* bitmap cache functions */ - -static int -bitmapTest ( void *element, void *key ) -{ - bitmap_t *a=(bitmap_t *)element; - bitmapkey_t *b=(bitmapkey_t *)key; - - if (a->xoffset == b->xoffset && a->yoffset == b->yoffset) { - b->glyph->Bit.bitmap = a->bitmap; - return TRUE; - } - return FALSE; -} - -static void * -bitmapFetch ( char **error, void *key ) -{ - bitmap_t *a; - bitmapkey_t *b=(bitmapkey_t *)key; - - a = (bitmap_t *)malloc(sizeof(bitmap_t)); - a->xoffset = b->xoffset; - a->yoffset = b->yoffset; - - b->glyph->Bit.bitmap = a->bitmap = (char *)malloc(b->glyph->Bit.size); - memset(a->bitmap, 0, b->glyph->Bit.size); - /* render glyph */ - if (b->glyph->gray_render) { - TT_Get_Glyph_Pixmap(b->glyph->glyph, &b->glyph->Bit, - a->xoffset, a->yoffset); - } - else { - TT_Get_Glyph_Bitmap(b->glyph->glyph, &b->glyph->Bit, - a->xoffset, a->yoffset); - } - return (void *)a; -} - -static void -bitmapRelease( void *element ) -{ - bitmap_t *a=(bitmap_t *)element; - - free( a->bitmap ); - free( (char *)element ); -} - -/********************************************************************/ -/* tweencolor cache functions */ - -static int -tweenColorTest (void *element, void *key) -{ - tweencolor_t *a=(tweencolor_t *)element; - tweencolorkey_t *b=(tweencolorkey_t *)key; - - return (a->pixel == b->pixel - && a->bgcolor == b->bgcolor - && a->fgcolor == b->fgcolor - && a->im == b->im); -} - -static void * -tweenColorFetch (char **error, void *key) -{ - tweencolor_t *a; - tweencolorkey_t *b=(tweencolorkey_t *)key; - int pixel, npixel, bg, fg; - gdImagePtr im; - - a = (tweencolor_t *)malloc(sizeof(tweencolor_t)); - pixel = a->pixel = b->pixel; - bg = a->bgcolor = b->bgcolor; - fg = a->fgcolor = b->fgcolor; - im = b->im; - - /* if fg is specified by a negative color idx, then don't antialias */ - if (fg <0) { - a->tweencolor = -fg; - } else { - npixel = NUMCOLORS - pixel; - a->tweencolor = gdImageColorResolve(im, - (pixel * im->red [fg] + npixel * im->red [bg]) / NUMCOLORS, - (pixel * im->green[fg] + npixel * im->green[bg]) / NUMCOLORS, - (pixel * im->blue [fg] + npixel * im->blue [bg]) / NUMCOLORS); - } - *error = NULL; - return (void *)a; -} - -static void -tweenColorRelease(void *element) -{ - free((char *)element); -} - -/********************************************************************/ -/* gdttfchar - render one character onto a gd image */ - -static int OneTime=0; -static gdCache_head_t *tweenColorCache; - -char * -gdttfchar(gdImage *im, int fg, font_t *font, - int x, int y, /* string start pos in pixels */ - TT_F26Dot6 x1, TT_F26Dot6 y1, /* char start offset (*64) from x,y */ - TT_F26Dot6 *advance, - TT_BBox **bbox, - char **next) -{ - int pc, ch, len; - int row, col; - int x2, y2; /* char start pos in pixels */ - int x3, y3; /* current pixel pos */ - unsigned char *pixel; - - glyph_t *glyph; - glyphkey_t glyphkey; - bitmapkey_t bitmapkey; - tweencolor_t *tweencolor; - tweencolorkey_t tweencolorkey; - - /****** set up tweenColorCache on first call ************/ - if (! OneTime) { - tweenColorCache = gdCacheCreate(TWEENCOLORCACHESIZE, - tweenColorTest, tweenColorFetch, tweenColorRelease); - OneTime++; - } - /**************/ - - if (font->have_char_map_Unicode) { /* use UTF-8 mapping from ASCII */ - len = gdTcl_UtfToUniChar(*next, &ch); - *next += len; - } else { - /* - * Big 5 mapping: - * use "JIS-8 half-width katakana" coding from 8-bit characters. Ref: - * ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/japan.inf-032092.sjs - */ - ch = (**next) & 255; /* don't extend sign */ - (*next)++; - if (ch >= 161 /* first code of JIS-8 pair */ - && **next) { /* don't advance past '\0' */ - ch = (ch * 256) + **next; - (*next)++; - } - } - - glyphkey.character = ch; - glyphkey.hinting = 1; - /* if fg is specified by a negative color idx, then don't antialias */ - glyphkey.gray_render = ((font->ptsize < MINANTIALIASPTSIZE) || (fg <0))?FALSE:TRUE; - glyphkey.font = font; - glyph = (glyph_t *)gdCacheGet(font->glyphCache, &glyphkey); - if (! glyph) - return font->glyphCache->error; - - *bbox = &glyph->metrics.bbox; - *advance = glyph->metrics.advance; - - /* if null *im, or invalid color, then assume user just wants brect */ - if (!im || fg > 255 || fg < -255) - return (char *)NULL; - - /* render (via cache) a bitmap for the current fractional offset */ - bitmapkey.xoffset = ((x1+32) & 63) - 32 - ((glyph->xmin+32) & -64); - bitmapkey.yoffset = ((y1+32) & 63) - 32 - ((glyph->ymin+32) & -64); - bitmapkey.glyph = glyph; - gdCacheGet(glyph->bitmapCache, &bitmapkey); - - /* copy to gif, mapping colors */ - x2 = x + (((glyph->xmin+32) & -64) + ((x1+32) & -64)) / 64; - y2 = y - (((glyph->ymin+32) & -64) + ((y1+32) & -64)) / 64; - tweencolorkey.fgcolor = fg; - tweencolorkey.im = im; - for (row = 0; row < glyph->Bit.rows; row++) { - if (glyph->gray_render) - pc = row * glyph->Bit.cols; - else - pc = row * glyph->Bit.cols * 8; - y3 = y2 - row; - if (y3 >= im->sy || y3 < 0) continue; - for (col = 0; col < glyph->Bit.width; col++, pc++) { - if (glyph->gray_render) { - tweencolorkey.pixel = - *((unsigned char *)(glyph->Bit.bitmap) + pc); - } else { - tweencolorkey.pixel = - (((*((unsigned char *)(glyph->Bit.bitmap) + pc/8)) - <<(pc%8))&128)?4:0; - } - /* if not background */ - if (tweencolorkey.pixel > 0) { - x3 = x2 + col; - if (x3 >= im->sx || x3 < 0) continue; -#if HAVE_LIBGD13 - pixel = &im->pixels[y3][x3]; -#else - pixel = &im->pixels[x3][y3]; -#endif - tweencolorkey.bgcolor = *pixel; - tweencolor = (tweencolor_t *)gdCacheGet( - tweenColorCache, &tweencolorkey); - *pixel = tweencolor->tweencolor; - } - } - } - return (char *)NULL; -} - -/********************************************************************/ -/* gdttf - render a utf8 string onto a gd image */ - -char * -gdttf(gdImage *im, int *brect, int fg, char *fontname, - double ptsize, double angle, int x, int y, char *str) -{ - TT_F26Dot6 ur_x=0, ur_y=0, ll_x=0, ll_y=0; - TT_F26Dot6 advance_x, advance_y, advance, x1, y1; - TT_BBox *bbox; - double sin_a, cos_a; - int i=0, ch; - font_t *font; - fontkey_t fontkey; - char *error, *next; - - /****** initialize font engine on first call ************/ - static gdCache_head_t *fontCache; - static TT_Engine engine; - - if (! fontCache) { - if (TT_Init_FreeType(&engine)) { - return "Failure to initialize font engine"; - } - fontCache = gdCacheCreate( FONTCACHESIZE, - fontTest, fontFetch, fontRelease); - } - /**************/ - - /* get the font (via font cache) */ - fontkey.fontname = fontname; - fontkey.ptsize = ptsize; - fontkey.angle = angle; - fontkey.engine = &engine; - font = (font_t *)gdCacheGet(fontCache, &fontkey); - if (! font) { - return fontCache->error; - } - sin_a = font->sin_a; - cos_a = font->cos_a; - advance_x = advance_y = 0; - - next=str; - while (*next) { - ch = *next; - - /* carriage returns */ - if (ch == '\r') { - advance_x = 0; - next++; - continue; - } - /* newlines */ - if (ch == '\n') { - advance_y -= (TT_F26Dot6)(font->imetrics.y_ppem * LINESPACE * 64); - advance_y = (advance_y-32) & -64; /* round to next pixel row */ - next++; - continue; - } - - x1 = (TT_F26Dot6)(advance_x * cos_a - advance_y * sin_a); - y1 = (TT_F26Dot6)(advance_x * sin_a + advance_y * cos_a); - - if ((error=gdttfchar(im, fg, font, x, y, x1, y1, &advance, &bbox, &next))) - return error; - - if (! i++) { /* if first character, init BB corner values */ - ll_x = bbox->xMin; - ll_y = bbox->yMin; - ur_x = bbox->xMax; - ur_y = bbox->yMax; - } - else { - if (! advance_x) ll_x = MIN(bbox->xMin, ll_x); - ll_y = MIN(advance_y + bbox->yMin, ll_y); - ur_x = MAX(advance_x + bbox->xMax, ur_x); - if (! advance_y) ur_y = MAX(bbox->yMax, ur_y); - } - advance_x += advance; - } - - /* rotate bounding rectangle */ - brect[0] = (int)(ll_x * cos_a - ll_y * sin_a); - brect[1] = (int)(ll_x * sin_a + ll_y * cos_a); - brect[2] = (int)(ur_x * cos_a - ll_y * sin_a); - brect[3] = (int)(ur_x * sin_a + ll_y * cos_a); - brect[4] = (int)(ur_x * cos_a - ur_y * sin_a); - brect[5] = (int)(ur_x * sin_a + ur_y * cos_a); - brect[6] = (int)(ll_x * cos_a - ur_y * sin_a); - brect[7] = (int)(ll_x * sin_a + ur_y * cos_a); - - /* scale, round and offset brect */ - i = 0; - while (i<8) { - brect[i] = x + (brect[i] + 32) / 64; - i++; - brect[i] = y - (brect[i] + 32) / 64; - i++; - } - - return (char *)NULL; -} - -#endif /* HAVE_LIBTTF */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/gd/gdttf.h b/ext/gd/gdttf.h deleted file mode 100644 index 4f32129702d..00000000000 --- a/ext/gd/gdttf.h +++ /dev/null @@ -1,16 +0,0 @@ -/* $Id$ */ - -#ifdef _OSD_POSIX -#ifndef APACHE -#error On this EBCDIC platform, PHP is only supported as an Apache module. -#else /*APACHE*/ -#ifndef CHARSET_EBCDIC -#define CHARSET_EBCDIC /* this machine uses EBCDIC, not ASCII! */ -#endif -#include "ebcdic.h" -#endif /*APACHE*/ -#endif /*_OSD_POSIX*/ - -char * gdttf(gdImage *im, int *brect, int fg, char *fontname, - double ptsize, double angle, int x, int y, char *str); - diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h deleted file mode 100644 index b2ac0c25694..00000000000 --- a/ext/gd/php_gd.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf | - | Stig Bakken | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GD_H -#define PHP_GD_H - -#define HAVE_GDIMAGECREATEFROMPNG 1 - -#if HAVE_LIBTTF|HAVE_LIBFREETYPE -#define ENABLE_GD_TTF -#endif - -#if HAVE_LIBGD - -#include - -#if HAVE_LIBT1 -#include "gdt1.h" -#endif - -#define PHP_GDIMG_TYPE_GIF 1 -#define PHP_GDIMG_TYPE_PNG 2 -#define PHP_GDIMG_TYPE_JPG 3 -#define PHP_GDIMG_TYPE_WBM 4 -#define PHP_GDIMG_TYPE_XBM 5 -#define PHP_GDIMG_TYPE_XPM 6 -#define PHP_GDIMG_CONVERT_WBM 7 -#define PHP_GDIMG_TYPE_GD 8 -#define PHP_GDIMG_TYPE_GD2 9 -#define PHP_GDIMG_TYPE_GD2PART 10 - -#ifdef PHP_WIN32 -#define PHP_GD_API __declspec(dllexport) -#else -#define PHP_GD_API -#endif - -PHPAPI extern const char php_sig_gif[3]; -PHPAPI extern const char php_sig_jpg[3]; -PHPAPI extern const char php_sig_png[3]; - -extern zend_module_entry gd_module_entry; -#define phpext_gd_ptr &gd_module_entry - -/* gd.c functions */ -PHP_MINFO_FUNCTION(gd); -PHP_MINIT_FUNCTION(gd); -PHP_MSHUTDOWN_FUNCTION(gd); - -#ifndef HAVE_GDIMAGECOLORRESOLVE -static int gdImageColorResolve(gdImagePtr, int, int, int); -#endif -PHP_FUNCTION(imagearc); -PHP_FUNCTION(imagechar); -PHP_FUNCTION(imagecharup); -PHP_FUNCTION(imagecolorallocate); -PHP_FUNCTION(imagepalettecopy); -PHP_FUNCTION(imagecolorat); -PHP_FUNCTION(imagecolorclosest); -PHP_FUNCTION(imagecolorclosesthwb); -PHP_FUNCTION(imagecolordeallocate); -PHP_FUNCTION(imagecolorresolve); -PHP_FUNCTION(imagecolorexact); -PHP_FUNCTION(imagecolorset); -PHP_FUNCTION(imagecolorstotal); -PHP_FUNCTION(imagecolorsforindex); -PHP_FUNCTION(imagecolortransparent); -PHP_FUNCTION(imagecopy); -PHP_FUNCTION(imagecopymerge); -PHP_FUNCTION(imagecopyresized); -PHP_FUNCTION(imagetypes); -PHP_FUNCTION(imagecreate); -PHP_FUNCTION(imageftbbox); -PHP_FUNCTION(imagefttext); - -PHP_FUNCTION(imagecreatetruecolor); -PHP_FUNCTION(imagetruecolortopalette); -PHP_FUNCTION(imagesetthickness); -PHP_FUNCTION(imageellipse); -PHP_FUNCTION(imagefilledellipse); -PHP_FUNCTION(imagefilledarc); -PHP_FUNCTION(imagealphablending); -PHP_FUNCTION(imagecolorresolvealpha); -PHP_FUNCTION(imagecolorclosestalpha); -PHP_FUNCTION(imagecolorexactalpha); -PHP_FUNCTION(imagecopyresampled); -PHP_FUNCTION(imagesetthickness); -PHP_FUNCTION(imagesettile); -PHP_FUNCTION(imagecopymergegray); -PHP_FUNCTION(imagesetbrush); -PHP_FUNCTION(imagesettile); -PHP_FUNCTION(imagesetstyle); - -PHP_FUNCTION(imagecreatefromstring); -PHP_FUNCTION(imagecreatefromgif); -PHP_FUNCTION(imagecreatefromjpeg); -PHP_FUNCTION(imagecreatefromxbm); -PHP_FUNCTION(imagecreatefromxpm); -PHP_FUNCTION(imagecreatefrompng); -PHP_FUNCTION(imagecreatefromwbmp); -PHP_FUNCTION(imagecreatefromgd); -PHP_FUNCTION(imagecreatefromgd2); -PHP_FUNCTION(imagecreatefromgd2part); - -PHP_FUNCTION(imagegammacorrect); -PHP_FUNCTION(imagedestroy); -PHP_FUNCTION(imagefill); -PHP_FUNCTION(imagefilledpolygon); -PHP_FUNCTION(imagefilledrectangle); -PHP_FUNCTION(imagefilltoborder); -PHP_FUNCTION(imagefontwidth); -PHP_FUNCTION(imagefontheight); - -PHP_FUNCTION(imagegif ); -PHP_FUNCTION(imagejpeg ); -PHP_FUNCTION(imagepng); -PHP_FUNCTION(imagewbmp); -PHP_FUNCTION(imagegd); -PHP_FUNCTION(imagegd2); - -PHP_FUNCTION(imageinterlace); -PHP_FUNCTION(imageline); -PHP_FUNCTION(imageloadfont); -PHP_FUNCTION(imagepolygon); -PHP_FUNCTION(imagerectangle); -PHP_FUNCTION(imagesetpixel); -PHP_FUNCTION(imagestring); -PHP_FUNCTION(imagestringup); -PHP_FUNCTION(imagesx); -PHP_FUNCTION(imagesy); -PHP_FUNCTION(imagedashedline); -PHP_FUNCTION(imagettfbbox); -PHP_FUNCTION(imagettftext); -PHP_FUNCTION(imagepsloadfont); -/* -PHP_FUNCTION(imagepscopyfont); -*/ -PHP_FUNCTION(imagepsfreefont); -PHP_FUNCTION(imagepsencodefont); -PHP_FUNCTION(imagepsextendfont); -PHP_FUNCTION(imagepsslantfont); -PHP_FUNCTION(imagepstext); -PHP_FUNCTION(imagepsbbox); - -PHP_FUNCTION(jpeg2wbmp); -PHP_FUNCTION(png2wbmp); -PHP_FUNCTION(image2wbmp); - -PHP_GD_API int phpi_get_le_gd(void); - -/* This is missing from gd.h */ -#if HAVE_COLORCLOSESTHWB -int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); -#endif - -#else - -#define phpext_gd_ptr NULL - -#endif - -#endif /* PHP_GD_H */ diff --git a/ext/gettext/CREDITS b/ext/gettext/CREDITS deleted file mode 100644 index acaebd7fae5..00000000000 --- a/ext/gettext/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GetText -Alex Plotnick diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 deleted file mode 100644 index f4a6fc34e97..00000000000 --- a/ext/gettext/config.m4 +++ /dev/null @@ -1,52 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(gettext,for GNU gettext support, -[ --with-gettext[=DIR] Include GNU gettext support.]) - -if test "$PHP_GETTEXT" != "no"; then - for i in /usr /usr/local $PHP_GETTEXT; do - if test -r $i/include/libintl.h; then - GETTEXT_DIR=$i - fi - done - - if test -z "$GETTEXT_DIR"; then - AC_MSG_ERROR(Cannot locate header file libintl.h) - fi - - GETTEXT_LIBDIR=$GETTEXT_DIR/lib - GETTEXT_INCDIR=$GETTEXT_DIR/include - - O_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" - AC_CHECK_LIB(intl, bindtextdomain, [ - GETTEXT_LIBS=intl - GETTEXT_CHECK_IN_LIB=intl - ], - AC_CHECK_LIB(c, bindtextdomain, [ - GETTEXT_LIBS= - GETTEXT_CHECK_IN_LIB=c - ],[ - AC_MSG_ERROR(Unable to find required gettext library) - ]) - ) - LDFLAGS=$O_LDFLAGS - - AC_DEFINE(HAVE_LIBINTL,1,[ ]) - PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared) - PHP_SUBST(GETTEXT_SHARED_LIBADD) - - if test -n "$GETTEXT_LIBS"; then - PHP_ADD_LIBRARY_WITH_PATH($GETTEXT_LIBS, $GETTEXT_LIBDIR, GETTEXT_SHARED_LIBADD) - fi - - PHP_ADD_INCLUDE($GETTEXT_INCDIR) - - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])]) - AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])]) - -fi diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c deleted file mode 100644 index f36b2e48b03..00000000000 --- a/ext/gettext/gettext.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Alex Plotnick | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_gettext.h" - -#if HAVE_LIBINTL - -#include -#include "ext/standard/info.h" - -/* {{{ php_gettext_functions[] - */ -function_entry php_gettext_functions[] = { - PHP_FE(textdomain, NULL) - PHP_FE(gettext, NULL) - PHP_FALIAS(_, gettext, NULL) - PHP_FE(dgettext, NULL) - PHP_FE(dcgettext, NULL) - PHP_FE(bindtextdomain, NULL) -#if HAVE_NGETTEXT - PHP_FE(ngettext, NULL) -#endif -#if HAVE_DNGETTEXT - PHP_FE(dngettext, NULL) -#endif -#if HAVE_DCNGETTEXT - PHP_FE(dcngettext, NULL) -#endif -#if HAVE_BIND_TEXTDOMAIN_CODESET - PHP_FE(bind_textdomain_codeset, NULL) -#endif - - - {NULL, NULL, NULL} -}; -/* }}} */ - -zend_module_entry php_gettext_module_entry = { - STANDARD_MODULE_HEADER, - "gettext", - php_gettext_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(gettext), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef COMPILE_DL_GETTEXT -ZEND_GET_MODULE(php_gettext) -#endif - -PHP_MINFO_FUNCTION(gettext) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "GetText Support", "enabled"); - php_info_print_table_end(); -} - -/* {{{ proto string textdomain(string domain) - Set the textdomain to "domain". Returns the current domain */ -PHP_FUNCTION(textdomain) -{ - zval **domain; - char *domain_name, *retval; - char *val; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain); - - val = Z_STRVAL_PP(domain); - if (strcmp(val, "") && strcmp(val, "0")) { - domain_name = val; - } else { - domain_name = NULL; - } - - retval = textdomain(domain_name); - - RETURN_STRING(retval, 1); -} -/* }}} */ - -/* {{{ proto string gettext(string msgid) - Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */ -PHP_FUNCTION(gettext) -{ - zval **msgid; - char *msgstr; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(msgid); - - msgstr = gettext(Z_STRVAL_PP(msgid)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string dgettext(string domain_name, string msgid) - Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */ -PHP_FUNCTION(dgettext) -{ - zval **domain_name, **msgid; - char *msgstr; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &msgid) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(msgid); - - msgstr = dgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string dcgettext(string domain_name, string msgid, long category) - Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */ -PHP_FUNCTION(dcgettext) -{ - zval **domain_name, **msgid, **category; - char *msgstr; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &domain_name, &msgid, &category) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(msgid); - convert_to_long_ex(category); - - msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category)); - - RETURN_STRING(msgstr, 1); -} -/* }}} */ - -/* {{{ proto string bindtextdomain(string domain_name, string dir) - Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */ -PHP_FUNCTION(bindtextdomain) -{ - zval **domain_name, **dir; - char *retval, dir_name[MAXPATHLEN]; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &dir) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(domain_name); - convert_to_string_ex(dir); - - if (strcmp(Z_STRVAL_PP(dir), "") && strcmp(Z_STRVAL_PP(dir), "0")) { - VCWD_REALPATH(Z_STRVAL_PP(dir), dir_name); - } else { - VCWD_GETCWD(dir_name, MAXPATHLEN); - } - - retval = bindtextdomain(Z_STRVAL_PP(domain_name), dir_name); - - RETURN_STRING(retval, 1); -} -/* }}} */ - -#if HAVE_NGETTEXT -/* {{{ proto string ngettext(string MSGID1, string MSGID2, int N) - Plural version of gettext() */ -PHP_FUNCTION(ngettext) -{ - zval **msgid1, **msgid2, **count; - char *msgstr; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &msgid1, &msgid2, &count) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - - msgstr = ngettext(Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); - if (msgstr) { - RETVAL_STRING (msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_DNGETTEXT -/* {{{ proto string dngettext (string domain, string msgid1, string msgid2, int count) - Plural version of dgettext() */ -PHP_FUNCTION(dngettext) -{ - zval **domain, **msgid1, **msgid2, **count; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - char *msgstr; - - convert_to_string_ex(domain); - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - - msgstr = dngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); - if (msgstr) { - RETVAL_STRING(msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_DCNGETTEXT -/* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, int n, int category) - Plural version of dcgettext() */ -PHP_FUNCTION(dcngettext) -{ - zval **domain, **msgid1, **msgid2, **count, **category; - - RETVAL_FALSE; - - if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count, &category) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - char* msgstr = NULL; - - convert_to_string_ex(domain); - convert_to_string_ex(msgid1); - convert_to_string_ex(msgid2); - convert_to_long_ex(count); - convert_to_long_ex(category); - - msgstr = dcngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count), Z_LVAL_PP(category)); - - if (msgstr) { - RETVAL_STRING(msgstr, 1); - } - } -} -/* }}} */ -#endif - -#if HAVE_BIND_TEXTDOMAIN_CODESET - -/* {{{ proto string bind_textdomain_codeset (string domain, string codeset) - Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */ -PHP_FUNCTION(bind_textdomain_codeset) -{ - zval **domain, **codeset; - char *retval; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain, &codeset) == FAILURE) { - WRONG_PARAM_COUNT; - } else { - convert_to_string_ex(domain); - convert_to_string_ex(codeset); - - retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset)); - - RETURN_STRING(retval, 1); - } -} -/* }}} */ -#endif - - -#endif /* HAVE_LIBINTL */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ - diff --git a/ext/gettext/gettext.dsp b/ext/gettext/gettext.dsp deleted file mode 100644 index 8150a17d84e..00000000000 --- a/ext/gettext/gettext.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gettext" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=gettext - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "gettext.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "gettext.mak" CFG="gettext - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "gettext - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "gettext - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "gettext - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" -# ADD LINK32 php4ts.lib gnu_gettext.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "gettext - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /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 php4ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS" -# ADD LINK32 php4ts_debug.lib gnu_gettext.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "gettext - Win32 Release_TS" -# Name "gettext - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\gettext.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_gettext.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h deleted file mode 100644 index bc4cfb93c49..00000000000 --- a/ext/gettext/php_gettext.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Alex Plotnick | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_GETTEXT_H -#define PHP_GETTEXT_H - -#if HAVE_LIBINTL -#ifndef INIT_FUNC_ARGS -#include "zend_modules.h" -#endif - -extern zend_module_entry php_gettext_module_entry; -#define gettext_module_ptr &php_gettext_module_entry - -PHP_MINFO_FUNCTION(gettext); - -PHP_FUNCTION(textdomain); -PHP_FUNCTION(gettext); -PHP_FUNCTION(dgettext); -PHP_FUNCTION(dcgettext); -PHP_FUNCTION(bindtextdomain); -#if HAVE_NGETTEXT -PHP_FUNCTION(ngettext); -#endif -#if HAVE_DNGETTEXT -PHP_FUNCTION(dngettext); -#endif -#if HAVE_DCNGETTEXT -PHP_FUNCTION(dcngettext); -#endif -#if HAVE_BIND_TEXTDOMAIN_CODESET -PHP_FUNCTION(bind_textdomain_codeset); -#endif - -#else -#define gettext_module_ptr NULL -#endif /* HAVE_LIBINTL */ - -#define phpext_gettext_ptr gettext_module_ptr - -#endif /* PHP_GETTEXT_H */ diff --git a/ext/gmp/CREDITS b/ext/gmp/CREDITS deleted file mode 100644 index 7e0346dc248..00000000000 --- a/ext/gmp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GNU GMP support -Stanislav Malyshev diff --git a/ext/gmp/README b/ext/gmp/README deleted file mode 100644 index e142e2e0313..00000000000 --- a/ext/gmp/README +++ /dev/null @@ -1,5 +0,0 @@ -Arbitrary length number support with GNU MP library. -Please see the PGP manual for more documentation. -See also GNU MP home page at http://www.swox.com/gmp/. -GNU MP library is available under the tems of GNU LGPL -license. Please see http://www.swox.com/gmp/lgpl.html diff --git a/ext/gmp/TODO b/ext/gmp/TODO deleted file mode 100644 index 81098a9cc1b..00000000000 --- a/ext/gmp/TODO +++ /dev/null @@ -1,22 +0,0 @@ -mpz_mul_2exp -mpz_[ft]div_[qr]_2exp - -V 3: -mpz_nextprime -mpz_addmul -mpz_root -mpz_perfect_power_p -mpz_lcm -mpz_si_kronecker -mpz_kronecker_si -mpz_remove -mpz_bin_ui -mpz_fib_ui -mpz_cmpabs -mpz_xor -mpz_tstbit -mpz_urandom[bm] -mpz_fits_slong_p -mpz_mul_si -mpz_odd_p -mpz_even_p diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 deleted file mode 100644 index bbc524c5406..00000000000 --- a/ext/gmp/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(gmp, for GNU MP support, -[ --with-gmp Include GNU MP support]) - -if test "$PHP_GMP" != "no"; then - - for i in /usr/local /usr $PHP_GMP; do - if test -f $i/include/gmp.h; then - GMP_DIR=$i - fi - done - - if test -z "$GMP_DIR"; then - AC_MSG_ERROR(Unable to locate gmp.h) - fi - PHP_ADD_INCLUDE($GMP_DIR/include) - - - PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared) - AC_DEFINE(HAVE_GMP, 1, [ ]) - PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib) -fi diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c deleted file mode 100644 index 7f133d0473e..00000000000 --- a/ext/gmp/gmp.c +++ /dev/null @@ -1,1253 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Stanislav Malyshev | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_gmp.h" -#include "ext/standard/info.h" - -#if HAVE_GMP - -#include -/* If you declare any globals in php_gmp.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(gmp) -*/ - -/* True global resources - no need for thread safety here */ -static int le_gmp; - -static unsigned char first_of_two_force_ref[] = { 2, BYREF_FORCE, BYREF_NONE }; - -/* {{{ gmp_functions[] - */ -function_entry gmp_functions[] = { - ZEND_FE(gmp_init, NULL) - ZEND_FE(gmp_intval, NULL) - ZEND_FE(gmp_strval, NULL) - ZEND_FE(gmp_add, NULL) - ZEND_FE(gmp_sub, NULL) - ZEND_FE(gmp_mul, NULL) - ZEND_FE(gmp_div_qr, NULL) - ZEND_FE(gmp_div_q, NULL) - ZEND_FE(gmp_div_r, NULL) - ZEND_FALIAS(gmp_div, gmp_div_q, NULL) - ZEND_FE(gmp_mod, NULL) - ZEND_FE(gmp_divexact, NULL) - ZEND_FE(gmp_neg, NULL) - ZEND_FE(gmp_abs, NULL) - ZEND_FE(gmp_fact, NULL) - ZEND_FE(gmp_sqrt, NULL) - ZEND_FE(gmp_sqrtrem, NULL) - ZEND_FE(gmp_pow, NULL) - ZEND_FE(gmp_powm, NULL) - ZEND_FE(gmp_perfect_square, NULL) - ZEND_FE(gmp_prob_prime, NULL) - ZEND_FE(gmp_gcd, NULL) - ZEND_FE(gmp_gcdext, NULL) - ZEND_FE(gmp_invert, NULL) - ZEND_FE(gmp_jacobi, NULL) - ZEND_FE(gmp_legendre, NULL) - ZEND_FE(gmp_cmp, NULL) - ZEND_FE(gmp_sign, NULL) - ZEND_FE(gmp_random, NULL) - ZEND_FE(gmp_and, NULL) - ZEND_FE(gmp_or, NULL) - ZEND_FE(gmp_com, NULL) - ZEND_FE(gmp_xor, NULL) - ZEND_FE(gmp_setbit, first_of_two_force_ref) - ZEND_FE(gmp_clrbit, first_of_two_force_ref) - ZEND_FE(gmp_scan0, NULL) - ZEND_FE(gmp_scan1, NULL) - ZEND_FE(gmp_popcount, NULL) - ZEND_FE(gmp_hamdist, NULL) - {NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */ -}; -/* }}} */ - -/* {{{ gmp_module_entry - */ -zend_module_entry gmp_module_entry = { - STANDARD_MODULE_HEADER, - "gmp", - gmp_functions, - ZEND_MODULE_STARTUP_N(gmp), - ZEND_MODULE_SHUTDOWN_N(gmp), - NULL, - NULL, - ZEND_MODULE_INFO_N(gmp), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_GMP -ZEND_GET_MODULE(gmp) -#endif - -static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); - -#define GMP_RESOURCE_NAME "GMP integer" - -#define GMP_ROUND_ZERO 0 -#define GMP_ROUND_PLUSINF 1 -#define GMP_ROUND_MINUSINF 2 - -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - -/* {{{ ZEND_MINIT_FUNCTION - */ -ZEND_MODULE_STARTUP_D(gmp) -{ - le_gmp = zend_register_list_destructors_ex(_php_gmpnum_free, NULL, GMP_RESOURCE_NAME, module_number); - REGISTER_LONG_CONSTANT("GMP_ROUND_ZERO", GMP_ROUND_ZERO, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GMP_ROUND_PLUSINF", GMP_ROUND_PLUSINF, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("GMP_ROUND_MINUSINF", GMP_ROUND_MINUSINF, CONST_CS | CONST_PERSISTENT); - - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - - return SUCCESS; -} -/* }}} */ - -/* {{{ ZEND_MSHUTDOWN_FUNCTION - */ -ZEND_MODULE_SHUTDOWN_D(gmp) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ ZEND_MINFO_FUNCTION - */ -ZEND_MODULE_INFO_D(gmp) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "gmp support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -/* Fetch zval to be GMP number. - Initially, zval can be also number or string */ -#define FETCH_GMP_ZVAL(gmpnumber, zval) \ -if(Z_TYPE_PP(zval) == IS_RESOURCE) { \ - ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ -} else {\ - if(convert_to_gmp(&gmpnumber, zval, 0) == FAILURE) {\ - RETURN_FALSE;\ - }\ - ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ -} - -/* create a new initialized GMP number */ -#define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } -#define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } - -/* {{{ convert_to_gmp - * Convert zval to be gmp number */ -static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base) -{ - int ret = 0; - int skip_lead = 0; - - *gmpnumber = emalloc(sizeof(mpz_t)); - switch(Z_TYPE_PP(val)) { - case IS_LONG: - case IS_BOOL: - case IS_CONSTANT: - { - convert_to_long_ex(val); - mpz_init_set_si(**gmpnumber, Z_LVAL_PP(val)); - } - break; - case IS_STRING: - { - char *numstr = Z_STRVAL_PP(val); - - if (Z_STRLEN_PP(val) > 2) { - if (numstr[0] == '0') { - if (numstr[1] == 'x' || numstr[1] == 'X') { - base = 16; - skip_lead = 1; - } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) { - base = 2; - skip_lead = 1; - } - } - } - ret = mpz_init_set_str(**gmpnumber, (skip_lead ? &numstr[2] : numstr), base); - } - break; - default: - zend_error(E_WARNING,"Unable to convert variable to GMP - wrong type"); - efree(*gmpnumber); - return FAILURE; - } - - if (ret) { - FREE_GMP_NUM(*gmpnumber); - return FAILURE; - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ typedefs - */ -typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); -typedef int (*gmp_unary_opl_t)(mpz_srcptr); - -typedef void (*gmp_unary_ui_op_t)(mpz_ptr, unsigned long); - -typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr); - -typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); -typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); -typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); -/* }}} */ - -#define gmp_zval_binary_ui_op(r, a, b, o, u) gmp_zval_binary_ui_op_ex(r, a, b, o, u, 0 TSRMLS_CC) -#define gmp_zval_binary_ui_op2(r, a, b, o, u) gmp_zval_binary_ui_op2_ex(r, a, b, o, u, 0 TSRMLS_CC) - -#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) -#define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL) -#define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) - -/* Unary operations */ -#define gmp_unary_op(op) _gmp_unary_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) -#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) - -/* {{{ gmp_zval_binary_ui_op_ex - Execute GMP binary operation. - May return GMP resource or long if operation allows this -*/ -static inline void gmp_zval_binary_ui_op_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int allow_ui_return TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; - unsigned long long_result=0; - int use_ui=0; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - if(gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { - use_ui=1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - INIT_GMP_NUM(gmpnum_result); - if(use_ui && gmp_ui_op) { - if(allow_ui_return) { - long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } else { - gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } - } else { - gmp_op(*gmpnum_result, *gmpnum_a, *gmpnum_b); - } - - if(use_ui && allow_ui_return) { - FREE_GMP_NUM(gmpnum_result); - RETURN_LONG((long)long_result); - } else { - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - } -} -/* }}} */ - -/* {{{ gmp_zval_binary_ui_op2_ex - Execute GMP binary operation which returns 2 values. - May return GMP resources or longs if operation allows this. -*/ -static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int allow_ui_return TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result1, *gmpnum_result2; - zval r; - int use_ui=0; - unsigned long long_result; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - if(gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { - /* use _ui function */ - use_ui=1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - INIT_GMP_NUM(gmpnum_result1); - INIT_GMP_NUM(gmpnum_result2); - - if(use_ui && gmp_ui_op) { - if(allow_ui_return) { - long_result = gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } else { - gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); - } - } else { - gmp_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, *gmpnum_b); - } - - array_init(return_value); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); - add_index_resource(return_value, 0, Z_LVAL(r)); - if(use_ui && allow_ui_return) { - mpz_clear(*gmpnum_result2); - add_index_long(return_value, 1, long_result); - } else { - ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); - add_index_resource(return_value, 1, Z_LVAL(r)); - } -} -/* }}} */ - -/* {{{ _gmp_binary_ui_op - */ -static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) { - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op); -} -/* }}} */ - -/* Unary operations */ - -/* {{{ gmp_zval_unary_op - */ -static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op TSRMLS_DC) -{ - mpz_t *gmpnum_a, *gmpnum_result; - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - INIT_GMP_NUM(gmpnum_result); - gmp_op(*gmpnum_result, *gmpnum_a); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ gmp_zval_unary_ui_op - */ -static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op) { - mpz_t *gmpnum_result; - - convert_to_long_ex(a_arg); - - INIT_GMP_NUM(gmpnum_result); - gmp_op(*gmpnum_result, Z_LVAL_PP(a_arg)); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ _gmp_unary_ui_op - Execute GMP unary operation. -*/ -static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) { - zval **a_arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_unary_ui_op(return_value, a_arg, gmp_op); -} -/* }}} */ - -/* {{{ _gmp_unary_op - */ -static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) { - zval **a_arg; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC); -} -/* }}} */ - -/* {{{ _gmp_unary_opl - */ -static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) { - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(gmp_op(*gmpnum_a)); -} -/* }}} */ - -/* {{{ _gmp_binary_opl - */ -static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) { - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, a_arg); - - RETURN_LONG(gmp_op(*gmpnum_a, *gmpnum_b)); -} -/* }}} */ - -/* {{{ proto resource gmp_init(mixed number [, int base]) - Initializes GMP number */ -ZEND_FUNCTION(gmp_init) -{ - zval **number_arg, **base_arg; - mpz_t * gmpnumber; - int argc; - int base=0; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &number_arg, &base_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if (argc==2) { - convert_to_long_ex(base_arg); - base = Z_LVAL_PP(base_arg); - if(base < 2 || base > 36) { - zend_error(E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); - RETURN_FALSE; - } - } - - if(convert_to_gmp(&gmpnumber, number_arg, base) == FAILURE) { - RETURN_FALSE; - } - - /* Write your own code here to handle argument number. */ - ZEND_REGISTER_RESOURCE(return_value, gmpnumber, le_gmp); -} -/* }}} */ - -/* {{{ proto int gmp_intval(resource gmpnumber) - Gets signed long value of GMP number */ -ZEND_FUNCTION(gmp_intval) -{ - zval **gmpnumber_arg; - mpz_t * gmpnum; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &gmpnumber_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if(Z_TYPE_PP(gmpnumber_arg) == IS_RESOURCE) { - ZEND_FETCH_RESOURCE(gmpnum, mpz_t *, gmpnumber_arg, -1, GMP_RESOURCE_NAME, le_gmp); - RETVAL_LONG(mpz_get_si(*gmpnum)); - } else { - convert_to_long_ex(gmpnumber_arg); - RETVAL_LONG(Z_LVAL_PP(gmpnumber_arg)); - } -} -/* }}} */ - -/* {{{ proto string gmp_strval(resource gmpnumber [, int base]) - Gets string representation of GMP number */ -ZEND_FUNCTION(gmp_strval) -{ - zval **gmpnumber_arg, **base_arg; - int base=10, num_len, argc; - mpz_t * gmpnum; - char *out_string; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &base_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum, gmpnumber_arg); - - switch (argc) { - case 2: - convert_to_long_ex(base_arg); - base = Z_LVAL_PP(base_arg); - break; - case 1: - base = 10; - break; - } - - if(base < 2 || base > 36) { - zend_error(E_WARNING, "Bad base for conversion: %d", base); - RETURN_FALSE; - } - - num_len = mpz_sizeinbase(*gmpnum, base); - out_string = emalloc(num_len+2); - if(mpz_sgn(*gmpnum) < 0) { - num_len++; - } - mpz_get_str(out_string, base, *gmpnum); - - /* - From GMP documentation for mpz_sizeinbase(): - The returned value will be exact or 1 too big. If base is a power of - 2, the returned value will always be exact. - - So let's check to see if we already have a \0 byte... - */ - - if (out_string[num_len-1] == '\0') - num_len--; - else - out_string[num_len] = '\0'; - - RETVAL_STRINGL(out_string, num_len, 0); -} -/* }}} */ - -/* {{{ proto resource gmp_add(resource a, resource b) - Add a and b */ -ZEND_FUNCTION(gmp_add) -{ - gmp_binary_ui_op(mpz_add, (gmp_binary_ui_op_t)mpz_add_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_sub(resource a, resource b) - Subtract b from a */ -ZEND_FUNCTION(gmp_sub) -{ - gmp_binary_ui_op(mpz_sub, (gmp_binary_ui_op_t)mpz_sub_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_mul(resource a, resource b) - Multiply a and b */ -ZEND_FUNCTION(gmp_mul) -{ - gmp_binary_ui_op(mpz_mul, (gmp_binary_ui_op_t)mpz_mul_ui); -} -/* }}} */ - -/* {{{ proto array gmp_div_qr(resource a, resource b [, int round]) - Divide a by b, returns quotient and reminder */ -ZEND_FUNCTION(gmp_div_qr) -{ - zval **a_arg, **b_arg, **round_arg; - int round=GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch(round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t)mpz_tdiv_qr_ui); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t)mpz_cdiv_qr_ui); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t)mpz_fdiv_qr_ui); - break; - } - -} -/* }}} */ - -/* {{{ proto resource gmp_div_r(resource a, resource b [, int round]) - Divide a by b, returns reminder only */ -ZEND_FUNCTION(gmp_div_r) -{ - zval **a_arg, **b_arg, **round_arg; - int round=GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch(round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui, 1 TSRMLS_CC); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui, 1 TSRMLS_CC); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui, 1 TSRMLS_CC); - break; - } -} -/* }}} */ - -/* {{{ proto resource gmp_div_q(resource a, resource b [, int round]) - Divide a by b, returns quotient only */ -ZEND_FUNCTION(gmp_div_q) -{ - zval **a_arg, **b_arg, **round_arg; - int round=GMP_ROUND_ZERO, argc; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - switch (argc) { - case 3: - convert_to_long_ex(round_arg); - round = Z_LVAL_PP(round_arg); - break; - case 2: - round = GMP_ROUND_ZERO; - break; - } - - switch(round) { - case GMP_ROUND_ZERO: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t)mpz_tdiv_q_ui); - break; - case GMP_ROUND_PLUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t)mpz_cdiv_q_ui); - break; - case GMP_ROUND_MINUSINF: - gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t)mpz_fdiv_q_ui); - break; - } - -} -/* }}} */ - -/* {{{ proto resource gmp_mod(resource a, resource b) - Computes a modulo b */ -ZEND_FUNCTION(gmp_mod) -{ - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto resource gmp_divexact(resource a, resource b) - Divide a by b using exact division algorithm */ -ZEND_FUNCTION(gmp_divexact) -{ - gmp_binary_op(mpz_divexact); -} -/* }}} */ - -/* {{{ proto resource gmp_neg(resource a) - Negates a number */ -ZEND_FUNCTION(gmp_neg) -{ - gmp_unary_op(mpz_neg); -} -/* }}} */ - -/* {{{ proto resource gmp_abs(resource a) - Calculates absolute value */ -ZEND_FUNCTION(gmp_abs) -{ - gmp_unary_op(mpz_abs); -} -/* }}} */ - -/* {{{ proto resource gmp_fact(int a) - Calculates factorial function */ -ZEND_FUNCTION(gmp_fact) -{ - gmp_unary_ui_op(mpz_fac_ui); -} -/* }}} */ - -/* {{{ proto resource gmp_pow(resource base, int exp) - Raise base to power exp */ -ZEND_FUNCTION(gmp_pow) -{ - zval **base_arg, **exp_arg; - mpz_t *gmpnum_result, *gmpnum_base; - int use_ui=0; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &base_arg, &exp_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if(Z_TYPE_PP(base_arg) == IS_LONG && Z_LVAL_PP(base_arg) >= 0) { - use_ui=1; - } else { - FETCH_GMP_ZVAL(gmpnum_base, base_arg); - } - - convert_to_long_ex(exp_arg); - - if(Z_LVAL_PP(exp_arg) < 0) { - zend_error(E_WARNING,"Negative exponent not supported"); - RETURN_FALSE; - } - - INIT_GMP_NUM(gmpnum_result); - if(use_ui) { - mpz_ui_pow_ui(*gmpnum_result, Z_LVAL_PP(base_arg), Z_LVAL_PP(exp_arg)); - } else { - mpz_pow_ui(*gmpnum_result, *gmpnum_base, Z_LVAL_PP(exp_arg)); - } - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto resource gmp_powm(resource base, resource exp, resource mod) - Raise base to power exp and take result modulo mod */ -ZEND_FUNCTION(gmp_powm) -{ - zval **base_arg, **exp_arg, **mod_arg; - mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; - int use_ui=0; - - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &base_arg, &exp_arg, &mod_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_base, base_arg); - if(Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) { - use_ui=1; - } else { - FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); - } - FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); - - INIT_GMP_NUM(gmpnum_result); - if(use_ui) { - mpz_powm_ui(*gmpnum_result, *gmpnum_base, (unsigned long)Z_LVAL_PP(exp_arg), *gmpnum_mod); - } else { - mpz_powm(*gmpnum_result, *gmpnum_base, *gmpnum_exp, *gmpnum_mod); - } - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - -} -/* }}} */ - -/* {{{ proto resource gmp_sqrt(resource a) - Takes integer part of square root of a */ -ZEND_FUNCTION(gmp_sqrt) -{ - gmp_unary_op(mpz_sqrt); -} -/* }}} */ - -/* {{{ proto array gmp_sqrtrem(resource a) - Square root with remainder */ -ZEND_FUNCTION(gmp_sqrtrem) -{ - zval **a_arg; - mpz_t *gmpnum_a, *gmpnum_result1, *gmpnum_result2; - zval r; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - INIT_GMP_NUM(gmpnum_result1); - INIT_GMP_NUM(gmpnum_result2); - - mpz_sqrtrem(*gmpnum_result1, *gmpnum_result2, *gmpnum_a); - - array_init(return_value); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); - add_index_resource(return_value, 0, Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); - add_index_resource(return_value, 1, Z_LVAL(r)); -} -/* }}} */ - -/* {{{ proto bool gmp_perfect_square(resource a) - Checks if a is an exact square */ -ZEND_FUNCTION(gmp_perfect_square) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_BOOL((mpz_perfect_square_p(*gmpnum_a)!=0)); -} -/* }}} */ - -/* {{{ proto int gmp_prob_prime(resource a[, int reps]) - Checks if a is "probably prime" */ -ZEND_FUNCTION(gmp_prob_prime) -{ - zval **gmpnumber_arg, **reps_arg; - mpz_t *gmpnum_a; - int argc, reps=10; - - argc = ZEND_NUM_ARGS(); - if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &reps_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, gmpnumber_arg); - - switch (argc) { - case 2: - convert_to_long_ex(reps_arg); - reps = Z_LVAL_PP(reps_arg); - break; - case 1: - reps = 10; - break; - } - - RETURN_LONG(mpz_probab_prime_p(*gmpnum_a, reps)); -} -/* }}} */ - -/* {{{ proto resource gmp_gcd(resource a, resource b) - Computes greatest common denominator (gcd) of a and b */ -ZEND_FUNCTION(gmp_gcd) -{ - zval **a_arg, **b_arg; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_gcd, (gmp_binary_ui_op_t)mpz_gcd_ui, 1 TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto array gmp_gcdext(resource a, resource b) - Computes G, S, and T, such that AS + BT = G = `gcd' (A, B) */ -ZEND_FUNCTION(gmp_gcdext) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_t, *gmpnum_s, *gmpnum_g; - zval r; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, a_arg); - - INIT_GMP_NUM(gmpnum_g); - INIT_GMP_NUM(gmpnum_s); - INIT_GMP_NUM(gmpnum_t); - - mpz_gcdext(*gmpnum_g, *gmpnum_s, *gmpnum_t, *gmpnum_a, *gmpnum_b); - - array_init(return_value); - - ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp); - add_assoc_resource(return_value, "g", Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp); - add_assoc_resource(return_value, "s", Z_LVAL(r)); - ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp); - add_assoc_resource(return_value, "t", Z_LVAL(r)); -} -/* }}} */ - -/* {{{ proto resource gmp_invert(resource a, resource b) - Computes the inverse of a modulo b */ -ZEND_FUNCTION(gmp_invert) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, a_arg); - - INIT_GMP_NUM(gmpnum_result); - if(mpz_invert(*gmpnum_result, *gmpnum_a, *gmpnum_b)) { - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); - } else { - FREE_GMP_NUM(gmpnum_result); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int gmp_jacobi(resource a, resource b) - Computes Jacobi symbol */ -ZEND_FUNCTION(gmp_jacobi) -{ - gmp_binary_opl(mpz_jacobi); -} -/* }}} */ - -/* {{{ proto int gmp_legendre(resource a, resource b) - Computes Legendre symbol */ -ZEND_FUNCTION(gmp_legendre) -{ - gmp_binary_opl(mpz_legendre); -} -/* }}} */ - -/* {{{ proto int gmp_cmp(resource a, resource b) - Compares two numbers */ -ZEND_FUNCTION(gmp_cmp) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - int use_si=0, res; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - if(Z_TYPE_PP(b_arg) == IS_LONG) { - use_si=1; - } else { - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - } - - if(use_si) { - res = mpz_cmp_si(*gmpnum_a, Z_LVAL_PP(b_arg)); - } else { - res = mpz_cmp(*gmpnum_a, *gmpnum_b); - } - - RETURN_LONG(res); -} -/* }}} */ - -/* {{{ proto int gmp_sign(resource a) - Gets the sign of the number */ -ZEND_FUNCTION(gmp_sign) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(mpz_sgn(*gmpnum_a)); -} -/* }}} */ - -/* {{{ proto resource gmp_random([int limiter]) - Gets random number */ -ZEND_FUNCTION(gmp_random) -{ - zval **limiter_arg; - int limiter, argc; - mpz_t *gmpnum_result; - - argc = ZEND_NUM_ARGS(); - - if (argc < 0 || argc > 1 || zend_get_parameters_ex(1, &limiter_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - if(argc) { - convert_to_long_ex(limiter_arg); - limiter = Z_LVAL_PP(limiter_arg); - } else { - limiter = 20; - } - - INIT_GMP_NUM(gmpnum_result); - mpz_random(*gmpnum_result, limiter); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto resource gmp_and(resource a, resource b) - Calculates logical AND of a and b */ -ZEND_FUNCTION(gmp_and) -{ - gmp_binary_op(mpz_and); -} -/* }}} */ - -/* {{{ proto resource gmp_or(resource a, resource b) - Calculates logical OR of a and b */ -ZEND_FUNCTION(gmp_or) -{ - gmp_binary_op(mpz_ior); -} -/* }}} */ - -/* {{{ proto resource gmp_com(resource a) - Calculates one's complement of a */ -ZEND_FUNCTION(gmp_com) -{ - gmp_unary_op(mpz_com); -} -/* }}} */ - -/* {{{ proto resource gmp_xor(resource a, resource b) - Calculates logical exclusive OR of a and b */ -ZEND_FUNCTION(gmp_xor) -{ - /* use formula: a^b = (a|b)&^(a&b) */ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result, *gmpnum_t; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - INIT_GMP_NUM(gmpnum_result); - INIT_GMP_NUM(gmpnum_t); - - mpz_and(*gmpnum_t, *gmpnum_a, *gmpnum_b); - mpz_com(*gmpnum_t, *gmpnum_t); - - mpz_ior(*gmpnum_result, *gmpnum_a, *gmpnum_b); - mpz_and(*gmpnum_result, *gmpnum_result, *gmpnum_t); - - FREE_GMP_NUM(gmpnum_t); - - ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); -} -/* }}} */ - -/* {{{ proto void gmp_setbit(resource &a, int index[, bool set_clear]) - Sets or clear bit in a */ -ZEND_FUNCTION(gmp_setbit) -{ - zval **a_arg, **ind_arg, **sc_arg; - int argc, index, set=1; - mpz_t *gmpnum_a; - - argc = ZEND_NUM_ARGS(); - if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &ind_arg, &sc_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); - - convert_to_long_ex(ind_arg); - index = Z_LVAL_PP(ind_arg); - - switch (argc) { - case 3: - convert_to_long_ex(sc_arg); - set = Z_LVAL_PP(sc_arg); - break; - case 2: - set = 1; - break; - } - - if(set) { - mpz_setbit(*gmpnum_a, index); - } else { - mpz_clrbit(*gmpnum_a, index); - } -} -/* }}} */ - -/* {{{ proto void gmp_clrbit(resource &a, int index) - Clears bit in a */ -ZEND_FUNCTION(gmp_clrbit) -{ - zval **a_arg, **ind_arg; - int index; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &ind_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); - - convert_to_long_ex(ind_arg); - index = Z_LVAL_PP(ind_arg); - - mpz_clrbit(*gmpnum_a, index); -} -/* }}} */ - -/* {{{ proto int gmp_popcount(resource a) - Calculates the population count of a */ -ZEND_FUNCTION(gmp_popcount) -{ - zval **a_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - - RETURN_LONG(mpz_popcount(*gmpnum_a)); -} -/* }}} */ - -/* {{{ proto int gmp_hamdist(resource a, resource b) - Calculates hamming distance between a and b */ -ZEND_FUNCTION(gmp_hamdist) -{ - zval **a_arg, **b_arg; - mpz_t *gmpnum_a, *gmpnum_b; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(1, &a_arg, &b_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - FETCH_GMP_ZVAL(gmpnum_b, b_arg); - - RETURN_LONG(mpz_hamdist(*gmpnum_a, *gmpnum_b)); -} -/* }}} */ - -/* {{{ proto int gmp_scan0(resource a, int start) - Finds first zero bit */ -ZEND_FUNCTION(gmp_scan0) -{ - zval **a_arg, **start_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - convert_to_long_ex(start_arg); - - RETURN_LONG(mpz_scan0(*gmpnum_a, Z_LVAL_PP(start_arg))); -} -/* }}} */ - -/* {{{ proto int gmp_scan1(resource a, int start) - Finds first non-zero bit */ -ZEND_FUNCTION(gmp_scan1) -{ - zval **a_arg, **start_arg; - mpz_t *gmpnum_a; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - FETCH_GMP_ZVAL(gmpnum_a, a_arg); - convert_to_long_ex(start_arg); - - RETURN_LONG(mpz_scan1(*gmpnum_a, Z_LVAL_PP(start_arg))); -} -/* }}} */ - -/* {{{ _php_gmpnum_free - */ -static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - mpz_t *gmpnum = (mpz_t *)rsrc->ptr; - - FREE_GMP_NUM(gmpnum); -} -/* }}} */ - -#endif /* HAVE_GMP */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h deleted file mode 100644 index c992135c5cc..00000000000 --- a/ext/gmp/php_gmp.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Stanislav Malyshev | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_GMP_H -#define PHP_GMP_H - -/* You should tweak config.m4 so this symbol (or some else suitable) - gets defined. -*/ -#if HAVE_GMP - -extern zend_module_entry gmp_module_entry; -#define phpext_gmp_ptr &gmp_module_entry - -#ifdef ZEND_WIN32 -#define GMP_API __declspec(dllexport) -#else -#define GMP_API -#endif - -ZEND_MODULE_STARTUP_D(gmp); -ZEND_MODULE_SHUTDOWN_D(gmp); -ZEND_MODULE_INFO_D(gmp); - -ZEND_FUNCTION(gmp_init); -ZEND_FUNCTION(gmp_intval); -ZEND_FUNCTION(gmp_strval); -ZEND_FUNCTION(gmp_add); -ZEND_FUNCTION(gmp_sub); -ZEND_FUNCTION(gmp_mul); -ZEND_FUNCTION(gmp_div_qr); -ZEND_FUNCTION(gmp_div_q); -ZEND_FUNCTION(gmp_div_r); -ZEND_FUNCTION(gmp_mod); -ZEND_FUNCTION(gmp_divexact); -ZEND_FUNCTION(gmp_neg); -ZEND_FUNCTION(gmp_abs); -ZEND_FUNCTION(gmp_fact); -ZEND_FUNCTION(gmp_sqrt); -ZEND_FUNCTION(gmp_pow); -ZEND_FUNCTION(gmp_powm); -ZEND_FUNCTION(gmp_sqrtrem); -ZEND_FUNCTION(gmp_perfect_square); -ZEND_FUNCTION(gmp_prob_prime); -ZEND_FUNCTION(gmp_gcd); -ZEND_FUNCTION(gmp_gcdext); -ZEND_FUNCTION(gmp_invert); -ZEND_FUNCTION(gmp_jacobi); -ZEND_FUNCTION(gmp_legendre); -ZEND_FUNCTION(gmp_cmp); -ZEND_FUNCTION(gmp_sign); -ZEND_FUNCTION(gmp_and); -ZEND_FUNCTION(gmp_or); -ZEND_FUNCTION(gmp_com); -ZEND_FUNCTION(gmp_xor); -ZEND_FUNCTION(gmp_random); -ZEND_FUNCTION(gmp_setbit); -ZEND_FUNCTION(gmp_clrbit); -ZEND_FUNCTION(gmp_scan0); -ZEND_FUNCTION(gmp_scan1); -ZEND_FUNCTION(gmp_popcount); -ZEND_FUNCTION(gmp_hamdist); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(gmp) - int global_variable; -ZEND_END_MODULE_GLOBALS(gmp) -*/ - -/* In every function that needs to use variables in php_gmp_globals, - do call GMPLS_FETCH(); after declaring other variables used by - that function, and always refer to them as GMPG(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define GMPG(v) TSRMG(gmp_globals_id, php_gmp_globals *, v) -#else -#define GMPG(v) (gmp_globals.v) -#endif - -#else - -#define phpext_gmp_ptr NULL - -#endif - -#endif /* PHP_GMP_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ diff --git a/ext/gmp/tests/001.phpt b/ext/gmp/tests/001.phpt deleted file mode 100644 index a2f520d5279..00000000000 --- a/ext/gmp/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for gmp presence ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -gmp extension is available \ No newline at end of file diff --git a/ext/gmp/tests/002.phpt b/ext/gmp/tests/002.phpt deleted file mode 100644 index 4e33b6111d7..00000000000 --- a/ext/gmp/tests/002.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -GMP functionality test - factorial ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/ext/gmp/tests/003.phpt b/ext/gmp/tests/003.phpt deleted file mode 100644 index 0a302573ee4..00000000000 --- a/ext/gmp/tests/003.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -Check for number base recognition ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- - ---EXPECT-- -1234 -1234 -10011010010 -1234 -1234 -1234 -2322 -1234 -1234 -1234 -1234 -1234 -0 -1234 diff --git a/ext/hyperwave/CREDITS b/ext/hyperwave/CREDITS deleted file mode 100644 index b01b16907f5..00000000000 --- a/ext/hyperwave/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -HyperWave -Uwe Steinmann diff --git a/ext/hyperwave/config.m4 b/ext/hyperwave/config.m4 deleted file mode 100644 index 9e5a31cc6d8..00000000000 --- a/ext/hyperwave/config.m4 +++ /dev/null @@ -1,20 +0,0 @@ -dnl -dnl $Id$ -dnl - -AC_MSG_CHECKING(for Hyperwave support) -AC_ARG_WITH(hyperwave, -[ --with-hyperwave Include Hyperwave support], -[ - if test "$withval" != "no"; then - AC_DEFINE(HYPERWAVE,1,[ ]) - AC_MSG_RESULT(yes) - PHP_NEW_EXTENSION(hyperwave, hw.c hg_comm.c) - else - AC_DEFINE(HYPERWAVE,0,[ ]) - AC_MSG_RESULT(no) - fi -],[ - AC_DEFINE(HYPERWAVE,0,[ ]) - AC_MSG_RESULT(no) -]) diff --git a/ext/hyperwave/debug.h b/ext/hyperwave/debug.h deleted file mode 100644 index 5b72dbb194d..00000000000 --- a/ext/hyperwave/debug.h +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** -* -* Copyright (C) 1991 Kendall Bennett. -* All rights reserved. -* -* Filename: $RCSfile$ -* Version: $Revision$ -* -* Language: ANSI C -* Environment: any -* -* Description: General header file for portable code. -* -* $Id$ -* -* Revision History: -* ----------------- -* -* $Log$ -* Revision 1.2 2000/07/02 23:46:41 sas -* Change header protection macros to conform to standard. -* -* Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" -* -* All identifiers that begin with an underscore and either an uppercase -* letter or another underscore are always reserved for any use by the -* implementation. -* -* Revision 1.1 1999/04/21 23:37:47 ssb -* moved db -* -* Revision 1.1.1.1 1999/04/07 21:03:29 zeev -* PHP 4.0 -* -* Revision 1.1.1.1 1999/03/17 04:29:10 andi -* PHP4 -* -* Revision 1.1.1.1 1998/12/21 07:56:22 andi -* Trying to start the zend CVS tree -* -* Revision 1.1 1998/08/12 09:29:16 steinm -* First version of Hyperwave module. -* -* Revision 1.6 92/03/15 12:51:48 kjb -* Added MK_FP macro and ushort typedef. -* -* Revision 1.5 91/10/28 03:17:33 kjb -* Ported to the Iris. -* -* Revision 1.4 91/09/26 15:29:02 kjb -* Added stuff for the SGI Iris 4D. -* -* Revision 1.3 91/09/26 10:07:04 kjb -* Added general typedef stuff. -* -* Revision 1.2 91/09/03 18:19:14 ROOT_DOS -* Added a few defines that are supplied by for UNIX compatibility. -* -* Revision 1.1 91/08/16 13:19:06 ROOT_DOS -* Initial revision -* -****************************************************************************/ - -#ifndef DEBUG_H -#define DEBUG_H - -#ifdef DEBUG -# define D(x) x -#else -# define D(x) -#endif - -#define PRIVATE static -#define PUBLIC - -#ifdef __MSDOS__ /* Compiling for MSDOS */ -# define MS(x) x -# define UX(x) -# define IR(x) -# define _8086 /* We know we have an 8086 type processor */ -#if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) -# define LDATA -# define NULL 0L -#else -# define NULL 0 -#endif -#else __MSDOS__ -#ifdef __IRIS4D__ /* Compiling for the SGI Iris 4D */ -# define MS(x) -# define UX(x) x /* The Iris is a UNIX machine */ -# define IR(x) x -# define O_BINARY 0 /* no binary input mode in UNIX open() */ -# define MAXFILE 255 /* These are defined in , but */ -# define MAXDIR 255 /* on UNIX machines, we just define */ -# define MAXPATH 255 /* them all to be the same size */ -# define far /* Near and far do not exist under */ -# define near /* UNIX or the Iris. */ -# define NULL ((void *)0) -#else __IRIS4D__ /* Assume UNIX compilation */ -# define MS(x) -# define UX(x) x -# define IR(x) -# define O_BINARY 0 /* no binary input mode in UNIX open() */ -# define MAXFILE 255 /* These are defined in , but */ -# define MAXDIR 255 /* on UNIX machines, we just define */ -# define MAXPATH 255 /* them all to be the same size */ -# define far /* Near and far do not exist under */ -# define near /* UNIX or the Iris. */ -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif __IRIS4D__ -#endif __MSDOS__ - -/**************************************************************************** -* -* SEG(p) Evaluates to the segment portion of an 8086 address. -* OFF(p) Evaluates to the offset portion of an 8086 address. -* FP(s,o) Creates a far pointer given a segment offset pair. -* PHYS(p) Evaluates to a long holding a physical address -* -****************************************************************************/ - -#ifdef _8086 -# define SEG(p) ( ((unsigned *)&(void far *)(p))[1] ) -# define OFF(p) ( (unsigned)(p) ) -# define FP(s,o) ( (void far *)( ((unsigned long)s << 16) + \ - (unsigned long)o )) -# define PHYS(p) ( (unsigned long)OFF(p) + \ - ((unsigned long)SEG(p) << 4)) -#else -# define PHYS(p) (p) -#endif _8086 - -/**************************************************************************** -* -* NUMELE(array) Evaluates to the array size in elements -* LASTELE(array) Evaluates to a pointer to the last element -* INBOUNDS(array,p) Evaluates to true if p points into the array -* RANGE(a,b,c) Evaluates to true if a <= b <= c -* max(a,b) Evaluates to a or b, whichever is larger -* min(a,b) Evaluates to a or b, whichever is smaller -* ABS(a) Evaluates to the absolute value of a -* NBITS(type) Returns the number of bits in a variable of the -* indicated type -* MAXINT Evaluates to the value of the largest signed integer -* -****************************************************************************/ - -#define NUMELE(a) (sizeof(a)/sizeof(*(a))) -#define LASTELE(a) ((a) + (NUMELE(a)-1)) -#ifdef LDATA -#define TOOHIGH(a, p) ((long)PHYS(p) - (long)PHYS(a) > (long)(NUMELE(a)-1)) -#define TOOLOW(a, p) ((long)PHYS(p) - (long)PHYS(a) < 0) -#else -#define TOOHIGH(a, p) ((long)(p) - (long)(a) > (long)(NUMELE(a)-1)) -#define TOOLOW(a, p) ((long)(p) - (long)(a) < 0) -#endif -#define INBOUNDS(a, p) ( ! (TOOHIGH(a, p) || TOOLOW(a, p)) ) - -#define _IS(t, x) (((t)1 << (x)) != 0) /* Evaluates true if the width of */ - /* variable of type t is < x. */ - /* The != 0 assures that the */ - /* answer is 1 or 0 */ - -#define NBITS(t) (4 * (1 + _IS(t, 4) + _IS(t, 8) + _IS(t, 12) + _IS(t, 16) \ - + _IS(t, 20) + _IS(t, 24) + _IS(t, 28) + _IS(t, 32))) - -#define MAXINT (((unsigned)~0) >> 1) - -#ifndef MAX -# define MAX(a, b) ( ((a) > (b)) ? (a) : (b)) -#endif -#ifndef MIN -# define MIN(a, b) ( ((a) < (b)) ? (a) : (b)) -#endif -#ifndef ABS -# define ABS(a) ((a) >= 0 ? (a) : -(a)) -#endif - -#define RANGE(a, b, c) ( (a) <= (b) && (b) <= (c) ) - -/* General typedefs */ - -#ifndef __GENDEFS -#define __GENDEFS -typedef void *ptr; -typedef void near *nearptr; -typedef void far *farptr; -/*typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong;*/ -typedef int bool; -#endif __GENDEFS - -/* Boolean truth values */ - -#define false 0 -#define true 1 -#define FALSE 0 -#define TRUE 1 -#define NO 0 -#define YES 1 - -#endif /* DEBUG_H */ diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c deleted file mode 100644 index c4ecca4d328..00000000000 --- a/ext/hyperwave/hg_comm.c +++ /dev/null @@ -1,5846 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -/* #define HW_DEBUG */ - -#include -#include "php.h" -#include "php_globals.h" -#include "SAPI.h" - -#if HYPERWAVE - -#include -#include -#include -#ifdef PHP_WIN32 -# include -# define EWOULDBLOCK WSAEWOULDBLOCK -# define ETIMEDOUT WSAETIMEDOUT -# define bcopy memcpy -# define bzero(a, b) memset(a, 0, b) -#else -# include -# include -# include -# include -# include -#endif -#include -#include -#include "hg_comm.h" -#include "ext/standard/head.h" - -/* Defining hw_optimize does optimize the send_objectbyidquery() function. - Instead of getting the complete return message including the objectrecords - with recv_hg_msg(), only the header of the return message is fetched. - The object records itself are fetched as they are needed straight from - the socket. This method requires less memory and is twice as fast because - reading from the net seems to be a bottleneck which has less impact if - the processing of the data is done in parallel. -*/ -#define hw_optimize - -/* Define hw_less_server_stress does reduce the stress on the hw server, by - using send_objectbyidquery() instead of send_getobject() multiple times. - send_objectbyidquery() gets a bunch of object records with one message. - This also reduced the number of lines in the servers log files. - Unfortunately this is not faster unless hw_optimize is defined, because - getting object records with multiple send_getobject() is already optimized. - First all request messages for each object are send and the the answers - are read. This gives the server the possibility to answer request already - while more request are comming in. -*/ -#define hw_less_server_stress - -static int set_nonblocking(int fd); -/* static int set_blocking(int fd); */ - -static int hg_read_exact(int sockfd, char *buf, int size); -/* static int hg_read(int sockfd, char *buf, int size); */ -static int hg_write(int sockfd, char *buf, int size); - -static int send_hg_msg(int sockfd, hg_msg *msg, int length); -static void build_msg_header(hg_msg *msg, int length, int version_msgid, int msg_type); -static char *build_msg_int(char *buf, int val); -static char *build_msg_str(char *buf, char *str); -static int swap(int val); - - -int version = HW_VERSION; -/* F_DISTRIBUTED has the effect that all object ids are - virtual. This means whenever an object is requested a - new id is generated for this session. Wavemaster and - Harmony set this flag. How do I know? tcpdump tells - a lot if the output is investigated. The bit is also - need to allow access on other server through the local - server. The hw_mapid() function won't work unless you - set F_DISTRIBUTED */ -/* int version = HW_VERSION | F_DISTRIBUTED; */ -/* int version = HW_VERSION | F_DISTRIBUTED | F_COMPRESSED; */ -static int msgid = 1; -static int sock_flags = -1; -static int non_blocking = 0; -static int swap_on = 0; -static int rtimeout = 40; -static int wtimeout = 40; -static int lowerror = 0; - -/*********************************************************************** -* Function fnInsStr() * -* * -* Insert string in string at position. The old string will be freed * -* with efree!!! The new string is allocated with malloc. * -* Parameter: string *str: string in which insstr is to be inserted * -* int pos: Position where string is to inserted (0=first) * -* string *insstr: string to be inserted * -* Return: pointer to new string or NULL. If NULL is returned the * -* memory for the old string has not been freed. * -***********************************************************************/ -char *fnInsStr(char *str, int pos, char *insstr) -{ - char *newstr, *ptr; - - if((str == NULL) || (insstr == NULL)) - return NULL; - if(pos > (int)strlen(str)) - return NULL; - - if(insstr[0] == '\0') - return str; - - if(NULL == (newstr = malloc(strlen(str) + strlen(insstr) + 1))) { - lowerror = LE_MALLOC; - return NULL; - } - - ptr = newstr; - memcpy(newstr, str, pos); - ptr += pos; - strcpy(ptr, insstr); - ptr += strlen(insstr); - strcpy(ptr, str+pos); - - free(str); - return newstr; -} - -/*********************************************************************** -* Function fnAddAnchor() * -* * -* Inserts new anchor into anchor list. * -* Parameter: DLIST pList: Anchor list * -* int objectID: object ID of Anchor * -* int start: start position * -* int end: end position * -* Return: Pointer to new anchor, NULL if error * -***********************************************************************/ -#ifdef newlist -ANCHOR *fnAddAnchor(zend_llist *pAnchorList, - int objectID, - int start, int end) -#else -ANCHOR *fnAddAnchor(DLIST *pAnchorList, - int objectID, - int start, int end) -#endif -{ - ANCHOR *cur_ptr; - -#ifdef newlist - ANCHOR **ptr; - if(NULL == (cur_ptr = (ANCHOR *) emalloc(sizeof(ANCHOR)))) - return NULL; -#else - if((cur_ptr = (ANCHOR *) dlst_newnode(sizeof(ANCHOR))) == NULL) { - return NULL; - } -#endif - - memset(cur_ptr, 0, sizeof(ANCHOR)); - cur_ptr->start = start; - cur_ptr->end = end; - cur_ptr->id = objectID; - cur_ptr->destdocname = NULL; - cur_ptr->nameanchor = NULL; - cur_ptr->link = NULL; - cur_ptr->tagattr = NULL; - cur_ptr->htmlattr = NULL; - cur_ptr->codebase = NULL; - cur_ptr->code = NULL; - cur_ptr->keyword = NULL; - cur_ptr->fragment = NULL; - -#ifdef newlist - zend_llist_prepend_element(pAnchorList, &cur_ptr); - ptr = (ANCHOR **) zend_llist_get_first(pAnchorList); -#else - dlst_insertafter(pAnchorList, cur_ptr, PHP_DLST_HEAD(pAnchorList)); -#endif - - return(cur_ptr); -} - -/*********************************************************************** -* Function fnDeleteAnchor() * -* * -* Inserts new anchor into anchor list. * -* Parameter: ptr: pointer to node * -* Return: void * -***********************************************************************/ -#ifdef newlist -void fnDeleteAnchor(void *ptr1) -#else -void fnDeleteAnchor(ANCHOR *ptr) -#endif -{ -#ifdef newlist - ANCHOR **ptr2, *ptr; - ptr2 = (ANCHOR **) ptr1; - ptr = *ptr2; -#endif - - if(ptr->destdocname) efree(ptr->destdocname); - if(ptr->nameanchor) efree(ptr->nameanchor); - if(ptr->link) efree(ptr->link); - if(ptr->tagattr) efree(ptr->tagattr); - if(ptr->htmlattr) efree(ptr->htmlattr); - if(ptr->codebase) efree(ptr->codebase); - if(ptr->code) efree(ptr->code); - if(ptr->keyword) efree(ptr->keyword); - if(ptr->fragment) efree(ptr->fragment); - -#ifdef newlist - efree(ptr); -#else - dlst_freenode(ptr); -#endif -} - -/*********************************************************************** -* Function fnListAnchor() * -* * -* Lists all anchors in anchor list. * -* Parameter: ptr: pointer to list * -* Return: void * -***********************************************************************/ -#ifdef newlist -void fnListAnchor(zend_llist *pAnchorList) -#else -void fnListAnchor(DLIST *pAnchorList) -#endif -{ -#ifdef newlist - ANCHOR *cur_ptr, **ptr; - ptr = (ANCHOR **) zend_llist_get_last(pAnchorList); - if(ptr) - cur_ptr = *ptr; - while(ptr) { - fprintf(stderr, "0x%X->0x%X ", (int) ptr, (int) cur_ptr); -#else - ANCHOR *cur_ptr; - cur_ptr = (ANCHOR *) dlst_last(pAnchorList); - while(cur_ptr) { - fprintf(stderr, "0x%X ", (int) cur_ptr); -#endif - - fprintf(stderr, "%d, %d, %s, %s, %s, %s %s\n", cur_ptr->start, - cur_ptr->end, - cur_ptr->tanchor == 1 ? "src" : "dest", - cur_ptr->destdocname, - cur_ptr->nameanchor, - cur_ptr->link, - cur_ptr->tagattr); -#ifdef newlist - ptr = (ANCHOR **) zend_llist_get_prev(pAnchorList); - if(ptr) - cur_ptr = *ptr; -#else - cur_ptr = (ANCHOR *) dlst_prev(cur_ptr); -#endif - } -} - -/*********************************************************************** -* Function fnCmpAnchors() * -* * -* Compares to Anchors by its start position * -* Parameter: ANCHOR a1: First Anchor * -* ANCHOR a2: Second Anchor * -* Return: As strcmp * -***********************************************************************/ -#ifdef newlist -int fnCmpAnchors(const void *e1, const void *e2 TSRMLS_DC) -{ - ANCHOR *a1, **aa1, *a2, **aa2; - zend_llist_element **ee1, **ee2; - ee1 = (zend_llist_element **) e1; - ee2 = (zend_llist_element **) e2; - aa1 = (ANCHOR **) (*ee1)->data; - aa2 = (ANCHOR **) (*ee2)->data; - a1 = *aa1; - a2 = *aa2; -#else -int fnCmpAnchors(ANCHOR *a1, ANCHOR *a2 TSRMLS_DC) -{ -#endif - if(a1->start < a2->start) - return -1; - if(a1->start == a2->start) { - /* It's importent to check this case as well, because a link with - a bigger end has to be inserted first. - */ - if(a1->end < a2->end) - return -1; - /* If both start and end are equal (yes, it is possible) - we will Src Anchor before a Dest anchor. There has been - a case where an IMG was surrounded by a NAME which was - surrounded by a HREF. In such a case the HREF doesn't - work. - */ - if(a1->end == a2->end) { - if(a1->tanchor > a2->tanchor) - return -1; - } - } - - return 1; -} - -/*********************************************************************** -* Function fnCreateAnchorList() * -* Uses either docofanchorrec or reldestrec to create a list of anchors * -* depending on anchormode * -* * -* Returns a list of Anchors converted from an object record * -* Parameter: int objectID: the object for which the list is created * -* char **anchors: object records of anchors * -* char **docofanchorrec: Name of destination absolut * -* char **reldestrec: Name of destination relativ to current * -* object * -* int ancount: number of anchors * -* int anchormode: 0 = use absolut dest, else rel. dest * -* Return: List of Anchors, NULL if error * -***********************************************************************/ -#ifdef newlist -zend_llist *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode) -#else -DLIST *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode) -#endif -{ - int start, end, i, destid, anchordestid, objectID; - ANCHOR *cur_ptr = NULL; -#ifdef newlist - zend_llist *pAnchorList; - pAnchorList = (zend_llist *) emalloc(sizeof(zend_llist)); - zend_llist_init(pAnchorList, sizeof(char *), fnDeleteAnchor, 0); -#else - DLIST *pAnchorList = dlst_init(); -#endif - - for(i=ancount-1; i>=0; i--) { - char *object = NULL; - char *docofanchorptr = NULL; - char *reldestptr = NULL; - char *str, *str1, link[200]; - - if(NULL != anchors[i]) { - object = anchors[i]; - docofanchorptr = docofanchorrec[i]; - if(reldestrec) /* FIXME reldestrec may only be NULL if anchormode != 0 */ - reldestptr = reldestrec[i]; - - /* Determine Position. Doesn't matter if Src or Dest - The Position field should always be there. Though there - are case in which the position has no meaning, e.g. if - a document is annotated and the annotation text doesn't - contain a link of type annotation, - In such a case the Position has the value 'invisible' */ - str = strstr(object, "Position"); - str += 9; - if(((int) str != 9) && (0 != strncmp(str, "invisible", 9))) { - sscanf(str, "0x%X 0x%X", &start, &end); - - /* Determine ObjectID */ - objectID = 0; - if(NULL != (str = strstr(object, "ObjectID"))) { - str += 9; - sscanf(str, "0x%X", &objectID); - } - - cur_ptr = fnAddAnchor(pAnchorList, objectID, start, end); - - /* Determine Type of Anchor */ - str = strstr(object, "TAnchor"); - str += 8; - if(*str == 'S') { - char destdocname[200]; - char nameanchor[200]; - cur_ptr->tanchor = 1; - - cur_ptr->destdocname = NULL; - if(NULL != (str = strstr(object, "Dest"))) { - char *tempptr; - - /* No need to care about the value of Dest, because we take the info - from docofanchorptr. - Since the anchor has a destination there are two possibilities. - 1. The destination is an anchor or - 2. or the destination is a document already. - In both cases docofanchorptr has the proper info because GETDOCBYANCHOR - is such a nice message. - */ - switch(anchormode) { - case 0: - tempptr = docofanchorptr; - break; - default: - tempptr = reldestptr; - } - if(NULL != tempptr) { - destid = 0; - if(NULL != (str = strstr(tempptr, "ObjectID="))) { - str += 9; - sscanf(str, "0x%X", &destid); - } - /* This is basically for NAME tags. There is no need - to add the destname if it is the document itself. - */ -/* if(destid == objID) { - cur_ptr->destdocname = NULL; - } else { */ - /* It's always nice to deal with names, so let's first check - for a name. If there is none we take the ObjectID. - */ - if(NULL != (str = strstr(tempptr, "Name="))) { - str += 5; - } else if(NULL != (str = strstr(tempptr, "ObjectID="))) { - str += 9; - } - if(sscanf(str, "%s\n", destdocname)) { - cur_ptr->destdocname = estrdup(destdocname); - } -/* } */ - } - } - - /* Get the Id of the anchor destination and the document id that belongs - to that anchor. We need that soon in order to determine if the anchor - points to a document or a dest anchor in a document. - */ - anchordestid = 0; - if(NULL != (str = strstr(object, "Dest="))) { - str += 5; - sscanf(str, "0x%X", &anchordestid); - } - - /* if anchordestid != destid then the destination is an anchor in a document whose - name (objectID) is already in destdocname. We will have to extend the link - by '#...' - */ - cur_ptr->nameanchor = NULL; - if(anchordestid != destid) { - if(NULL != (str = strstr(object, "Dest="))) { - str += 5; - if(sscanf(str, "%s\n", nameanchor)) - cur_ptr->nameanchor = estrdup(nameanchor); - } - } - - if(!cur_ptr->destdocname) { - cur_ptr->link = NULL; - if(NULL != (str = strstr(object, "Hint=URL:"))) { - str += 9; - if(sscanf(str, "%s\n", link)) - cur_ptr->link = estrdup(link); - } else if(NULL != (str = strstr(object, "Hint="))) { - str += 5; - if(sscanf(str, "%s\n", link)) - cur_ptr->link = estrdup(link); - } - } - - cur_ptr->fragment = NULL; - if(NULL != (str = strstr(object, "Fragment="))) { - str += 9; - if(sscanf(str, "%s\n", link)) - cur_ptr->fragment = estrdup(link); - } - - { - char *htmlattr, *str2; - int offset; - str1 = object; - htmlattr = emalloc(strlen(object)); /* alloc mem big enough for htmlattr */ - htmlattr[0] = '\0'; - offset = 0; - while(NULL != (str = strstr(str1, "HtmlAttr="))) { - str += 9; - str1 = str; - while((*str1 != '\n') && (*str1 != '\0')) - str1++; - /* Find the '=' in the HTML attr and make sure it is part of the - attr and not somewhere in the objrec. */ - if((NULL != (str2 = strchr(str, '='))) && (str2 < str1)) { - str2++; - strncpy(&htmlattr[offset], str, str2 - str); - offset = offset + (str2 - str); - htmlattr[offset++] = '"'; - strncpy(&htmlattr[offset], str2, str1 - str2); - offset = offset + (str1 - str2); - htmlattr[offset++] = '"'; - htmlattr[offset++] = ' '; - htmlattr[offset] = '\0'; - } - } - if(offset){ - /* remove last space */ - htmlattr[offset-1] = '\0'; - cur_ptr->htmlattr = estrdup(htmlattr); - } - efree(htmlattr); - } - - if(NULL != (str = strstr(object, "LinkType="))) { - str += 9; - if(strncmp(str, "background", 10) == 0) - cur_ptr->linktype=HW_BACKGROUND_LINK; - else - if(strncmp(str, "intagnodel", 10) == 0) { /* New type introduced by Uwe Steinmann 16.03.2001 */ - cur_ptr->linktype=HW_INTAGNODEL_LINK; - cur_ptr->tagattr = NULL; - if(NULL != (str = strstr(object, "TagAttr="))) { - str += 8; - str1 = str; - while((*str1 != '\n') && (*str1 != '\0')) - str1++; - cur_ptr->tagattr = emalloc(str1 - str + 1); - memcpy(cur_ptr->tagattr, str, str1 - str); - cur_ptr->tagattr[str1 - str] = '\0'; - } - } else - if(strncmp(str, "intag", 5) == 0) { - cur_ptr->linktype=HW_INTAG_LINK; - cur_ptr->tagattr = NULL; - if(NULL != (str = strstr(object, "TagAttr="))) { - str += 8; - str1 = str; - while((*str1 != '\n') && (*str1 != '\0')) - str1++; - cur_ptr->tagattr = emalloc(str1 - str + 1); - memcpy(cur_ptr->tagattr, str, str1 - str); - cur_ptr->tagattr[str1 - str] = '\0'; - } - } else - if(strncmp(str, "applet", 6) == 0) { - cur_ptr->linktype=HW_APPLET_LINK; - cur_ptr->codebase = NULL; - if(NULL != (str = strstr(object, "CodeBase="))) { - str += 9; - str1 = str; - while((*str1 != '\n') && (*str1 != '\0')) - str1++; - cur_ptr->codebase = emalloc(str1 - str + 1); - memcpy(cur_ptr->codebase, str, str1 - str); - cur_ptr->codebase[str1 - str] = '\0'; - } - cur_ptr->code = NULL; - if(NULL != (str = strstr(object, "Code="))) { - str += 5; - str1 = str; - while((*str1 != '\n') && (*str1 != '\0')) - str1++; - cur_ptr->code = emalloc(str1 - str + 1); - memcpy(cur_ptr->code, str, str1 - str); - cur_ptr->code[str1 - str] = '\0'; - } - } else - cur_ptr->linktype=HW_DEFAULT_LINK; - } else - cur_ptr->linktype=HW_DEFAULT_LINK; - - } else { /* Destination Anchor */ - char nameanchor[200]; - - cur_ptr->tanchor = 2; - cur_ptr->link = NULL; - - /* Here is the only additional info for the name attribute */ - cur_ptr->nameanchor = NULL; - if(NULL != (str = strstr(object, "ObjectID="))) { - str += 9; - if(sscanf(str, "%s\n", nameanchor)) - cur_ptr->nameanchor = estrdup(nameanchor); - } - - cur_ptr->keyword = NULL; - if(NULL != (str = strstr(object, "Keyword="))) { - str += 8; - if(sscanf(str, "%s\n", nameanchor)) - cur_ptr->keyword = estrdup(nameanchor); - } - - } - - } - /* free memory even if it is an invisible anchor */ - efree(anchors[i]); - if(docofanchorrec[i]) efree(docofanchorrec[i]); - if(reldestrec) - if(reldestrec[i]) efree(reldestrec[i]); - } - } - return pAnchorList; -} - -/*********************************************************************** -* Function fnInsAnchorsIntoText() * -* * -* Returns the text document with all anchors inserted form list * -* Parameter: char *text: text without anchors * -* DList *pAnchorList: list of anchors * -* Return: Text with anchors * -***********************************************************************/ -#define BUFFERLEN 200 -#ifdef newlist -char *fnInsAnchorsIntoText(char *text, zend_llist *pAnchorList, char **bodytag, char **urlprefix) { - ANCHOR **ptr; -#else -char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char **urlprefix) { -#endif - ANCHOR *cur_ptr; - char bgstr[BUFFERLEN], istr[BUFFERLEN]; - char **scriptname; - char *newtext; - int offset = 0; - int laststart=0; - char emptystring[BUFFERLEN]; - int i; - TSRMLS_FETCH(); - - emptystring[0] = '\0'; - -/* The following is very tricky and depends on how rewriting is setup on your webserver. - If you skip the scriptname in the url you will have to map each hyperwave name - to http://. This may not always be a good idea. The best solution is - probably to provide a prefix for such - a case which is an optional parameter to hw_gettext() or hw_pipedocument(). - FIXME: Currently, the variable SCRIPT_NAME is empty thouht SCRIPT_URL is - not. In our case this is OK, since as mentioned above it is better to have no - SCRIPT_NAME than to have if rewriting is on. -*/ - if(urlprefix) { - scriptname = urlprefix; - } else { - zval **script_name; - scriptname = emalloc(5*sizeof(char *)); - if (zend_hash_find(&EG(symbol_table), "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==FAILURE) - for(i=0; i<5; i++) - scriptname[i] = &emptystring; - else { - convert_to_string_ex(script_name); - for(i=0; i<5; i++) - scriptname[i] = Z_STRVAL_PP(script_name); - } - -#if 0 -#if APACHE - { - int j; - array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); - table_entry *elts = (table_entry *)arr->elts; - - for (j=0; j < arr->nelts; j++) { - if((0 == strcmp(elts[j].key, "SCRIPT_NAME")) || - (0 == strcmp(elts[j].key, "SCRIPT_URL"))) - break; - } - scriptname = elts[j].val; - } -#else - scriptname = getenv("SCRIPT_FILENAME"); -#endif -#endif - } - - newtext = text; - bgstr[0] = '\0'; -#ifdef newlist - zend_llist_sort(pAnchorList, fnCmpAnchors TSRMLS_CC); - ptr = (ANCHOR **) zend_llist_get_last(pAnchorList); - if(ptr) - cur_ptr = *ptr; - while(NULL != ptr) { -#else - dlst_mergesort(pAnchorList, fnCmpAnchors); - cur_ptr = (ANCHOR *) dlst_last(pAnchorList); - while(NULL != cur_ptr) { -#endif - - istr[0] = '\0'; - if(cur_ptr->tanchor == 1) { /* Src Anchor */ - if(laststart >= cur_ptr->end) - offset = 0; - if((cur_ptr->link != NULL) && (cur_ptr->link[0] != '\0')) { - /* The link is only set if the Link points to an external document */ - switch(cur_ptr->linktype) { - case HW_BACKGROUND_LINK: - snprintf(istr, BUFFERLEN, " background='%s'", cur_ptr->link); - break; - case HW_INTAG_LINK: - snprintf(istr, BUFFERLEN, " %s='%s'", cur_ptr->tagattr, cur_ptr->link); - offset -= 4; /* because there is no closing tag */ -/* laststart = cur_ptr->start; */ - break; - case HW_INTAGNODEL_LINK: - snprintf(istr, BUFFERLEN, "%s", cur_ptr->link); - offset -= 4; /* because there is no closing tag */ -/* laststart = cur_ptr->start; */ - break; - case HW_APPLET_LINK: - if(cur_ptr->codebase) - snprintf(istr, BUFFERLEN, " CODEBASE='%s' CODE='%s'", cur_ptr->codebase, cur_ptr->code); - else - snprintf(istr, BUFFERLEN, " CODEBASE='/' CODE='%s'", cur_ptr->code); - break; - default: - newtext = fnInsStr(newtext, cur_ptr->end+offset, ""); - if(cur_ptr->fragment) - snprintf(istr, BUFFERLEN, "link, cur_ptr->fragment); - else - snprintf(istr, BUFFERLEN, "link); - if(cur_ptr->htmlattr) { - strncat(istr, " ", BUFFERLEN - 1 - strlen(istr)); - strncat(istr, cur_ptr->htmlattr, BUFFERLEN - 1 - strlen(istr)); - } - strncat(istr, ">", BUFFERLEN - 1 - strlen(istr)); - } - } else { - switch(cur_ptr->linktype) { - case HW_BACKGROUND_LINK: - if(NULL != cur_ptr->destdocname) { - snprintf(istr, BUFFERLEN, " background='%s/%s'", scriptname[HW_BACKGROUND_LINK], cur_ptr->destdocname); - } else - istr[0] = '\0'; - break; - case HW_INTAG_LINK: - if(cur_ptr->fragment) - snprintf(istr, BUFFERLEN, " %s='#%s'", cur_ptr->tagattr, cur_ptr->fragment); - else - snprintf(istr, BUFFERLEN, " %s='%s/%s'", cur_ptr->tagattr, scriptname[HW_INTAG_LINK], cur_ptr->destdocname); - offset -= 4; /* because there is no closing tag */ - break; - case HW_INTAGNODEL_LINK: - snprintf(istr, BUFFERLEN, "%s", cur_ptr->destdocname); - offset -= 4; /* because there is no closing tag */ - break; - case HW_APPLET_LINK: - if(cur_ptr->codebase) -/* snprintf(istr, BUFFERLEN, " CODEBASE='%s%s' CODE='%s'", scriptname == NULL ? "" : scriptname, cur_ptr->codebase, cur_ptr->code); */ - snprintf(istr, BUFFERLEN, " CODEBASE='%s%s' CODE='%s'", scriptname[HW_APPLET_LINK], cur_ptr->codebase, cur_ptr->code); - else - snprintf(istr, BUFFERLEN, " CODEBASE='/' CODE='%s'", cur_ptr->code); - break; - default: - newtext = fnInsStr(newtext, cur_ptr->end+offset, ""); - - if(cur_ptr->nameanchor) - snprintf(istr, BUFFERLEN, "destdocname, cur_ptr->nameanchor); - else if(cur_ptr->fragment) - snprintf(istr, BUFFERLEN, "destdocname, cur_ptr->fragment); - else - snprintf(istr, BUFFERLEN, "destdocname); - - if(cur_ptr->htmlattr) { - strncat(istr, " ", BUFFERLEN - 1 - strlen(istr)); - strncat(istr, cur_ptr->htmlattr, BUFFERLEN - 1 - strlen(istr)); - } - strncat(istr, ">", BUFFERLEN - 1 - strlen(istr)); - } - } - } else { - if(laststart >= cur_ptr->end) - offset = 0; - newtext = fnInsStr(newtext, cur_ptr->end+offset, ""); - - /* If we have a keyword, we assume we had a fragment which has been used - instead of the destdocname - */ - if(cur_ptr->keyword) - snprintf(istr, BUFFERLEN, "", cur_ptr->keyword); - else if(cur_ptr->nameanchor) - snprintf(istr, BUFFERLEN, "", cur_ptr->nameanchor); - } - newtext = fnInsStr(newtext, cur_ptr->start, istr); - /* In case there are several TAGS nested, we accumulate the offset - You wonder what the 4 means? It's the length of */ - offset += strlen(istr) + 4; - laststart = cur_ptr->start; -#ifdef newlist - ptr = (ANCHOR **) zend_llist_get_prev(pAnchorList); - if(ptr) - cur_ptr = *ptr; -#else - cur_ptr = (ANCHOR *) dlst_prev(cur_ptr); -#endif - } - snprintf(istr, BUFFERLEN, "", bgstr); - *bodytag = estrdup(istr); -/* if(scriptname != urlprefix) efree(scriptname); */ - if(scriptname != NULL) efree(scriptname); - return(newtext); -} -#undef BUFFERLEN - -/*********************************************************************** -* Function fnAttributeValue() * -* * -* Returns the value of an attribute * -* Parameter: char *object: object record * -* char *attrname: attribute name * -* Return: char*: attribute value, NULL if name not found * -***********************************************************************/ -char *fnAttributeValue(char *object, char *attrname) -{ - char *str, *str1, *attrvalue; - int len; - - str = strstr(object, attrname); - if(NULL == str) - return(NULL); - str += strlen(attrname); - str++; - str1 = str; - while((*str1 != '\0') && (*str1 != '\n')) - str1++; - len = str1 - str; - if(NULL == (attrvalue = emalloc(len+1))) { - lowerror = LE_MALLOC; - return NULL; - } - memcpy(attrvalue, str, len); - attrvalue[len] = '\0'; - return(attrvalue); -} - -/*********************************************************************** -* Function fnAttributeCompare() * -* * -* Checks if an attribute in an objrec has a certain value * -* Parameter: char *object: object record * -* char *attrname: attribute name * -* char *value: value of attribute * -* Return: char*: as strcmp * -***********************************************************************/ -int fnAttributeCompare(char *object, char *attrname, char *value) -{ - char *str, *str1; - int len; - - if((NULL == object) || (NULL == attrname) || (NULL == value)) - return -2; - - /* Find the attribute Name and make sure it is followed by - a '=' sign and preceded by a '\n'; - */ - str = strstr(object, attrname); - if((NULL == str) || - (str[strlen(attrname)] != '=') || - (str[-1] != '\n')) { - return(-2); - } - str += strlen(attrname); /* skip the attribute name */ - str++; /* skip the equal sign */ - - /* Search for end of attribute value */ - str1 = str; - while((*str1 != '\0') && (*str1 != '\n')) - str1++; - len = str1 - str; - return(strncmp(str, value, len)); -} - -/********************************************************************* -* Function fnCOpenDataCon() * -* * -* Opens data connection on client side. This function is called * -* right after the client has requested any data from the server * -* Parameter: int sockfd: socket of control connection * -* int *port: port of control und data connection * -* Return : sockfd on success, <0 if error * -*********************************************************************/ -static int fnCOpenDataCon(int sockfd, int *port) - { - int fd; - struct sockaddr_in serv_addr; - int len; - int option = 1; - -/* len = sizeof(com_addr); - if(getsockname(sockfd, (struct sockaddr *) &com_addr, &len) < 0) - { - return(-1); - } - - *port = htons(com_addr.sin_port); */ - - /* - ** Open a TCP socket (an Internet stream socket) - */ - if((fd = socket(AF_INET, SOCK_STREAM, 0)) == SOCK_ERR) - { - return(-1); - } - - /* - ** Make sure that address may be reused - */ -#if defined(SUN) || defined(PHP_WIN32) - setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&option, sizeof(option)); -#else - setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &option, sizeof(option)); -#endif - - /* - ** Open connection aktiv - ** Let bind() select a port number - */ - bzero((char *) &serv_addr, sizeof(serv_addr)); - if(bind(fd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) - { - return(-1); - } - - /* - ** Get the port number bind selected - */ - len = sizeof (serv_addr); - if(getsockname(fd, (struct sockaddr *)&serv_addr, &len) < 0) - { - return(-1); - } - *port = ntohs(serv_addr.sin_port); - - listen(fd, 5); - - return(fd); - } - -/*====================================================================== - * - * Read/write routines with timeout detection. - * - * Usage: write_to(fd, buffer, n, timeout) - * read_to(fd, buffer, n, timeout) - * - * David Chavez - * Engineering Services & Software - * 7841 New Salem Street - * San Diego, CA 92126 - * USA - * - * dec@essw.com - * - *====================================================================*/ -#ifdef PHP_WIN32 -#include -#else -#include -#include -#include -#endif -#include -#include - -#ifndef PHP_WIN32 -static sigset_t newmask, oldmask, zeromask; -#endif - -static int set_noblock(int fd) -{ -#ifdef PHP_WIN32 - u_long argp=1; - - return ioctlsocket (fd, FIONBIO , &argp); -#else - - sigemptyset(&zeromask); - sigemptyset(&newmask); - sigaddset(&newmask, SIGHUP); - sigaddset(&newmask, SIGUSR1); - sigaddset(&newmask, SIGUSR2); - if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0) return -1; - - return fcntl(fd, F_SETFL, O_NONBLOCK | O_NDELAY /* | FNBIO*/); -#endif -} - -int write_to(int fd, void *buffer, int n, int timeout) -{ - int nrem, nw=0; - char *bptr; - int error=0; -#if defined(SYSV) || defined(PHP_WIN32) - int width = 20; -#else - int width = getdtablesize(); -#endif - fd_set writefds; - struct timeval select_timeout; - - select_timeout.tv_sec = timeout; -#ifdef PHP_WIN32 - select_timeout.tv_usec = 0; -#else /* is this just a typo? */ - select_timeout.tv_usec = 0.; -#endif - - /* Set fd to non-blocking */ - - if (set_noblock(fd) != 0) return -1; - - /* Write to fd until no more can be written */ - - FD_ZERO(&writefds); - - FD_SET((unsigned int)fd, &writefds); - - for( nrem = n, bptr = buffer; nrem;) - { - if(( error = select(width, - (fd_set *) 0, - &writefds, - (fd_set *) 0, - &select_timeout)) <= 0 && errno != EINTR) break; - - if(errno != EINTR && ( nw = write(fd, bptr, nrem)) <= 0) { - /* - * check for error number - and keep trying to - * write - */ - if(errno == EWOULDBLOCK || errno == EAGAIN || errno == EINTR) - { - continue; - } - else - { - error = nw; - break; - } - } else { - nrem -= nw; - bptr += nw; - } - } -#ifndef PHP_WIN32 - if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) return -1; -#endif - if( ! error ) { - errno = ETIMEDOUT; - return(-2); - } else if (error < 0) { - return(error); - } else { - return(n); - } -} - -int read_to(int fd, char *buffer, int n, int timeout) - { - int nrem, nread, nr=0; - char *bptr; - int error=0; - -#if defined(SYSV) || defined(PHP_WIN32) - int width = 20; -#else - int width = getdtablesize(); -#endif - fd_set readfds; - struct timeval select_timeout; - - select_timeout.tv_sec = timeout; -#ifdef PHP_WIN32 - select_timeout.tv_usec = 0; -#else - select_timeout.tv_usec = 0.; -#endif - - /* Set fd to non-blocking */ - - if (set_noblock(fd) != 0) return -1; - - FD_ZERO(&readfds); - - FD_SET((unsigned int)fd, &readfds); - - for( nrem = n, bptr = buffer, nread = 0; nrem;) - { - if(( error = select(width, - &readfds, - (fd_set *) 0, - (fd_set *) 0, - &select_timeout)) <= 0 && errno != EINTR) break; - - if(errno != EINTR && (nr = read (fd, bptr, nrem)) < 0) - { - /* - * check for error number - and keep trying to - * read - */ - if(errno == EWOULDBLOCK || errno == EAGAIN || errno == EINTR) - { - continue; - } - else - { - error = nr; - break; - } - } - else if(nr == 0) - { - break; - } - else - { - nread += nr; - bptr += nr; - nrem -= nr; - } - } - -#ifndef PHP_WIN32 - if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) return -1; -#endif - if( ! error ) - { - errno = ETIMEDOUT; - return(-2); - } - else if ( error < 0) - { - return(-1); - } - else - { - return(nread); - } - } - -void set_swap(int do_swap) -{ - swap_on = do_swap; -} - -/*********************************************************************** -* Function open_hg_connection() * -* * -***********************************************************************/ -int open_hg_connection(char *server_name, int port) -{ - int sockfd; - int option = 1; - struct sockaddr_in server_addr; - struct hostent *hp; - - if ( NULL == server_name ) - return(-1); - - if ( (hp = gethostbyname(server_name)) == NULL ) { - return(-2); - } - - bzero((char *)&server_addr, sizeof(server_addr)); - server_addr.sin_family = AF_INET; - if ( port != 0 ) - server_addr.sin_port = htons(port); - else - server_addr.sin_port = htons(HG_SERVER_PORT); -/* bcopy(hp->h_addr, (char *) &server_addr.sin_addr, hp->h_length); */ - server_addr.sin_addr = *(struct in_addr *) hp->h_addr; - - if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == SOCK_ERR ) { - return(-3); - } - -#if defined(SUN) || defined(PHP_WIN32) - setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&option, sizeof(option)); -#else - setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &option, sizeof(option)); -#endif /* SUN */ - - if (connect(sockfd, (struct sockaddr *) &server_addr, sizeof(server_addr)) < 0) { - HWSOCK_FCLOSE(sockfd); - return(-4); - } - -#ifndef PHP_WIN32 - if ( (sock_flags = fcntl(sockfd, F_GETFL, 0)) == -1 ) -#endif - - if ( set_nonblocking(sockfd) == -1 ) { - HWSOCK_FCLOSE(sockfd); - return(-5); - } - - return(sockfd); -} - - -/*********************************************************************** -* Function initialize_hg_connection() * -* * -***********************************************************************/ -int initialize_hg_connection(int sockfd, int *do_swap, int *version, char **userdata, char **server_string, char *username, char *password) -{ - char buf, c; - char *tmp; - hg_msg *ready_msg, *retmsg, msg; - int i = 0x01; - int length; - - *do_swap = 0; - buf = 'T'; - if ( hg_write(sockfd, &buf, 1) == -1 ) { - return(-2); - } - - if ( hg_read_exact(sockfd, &buf, 1) == -1 ) { - return(-3); - } - if ( buf == 'F' ) { - return(-4); - } - if ( buf != 'T' ) { - return(-5); - } - - buf = c = ( *(char *)&i ) ? 'l' : 'B'; - if ( hg_write(sockfd, &buf, 1) == -1 ) { - return(-6); - } - if ( hg_read_exact(sockfd, &buf, 1) == -1 ) { - return(-7); - } - if ( c != buf ) { - swap_on = 1; - *do_swap = 1; - } else { - swap_on = 0; - *do_swap = 0; - } - - if ( send_ready(sockfd) == -1) { - return(-8); - } - - /* Receive return from Ready message */ - if ( (ready_msg = recv_ready(sockfd)) == NULL ) { - return(-9); - } - - if ((ready_msg->version_msgid & F_VERSION) < HW_VERSION) - return(-8); - *version = ready_msg->version_msgid; - *server_string = strdup(ready_msg->buf+4); - efree(ready_msg->buf); - efree(ready_msg); - - /* If we have a username and password then do the identification. */ - if((NULL != username) && (NULL != password)) { - length = HEADER_LENGTH + sizeof(int) + strlen(username) + 1 + strlen(password) + 1; - - build_msg_header(&msg, length, msgid++, IDENTIFY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 0); - tmp = build_msg_str(tmp, username); - tmp = build_msg_str(tmp, password); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-10); - } - efree(msg.buf); - } - - if((NULL != username) && (NULL != password)) { - /* Receive return form identify message */ - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-11); - - *userdata = retmsg->buf; - efree(retmsg); - } - - return(0); -} - - -static int set_nonblocking(int fd) -{ -#ifdef PHP_WIN32 - unsigned int argp=0; - -/* if ( sock_flags == -1 ) - getsockopt (fd, SOL_SOCKET, optname, optval, optlen); -*/ if(ioctlsocket (fd, FIONBIO , &argp) == -1) - return(-1); -#else - if ( sock_flags == -1 ) - sock_flags = fcntl(fd, F_GETFL, 0); - if ( fcntl(fd, F_SETFL, O_NONBLOCK) == -1 ) - return(-1); -#endif - non_blocking = 1; - return(0); -} - - -/* -static int set_blocking(int fd) -{ -#ifdef PHP_WIN32 - unsigned int argp=1; - - if(ioctlsocket (fd, FIONBIO , &argp) == -1) - return(-1); -#else - if ( fcntl(fd, F_SETFL, sock_flags) == -1 ) - return(-1); -#endif - return(0); -} -*/ - -static int hg_read_exact(int sockfd, char *buf, int size) -{ - int len = 0; - - len = read_to(sockfd, (void *) buf, size, rtimeout); - if ( len < 0 ) - return -1; - return(len); -} - -/* -static int hg_read(int sockfd, char *buf, int size) -{ - int try = 0; - int len = 0; - - if ( !non_blocking ) - set_nonblocking(sockfd); - while ( len == 0 ) { - len = recv(sockfd, (void *) buf, size, 0); - if ( len == -1 ) { - if ( (errno == EAGAIN) || (errno == EWOULDBLOCK) ) { - if ( ++try > 5 ) - return(-1); - php_sleep(1); - } - else return(-1); - } - } - return(len); -} -*/ - -static int hg_write(int sockfd, char *buf, int size) -{ - int try = 0; - int len = 0; - - if ( !non_blocking ) - set_nonblocking(sockfd); - while ( size > 0 ) { - len = send(sockfd, (void *) buf, size, 0); - if ( len == -1 ) { - if ( (errno == EAGAIN) || (errno == EWOULDBLOCK) ) { - if ( ++try > 5 ) - return(-1); - php_sleep(1); - } - else return(-1); - } - else { - size -= len; - buf += len; - try = 0; - } - } - return(0); -} - -hg_msg *recv_hg_msg_head(int sockfd) -{ - hg_msg *msg; - - if ( (msg = (hg_msg *)emalloc(sizeof(hg_msg))) == NULL ) { - lowerror = LE_MALLOC; - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->length), 4) == -1 ) { - efree(msg); - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->version_msgid), 4) == -1 ) { - efree(msg); - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->msg_type), 4) == -1 ) { - efree(msg); - return(NULL); - } - -#ifdef HW_DEBUG - php_printf(" Recv msg: type = %d -- id = %d
\n", msg->msg_type, msg->version_msgid); -#endif - return(msg); -} - - -hg_msg *recv_hg_msg(int sockfd) -{ - hg_msg *msg; - - if ( (msg = (hg_msg *)emalloc(sizeof(hg_msg))) == NULL ) { -/* php_printf("recv_hg_msg"); */ - lowerror = LE_MALLOC; - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->length), 4) == -1 ) { -/* php_printf("recv_hg_msg: hg_read (1) returned -1\n"); */ - efree(msg); - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->version_msgid), 4) == -1 ) { -/* php_printf("recv_hg_msg: hg_read (2) returned -1\n"); */ - efree(msg); - return(NULL); - } - - if ( hg_read_exact(sockfd, (char *)&(msg->msg_type), 4) == -1 ) { -/* php_printf("recv_hg_msg: hg_read (3) returned -1\n"); */ - efree(msg); - return(NULL); - } - - if ( msg->length > HEADER_LENGTH ) { - if ( (msg->buf = (char *) emalloc(msg->length-HEADER_LENGTH)) == NULL ) { -/* php_printf("recv_hg_msg"); */ - lowerror = LE_MALLOC; - efree(msg); - return(NULL); - } - if ( hg_read_exact(sockfd, msg->buf, msg->length-HEADER_LENGTH) == -1 ) { -/* php_printf("recv_hg_msg: hg_read (4) returned -1\n"); */ - efree(msg->buf); - efree(msg); - return(NULL); - } - } - else - msg->buf = NULL; - -#ifdef HW_DEBUG - php_printf(" Recv msg: type = %d -- id = %d
\n", msg->msg_type, msg->version_msgid); -#endif - return(msg); -} - - -hg_msg *recv_ready(int sockfd) -{ - hg_msg *ready_msg; - - if ( (ready_msg = recv_hg_msg(sockfd)) == NULL ) { -/* php_printf("recv_ready: recv_hg_msg returned NULL\n"); */ - return(NULL); - } - if ( ready_msg->msg_type != READY_MESSAGE ) { -/* php_printf("recv_ready: recv_hg_msg returned wrong message: %d, %d \n", ready_msg->length, ready_msg->msg_type); */ - efree(ready_msg); - return(NULL); - } - - return(ready_msg); -} - - -hg_msg *recv_command(int sockfd) -{ - hg_msg *comm_msg; - - if ( (comm_msg = recv_hg_msg(sockfd)) == NULL ) { -/* fprintf(stderr, "recv_command: recv_hg_msg returned NULL\n"); */ - return(NULL); - } - if ( comm_msg->msg_type != COMMAND_MESSAGE ) { -/* fprintf(stderr, "recv_command: recv_hg_msg returned wrong message\n"); */ - return(NULL); - } - - return(comm_msg); -} - -int send_dummy(int sockfd, hw_objectID objectID, int msgid, char **attributes) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, msgid); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - *attributes = NULL; - return(-1); - } - - if(0 == (int) *(retmsg->buf)) { - *attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *((int *) retmsg->buf); - *attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -static int bh_send_deleteobject(int sockfd, hw_objectID objectID) { - hg_msg msg; - int length; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, DELETEOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - return(msgid-1); -} - -static int uh_send_deleteobject(int sockfd) { - hg_msg *retmsg; - int error; - - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - if(NULL == retmsg->buf) { - efree(retmsg); - return -1; - } - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return(error); -} - -int send_deleteobject(int sockfd, hw_objectID objectID) -{ - if(0 > bh_send_deleteobject(sockfd, objectID)) - return -1; - return(uh_send_deleteobject(sockfd)); -} - -static int bh_send_changeobject(int sockfd, hw_objectID objectID, char *mod) { - hg_msg msg; - int length; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID) + strlen(mod) + 1; - - build_msg_header(&msg, length, msgid++, CHANGEOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - tmp = build_msg_str(tmp, mod); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - return(msgid-1); -} - -static int uh_send_changeobject(int sockfd) { - hg_msg *retmsg; - int error; - - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return(error); -} - -int send_changeobject(int sockfd, hw_objectID objectID, char *modification) -{ - if(0 > bh_send_changeobject(sockfd, objectID, modification)) - return -1; - return(uh_send_changeobject(sockfd)); -} - -int send_groupchangeobject(int sockfd, hw_objectID objectID, char *modification) -{ - hw_objectID *childIDs; - int count, i, error; - - if(0 == (error = send_lock(sockfd, objectID))) { - send_changeobject(sockfd, objectID, modification); - send_unlock(sockfd, objectID); - }/* else - fprintf(stderr, "Could not lock 0x%X (error = %d)\n", objectID, error); */ - - if(0 == send_children(sockfd, objectID, &childIDs, &count)) { -/* fprintf(stderr, "Changing Children of 0x%X\n", objectID); */ - for(i=0; i send_groupchangeobject(sockfd, childIDs[i], modification)) -/* fprintf(stderr, "Cannot change 0x%X\n", objectID) */; - if(childIDs) - efree(childIDs); - }/* else - fprintf(stderr, "No Children of 0x%X\n", objectID); */ - return(0); -} - -static int bh_send_getobject(int sockfd, hw_objectID objectID) { - hg_msg msg; - int length; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - return(msgid-1); -} - -static int uh_send_getobject(int sockfd, char **attributes) { - hg_msg *retmsg; - int error; - - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - *attributes = NULL; - return(-1); - } - - if(0 == (int) *(retmsg->buf)) { - *attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *((int *) retmsg->buf); - *attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -int send_getobject(int sockfd, hw_objectID objectID, char **attributes) -{ - if(0 > bh_send_getobject(sockfd, objectID)) - return -1; - return(uh_send_getobject(sockfd, attributes)); -} - -int send_getandlock(int sockfd, hw_objectID objectID, char **attributes) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETANDLOCK_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - *attributes = NULL; - return(-1); - } - - if(0 == (error = (int) *(retmsg->buf))) { - *attributes = estrdup(retmsg->buf+sizeof(int)); - } else { - *attributes = NULL; - } - - efree(retmsg->buf); - efree(retmsg); - return error; -} - -int send_lock(int sockfd, hw_objectID objectID) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETANDLOCK_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - error = *((int *) retmsg->buf); - - efree(retmsg->buf); - efree(retmsg); - return error; -} - -int send_insertobject(int sockfd, char *objrec, char *parms, hw_objectID *objectID) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr; - - length = HEADER_LENGTH + strlen(objrec) + 1 + strlen(parms) + 1; - - build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, objrec); - tmp = build_msg_str(tmp, parms); -/*fprintf(stderr, "objrec = %s, parms = %s\n", objrec, parms); */ - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - *objectID = 0; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(0 == (error = *ptr)) { - ptr++; - *objectID = *ptr; - } else { - *objectID = 0; - } - efree(retmsg->buf); - efree(retmsg); - return error; -} - -int send_unlock(int sockfd, hw_objectID objectID) -{ - hg_msg msg; - int length; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, UNLOCK_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - return 0; -} - -int send_incollections(int sockfd, int retcol, int cobjids, hw_objectID *objectIDs, int ccollids, hw_objectID *collIDs, int *count, hw_objectID **retIDs) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, *ptr1, i; - - length = HEADER_LENGTH + sizeof(hw_objectID) + (cobjids + ccollids) * sizeof(hw_objectID) + 2 * sizeof(int); - - build_msg_header(&msg, length, msgid++, INCOLLECTIONS_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-3); - } - - tmp = build_msg_int(msg.buf, retcol); - tmp = build_msg_int(tmp, cobjids); - for(i=0; ibuf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr; - ptr++; - if(NULL != (*retIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *retIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - if(retmsg->buf) efree(retmsg->buf); - if(retmsg) efree(retmsg); - return error; - } - return(0); -} - - -int send_inscoll(int sockfd, hw_objectID objectID, char *objrec, hw_objectID *new_objectID) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID) + strlen(objrec) + 1; - - build_msg_header(&msg, length, msgid++, INSCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-3); - } - - tmp = build_msg_int(msg.buf, objectID); - tmp = build_msg_str(tmp, objrec); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - return(-1); - } - - ptr = (int *) retmsg->buf; - if(0 != (error = *ptr)) { - efree(retmsg->buf); - efree(retmsg); - *new_objectID = 0; - return error; - } - - ptr++; - *new_objectID = *ptr; - efree(retmsg->buf); - efree(retmsg); - return 0; -} - -int send_insdoc(int sockfd, hw_objectID objectID, char *objrec, char *text, hw_objectID *new_objectID) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID) + strlen(objrec) + 1; - if(text) { - length += strlen(text); - length++; - } - - build_msg_header(&msg, length, msgid++, INSDOC_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-3); - } - - tmp = build_msg_int(msg.buf, objectID); - tmp = build_msg_str(tmp, objrec); - if(text) - tmp = build_msg_str(tmp, text); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - return(-1); - } - - ptr = (int *) retmsg->buf; - if(0 != (error = *ptr)) { - efree(retmsg->buf); - efree(retmsg); - *new_objectID = 0; - return error; - } - - ptr++; - *new_objectID = *ptr; - efree(retmsg->buf); - efree(retmsg); - return 0; -} - -int send_getdestforanchorsobj(int sockfd, char **anchorrec, char ***destrec, int count); -int send_getreldestforanchorsobj(int sockfd, char **anchorrec, char ***reldestrec, int count, int rootID, int thisID); - -int send_gettext(int sockfd, hw_objectID objectID, int mode, int rootid, char **objattr, char **bodytag, char **text, int *count, char *urlprefix) -{ - hg_msg msg, *retmsg; - int length, *ptr, ancount, error; - char *tmp, *attributes, *documenttype; - char **anchors; - int i; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - attributes = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 0) { - attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *ptr; - attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } - - length = HEADER_LENGTH + strlen(attributes) + 1; - build_msg_header(&msg, length, msgid++, GETTEXT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, attributes); - - documenttype = fnAttributeValue(attributes, "DocumentType"); - *objattr = strdup(attributes); - efree(attributes); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if (retmsg == NULL) { - *text = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 0) { - ptr++; - *count = retmsg->length-HEADER_LENGTH-sizeof(int); - if(NULL != (*text = malloc(*count + 1))) { - memcpy(*text, retmsg->buf+sizeof(int), *count); -/* *text[*count] = 0; */ - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *ptr; - efree(retmsg->buf); - efree(retmsg); - *text = NULL; - return(error); - } - efree(retmsg->buf); - efree(retmsg); - - if((documenttype != NULL) && (strcmp(documenttype, "Image") != 0)) { - if(send_getanchorsobj(sockfd, objectID, &anchors, &ancount) == 0) { - char **destrec, **reldestrec; -#ifdef newlist - zend_llist *pAnchorList; -#else - DLIST *pAnchorList; -#endif - - /* Get dest as relative and absolut path */ - send_getdestforanchorsobj(sockfd, anchors, &destrec, ancount); - send_getreldestforanchorsobj(sockfd, anchors, &reldestrec, ancount, rootid, objectID); - pAnchorList = fnCreateAnchorList(objectID, anchors, destrec, reldestrec, ancount, mode); - - /* Free only the array, the objrecs has been freed in fnCreateAnchorList() */ - if(anchors) efree(anchors); - if(destrec) efree(destrec); - if(reldestrec) efree(reldestrec); - - if(pAnchorList != NULL) { - char *newtext; - char *body = NULL; - char **prefixarray; - - prefixarray = emalloc(5*sizeof(char *)); - for(i=0; i<5; i++) - prefixarray[i] = urlprefix; - - newtext = fnInsAnchorsIntoText(*text, pAnchorList, &body, prefixarray); - - efree(prefixarray); -#ifdef newlist - zend_llist_destroy(pAnchorList); - efree(pAnchorList); -#else - dlst_kill(pAnchorList, fnDeleteAnchor); -#endif - *bodytag = strdup(body); - if(body) efree(body); - *text = newtext; - *count = strlen(newtext); - } - } - } - - if(documenttype) efree(documenttype); - return(0); -} - -int send_insertanchors(char **text, int *count, char **anchors, char **destrec, int ancount, char **urlprefix, char **bodytag) { - char **reldestrec = NULL; - int mode = 0; - hw_objectID objectID = 0; -#ifdef newlist - zend_llist *pAnchorList = NULL; -#else - DLIST *pAnchorList = NULL; -#endif - pAnchorList = fnCreateAnchorList(objectID, anchors, destrec, reldestrec, ancount, mode); - - /* Free only the array, the objrecs has been freed in fnCreateAnchorList() */ - if(anchors) efree(anchors); - if(destrec) efree(destrec); - if(reldestrec) efree(reldestrec); - - if(pAnchorList != NULL) { - char *newtext; - char *body = NULL; - - newtext = fnInsAnchorsIntoText(*text, pAnchorList, &body, urlprefix); - -#ifdef newlist - zend_llist_destroy(pAnchorList); - efree(pAnchorList); -#else - dlst_kill(pAnchorList, fnDeleteAnchor); -#endif - *bodytag = strdup(body); - if(body) efree(body); - *text = newtext; - *count = strlen(newtext); - } - return 0; -} - -int send_edittext(int sockfd, char *objattr, char *text) -{ - hg_msg msg, *retmsg; - int length, *ptr, error; - char *tmp, *path, *objid; - hw_objectID objectID; - - objid = fnAttributeValue(objattr, "ObjectID"); - if(objid == NULL) - return(-1); - if(!sscanf(objid, "0x%x", &objectID)) - return(-2); - - path = fnAttributeValue(objattr, "Path"); - if(path == NULL) - return(-3); - - length = HEADER_LENGTH + sizeof(hw_objectID) + strlen(path) + 1 + 1 + strlen(text) + 1; - build_msg_header(&msg, length, msgid++, EDITTEXT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-4); - } - - tmp = build_msg_int(msg.buf, objectID); - tmp = build_msg_str(tmp, path); - tmp = build_msg_str(tmp, ""); - tmp = build_msg_str(tmp, text); - - if(path) efree(path); - if(objid) efree(objid); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-5); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if (retmsg == NULL) { - *text = '\0'; - return(-6); - } - - ptr = (int *) retmsg->buf; - error = *ptr; - efree(retmsg->buf); - efree(retmsg); - return(error); -} - -int send_getcgi(int sockfd, hw_objectID objectID, char *cgi_env_str, char **objattr, char **text, int *count) -{ - hg_msg msg, *retmsg; - int length, *ptr, error, new_attr_len; - char *tmp, *attributes, *new_attr; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - attributes = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 0) { - attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *ptr; - attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } - - new_attr_len = strlen(attributes) + strlen(cgi_env_str) + 2; - new_attr = malloc(new_attr_len); - strcpy(new_attr, attributes); - strcat(new_attr, cgi_env_str); - length = HEADER_LENGTH + strlen(new_attr) + 1 + sizeof(int); - build_msg_header(&msg, length, msgid++, GETCGI_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, new_attr); - tmp = build_msg_int(tmp, 0); - - *objattr = strdup(attributes); - efree(attributes); - free(new_attr); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if (retmsg == NULL) { - *text = NULL; - return(-1); - } - - /* Attention: It looks like the documentation is not quite right. - According to the docs the buffer starts with an integer which - is followed by the output of the cgi script. This seems not to - be true. There is another integer right after the error. - The output of the cgi script is also preceded by the 'Content-type' - header. */ - ptr = (int *) retmsg->buf; - if(*ptr++ == 1024) { - *count = *ptr++; - if(NULL != (*text = malloc(*count + 1))) { - memcpy(*text, ptr, *count); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *ptr + 1024; /* move errors to >2024 */ - efree(retmsg->buf); - efree(retmsg); - *text = NULL; - return(error); - } - efree(retmsg->buf); - efree(retmsg); - - return(0); -} - -int send_getremote(int sockfd, hw_objectID objectID, char **objattr, char **text, int *count) -{ - hg_msg msg, *retmsg; - int length, *ptr, error; - char *tmp, *attributes; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - attributes = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 0) { - attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *ptr; - attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } - - length = HEADER_LENGTH + strlen(attributes) + 1 + sizeof(int); - build_msg_header(&msg, length, msgid++, GETREMOTE_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, attributes); - tmp = build_msg_int(tmp, 0); - - *objattr = strdup(attributes); - efree(attributes); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if (retmsg == NULL) { - *text = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 1024) { - *count = retmsg->length-HEADER_LENGTH-sizeof(int)-sizeof(int); - if(NULL != (*text = malloc(*count + 1))) { - memcpy(*text, ptr+2, *count); -/* *text[*count] = 0; */ - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *ptr + 1024; /* move errors to >2024 */ - efree(retmsg->buf); - efree(retmsg); - *text = NULL; - return(error); - } - efree(retmsg->buf); - efree(retmsg); - - return(0); -} - -int send_getremotechildren(int sockfd, char *attributes, char **text, int **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, *ptr, *ptr1, error; - char *tmp; - -/* length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if(retmsg == NULL) { - attributes = NULL; - return(-1); - } - - ptr = (int *) retmsg->buf; - if(*ptr == 0) { - attributes = estrdup(retmsg->buf+sizeof(int)); - efree(retmsg->buf); - efree(retmsg); - } else { - error = *ptr; - attributes = NULL; - efree(retmsg->buf); - efree(retmsg); - return error; - } -*/ - length = HEADER_LENGTH + strlen(attributes) + 1 + sizeof(int); - build_msg_header(&msg, length, msgid++, GETREMOTECHILDREN_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, attributes); - tmp = build_msg_int(tmp, 0); - -/* efree(attributes); */ - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if (retmsg == NULL) { - *childIDs = NULL; - return(-1); - } - ptr = (int *) retmsg->buf; - if(*ptr++ == 1024) { - int i, remlen, sum; - *count = *ptr; - ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - sum = 0; - for(i=0; i<*count; ptr++, i++) { - ptr1[i] = *ptr; - sum += *ptr; - } - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - - remlen = retmsg->length - HEADER_LENGTH - *count * sizeof(int) - 2 * sizeof(int); -/*ptr1[i-1] = remlen; */ -/*ptr1[i-2] = sum; */ -/*ptr1[i-3] = *count; */ - if(NULL != (*text = emalloc(remlen + 1))) { - memcpy(*text, ptr, remlen); - } else { - efree(childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - efree(retmsg->buf); - efree(retmsg); - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - *childIDs = NULL; - *text = NULL; - return error; - } - return(0); -} - -int send_mvcpdocscollscoll(int sockfd, hw_objectID *objectIDs, int count, int from, int dest, int cpmv, int doccoll) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - - if(count <= 0) - return 0; - - /* HEADER_LENGTH + cpmv + from + dest + count + nr of obj */ - length = HEADER_LENGTH + sizeof(hw_objectID) + sizeof(hw_objectID) + sizeof(hw_objectID) + sizeof(hw_objectID) + count * sizeof(hw_objectID); - - switch(doccoll) { - case DOCUMENT: - build_msg_header(&msg, length, msgid++, MVCPDOCSCOLL_MESSAGE); - break; - case COLLECTION: - build_msg_header(&msg, length, msgid++, MVCPCOLLSCOLL_MESSAGE); - break; - } - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, cpmv); - tmp = build_msg_int(tmp, from); - tmp = build_msg_int(tmp, dest); - tmp = build_msg_int(tmp, count); - for(i=0; ibuf); - efree(retmsg->buf); - efree(retmsg); - return(error); -} - -int send_docbyanchor(int sockfd, hw_objectID objectID, hw_objectID *anchorID) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - ptr = (int *) retmsg->buf; - error = *ptr++; - if(error == 0) { - *anchorID = *ptr; - } else { - *anchorID = 0; - } - efree(retmsg->buf); - efree(retmsg); - return error; -} - -int send_docbyanchorobj(int sockfd, hw_objectID objectID, char **objrec) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, anchorID; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETDOCBYANCHOR_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - ptr = (int *) retmsg->buf; - error = *ptr++; - if(error == 0) { - anchorID = *ptr; - } else { - anchorID = 0; - } - efree(retmsg->buf); - efree(retmsg); - - if(0 > bh_send_getobject(sockfd, anchorID)) - return -1; - return(uh_send_getobject(sockfd, objrec)); -} - -int send_children(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *ptr, *ptr1; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if (-1 == send_hg_msg(sockfd, &msg, length)) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-3); - } - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -int send_childrenobj(int sockfd, hw_objectID objectID, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *childIDs = NULL; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, CHILDREN_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - for(i=0; i<*count; ptr++, i++) - childIDs[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - efree(childIDs); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(childIDs); - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getchildcoll(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -int send_getchildcollobj(int sockfd, hw_objectID objectID, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *childIDs = NULL; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETCHILDCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - for(i=0; i<*count; ptr++, i++) - childIDs[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - efree(childIDs); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(childIDs); - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getchilddoccoll(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } else { - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - int *ptr, i, *ptr1; - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - } - } - - return(0); - -} - -int send_getchilddoccollobj(int sockfd, hw_objectID objectID, hw_objrec ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *childIDs = NULL; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETCHILDDOCCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - int *ptr, i; - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg->buf) efree(retmsg->buf); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - for(i=0; i<*count; ptr++, i++) - childIDs[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getanchors(int sockfd, hw_objectID objectID, int **anchorIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETANCHORS_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - if (NULL == (retmsg = recv_hg_msg(sockfd))) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (*anchorIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *anchorIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -int send_getanchorsobj(int sockfd, hw_objectID objectID, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - int *anchorIDs = NULL; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, 50, GETANCHORS_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - - if (NULL == (retmsg = recv_hg_msg(sockfd))) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (anchorIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = anchorIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each anchor the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, anchorIDs, count, NULL, childrec)) { - efree(anchorIDs); - return -2; - } - efree(anchorIDs); -#else - for(i=0; i<*count; i++) { - - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, anchorIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, anchorIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - if(anchorIDs) efree(anchorIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getdestforanchorsobj(int sockfd, char **anchorrec, char ***destrec, int count) -{ - int i; - char *objptr, **destptr; - char *str; - int objectID; - - if(NULL == (destptr = (char **) emalloc(count * sizeof(hw_objrec *)))) { - lowerror = LE_MALLOC; - return -1; - } - - /* Now get for each anchor the object record of its destination */ - for(i=0; i send_docbyanchorobj(sockfd, objectID, &objptr)) { - efree(destptr); - return -1; - } - destptr[i] = objptr; - /* if we can't get the object rec of the dest, than this document - is probably not accessible for us. For later functions simply - set anchorrec[i] to NULL */ - if(destptr[i] == NULL) { - if(anchorrec[i]) efree(anchorrec[i]); - anchorrec[i] = NULL; - } - } else { - destptr[i] = NULL; - } - } - *destrec = destptr; - - return(0); -} - -int send_getreldestforanchorsobj(int sockfd, char **anchorrec, char ***reldestrec, int count, int rootID, int thisID) -{ - int i; - char *docofanchorptr, **reldestptr; - char *str; - int destobjectID; - - if(NULL == (reldestptr = (char **) emalloc(count * sizeof(char *)))) { - lowerror = LE_MALLOC; - return -1; - } - - /* Now get for each anchor the object record of its destination */ - for(i=0; i send_docbyanchorobj(sockfd, destobjectID, &docofanchorptr)) { - efree(reldestptr); - return -1; - } - - reldestptr[i] = docofanchorptr; - /* if we can't get the object rec of the dest, than this document - is probably not accessible for us. For later functions simply - set anchorrec[i] to NULL */ - if(reldestptr[i] == NULL) { - if(anchorrec[i]) efree(anchorrec[i]); - anchorrec[i] = NULL; - } else { - int j, *retthisIDs, *retdestIDs, equaltill, mincount, countthis, countdest, destdocid; - char destdocname[200]; - char anchorstr[300]; - char temp[200]; - char *strptr; - - if(NULL != (str = strstr(docofanchorptr, "Name="))) { - str += 5; - sscanf(str, "%s\n", destdocname); - } - if(NULL != (str = strstr(docofanchorptr, "ObjectID="))) { - str += 9; - sscanf(str, "0x%X", &destdocid); - } - - send_incollections(sockfd, 1, 1, &thisID, 1, &rootID, &countthis, &retthisIDs); - send_incollections(sockfd, 1, 1, &destdocid, 1, &rootID, &countdest, &retdestIDs); - -/* -fprintf(stderr, "%d: ", thisID); -for(k=0; k= 0) && (pcount != 0) && (parentIDs != NULL) && (pid != 0)) { -/*fprintf(stderr, "Get parents for %d\n", pid); */ - if(0 != send_getparents(sockfd, pid, &parentIDs, &pcount)) { - efree(pathIDs); - return -1; - } - pid = 0; - for(i=0; i 5 -> 4 -> 20 - ** (this means: 20 is child of 4, 4 is child of 5, 5 is child - ** of 1) it will return 1, 4, 5 instead of 1, 5, 4 - ** Consequently, we have to create the correct path, by checking - ** for the parents and identifying it in the list. - ** But there is another problem. If the id for which the list of - ** of collection is generated is a colletion itself, it will - ** show up in the list as well. In order to make the algorithmn - ** work proberly it has to be the last member of the list. - */ - for(i=0; ibuf; - efree(retmsg); - - return(0); -} - -int send_objectbyidquery(int sockfd, hw_objectID *IDs, int *count, char *query, char ***objrecs) -{ - hg_msg msg, *retmsg; - int length; - char *tmp, *str; - int *ptr, i; - int *offsets, *childIDs; - char **childrec; - - if(*count <= 0) { - *objrecs = emalloc(0); - return(0); - } - length = HEADER_LENGTH + sizeof(int) + sizeof(int) + *count * sizeof(hw_objectID); - if(query) - length = length + strlen(query) + 1; - - build_msg_header(&msg, length, msgid++, OBJECTBYIDQUERY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 1); - tmp = build_msg_int(tmp, *count); - for(i=0; i<*count; i++) - tmp = build_msg_int(tmp, IDs[i]); - if(query) - tmp = build_msg_str(tmp, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - -#ifdef hw_optimize - { - int hg_error; - int c, allc; - - allc = 0; - retmsg = recv_hg_msg_head(sockfd); - if ( retmsg == NULL ) - return(-1); - - /* read error field */ - if ( (c = hg_read_exact(sockfd, (char *) &hg_error, 4)) == -1 ) { - if(retmsg) efree(retmsg); - return(-2); - } - allc += c; - - if(hg_error) { - if(retmsg) efree(retmsg); - return(-3); - } - - /* read count field */ - if ( (c = hg_read_exact(sockfd, (char *) count, 4)) == -1 ) { - if(retmsg) efree(retmsg); - return(-2); - } - allc += c; - - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - if((c = hg_read_exact(sockfd, (char *) childIDs, *count * sizeof(hw_objectID))) == -1) { - efree(childIDs); - if(retmsg) efree(retmsg); - return(-3); - } - } else { - efree(retmsg); - lowerror = LE_MALLOC; - return(-4); - } - allc += c; - - if(NULL != (offsets = emalloc(*count * sizeof(int)))) { - if((c = hg_read_exact(sockfd, (char *) offsets, *count * sizeof(int))) == -1) { - efree(childIDs); - efree(offsets); - if(retmsg) efree(retmsg); - return(-5); - } - } else { - efree(retmsg); - efree(childIDs); - lowerror = LE_MALLOC; - return(-6); - } - allc += c; - - str = (char *)ptr; - if(NULL == (childrec = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - efree(offsets); - efree(childIDs); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } else { - for(i=0; i<*count; i++) { - char *ptr; - childrec[i] = emalloc(offsets[i] + 1); - ptr = childrec[i]; - c = hg_read_exact(sockfd, (char *) ptr, offsets[i]); - ptr[c] = '\0'; - allc += c; - } - /* Reading the trailing '\0' */ - c = hg_read_exact(sockfd, (char *) &hg_error, 1); - *objrecs = childrec; - } - } -#else - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ != 0) { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - *count = *ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - if(NULL != (offsets = emalloc(*count * sizeof(int)))) { - ptr1 = offsets; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - } else { - efree(retmsg->buf); - efree(retmsg); - efree(childIDs); - lowerror = LE_MALLOC; - return(-1); - } - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - - str = (char *)ptr; - if(NULL == (childrec = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - efree(offsets); - efree(childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } else { - for(i=0; i<*count; i++) { - char *ptr; - childrec[i] = emalloc(offsets[i] + 1); - ptr = childrec[i]; - memcpy(ptr, str, offsets[i]); - ptr[offsets[i]] = '\0'; - str += offsets[i]; - } - *objrecs = childrec; - } - - efree(retmsg->buf); -#endif - - efree(retmsg); - efree(childIDs); - efree(offsets); - return(0); -} - -int send_getobjbyquery(int sockfd, char *query, int maxhits, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - - length = HEADER_LENGTH + strlen(query) + 1; - - build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - return(0); -} - -int send_getobjbyqueryobj(int sockfd, char *query, int maxhits, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *childIDs = NULL; - int *ptr, *ptr1; - - length = HEADER_LENGTH + strlen(query) + 1; - - build_msg_header(&msg, length, msgid++, GETOBJBYQUERY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-3); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -4; - } - if(*ptr++ == 0) { - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-5); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - efree(childIDs); - lowerror = LE_MALLOC; - return(-6); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - efree(childIDs); - return(-7); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-8); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getobjbyquerycoll(int sockfd, hw_objectID collID, char *query, int maxhits, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - - length = HEADER_LENGTH + strlen(query) + 1 + sizeof(int) + sizeof(collID); - - build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 1); - tmp = build_msg_int(tmp, collID); - tmp = build_msg_str(tmp, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - return(0); -} - -int send_getobjbyquerycollobj(int sockfd, hw_objectID collID, char *query, int maxhits, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - hw_objectID *childIDs = NULL; - int *ptr, *ptr1; - - length = HEADER_LENGTH + strlen(query) + 1 + sizeof(int) + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJBYQUERYCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 1); - tmp = build_msg_int(tmp, collID); - tmp = build_msg_str(tmp, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return -1; - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - if(childIDs) efree(childIDs); - return -2; - } - if(childIDs) efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - efree(childIDs); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - efree(childIDs); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getobjbyftquery(int sockfd, char *query, int maxhits, hw_objectID **childIDs, float **weights, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - float *ptr2; - - length = HEADER_LENGTH + strlen(query) + 1; - - build_msg_header(&msg, length, msgid++, GETOBJBYFTQUERY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - char *cptr, tmp[20]; - float weight; - int j; - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - if(NULL != (*weights = emalloc(*count * sizeof(float)))) { - ptr2 = *weights; - for(i=0; i<*count; i++) { - ptr1[i] = *ptr++; /* Object id */ - cptr = (char *) ptr; - j = 0; - while(*cptr != ' ') { - tmp[j++] = *cptr++; - } - cptr++; /* Skip space after weight */ - tmp[j] = '\0'; - sscanf(tmp, "%f", &weight); - ptr2[i] = weight; - ptr = (int *) cptr; - ptr++; /* Skip 0-Integer after weight string */ - } - efree(retmsg->buf); - efree(retmsg); - } else { - efree(*childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - return(0); -} - -int send_getobjbyftqueryobj(int sockfd, char *query, int maxhits, char ***childrec, float **weights, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *childIDs = NULL; - int *ptr, *ptr1; - float *ptr2; - - length = HEADER_LENGTH + strlen(query) + 1; - - build_msg_header(&msg, length, msgid++, GETOBJBYFTQUERY_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-3); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -4; - } - if(*ptr++ == 0) { - char *cptr, tmp[20]; - float weight; - int j; - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - if(NULL != (*weights = emalloc(*count * sizeof(float)))) { - ptr2 = *weights; - for(i=0; i<*count; i++) { - ptr1[i] = *ptr++; /* Object id */ - cptr = (char *) ptr; - j = 0; - while(*cptr != ' ') { - tmp[j++] = *cptr++; - } - cptr++; /* Skip space after weight */ - tmp[j] = '\0'; - sscanf(tmp, "%f", &weight); - ptr2[i] = weight; - ptr = (int *) cptr; - ptr++; /* Skip 0-Integer after weight string */ - } - efree(retmsg->buf); - efree(retmsg); - } else { - efree(childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-5); - } - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-5); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - efree(*weights); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - efree(childIDs); - efree(*weights); - lowerror = LE_MALLOC; - return(-6); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - efree(childIDs); - efree(*weights); - return(-7); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-8); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getobjbyftquerycoll(int sockfd, hw_objectID collID, char *query, int maxhits, hw_objectID **childIDs, float **weights, int *count) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr, i, *ptr1; - float *ptr2; - - length = HEADER_LENGTH + strlen(query) + 1 + sizeof(int) + sizeof(collID); - - build_msg_header(&msg, length, msgid++, GETOBJBYFTQUERYCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 1); - tmp = build_msg_int(tmp, collID); - tmp = build_msg_str(tmp, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - char *cptr, tmp[20]; - float weight; - int j; - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - if(NULL != (*weights = emalloc(*count * sizeof(float)))) { - ptr2 = *weights; - for(i=0; i<*count; i++) { - ptr1[i] = *ptr++; /* Object id */ - cptr = (char *) ptr; - j = 0; - while(*cptr != ' ') { - tmp[j++] = *cptr++; - } - cptr++; /* Skip space after weight */ - tmp[j] = '\0'; - sscanf(tmp, "%f", &weight); - ptr2[i] = weight; - ptr = (int *) cptr; - ptr++; /* Skip 0-Integer after weight string */ - } - } else { - efree(*childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - return(0); -} - -int send_getobjbyftquerycollobj(int sockfd, hw_objectID collID, char *query, int maxhits, char ***childrec, float **weights, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - hw_objectID *childIDs = NULL; - int *ptr, *ptr1; - float *ptr2; - - length = HEADER_LENGTH + strlen(query) + 1 + sizeof(int) + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETOBJBYFTQUERYCOLL_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, 1); - tmp = build_msg_int(tmp, collID); - tmp = build_msg_str(tmp, query); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return -1; - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - char *cptr, tmp[20]; - float weight; - int j; - *count = (*ptr < maxhits) ? *ptr : maxhits; - ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - if(NULL != (*weights = emalloc(*count * sizeof(float)))) { - ptr2 = *weights; - for(i=0; i<*count; i++) { - ptr1[i] = *ptr++; /* Object id */ - cptr = (char *) ptr; - j = 0; - while(*cptr != ' ') { - tmp[j++] = *cptr++; - } - cptr++; /* Skip space after weight */ - tmp[j] = '\0'; - sscanf(tmp, "%f", &weight); - ptr2[i] = weight; - ptr = (int *) cptr; - ptr++; /* Skip 0-Integer after weight string */ - } - efree(retmsg->buf); - efree(retmsg); - } else { - efree(childIDs); - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each child collection the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - if(childIDs) efree(childIDs); - if(*weights) efree(weights); - return -2; - } - if(childIDs) efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - efree(childIDs); - efree(*weights); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - efree(childIDs); - efree(*weights); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_getparents(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *ptr, *ptr1; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if (-1 == send_hg_msg(sockfd, &msg, length)) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-3); - } - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = *childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -int send_getparentsobj(int sockfd, hw_objectID objectID, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - hw_objectID *childIDs = NULL; - int *ptr; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETPARENT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if (-1 == send_hg_msg(sockfd, &msg, length)) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - for(i=0; i<*count; ptr++, i++) - childIDs[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each parent the object record */ -#ifdef hw_less_server_stress - if(0 != send_objectbyidquery(sockfd, childIDs, count, NULL, childrec)) { - efree(childIDs); - return -2; - } - efree(childIDs); -#else - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } -#endif - return(0); -} - -int send_pipedocument(int sockfd, char *host, hw_objectID objectID, int mode, int rootid, char **objattr, char **bodytag, char **text, int *count, char **urlprefix) -{ - hg_msg msg, *retmsg; - int length, len; - char *tmp, header[80], *head_ptr, *sizestr; - struct sockaddr_in serv_addr; - struct hostent *hostptr; - char *hostip = NULL; - char *attributes = NULL; - char *documenttype; - char **anchors; - int newfd, fd, port, size, error, ancount; - int *ptr; - - if(-1 == (fd = fnCOpenDataCon(sockfd, &port))) { - /* not set yet efree(msg.buf); */ - return(-1); - } - - /* - ** Get information about host - */ - if(host) { - if((hostptr = gethostbyname(host)) == NULL) { - HWSOCK_FCLOSE(fd); - return(-2); - } - } else { - HWSOCK_FCLOSE(fd); - return(-2); - } - - switch(hostptr->h_addrtype) { - struct in_addr *ptr1; - char *ptr; - case AF_INET: - ptr = hostptr->h_addr_list[0]; - ptr1 = (struct in_addr *) ptr; - hostip = inet_ntoa(*ptr1); - break; - default: - HWSOCK_FCLOSE(fd); - return(-3); - break; - } - - /* Bottom half of send_getobject */ - if(0 > bh_send_getobject(sockfd, objectID)) { - HWSOCK_FCLOSE(fd); - return -4; - } - - /* Upper half of send_getobject */ - if(0 > (error = uh_send_getobject(sockfd, &attributes))) { - HWSOCK_FCLOSE(fd); - return error; - } - - length = HEADER_LENGTH + sizeof(hw_objectID) + sizeof(int) + strlen(hostip) + 1 + strlen("Refno=0x12345678") + 1; - build_msg_header(&msg, length, msgid++, PIPEDOCUMENT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - if(attributes) efree(attributes); - lowerror = LE_MALLOC; - return(-5); - } - - tmp = build_msg_int(msg.buf, objectID); - tmp = build_msg_int(tmp, port); - tmp = build_msg_str(tmp, hostip); - tmp = build_msg_str(tmp, "Refno=0x12345678"); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - if(attributes) efree(attributes); - efree(msg.buf); - HWSOCK_FCLOSE(fd); - return(-6); - } - efree(msg.buf); - - /* Just check if the command was understood */ - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(-7); - } - - ptr = (int *) retmsg->buf; - if((ptr == NULL) || (*ptr != 0)) { - error = *ptr; - if(retmsg->buf) efree(retmsg->buf); - efree(retmsg); - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(error); - } - - efree(retmsg->buf); - efree(retmsg); - - /* passively open the data connection. The HG server is probably - already waiting for us. - */ - len = sizeof(serv_addr); - if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) { -/* php_printf("client: can't open data connection to server\n"); */ - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(-8); - } else { - HWSOCK_FCLOSE(fd); - } - - /* First of all read the header */ - head_ptr = header; - while((read_to(newfd, head_ptr, 1, rtimeout) == 1) && (*head_ptr != '\0')) { - head_ptr++; - } - - /* Let's see how big the document is and read it into var text */ - sizestr = strstr(header, "sz="); - if(sizestr) { - sizestr += 3; - sscanf(sizestr, "%d\n", &size); - *count = size; - if((size != 0) && (NULL != (*text = malloc(size+1)))) { - read_to(newfd, *text, size, rtimeout); - (*text)[size] = '\0'; - } - } else { - *text = NULL; - } - - /* close the data connection */ - HWSOCK_FCLOSE(newfd); - - documenttype = fnAttributeValue(attributes, "DocumentType"); - - /* Make a copy with strdup (not estrdup), because we want to - keep the attributes in hw_document struct. - */ - *objattr = strdup(attributes); - efree(attributes); - - if((documenttype != NULL) && (!strcmp(documenttype, "text") != 0)) { - if(send_getanchorsobj(sockfd, objectID, &anchors, &ancount) == 0) { - char **destrec, **reldestrec; -#ifdef newlist - zend_llist *pAnchorList = NULL; -#else - DLIST *pAnchorList = NULL; -#endif - - /* Get dest as relative and absolut path */ - send_getdestforanchorsobj(sockfd, anchors, &destrec, ancount); - send_getreldestforanchorsobj(sockfd, anchors, &reldestrec, ancount, rootid, objectID); - pAnchorList = fnCreateAnchorList(objectID, anchors, destrec, reldestrec, ancount, mode); - /* Free only the array, the objrecs has been freed in fnCreateAnchorList() */ - if(anchors) efree(anchors); - if(destrec) efree(destrec); - if(reldestrec) efree(reldestrec); - - if(pAnchorList != NULL) { - char *newtext; - char *body = NULL; - - newtext = fnInsAnchorsIntoText(*text, pAnchorList, &body, urlprefix); -#ifdef newlist - zend_llist_destroy(pAnchorList); - efree(pAnchorList); -#else - dlst_kill(pAnchorList, fnDeleteAnchor); -#endif - *bodytag = strdup(body); - if(body) efree(body); - *text = newtext; - *count = strlen(newtext); - } - } - } else { - *bodytag = NULL; - } - - if(documenttype) efree(documenttype); - return(0); -} - -int send_pipecgi(int sockfd, char *host, hw_objectID objectID, char *cgi_env_str, char **objattr, char **text, int *count) -{ - hg_msg msg, *retmsg; - int length, len, new_attr_len; - char *tmp, header[80], *head_ptr, *sizestr; - struct sockaddr_in serv_addr; - struct hostent *hostptr; - char *hostip = NULL; - char *attributes = NULL; - char *documenttype, *new_attr; - int newfd, fd, port, size, error; - int *ptr; - - if(-1 == (fd = fnCOpenDataCon(sockfd, &port))) { - /* not set yet? efree(msg.buf); */ - return(-1); - } - - /* - ** Get information about host - */ - if(host) { - if((hostptr = gethostbyname(host)) == NULL) { - HWSOCK_FCLOSE(fd); - return(-1); - } - } else { - HWSOCK_FCLOSE(fd); - return(-1); - } - - switch(hostptr->h_addrtype) { - struct in_addr *ptr1; - char *ptr; - case AF_INET: - ptr = hostptr->h_addr_list[0]; - ptr1 = (struct in_addr *) ptr; - hostip = inet_ntoa(*ptr1); - break; - default: -/* php_printf(stderr, "unknown address type\n"); */ - break; - } - - /* Bottom half of send_getobject */ - if(0 > bh_send_getobject(sockfd, objectID)) { - HWSOCK_FCLOSE(fd); - return -1; - } - - /* Upper half of send_getobject */ - if(0 > (error = uh_send_getobject(sockfd, &attributes))) { - HWSOCK_FCLOSE(fd); - return error; - } - - new_attr_len = strlen(attributes) + strlen(cgi_env_str) + 2; - new_attr = malloc(new_attr_len); - strcpy(new_attr, attributes); - strcat(new_attr, cgi_env_str); - length = HEADER_LENGTH + strlen(new_attr) + 1 + sizeof(int) + strlen(hostip) + 1 + sizeof(int) + sizeof(int); - build_msg_header(&msg, length, msgid++, PIPECGI_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - if(attributes) efree(attributes); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, hostip); - tmp = build_msg_int(tmp, port); - tmp = build_msg_str(tmp, new_attr); - tmp = build_msg_int(tmp, 1); - tmp = build_msg_int(tmp, 0x12345678); - free(new_attr); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - if(attributes) efree(attributes); - efree(msg.buf); - HWSOCK_FCLOSE(fd); - return(-1); - } - efree(msg.buf); - - /* Just check if the command was understood */ - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(-1); - } - - ptr = (int *) retmsg->buf; - if((ptr == NULL) || (*ptr != 0)) { - if(retmsg->buf) efree(retmsg->buf); - efree(retmsg); - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(-1); - } - - efree(retmsg->buf); - efree(retmsg); - - /* passively open the data connection. The HG server is probably - already waiting for us. - */ - len = sizeof(serv_addr); - if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) { - if(attributes) efree(attributes); - HWSOCK_FCLOSE(fd); - return(-1); - } else { - HWSOCK_FCLOSE(fd); - } - - /* First of all read the header */ - head_ptr = header; - while((read_to(newfd, head_ptr, 1, rtimeout) == 1) && (*head_ptr != '\0')) { - head_ptr++; - } - - /* Let's see how big the document is and read it into var text */ - sizestr = strstr(header, "sz="); - if(sizestr) { - sizestr += 3; - sscanf(sizestr, "%d\n", &size); - *count = size; - if((size != 0) && (NULL != (*text = malloc(size+1)))) { - read_to(newfd, *text, size, rtimeout); - } - } else { - *text = NULL; - } - - /* close the data connection */ - HWSOCK_FCLOSE(newfd); - - documenttype = fnAttributeValue(attributes, "DocumentType"); - - /* Make a copy with strdup (not estrdup), because we want to - keep the attributes in hw_document struct. - */ - *objattr = strdup(attributes); - efree(attributes); - - if(documenttype) efree(documenttype); - return(0); -} - -int send_putdocument(int sockfd, char *host, hw_objectID parentID, char *objectRec, char *text, int count, hw_objectID *objectID) -{ - hg_msg msg, *retmsg; - int length, len; - char *tmp, header[80], parms[30], *head_ptr; - struct sockaddr_in serv_addr; - struct hostent *hostptr; - char *hostip = NULL; - int newfd, fd, port, error; - int *ptr; - - /* First of all we have to insert the document record */ - sprintf(parms, "Parent=0x%x", parentID); - length = HEADER_LENGTH + strlen(objectRec) + 1 + strlen(parms) + 1; - - build_msg_header(&msg, length, msgid++, INSERTOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_str(msg.buf, objectRec); - tmp = build_msg_str(tmp, parms); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-3); - } - - ptr = (int *) retmsg->buf; - if(0 == (error = *ptr)) { - ptr++; - *objectID = *ptr; - } else { - if(retmsg->buf) efree(retmsg->buf); - efree(retmsg); - return(error); - } - - efree(retmsg->buf); - efree(retmsg); - - /* - ** Get information about host - */ - if(host) { - if((hostptr = gethostbyname(host)) == NULL) { - /* close(fd); fd is not set yet */ - return(-4); - } - } else { - /* close(fd); fd is not set yet */ - return(-5); - } - - switch(hostptr->h_addrtype) { - struct in_addr *ptr1; - char *ptr; - case AF_INET: - ptr = hostptr->h_addr_list[0]; - ptr1 = (struct in_addr *) ptr; - hostip = inet_ntoa(*ptr1); - break; - default: -/* fprintf(stderr, "unknown address type\n"); */ - break; - } - - if(-1 == (fd = fnCOpenDataCon(sockfd, &port))) { - efree(msg.buf); - return(-6); - } - - /* Start building the PUTDOCUMENT message. I works even if - the Refno is skipped. I guess the path can be omitted too. */ - length = HEADER_LENGTH + sizeof(hw_objectID) + sizeof(int) + strlen(hostip) + 1 + strlen("Hyperwave") + 1+ strlen("Refno=0x12345678") + 1; - - build_msg_header(&msg, length, msgid++, PUTDOCUMENT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-7); - } - - tmp = build_msg_int(msg.buf, *objectID); - tmp = build_msg_int(tmp, port); - tmp = build_msg_str(tmp, hostip); - tmp = build_msg_str(tmp, "Hyperwave"); - tmp = build_msg_str(tmp, "Refno=0x12345678"); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - HWSOCK_FCLOSE(fd); - return(-8); - } - efree(msg.buf); - - /* passively open the data connection. The HG server is probably - already waiting for us. - */ - len = sizeof(serv_addr); - if((newfd = accept(fd, (struct sockaddr *) &serv_addr, &len)) < 0) { - HWSOCK_FCLOSE(fd); - return(-9); - } else { - HWSOCK_FCLOSE(fd); - } - - /* First of all write the header. According to the documentation - there should be a header first. Well, after some investigation - with tcpdump I found out, that Harmony and wavemaster don't - sent it. The also do not sent the Refno in the PUTDOCUMENT msg. - Anyway, we sent both. */ - head_ptr = header; - sprintf(header, "HGHDR\nsz=%d\nref=12345678\n", count); - len = strlen(header) + 1; - if(len != write_to(newfd, header, len, wtimeout)) { - HWSOCK_FCLOSE(newfd); - return(-10); - } - - /* And now the document */ - if(count != write_to(newfd, text, count, wtimeout)) { - HWSOCK_FCLOSE(newfd); - return(-11); - } - - /* The data connection has to be close before the return - msg can be read. The server will not sent it before. */ - HWSOCK_FCLOSE(newfd); - - /* Just check if the command was understood */ - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - HWSOCK_FCLOSE(fd); - return(-12); - } - - ptr = (int *) retmsg->buf; - if((ptr == NULL) || (*ptr != 0)) { - if(retmsg->buf) efree(retmsg->buf); - efree(retmsg); - HWSOCK_FCLOSE(fd); - return(-13); - } - - efree(retmsg->buf); - efree(retmsg); - - return(0); -} - -int send_getsrcbydest(int sockfd, hw_objectID objectID, char ***childrec, int *count) -{ - hg_msg msg, *retmsg; - int length, i, error; - char *tmp; - int *childIDs = NULL; - char **objptr; - int *ptr, *ptr1; - - length = HEADER_LENGTH + sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, GETSRCBYDEST_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, objectID); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) - return(-1); - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *count = *ptr; - ptr++; - if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) { - ptr1 = childIDs; - for(i=0; i<*count; ptr++, i++) - ptr1[i] = *ptr; - efree(retmsg->buf); - efree(retmsg); - } else { - efree(retmsg->buf); - efree(retmsg); - lowerror = LE_MALLOC; - return(-1); - } - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - /* Now get for each source the object record */ - for(i=0; i<*count; i++) { - length = HEADER_LENGTH + sizeof(hw_objectID); - build_msg_header(&msg, length, childIDs[i], GETOBJECT_MESSAGE); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - efree(childIDs); - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, childIDs[i]); - - if ( send_hg_msg(sockfd, &msg, length) == -1 ) { - efree(childIDs); - efree(msg.buf); - return(-1); - } - - efree(msg.buf); - } - efree(childIDs); - - if(NULL == (objptr = (char **) emalloc(*count * sizeof(hw_objrec *)))) { - /* if emalloc fails, get at least all remaining messages from server */ - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - efree(retmsg->buf); - efree(retmsg); - } - *childrec = NULL; - lowerror = LE_MALLOC; - return(-1); - } else { - *childrec = objptr; - - for(i=0; i<*count; i++) { - retmsg = recv_hg_msg(sockfd); - if ( retmsg != NULL ) { - if(0 == (int) *(retmsg->buf)) { - *objptr = estrdup(retmsg->buf+sizeof(int)); - objptr++; - efree(retmsg->buf); - efree(retmsg); - } else { - *objptr = NULL; - objptr++; - efree(retmsg->buf); - efree(retmsg); - } - } - } - } - - return(0); -} - -int send_mapid(int sockfd, int servid, hw_objectID id, int *virtid) -{ - hg_msg msg, *retmsg; - int length, error; - char *tmp; - int *ptr; - - length = HEADER_LENGTH + 2 * sizeof(hw_objectID); - - build_msg_header(&msg, length, msgid++, HG_MAPID); - - if ( (msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { - lowerror = LE_MALLOC; - return(-1); - } - - tmp = build_msg_int(msg.buf, servid); - tmp = build_msg_int(tmp, id); - - if (-1 == send_hg_msg(sockfd, &msg, length)) { - efree(msg.buf); - return(-2); - } - - efree(msg.buf); - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-3); - } - - ptr = (int *) retmsg->buf; - if(ptr == NULL) { - if(retmsg) efree(retmsg); - return -1; - } - if(*ptr++ == 0) { - *virtid = *ptr; - } else { - error = *((int *) retmsg->buf); - efree(retmsg->buf); - efree(retmsg); - return error; - } - - return(0); -} - -#define BUFFERLEN 200 -char *get_hw_info(hw_connection *conn) { - char temp[BUFFERLEN]; - int len; - struct sockaddr_in serv_addr; - - len = sizeof (serv_addr); - if(getsockname(conn->socket, (struct sockaddr *)&serv_addr, &len) < 0) - return(NULL); - - snprintf(temp, BUFFERLEN, "%s, %s, %d, %s, %d, %d", conn->server_string, conn->hostname, - conn->version, conn->username, - serv_addr.sin_port, conn->swap_on); - return(estrdup(temp)); -} -#undef BUFFERLEN - -static int send_hg_msg(int sockfd, hg_msg *msg, int length) -{ - char *buf, *tmp; - -#ifdef HW_DEBUG - php_printf("Sending msg: type = %d -- id = %d
\n", msg->msg_type, msg->version_msgid); -#endif - if ( length < HEADER_LENGTH ) { -/* fprintf(stderr, "send_hg_msg: bad msg\n"); */ - return(-1); - } - - if ( (tmp = buf = (char *)emalloc(length)) == NULL ) { -/* perror("send_hg_msg"); */ - lowerror = LE_MALLOC; - return(-1); - } - - memcpy(tmp, (char *) &(msg->length), 4); - tmp += 4; - memcpy(tmp, (char *) &(msg->version_msgid), 4); - tmp += 4; - memcpy(tmp, (char *) &(msg->msg_type), 4); - if ( msg->length > HEADER_LENGTH ) { - tmp += 4; - memcpy(tmp, msg->buf, length-HEADER_LENGTH); - } - - if ( hg_write(sockfd, buf, length) == -1 ) { - efree(buf); - return(-1); - } - - efree(buf); - return(0); -} - - -int send_ready(int sockfd) -{ - hg_msg ready_msg; - - build_msg_header(&ready_msg, HEADER_LENGTH, version, READY_MESSAGE); - ready_msg.buf = NULL; - - if ( send_hg_msg(sockfd, &ready_msg, HEADER_LENGTH) == -1 ) { - return(-1); - } - - return(0); -} - - -int send_command(int sockfd, int command, char **answer) -{ - hg_msg comm_msg, *retmsg; - char *comm_str, *tmp; - int respond = 1; - int length; - - if ( command == STAT_COMMAND ) - comm_str = STAT_COMMAND_STR; - else - comm_str = WHO_COMMAND_STR; - length = HEADER_LENGTH + sizeof(respond) + strlen(comm_str) + 1; - - build_msg_header(&comm_msg, length, msgid++, COMMAND_MESSAGE); - - if ( (comm_msg.buf = (char *)emalloc(length-HEADER_LENGTH)) == NULL ) { -/* perror("send_command"); */ - lowerror = LE_MALLOC; - return(-1); - } - - - tmp = build_msg_int(comm_msg.buf, respond); - tmp = build_msg_str(tmp, comm_str); - - - if ( send_hg_msg(sockfd, &comm_msg, length) == -1 ) { - efree(comm_msg.buf); - return(-1); - } - efree(comm_msg.buf); - - /* Just check if the command was understood */ - retmsg = recv_hg_msg(sockfd); - if ( retmsg == NULL ) { - return(-1); - } - - *answer = retmsg->buf; - efree(retmsg); - - return(0); -} - - -static void build_msg_header(hg_msg *msg, int length, int version_msgid, int msg_type) -{ - if ( swap_on ) { - msg->length = swap(length); - msg->version_msgid = swap(version_msgid); - msg->msg_type = swap(msg_type); - } - else { - msg->length = length; - msg->version_msgid = version_msgid; - msg->msg_type = msg_type; - } -} - - -static char *build_msg_int(char *buf, int val) { - int tmp; - -#ifdef HW_DEBUG - php_printf(" Added int to header: %d
\n", val); -#endif - tmp = swap_on ? swap(val) : val; - memcpy(buf, (char *)&tmp, 4); - - return(buf+4); -} - - -static char *build_msg_str(char *buf, char *str) -{ - int len = strlen(str)+1; - -#ifdef HW_DEBUG - php_printf(" Added str to header: %s (%d)
\n", str, strlen(str)); -#endif - - memcpy(buf, str, len); - - return(buf+len); -} - - -static int swap(int val) -{ - int tmp; - - ((char*)&tmp)[0] = ((char*)&val)[3]; - ((char*)&tmp)[1] = ((char*)&val)[2]; - ((char*)&tmp)[2] = ((char*)&val)[1]; - ((char*)&tmp)[3] = ((char*)&val)[0]; - - return(tmp); -} - - -void close_hg_connection(int sockfd) -{ - shutdown(sockfd, 2); - HWSOCK_FCLOSE(sockfd); -} - -#endif - -/* - * Local variables: - * tab-width: 4 - * End: - */ - diff --git a/ext/hyperwave/hg_comm.h b/ext/hyperwave/hg_comm.h deleted file mode 100644 index 3cb441e5c61..00000000000 --- a/ext/hyperwave/hg_comm.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Rasmus Lerdorf | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef HG_COMM_H -#define HG_COMM_H - -#if HYPERWAVE - -#define newlist - -#include "hw_error.h" -#ifdef newlist -#else -#include "dlist.h" -#endif -#define HG_SERVER_PORT 418 - -#define F_DISTRIBUTED 0x80000000 -#define F_COMPRESSED 0x40000000 -#define F_VERSION 0x00003fff -#define HW_VERSION 717L /* 7.17 */ - -#define HEADER_LENGTH 12 - -#define STAT_COMMAND_STR "stat" -#define WHO_COMMAND_STR "who" -#define STAT_COMMAND 1 -#define WHO_COMMAND 2 - -#define GETDOCBYANCHOR_MESSAGE 2 -#define GETCHILDCOLL_MESSAGE 3 -#define GETPARENT_MESSAGE 4 -#define GETCHILDDOCCOLL_MESSAGE 5 -#define GETOBJECT_MESSAGE 7 -#define GETANCHORS_MESSAGE 8 -#define GETOBJBYQUERY_MESSAGE 9 -#define GETOBJBYQUERYCOLL_MESSAGE 10 -#define OBJECTBYIDQUERY_MESSAGE 11 -#define GETTEXT_MESSAGE 12 -#define INSDOC_MESSAGE 14 -#define INSCOLL_MESSAGE 17 -#define GETSRCBYDEST_MESSAGE 19 -#define MVCPDOCSCOLL_MESSAGE 22 -#define MVCPCOLLSCOLL_MESSAGE 23 -#define IDENTIFY_MESSAGE 24 -#define READY_MESSAGE 25 -#define COMMAND_MESSAGE 26 -#define CHANGEOBJECT_MESSAGE 27 -#define EDITTEXT_MESSAGE 28 -#define GETANDLOCK_MESSAGE 29 -#define UNLOCK_MESSAGE 30 -#define INCOLLECTIONS_MESSAGE 31 -#define INSERTOBJECT_MESSAGE 32 -#define GETOBJBYFTQUERY_MESSAGE 34 -#define GETOBJBYFTQUERYCOLL_MESSAGE 35 -#define PIPEDOCUMENT_MESSAGE 36 -#define DELETEOBJECT_MESSAGE 37 -#define PUTDOCUMENT_MESSAGE 38 -#define GETREMOTE_MESSAGE 39 -#define GETREMOTECHILDREN_MESSAGE 40 -#define HG_MAPID 43 -#define CHILDREN_MESSAGE 44 -#define GETCGI_MESSAGE 45 -#define PIPECGI_MESSAGE 46 - -#define HW_DEFAULT_LINK 0 -#define HW_IMAGE_LINK 1 -#define HW_BACKGROUND_LINK 2 -#define HW_INTAG_LINK 3 -#define HW_APPLET_LINK 4 -#define HW_INTAGNODEL_LINK 5 - -#define COPY 0 -#define MOVE 1 -#define DOCUMENT 0 -#define COLLECTION 1 - - -#ifdef PHP_WIN32 -# define SOCK_ERR INVALID_SOCKET -# define SOCK_CONN_ERR SOCKET_ERROR -# define HWSOCK_FCLOSE(s) closesocket(s) -#else -# define SOCK_ERR -1 -# define SOCK_CONN_ERR -1 -# define HWSOCK_FCLOSE(s) close(s) -#endif - - -/* Low error messages */ -#define LE_MALLOC -1 - -typedef struct { - int id; /* object ID of anchor */ - int tanchor; /* Type of anchor. Can be 1=Src, 2=Dest */ - int start; /* start of anchor */ - int end; /* end of anchor */ - char *nameanchor; /* name tag attribute of destination document */ - /* if anchor is of type Src the following are used as well */ - char *destdocname; /* name of destination document */ - char *link; /* url for external destination */ - int linktype; /* type of link. see above */ - char *tagattr; /* more attributes of tag, like Border=0 */ - char *htmlattr; /* */ - char *codebase; /* codebase of applet */ - char *code; /* code of applet */ - char *fragment; /* name link of Src */ - - /* if anchor is of type Dest the following are used as well */ - char *keyword; /* name link of Dest */ - } ANCHOR; - -typedef struct { - int length; - int version_msgid; - int msg_type; - char *buf; -} hg_msg; - -typedef struct { - int socket; - int swap_on; - int version; - char *server_string; - char *hostname; - char *username; - int lasterror; - int linkroot; -} hw_connection; - -typedef int hw_objectID; -typedef char hw_objrec; -typedef float hw_float; - -#ifdef newlist -void fnDeleteAnchor(void *ptr1); -void fnListAnchor(zend_llist *pAnchorList); -zend_llist *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode); -char *fnInsAnchorsIntoText(char *text, zend_llist *pAnchorList, char **bodytag, char **urlprefix); -int fnCmpAnchors(const void *e1, const void *e2 TSRMLS_DC); -ANCHOR *fnAddAnchor(zend_llist *pAnchorList, int objectID, int start, int end); -#else -void fnDeleteAnchor(ANCHOR *ptr); -void fnListAnchor(DLIST *pAnchorList); -DLIST *fnCreateAnchorList(hw_objectID objID, char **anchors, char **docofanchorrec, char **reldestrec, int ancount, int anchormode); -char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char **urlprefix); -int fnCmpAnchors(ANCHOR *a1, ANCHOR *a2 TSRMLS_DC); -ANCHOR *fnAddAnchor(DLIST *pAnchorList, int objectID, int start, int end); -#endif -extern void set_swap(int do_swap); -extern int open_hg_connection(char *server_name, int port); -extern void close_hg_connection(int sockfd); -extern int initialize_hg_connection(int sockfd, int *do_swap, int *version, char **userdata, char **server_string, char *username, char *password); - -extern int send_ready(int sockfd); -extern int send_command(int sockfd, int command, char **answer); - -extern hg_msg *recv_hg_msg(int sockfd); -extern hg_msg *recv_ready(int sockfd); -extern hg_msg *recv_command(int sockfd); - -extern char *fnInsStr(char *str, int pos, char *insstr); -extern int fnAttributeCompare(char *object, char *attrname, char *value); -extern char *fnAttributeValue(char *object, char *attrname); -extern int getrellink(int sockfd, int rootID, int thisID, int destID, char **reldesstr); - -extern int send_deleteobject(int sockfd, hw_objectID objectID); -extern int send_changeobject(int sockfd, hw_objectID objectID, char *mod); -extern int send_groupchangeobject(int sockfd, hw_objectID objectID, char *mod); -extern int send_getobject(int sockfd, hw_objectID objectID, char **attributes); -extern int send_getandlock(int sockfd, hw_objectID objectID, char **attributes); -extern int send_lock(int sockfd, hw_objectID objectID); -extern int send_unlock(int sockfd, hw_objectID objectID); -extern int send_gettext(int sockfd, hw_objectID objectID, int mode, int rootid, char **objattr, char **bodytag, char **text, int *count, char *urlprefix); -extern int send_edittext(int sockfd, char *objattr, char *text); -extern int send_getcgi(int sockfd, hw_objectID objectID, char *cgi_env_str, char **objattr, char **text, int *count); -extern int send_getremote(int sockfd, hw_objectID objectID, char **objattr, char **text, int *count); -extern int send_getremotechildren(int sockfd, char *attributes, char **text, int **childIDs, int *count); -extern int send_docbyanchor(int sockfd, hw_objectID objectID, hw_objectID *anchorID); -extern int send_docbyanchorobj(int sockfd, hw_objectID objectID, char **objrec); -extern int send_mvcpdocscollscoll(int sockfd, hw_objectID *objectIDs, int count, int from, int dest, int cpmv, int docscoll); -extern int send_childrenobj(int sockfd, hw_objectID objectID, char ***childrec, int *count); -extern int send_getchildcoll(int sockfd, int objectID, hw_objectID **childIDs, int *count); -extern int send_getchildcollobj(int sockfd, hw_objectID objectID, hw_objrec ***childrec, int *count); -extern int send_getchilddoccoll(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count); -extern int send_getchilddoccollobj(int sockfd, hw_objectID objectID, hw_objrec ***childrec, int *count); -extern int send_getanchors(int sockfd, hw_objectID objectID, hw_objectID **anchorIDs, int *count); -extern int send_getanchorsobj(int sockfd, hw_objectID objectID, char ***childrec, int *count); -extern int send_objectbyidquery(int sockfd, hw_objectID *IDs, int *count, char *query, char ***objrecs); -extern int send_getobjbyquery(int sockfd, char *query, int maxhits, hw_objectID **childIDs, int *count); -extern int send_getobjbyqueryobj(int sockfd, char *query, int maxhits, char ***childrec, int *count); -extern int send_getobjbyquerycoll(int sockfd, hw_objectID collID, char *query, int maxhits, hw_objectID **childIDs, int *count); -extern int send_getobjbyquerycollobj(int sockfd, hw_objectID collID, char *query, int maxhits, char ***childrec, int *count); -extern int send_getobjbyftquery(int sockfd, char *query, int maxhits, hw_objectID **childIDs, float **weights, int *count); -extern int send_getobjbyftqueryobj(int sockfd, char *query, int maxhits, char ***childrec, float **weights, int *count); -extern int send_getobjbyftquerycoll(int sockfd, hw_objectID collID, char *query, int maxhits, hw_objectID **childIDs, float **weight, int *count); -extern int send_getobjbyftquerycollobj(int sockfd, hw_objectID collID, char *query, int maxhits, char ***childrec, float **weight, int *count); -extern int send_identify(int sockfd, char *name, char *passwd, char **userdata); -extern int send_getparents(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count); -extern int send_children(int sockfd, hw_objectID objectID, hw_objectID **childIDs, int *count); -extern int send_getparentsobj(int sockfd, hw_objectID objectID, char ***childrec, int *count); -extern int send_pipedocument(int sockfd, char *hostname, hw_objectID objectID, int mode, int rootid, char** objattr, char **bodytag, char **text, int *count, char **urlprefix); -extern int send_pipecgi(int sockfd, char *host, hw_objectID objectID, char *cgi_env_str, char **objattr, char **text, int *count); -extern int send_putdocument(int sockfd, char *hostname, hw_objectID parentID, char *objectRec, char *text, int count, hw_objectID *objectID); -extern int send_inscoll(int sockfd, hw_objectID objectID, char *objrec, hw_objectID *new_objectID); -extern int send_insertobject(int sockfd, char *objrec, char *parms, hw_objectID *objectID); -extern int send_insdoc(int sockfd, hw_objectID objectID, char *objrec, char *text, hw_objectID *new_objectID); -extern int send_incollections(int sockfd, int retcol, int cobjids, hw_objectID *objectIDs, int ccollids, hw_objectID *collIDs, int *count, hw_objectID **retIDs); -extern int send_getsrcbydest(int sockfd, hw_objectID objid, char ***childrec, int *count); -extern int send_mapid(int sockfd, int servid, hw_objectID id, int *virtid); -extern int send_dummy(int sockfd, hw_objectID objectID, int msgid, char **attributes); -extern int send_insertanchors(char **text, int *count, char **anchors, char **destrec, int ancount, char **urlprefix, char **bodytag); -extern char *get_hw_info(hw_connection *conn); - -#define send_mvcpdocscoll(sockfd, objectIDs, count, from, dest, mvcp) \ - send_mvcpdocscollscoll(sockfd, objectIDs, count, from, dest, mvcp, DOCUMENT) -#define send_mvcpcollscoll(sockfd, objectIDs, count, from, dest, mvcp) \ - send_mvcpdocscollscoll(sockfd, objectIDs, count, from, dest, mvcp, COLLECTION) - -#endif -#endif diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c deleted file mode 100644 index 006a8f2209a..00000000000 --- a/ext/hyperwave/hw.c +++ /dev/null @@ -1,4482 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 4 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2002 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | 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 | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_globals.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/head.h" -#include "ext/standard/info.h" -#include "fopen_wrappers.h" -#include "SAPI.h" - -#ifdef PHP_WIN32 -#include -#else -#include "build-defs.h" -#endif - -#if HYPERWAVE - -#include "php_ini.h" -#include "php_hyperwave.h" - -static int le_socketp, le_psocketp, le_document; - -/*hw_module php_hw_module;*/ - -#define HW_ATTR_NONE 1 -#define HW_ATTR_LANG 2 -#define HW_ATTR_NR 3 - -function_entry hw_functions[] = { - PHP_FE(hw_connect, NULL) - PHP_FE(hw_pconnect, NULL) - PHP_FE(hw_close, NULL) - PHP_FE(hw_root, NULL) - PHP_FE(hw_info, NULL) - PHP_FE(hw_connection_info, NULL) - PHP_FE(hw_error, NULL) - PHP_FE(hw_errormsg, NULL) - PHP_FE(hw_getparentsobj, NULL) - PHP_FE(hw_getparents, NULL) - PHP_FE(hw_children, NULL) - PHP_FE(hw_childrenobj, NULL) - PHP_FE(hw_getchildcoll, NULL) - PHP_FE(hw_getchildcollobj, NULL) - PHP_FE(hw_getobject, NULL) - PHP_FE(hw_getandlock, NULL) - PHP_FE(hw_unlock, NULL) - PHP_FE(hw_gettext, NULL) - PHP_FE(hw_edittext, NULL) - PHP_FE(hw_getcgi, NULL) - PHP_FE(hw_getremote, NULL) - PHP_FE(hw_getremotechildren, NULL) - PHP_FE(hw_pipedocument, NULL) - PHP_FE(hw_pipecgi, NULL) - PHP_FE(hw_insertdocument, NULL) - PHP_FE(hw_mv, NULL) - PHP_FE(hw_cp, NULL) - PHP_FE(hw_deleteobject, NULL) - PHP_FE(hw_changeobject, NULL) - PHP_FE(hw_modifyobject, NULL) - PHP_FE(hw_docbyanchor, NULL) - PHP_FE(hw_docbyanchorobj, NULL) - PHP_FE(hw_getobjectbyquery, NULL) - PHP_FE(hw_getobjectbyqueryobj, NULL) - PHP_FE(hw_getobjectbyquerycoll, NULL) - PHP_FE(hw_getobjectbyquerycollobj, NULL) - PHP_FE(hw_getobjectbyftquery, NULL) - PHP_FE(hw_getobjectbyftqueryobj, NULL) - PHP_FE(hw_getobjectbyftquerycoll, NULL) - PHP_FE(hw_getobjectbyftquerycollobj, NULL) - PHP_FE(hw_getchilddoccoll, NULL) - PHP_FE(hw_getchilddoccollobj, NULL) - PHP_FE(hw_getanchors, NULL) - PHP_FE(hw_getanchorsobj, NULL) - PHP_FE(hw_getusername, NULL) - PHP_FE(hw_setlinkroot, NULL) - PHP_FE(hw_identify, NULL) - PHP_FE(hw_free_document, NULL) - PHP_FE(hw_new_document, NULL) - PHP_FE(hw_new_document_from_file, NULL) - PHP_FE(hw_output_document, NULL) - PHP_FE(hw_document_size, NULL) - PHP_FE(hw_document_attributes, NULL) - PHP_FE(hw_document_bodytag, NULL) - PHP_FE(hw_document_content, NULL) - PHP_FE(hw_document_setcontent, NULL) - PHP_FE(hw_objrec2array, NULL) - PHP_FE(hw_array2objrec, NULL) - PHP_FE(hw_incollections, NULL) - PHP_FE(hw_inscoll, NULL) - PHP_FE(hw_insertobject, NULL) - PHP_FE(hw_insdoc, NULL) - PHP_FE(hw_getsrcbydestobj, NULL) - PHP_FE(hw_insertanchors, NULL) - PHP_FE(hw_getrellink, NULL) - PHP_FE(hw_who, NULL) - PHP_FE(hw_stat, NULL) - PHP_FE(hw_mapid, NULL) - PHP_FE(hw_dummy, NULL) - {NULL, NULL, NULL} -}; - -zend_module_entry hw_module_entry = { - STANDARD_MODULE_HEADER, - "hyperwave", hw_functions, PHP_MINIT(hw), PHP_MSHUTDOWN(hw), NULL, NULL, PHP_MINFO(hw), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES -}; - -/* -#ifdef ZTS -int hw_globals_id; -#else -PHP_HW_API php_hw_globals hw_globals; -#endif -*/ - -ZEND_DECLARE_MODULE_GLOBALS(hw) - -#ifdef COMPILE_DL_HYPERWAVE -ZEND_GET_MODULE(hw) -#endif - -void print_msg(hg_msg *msg, char *str, int txt); - -void _close_hw_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - hw_connection *conn = (hw_connection *)rsrc->ptr; - - if(conn->hostname) - free(conn->hostname); - if(conn->username) - free(conn->username); - close(conn->socket); - free(conn); - HwSG(num_links)--; -} - -void _close_hw_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - hw_connection *conn = (hw_connection *)rsrc->ptr; - - if(conn->hostname) - free(conn->hostname); - if(conn->username) - free(conn->username); - close(conn->socket); - free(conn); - HwSG(num_links)--; - HwSG(num_persistent)--; -} - -void _free_hw_document(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - hw_document *doc = (hw_document *)rsrc->ptr; - if(doc->data) - free(doc->data); - if(doc->attributes) - free(doc->attributes); - if(doc->bodytag) - free(doc->bodytag); - free(doc); -} - -static void php_hw_init_globals(zend_hw_globals *hw_globals) -{ - hw_globals->num_persistent = 0; -} - -static PHP_INI_MH(OnHyperwavePort) -{ - if (new_value==NULL) { - HwSG(default_port) = HG_SERVER_PORT; - } else { - HwSG(default_port) = atoi(new_value); - } - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("hyerwave.allow_persistent", "0", PHP_INI_SYSTEM, OnUpdateInt, allow_persistent, zend_hw_globals, hw_globals) - PHP_INI_ENTRY("hyperwave.default_port", "418", PHP_INI_ALL, OnHyperwavePort) -PHP_INI_END() - -PHP_MINIT_FUNCTION(hw) -{ - ZEND_INIT_MODULE_GLOBALS(hw, php_hw_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - le_socketp = zend_register_list_destructors_ex(_close_hw_link, NULL, "hyperwave link", module_number); - le_psocketp = zend_register_list_destructors_ex(NULL, _close_hw_plink, "hyperwave link persistent", module_number); - le_document = zend_register_list_destructors_ex(_free_hw_document, NULL, "hyperwave document", module_number); - Z_TYPE(hw_module_entry) = type; - - REGISTER_LONG_CONSTANT("HW_ATTR_LANG", HW_ATTR_LANG, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_ATTR_NR", HW_ATTR_NR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("HW_ATTR_NONE", HW_ATTR_NONE, CONST_CS | CONST_PERSISTENT); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(hw) -{ - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} - -/* {{{ make_return_objrec - * creates an array in return value and frees all memory - * Also adds as an assoc. array at the end of the return array with - * statistics. - */ -int make_return_objrec(pval **return_value, char **objrecs, int count) -{ - zval *stat_arr; - int i; - int hidden, collhead, fullcollhead, total; - int collheadnr, fullcollheadnr; - - if (array_init(*return_value) == FAILURE) { - /* Ups, failed! Let's at least free the memory */ - for(i=0; i