From 3f4d2c4b7f8b693011c798b216864b851c78d4f0 Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Sun, 3 Feb 2002 20:42:11 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'PRE_ISSET_PATCH'. --- CODING_STANDARDS | 220 - CREDITS | 2 - ChangeLog | 1513 -- ChangeLog.1999.gz | Bin 78772 -> 0 bytes ChangeLog.2000.gz | Bin 159518 -> 0 bytes ChangeLog.2001.gz | Bin 198003 -> 0 bytes EXTENSIONS | 462 - INSTALL | 411 - LICENSE | 75 - Makefile.in | 63 - NEWS | 1824 --- README.CVS-RULES | 105 - README.EXTENSIONS | 39 - README.EXT_SKEL | 184 - README.PARAMETER_PARSING_API | 118 - README.QNX | 57 - README.SELF-CONTAINED-EXTENSIONS | 174 - README.STREAMS | 243 - README.Zeus | 126 - RELEASE_PROCESS | 186 - TODO | 137 - TODO-4.2.txt | 33 - 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 - acconfig.h.in | 1 - acinclude.m4 | 1194 -- apidoc-zend.txt | 280 - apidoc.txt | 492 - build/bsd_makefile | 34 - build/build.mk | 71 - build/build2.mk | 77 - build/buildcheck.sh | 92 - build/dynlib.mk | 24 - build/fastgen.sh | 80 - build/genif.sh | 41 - build/library.mk | 23 - build/ltlib.mk | 24 - 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 | 716 - build/sysv_makefile | 34 - buildconf | 36 - config.guess | 1308 -- config.sub | 1417 -- configure.in | 1227 -- cvsclean | 3 - dynlib.m4 | 88 - ext/Makefile.in | 4 - ext/aspell/CREDITS | 2 - ext/aspell/Makefile.in | 5 - ext/aspell/aspell.c | 228 - ext/aspell/config.m4 | 30 - ext/aspell/php_aspell.h | 41 - ext/bcmath/CREDITS | 2 - ext/bcmath/Makefile.in | 11 - ext/bcmath/bcmath.c | 506 - ext/bcmath/config.m4 | 14 - 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/Makefile.in | 9 - 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/Makefile.in | 7 - 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/bcmath/setup.stub | 6 - ext/calendar/CREDITS | 2 - ext/calendar/Makefile.in | 6 - 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/Makefile.in | 8 - ext/ccvs/TODO | 7 - ext/ccvs/ccvs.c | 607 - ext/ccvs/ccvs.h | 59 - ext/ccvs/config.m4 | 27 - ext/com/COM.c | 1850 --- 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/Makefile.in | 5 - 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/Makefile.in | 8 - ext/crack/config.m4 | 33 - ext/crack/crack.c | 270 - ext/crack/php_crack.h | 72 - ext/crack/tests/001.phpt | 23 - ext/ctype/CREDITS | 2 - ext/ctype/Makefile.in | 8 - ext/ctype/README | 5 - ext/ctype/config.m4 | 15 - ext/ctype/ctype.c | 313 - 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/Makefile.in | 7 - ext/curl/config.m4 | 62 - ext/curl/curl.c | 1090 -- ext/curl/curl.dsp | 177 - ext/curl/php_curl.h | 101 - ext/cybercash/CREDITS | 2 - ext/cybercash/Makefile.in | 5 - 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/Makefile.in | 8 - ext/cybermut/config.m4 | 48 - ext/cybermut/cybermut.c | 178 - ext/cybermut/cybermut.xml | 214 - ext/cybermut/php_cybermut.h | 73 - ext/cybermut/tests/001.phpt | 23 - ext/cyrus/CREDITS | 2 - ext/cyrus/Makefile.in | 8 - ext/cyrus/config.m4 | 47 - ext/cyrus/cyrus.c | 516 - ext/cyrus/php_cyrus.h | 78 - ext/db/CREDITS | 2 - ext/db/Makefile.in | 5 - 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/Makefile.in | 8 - ext/dba/config.m4 | 235 - 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/dba/setup.stub | 6 - ext/dbase/CREDITS | 2 - ext/dbase/Makefile.in | 6 - 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 | 197 - ext/dbase/dbf_rec.h | 10 - ext/dbase/php_dbase.h | 44 - ext/dbase/setup.stub | 4 - ext/dbplus/CREDITS | 2 - ext/dbplus/EXPERIMENTAL | 5 - ext/dbplus/Makefile.in | 8 - ext/dbplus/README | 3 - ext/dbplus/config.m4 | 47 - ext/dbplus/dbplus.c | 247 - ext/dbplus/php_dbplus.c | 1558 -- ext/dbplus/php_dbplus.h | 124 - ext/dbplus/tests/001.phpt | 23 - ext/dbx/CREDITS | 9 - ext/dbx/INSTALL | 25 - ext/dbx/Makefile.in | 6 - ext/dbx/config.m4 | 10 - ext/dbx/dbx.c | 805 - ext/dbx/dbx.dsp | 165 - 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 | 279 - ext/dbx/dbx_pgsql.h | 56 - ext/dbx/howto_extend_dbx.html | 316 - ext/dbx/php_dbx.h | 87 - ext/dbx/tests/001.phpt | 12 - ext/dbx/tests/002.phpt | 27 - ext/dbx/tests/003.phpt | 107 - ext/dbx/tests/004.phpt | 30 - ext/dbx/tests/005.phpt | 90 - ext/dbx/tests/006.phpt | 55 - ext/dbx/tests/007.phpt | 74 - ext/dbx/tests/008.phpt | 146 - ext/dbx/tests/dbx_test.p | 54 - ext/dbx/tests/dbx_test.pgsql.script | 37 - ext/dbx/tests/dbx_test.script | 38 - ext/dio/EXPERIMENTAL | 0 ext/dio/Makefile.in | 8 - ext/dio/config.m4 | 10 - ext/dio/dio.c | 428 - ext/dio/php_dio.h | 63 - ext/dio/tests/001.phpt | 23 - ext/domxml/CREDITS | 2 - ext/domxml/EXPERIMENTAL | 5 - ext/domxml/Makefile.in | 8 - ext/domxml/TODO | 16 - ext/domxml/config.m4 | 172 - ext/domxml/domxml.dsp | 114 - ext/domxml/php_domxml.c | 3609 ----- ext/domxml/php_domxml.h | 190 - 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 | 657 - 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/Makefile.in | 7 - ext/exif/config.m4 | 11 - ext/exif/exif.c | 1294 -- ext/exif/exif.dsp | 113 - ext/exif/php_exif.h | 24 - ext/ext_skel | 289 - ext/fbsql/CREDITS | 2 - ext/fbsql/Makefile.in | 10 - ext/fbsql/Readme_w32.txt | 22 - ext/fbsql/config.m4 | 42 - ext/fbsql/fbsql.dsp | 171 - ext/fbsql/php_fbsql.c | 3454 ----- ext/fbsql/php_fbsql.h | 143 - ext/fdf/CREDITS | 2 - ext/fdf/Makefile.in | 7 - ext/fdf/config.m4 | 36 - ext/fdf/fdf.c | 802 - ext/fdf/fdf.dsp | 114 - ext/fdf/php_fdf.h | 62 - ext/fdf/setup.stub | 7 - ext/filepro/CREDITS | 2 - ext/filepro/Makefile.in | 6 - ext/filepro/config.m4 | 13 - ext/filepro/filepro.c | 576 - ext/filepro/filepro.dsp | 109 - ext/filepro/php_filepro.h | 48 - ext/filepro/setup.stub | 5 - ext/fribidi/CREDITS | 2 - ext/fribidi/Makefile.in | 9 - 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/Makefile.in | 6 - ext/ftp/config.m4 | 11 - ext/ftp/ftp.c | 1289 -- ext/ftp/ftp.h | 158 - ext/ftp/php_ftp.c | 782 - ext/ftp/php_ftp.h | 66 - ext/gd/CREDITS | 2 - ext/gd/Makefile.in | 7 - ext/gd/config.m4 | 263 - ext/gd/gd.c | 3622 ----- 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 | 549 - ext/gd/gdt1.h | 36 - ext/gd/gdttf.c | 868 -- ext/gd/gdttf.h | 16 - ext/gd/php_gd.h | 180 - ext/gd/setup.stub | 6 - ext/gettext/CREDITS | 2 - ext/gettext/Makefile.in | 7 - ext/gettext/config.m4 | 52 - ext/gettext/gettext.c | 311 - ext/gettext/gettext.dsp | 113 - ext/gettext/php_gettext.h | 58 - ext/gettext/setup.stub | 6 - ext/gmp/CREDITS | 2 - ext/gmp/Makefile.in | 9 - ext/gmp/README | 5 - ext/gmp/TODO | 22 - ext/gmp/config.m4 | 25 - ext/gmp/gmp.c | 1230 -- ext/gmp/php_gmp.h | 115 - ext/gmp/tests/001.phpt | 23 - ext/gmp/tests/002.phpt | 19 - ext/hyperwave/CREDITS | 2 - ext/hyperwave/Makefile.in | 5 - 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 | 4540 ------ ext/hyperwave/hw_error.h | 111 - ext/hyperwave/hyperwave.dsp | 120 - ext/hyperwave/php_hyperwave.h | 147 - ext/hyperwave/setup.stub | 6 - ext/icap/CREDITS | 2 - ext/icap/Makefile.in | 7 - 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 | 31 - ext/iconv/iconv.c | 315 - ext/iconv/iconv.dsp | 107 - ext/iconv/php_iconv.h | 65 - ext/iconv/tests/001.phpt | 18 - ext/iconv/tests/002.inc | 14 - ext/iconv/tests/002.phpt | 12 - ext/iconv/tests/skipif.inc | 11 - ext/imap/CREDITS | 2 - ext/imap/IMAP_Win32_HOWTO.txt | 32 - ext/imap/Makefile.in | 7 - 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/imap/setup.stub | 7 - ext/informix/CREDITS | 2 - ext/informix/Makefile.in | 20 - ext/informix/config.m4 | 95 - ext/informix/ifx.dsp | 134 - ext/informix/ifx.ec | 4260 ----- ext/informix/php_informix.h | 180 - ext/informix/setup.stub | 9 - ext/informix/stub.c | 0 ext/ingres_ii/CREDITS | 2 - ext/ingres_ii/EXPERIMENTAL | 5 - ext/ingres_ii/Makefile.in | 8 - 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/Makefile.in | 6 - ext/interbase/config.m4 | 23 - ext/interbase/interbase.c | 3125 ---- ext/interbase/interbase.dsp | 113 - ext/interbase/php_interbase.h | 184 - ext/interbase/setup.stub | 7 - 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/Makefile.in | 7 - ext/ldap/config.m4 | 108 - ext/ldap/ldap.c | 2168 --- ext/ldap/ldap.dsp | 230 - ext/ldap/php_ldap.h | 119 - ext/ldap/setup.stub | 8 - ext/mailparse/CREDITS | 2 - ext/mailparse/EXPERIMENTAL | 5 - ext/mailparse/Makefile.in | 15 - ext/mailparse/README | 79 - ext/mailparse/config.m4 | 14 - ext/mailparse/libs.mk | 7 - ext/mailparse/mailparse.c | 912 -- 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 | 137 - 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/Makefile.in | 7 - ext/mbstring/README_PHP3-i18n-ja | 774 - ext/mbstring/config.m4 | 39 - ext/mbstring/mbfilter.c | 8597 ----------- ext/mbstring/mbfilter.h | 549 - ext/mbstring/mbfilter_ja.c | 7334 --------- 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 | 123 - ext/mbstring/mbstring.h | 188 - ext/mbstring/php_mbregex.c | 983 -- ext/mcal/CREDITS | 2 - ext/mcal/Makefile.in | 7 - ext/mcal/config.m4 | 50 - ext/mcal/php_mcal.c | 1631 -- ext/mcal/php_mcal.h | 68 - ext/mcrypt/CREDITS | 2 - ext/mcrypt/Makefile.in | 7 - 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/setup.stub | 6 - ext/mcrypt/tests/001.phpt | 31 - ext/mhash/CREDITS | 2 - ext/mhash/Makefile.in | 7 - ext/mhash/config.m4 | 25 - ext/mhash/mhash.c | 286 - ext/mhash/mhash.dsp | 115 - ext/mhash/php_mhash.h | 27 - ext/mhash/setup.stub | 6 - ext/ming/CREDITS | 2 - ext/ming/EXPERIMENTAL | 5 - ext/ming/Makefile.in | 8 - ext/ming/config.m4 | 32 - ext/ming/ming.c | 3158 ---- ext/ming/ming.dsp | 107 - ext/ming/php_ming.h | 167 - ext/mnogosearch/CREDITS | 2 - ext/mnogosearch/Makefile.in | 9 - 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/mnogosearch/setup.stub | 10 - ext/msession/CREDITS | 3 - ext/msession/Makefile.in | 11 - ext/msession/README | 33 - ext/msession/config.m4 | 34 - ext/msession/msession-test.php | 125 - ext/msession/msession.c | 1223 -- ext/msession/msession.php | 10 - ext/msession/php_msession.h | 106 - ext/msession/reqclient.h | 140 - ext/msql/CREDITS | 2 - ext/msql/Makefile.in | 7 - ext/msql/config.m4 | 42 - ext/msql/msql.dsp | 107 - ext/msql/php_msql.c | 1321 -- ext/msql/php_msql.h | 82 - ext/msql/setup.stub | 11 - 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/muscat/EXPERIMENTAL | 1 - ext/muscat/LICENSE | 282 - ext/muscat/LICENSE.about | 30 - ext/muscat/Makefile.in | 7 - ext/muscat/config.m4 | 37 - ext/muscat/muscat.c | 352 - ext/muscat/muscat.php | 10 - ext/muscat/muscat_handles.h | 60 - ext/muscat/muscat_net.c | 91 - ext/muscat/muscat_net.h | 59 - ext/muscat/php_muscat.h | 97 - ext/mysql/CREDITS | 2 - ext/mysql/Makefile.in | 10 - ext/mysql/config.m4 | 102 - ext/mysql/libmysql/Makefile.in | 16 - 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 | 18 - 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/mysql/setup.stub | 7 - ext/ncurses/CREDITS | 2 - ext/ncurses/EXPERIMENTAL | 0 ext/ncurses/Makefile.in | 8 - ext/ncurses/c-prototypes | 263 - ext/ncurses/config.m4 | 55 - ext/ncurses/example1.php | 28 - ext/ncurses/ncurses.c | 308 - ext/ncurses/ncurses.php | 10 - ext/ncurses/ncurses_fe.c | 175 - ext/ncurses/ncurses_functions.c | 1746 --- ext/ncurses/php_ncurses.h | 79 - 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/Makefile.in | 6 - ext/oci8/config.m4 | 86 - ext/oci8/oci8.c | 5298 ------- ext/oci8/oci8.dsp | 113 - ext/oci8/oci8.dsw | 29 - ext/oci8/php_oci8.h | 212 - ext/oci8/setup.stub | 6 - ext/odbc/CREDITS | 2 - ext/odbc/Makefile.in | 7 - ext/odbc/config.m4 | 553 - ext/odbc/php_odbc.c | 3532 ----- ext/odbc/php_odbc.h | 356 - ext/odbc/php_velocis.h | 92 - ext/odbc/setup.stub | 154 - ext/odbc/velocis.c | 698 - ext/openssl/CREDITS | 2 - ext/openssl/EXPERIMENTAL | 5 - ext/openssl/Makefile.in | 7 - 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/Makefile.in | 6 - ext/oracle/config.m4 | 158 - ext/oracle/oracle.c | 1789 --- ext/oracle/oracle.dsp | 113 - ext/oracle/php_oracle.h | 137 - ext/oracle/setup.stub | 9 - ext/overload/CREDITS | 2 - ext/overload/EXPERIMENTAL | 0 ext/overload/Makefile.in | 8 - ext/overload/README | 112 - 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/Makefile.in | 7 - ext/ovrimos/config.m4 | 28 - ext/ovrimos/ovrimos.c | 1326 -- ext/ovrimos/php_ovrimos.h | 44 - ext/ovrimos/setup.stub | 6 - ext/pcntl/CREDITS | 2 - ext/pcntl/EXPERIMENTAL | 5 - ext/pcntl/Makefile.in | 8 - 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 | 47 - ext/pcntl/php_signal.h | 28 - ext/pcntl/test-pcntl.php | 35 - ext/pcntl/tests/001.phpt | 81 - ext/pcre/CREDITS | 2 - ext/pcre/Makefile.in | 10 - ext/pcre/config.m4 | 61 - ext/pcre/config0.m4 | 61 - 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/Makefile.in | 7 - 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/pcre/setup.stub | 6 - ext/pdf/CREDITS | 2 - ext/pdf/Makefile.in | 7 - ext/pdf/config.m4 | 121 - ext/pdf/pdf.c | 3231 ---- ext/pdf/pdf.dsp | 114 - ext/pdf/php_pdf.h | 179 - ext/pdf/setup.stub | 7 - ext/pfpro/CREDITS | 2 - ext/pfpro/Makefile.in | 8 - 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/Makefile.in | 9 - ext/pgsql/README | 181 - ext/pgsql/config.m4 | 69 - ext/pgsql/pgsql.c | 2612 ---- ext/pgsql/pgsql.dsp | 167 - ext/pgsql/php_pgsql.h | 176 - ext/pgsql/setup.stub | 8 - 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/Makefile.in | 6 - ext/posix/config.m4 | 13 - ext/posix/php_posix.h | 85 - ext/posix/posix.c | 955 -- ext/pspell/CREDITS | 2 - ext/pspell/Makefile.in | 7 - ext/pspell/README | 51 - ext/pspell/config.m4 | 35 - ext/pspell/php_pspell.h | 52 - ext/pspell/pspell.c | 820 - ext/qtdom/CREDITS | 2 - ext/qtdom/EXPERIMENTAL | 5 - ext/qtdom/Makefile.in | 10 - ext/qtdom/config.m4 | 34 - ext/qtdom/qtdom.c | 272 - ext/qtdom/qtdom.h | 75 - ext/qtdom/qtdom.php | 10 - ext/qtdom/qtdom_qt.cpp | 371 - ext/qtdom/qtdom_qt.h | 67 - ext/readline/CREDITS | 2 - ext/readline/Makefile.in | 7 - ext/readline/README.libedit | 4 - ext/readline/config.m4 | 92 - ext/readline/php_readline.h | 39 - ext/readline/readline.c | 439 - ext/readline/setup.stub | 3 - ext/recode/CREDITS | 2 - ext/recode/Makefile.in | 7 - ext/recode/config.m4 | 63 - ext/recode/php_recode.h | 79 - ext/recode/recode.c | 226 - ext/recode/setup.stub | 3 - 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_wrapper.c | 1850 --- 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/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/xmlrpc/CREDITS | 2 - ext/rpc/xmlrpc/EXPERIMENTAL | 5 - ext/rpc/xmlrpc/Makefile.in | 11 - ext/rpc/xmlrpc/config.m4 | 90 - ext/rpc/xmlrpc/libxmlrpc/Makefile.in | 10 - 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 - ext/rpc/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 | 14 - ext/rpc/xmlrpc/libxmlrpc/xmlrpc_introspection.c | 594 - ext/rpc/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 | 120 - ext/rpc/xmlrpc/xmlrpc-epi-php.c | 1486 -- ext/rpc/xmlrpc/xmlrpc.dsp | 211 - ext/satellite/CREDITS | 2 - ext/satellite/EXPERIMENTAL | 5 - ext/satellite/Makefile.in | 53 - ext/satellite/README | 98 - ext/satellite/class.c | 189 - ext/satellite/class.h | 219 - ext/satellite/common.c | 31 - ext/satellite/common.h | 70 - ext/satellite/config.m4 | 76 - ext/satellite/corba.c | 131 - ext/satellite/corba.h | 43 - ext/satellite/enum.c | 174 - ext/satellite/enum.h | 34 - ext/satellite/findtype.c | 145 - ext/satellite/findtype.h | 43 - ext/satellite/hashtable.c | 101 - ext/satellite/hashtable.h | 35 - ext/satellite/multiple_components.patch | 34 - ext/satellite/namedvalue_to_zval.c | 322 - ext/satellite/namedvalue_to_zval.h | 36 - ext/satellite/object.c | 897 -- ext/satellite/object.h | 37 - ext/satellite/php_orbit.c | 214 - ext/satellite/php_orbit.h | 43 - ext/satellite/struct.c | 317 - ext/satellite/struct.h | 35 - ext/satellite/tests/001.phpt | 23 - ext/satellite/tests/002.phpt | 15 - ext/satellite/tests/003.phpt | 21 - ext/satellite/tests/004.phpt | 16 - ext/satellite/tests/005.phpt | 15 - ext/satellite/tests/random.idl | 14 - ext/satellite/typecode.c | 436 - ext/satellite/typecode.h | 34 - ext/satellite/typemanager.c | 598 - ext/satellite/typemanager.h | 112 - ext/satellite/zval_to_namedvalue.c | 480 - ext/satellite/zval_to_namedvalue.h | 33 - ext/session/CREDITS | 2 - ext/session/Makefile.in | 7 - ext/session/config.m4 | 35 - ext/session/mod_files.c | 352 - 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 | 185 - ext/session/mod_user.h | 39 - ext/session/php_session.h | 202 - ext/session/session.c | 1516 -- ext/session/setup.stub | 6 - ext/session/tests/001.phpt | 27 - ext/session/tests/002.phpt | 10 - ext/session/tests/003.phpt | 36 - ext/session/tests/004.phpt | 105 - ext/session/tests/005.phpt | 140 - ext/session/tests/006.phpt | 63 - ext/shmop/CREDITS | 2 - ext/shmop/Makefile.in | 8 - ext/shmop/README | 69 - ext/shmop/config.m4 | 8 - ext/shmop/php_shmop.h | 84 - ext/shmop/setup.stub | 5 - 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/Makefile.in | 7 - 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/Makefile.in | 7 - ext/sockets/config.m4 | 15 - ext/sockets/php_sockets.h | 134 - ext/sockets/php_sockets_win.c | 177 - ext/sockets/php_sockets_win.h | 82 - ext/sockets/sockets.c | 1963 --- ext/sockets/sockets.dsp | 118 - ext/sockets/sockets.php | 10 - ext/standard/CREDITS | 3 - ext/standard/Makefile.in | 22 - ext/standard/array.c | 3361 ---- ext/standard/assert.c | 301 - ext/standard/base64.c | 201 - ext/standard/base64.h | 37 - ext/standard/basic_functions.c | 2572 ---- ext/standard/basic_functions.h | 207 - ext/standard/browscap.c | 269 - ext/standard/config.m4 | 236 - ext/standard/crc32.c | 132 - ext/standard/credits.c | 125 - ext/standard/credits.h | 42 - ext/standard/credits_ext.h | 89 - ext/standard/credits_sapi.h | 24 - ext/standard/crypt.c | 173 - ext/standard/cyr_convert.c | 299 - ext/standard/cyr_convert.h | 29 - ext/standard/datetime.c | 846 - ext/standard/datetime.h | 45 - ext/standard/dir.c | 354 - ext/standard/dl.c | 231 - ext/standard/dl.h | 34 - ext/standard/dns.c | 355 - ext/standard/dns.h | 42 - ext/standard/exec.c | 488 - ext/standard/exec.h | 35 - ext/standard/file.c | 2355 --- ext/standard/file.h | 129 - 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 | 771 - ext/standard/fsock.h | 88 - ext/standard/ftok.c | 66 - ext/standard/ftp_fopen_wrapper.c | 324 - ext/standard/head.c | 177 - ext/standard/head.h | 32 - ext/standard/html.c | 586 - ext/standard/html.h | 36 - ext/standard/http_fopen_wrapper.c | 332 - ext/standard/image.c | 525 - 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 | 1056 -- 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 | 39 - ext/standard/php_ext_syslog.h | 39 - ext/standard/php_filestat.h | 76 - ext/standard/php_fopen_wrapper.c | 61 - ext/standard/php_fopen_wrappers.h | 30 - ext/standard/php_ftok.h | 30 - ext/standard/php_image.h | 26 - 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 | 150 - 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 | 69 - ext/standard/php_string.h | 156 - ext/standard/php_type.h | 41 - ext/standard/php_var.h | 64 - ext/standard/php_versioning.h | 31 - ext/standard/quot_print.c | 138 - ext/standard/quot_print.h | 26 - ext/standard/rand.c | 414 - ext/standard/reg.c | 657 - ext/standard/reg.h | 50 - ext/standard/scanf.c | 1253 -- ext/standard/scanf.h | 50 - ext/standard/soundex.c | 115 - ext/standard/string.c | 3866 ----- ext/standard/strnatcmp.c | 173 - ext/standard/syslog.c | 283 - ext/standard/tests/array/001.phpt | 15409 ------------------- 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 | 149 - 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 | 17 - 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 - ext/standard/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 | 530 - ext/standard/var_unserializer.c | 755 - ext/standard/var_unserializer.re | 402 - ext/standard/versioning.c | 220 - ext/swf/CREDITS | 2 - ext/swf/Makefile.in | 7 - ext/swf/config.m4 | 35 - ext/swf/php_swf.h | 119 - ext/swf/swf.c | 1255 -- ext/sybase/CREDITS | 2 - ext/sybase/Makefile.in | 7 - ext/sybase/config.m4 | 30 - ext/sybase/php_sybase_db.c | 1403 -- ext/sybase/php_sybase_db.h | 89 - ext/sybase/setup.stub | 11 - ext/sybase_ct/CREDITS | 2 - ext/sybase_ct/Makefile.in | 8 - ext/sybase_ct/config.m4 | 51 - ext/sybase_ct/php_sybase_ct.c | 1689 -- ext/sybase_ct/php_sybase_ct.h | 112 - ext/sybase_ct/setup.stub | 6 - ext/sybase_ct/sybase_ct.dsp | 114 - ext/sysvsem/CREDITS | 2 - ext/sysvsem/Makefile.in | 6 - ext/sysvsem/config.m4 | 29 - ext/sysvsem/php_sysvsem.h | 56 - ext/sysvsem/setup.stub | 5 - ext/sysvsem/sysvsem.c | 438 - ext/sysvshm/CREDITS | 2 - ext/sysvshm/Makefile.in | 6 - ext/sysvshm/config.m4 | 11 - ext/sysvshm/php_sysvshm.h | 85 - ext/sysvshm/setup.stub | 5 - ext/sysvshm/sysvshm.c | 434 - ext/vpopmail/CREDITS | 2 - ext/vpopmail/EXPERIMENTAL | 5 - ext/vpopmail/Makefile.in | 8 - 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/Makefile.in | 5 - ext/wddx/config.m4 | 15 - ext/wddx/php_wddx.h | 46 - ext/wddx/php_wddx_api.h | 66 - ext/wddx/wddx.c | 1302 -- ext/xml/CREDITS | 2 - ext/xml/Makefile.in | 11 - ext/xml/config.m4 | 58 - ext/xml/expat/Changes | 46 - ext/xml/expat/Makefile.in | 7 - 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 | 90 - ext/xml/tests/003.phpt | 89 - ext/xml/tests/004.phpt | 58 - 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/Makefile.in | 11 - ext/xmlrpc/config.m4 | 90 - ext/xmlrpc/libxmlrpc/Makefile.in | 10 - 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 | 14 - 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 | 120 - ext/xmlrpc/xmlrpc-epi-php.c | 1486 -- ext/xmlrpc/xmlrpc.dsp | 211 - ext/xslt/EXPERIMENTAL | 5 - ext/xslt/Makefile.in | 8 - ext/xslt/README.XSLT-BACKENDS | 284 - ext/xslt/config.m4 | 108 - 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/Makefile.in | 7 - ext/yaz/README | 5 - ext/yaz/config.m4 | 41 - ext/yaz/php_yaz.c | 2763 ---- ext/yaz/php_yaz.h | 81 - ext/yaz/setup.stub | 8 - ext/yaz/yaz.dsp | 111 - ext/yp/CREDITS | 2 - ext/yp/Makefile.in | 6 - ext/yp/config.m4 | 15 - ext/yp/php_yp.h | 69 - ext/yp/setup.stub | 6 - ext/yp/yp.c | 418 - ext/zip/CREDITS | 2 - ext/zip/Makefile.in | 8 - 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/Makefile.in | 7 - ext/zlib/config0.m4 | 52 - ext/zlib/php_zlib.h | 79 - ext/zlib/setup.stub | 7 - ext/zlib/tests/001.phpt | 17 - ext/zlib/tests/002.phpt | 17 - ext/zlib/tests/003.phpt | 16 - ext/zlib/zlib.c | 1299 -- ext/zlib/zlib.dsp | 113 - ext/zlib/zlib_fopen_wrapper.c | 104 - ext/zlib/zlib_win32_howto.txt | 16 - footer | 8 - genfiles | 23 - header | 18 - 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 | 264 - main/fopen_wrappers.c | 671 - main/fopen_wrappers.h | 96 - main/internal_functions.c.in | 51 - main/internal_functions_registry.h | 38 - main/internal_functions_win32.c | 109 - main/logos.h | 1059 -- main/main.c | 1428 -- main/mergesort.c | 356 - main/network.c | 396 - main/output.c | 644 - main/php.h | 360 - 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 | 382 - main/php_ini.h | 74 - main/php_logos.c | 98 - main/php_logos.h | 10 - main/php_main.h | 58 - main/php_network.h | 65 - main/php_open_temporary_file.c | 204 - main/php_open_temporary_file.h | 24 - main/php_output.h | 92 - main/php_realpath.c | 283 - main/php_reentrancy.h | 128 - main/php_regex.h | 45 - main/php_sprintf.c | 51 - main/php_streams.h | 109 - 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 | 905 -- main/rfc1867.h | 12 - main/safe_mode.c | 191 - main/safe_mode.h | 15 - main/snprintf.c | 949 -- main/snprintf.h | 44 - main/streams.c | 368 - main/strlcat.c | 86 - main/strlcpy.c | 83 - main/win95nt.h | 63 - makedist | 148 - makerpm | 155 - pear/Archive/Tar.php | 1111 -- pear/CMD.php | 286 - pear/CODING_STANDARDS | 8 - pear/Console/Getopt.php | 232 - pear/DB.php | 872 -- pear/HTTP.php | 172 - pear/ITX.xml | 21 - pear/Mail.php | 186 - pear/Makefile.in | 190 - pear/PEAR.php | 794 - pear/PEAR/Autoloader.php | 167 - pear/PEAR/Common.php | 430 - pear/PEAR/Config.php | 222 - pear/PEAR/Dependency.php | 247 - pear/PEAR/Installer.php | 363 - pear/PEAR/Packager.php | 162 - pear/PEAR/Registry.php | 187 - pear/PEAR/Remote.php | 124 - pear/PEAR/Uploader.php | 61 - pear/PEAR/WebInstaller.php | 631 - pear/README | 37 - pear/System.php | 354 - pear/TODO | 20 - pear/catalog | 1 - pear/install-pear.txt | 11 - pear/package.dtd | 81 - pear/pear.m4 | 89 - 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 | 9 - pear/scripts/pearcmd-install.php | 33 - pear/scripts/pearcmd-list.php | 20 - pear/scripts/pearcmd-package.php | 15 - pear/scripts/pearcmd-remote-list.php | 24 - pear/scripts/pearcmd-show-config.php | 16 - pear/scripts/pearcmd-uninstall.php | 26 - pear/scripts/pearize.in | 225 - pear/scripts/pearwin.php | 150 - pear/scripts/php-config.in | 26 - pear/scripts/phpextdist | 27 - pear/scripts/phpize.in | 31 - pear/scripts/phptar.in | 236 - pear/tests/pear1.phpt | 87 - pear/tests/pear_autoloader.phpt | 80 - pear/tests/pear_config.phpt | 72 - pear/tests/pear_error.phpt | 153 - pear/tests/pear_error2.phpt | 24 - pear/tests/pear_error3.phpt | 40 - pear/tests/pear_error4.phpt | 89 - pear/tests/pear_registry.phpt | 92 - pear/tests/php.ini | 2 - pear/tests/system.input | 1 - pear/tests/user.input | 0 php.gif | Bin 3872 -> 0 bytes php.ini-dist | 873 -- php.ini-recommended | 878 -- 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 | 605 - sapi/Makefile.in | 4 - sapi/README | 17 - sapi/aolserver/CREDITS | 2 - sapi/aolserver/Makefile.in | 5 - sapi/aolserver/README | 69 - sapi/aolserver/aolserver.c | 622 - sapi/aolserver/config.m4 | 34 - sapi/aolserver/php.sym | 2 - sapi/aolserver/php4aolserver.dsp | 135 - sapi/apache/CREDITS | 3 - sapi/apache/Makefile.in | 7 - sapi/apache/apMakefile.libdir | 4 - sapi/apache/apMakefile.tmpl | 77 - sapi/apache/config.m4 | 247 - 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/Makefile.in | 7 - sapi/apache2filter/README | 63 - sapi/apache2filter/apache_config.c | 164 - sapi/apache2filter/config.m4 | 61 - 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/Makefile.in | 5 - sapi/caudium/README | 16 - sapi/caudium/TODO | 30 - sapi/caudium/caudium.c | 838 - sapi/caudium/config.m4 | 100 - sapi/cgi/CREDITS | 2 - sapi/cgi/Makefile.in | 5 - sapi/cgi/cgi_main.c | 833 - sapi/cgi/config.m4 | 102 - sapi/cgi/getopt.c | 175 - sapi/cgi/php.sym | 0 sapi/cgi/php_getopt.h | 7 - sapi/cli/CREDITS | 2 - sapi/cli/Makefile.in | 28 - sapi/cli/config.m4 | 25 - sapi/cli/getopt.c | 175 - sapi/cli/php_cli.c | 625 - sapi/cli/php_getopt.h | 7 - sapi/fastcgi/CREDITS | 4 - sapi/fastcgi/Makefile.in | 5 - sapi/fastcgi/README.FastCGI | 17 - sapi/fastcgi/config.m4 | 26 - sapi/fastcgi/fastcgi.c | 579 - 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/Makefile.in | 5 - sapi/isapi/config.m4 | 28 - 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/Makefile.in | 5 - sapi/nsapi/config.m4 | 39 - sapi/nsapi/nsapi-readme.txt | 65 - sapi/nsapi/nsapi.c | 542 - sapi/nsapi/php4nsapi.dsp | 135 - sapi/phttpd/CREDITS | 2 - sapi/phttpd/Makefile.in | 5 - sapi/phttpd/README | 5 - sapi/phttpd/config.m4 | 26 - sapi/phttpd/php.sym | 4 - sapi/phttpd/php_phttpd.h | 24 - sapi/phttpd/phttpd.c | 312 - sapi/pi3web/CREDITS | 2 - sapi/pi3web/Makefile.in | 5 - sapi/pi3web/README | 50 - sapi/pi3web/config.m4 | 28 - sapi/pi3web/php.sym | 0 sapi/pi3web/php4pi3web.dsp | 136 - sapi/pi3web/pi3web_sapi.c | 467 - sapi/pi3web/pi3web_sapi.h | 96 - sapi/roxen/Makefile.in | 5 - sapi/roxen/README | 18 - sapi/roxen/TODO | 33 - sapi/roxen/config.m4 | 61 - sapi/roxen/roxen.c | 728 - sapi/servlet/CREDITS | 2 - sapi/servlet/EXPERIMENTAL | 5 - sapi/servlet/Makefile.in | 30 - sapi/servlet/README | 122 - sapi/servlet/config.m4 | 50 - 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 | 212 - sapi/servlet/sessions.php | 60 - sapi/servlet/web.xml | 40 - sapi/thttpd/CREDITS | 2 - sapi/thttpd/Makefile.in | 5 - sapi/thttpd/README | 59 - sapi/thttpd/config.m4 | 28 - 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/Makefile.in | 5 - sapi/tux/README | 86 - sapi/tux/config.m4 | 19 - sapi/tux/php.sym | 2 - sapi/tux/php_tux.c | 429 - sapi/webjames/CREDITS | 2 - sapi/webjames/Makefile.in | 5 - sapi/webjames/README | 32 - sapi/webjames/config.m4 | 24 - sapi/webjames/php_webjames.h | 28 - sapi/webjames/webjames.c | 339 - 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 | 24 - 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 | 10 - tests/basic/003.phpt | 12 - tests/basic/004.phpt | 11 - tests/basic/005.phpt | 11 - 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/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 | 13 - 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/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 | 1747 --- win32/php4dllts.dsp | 2041 --- win32/php4ts.dsp | 167 - win32/php4ts.dsw | 220 - win32/php4ts_cli.dsp | 167 - win32/php5ts.dsw | 220 - win32/php_modules.dsw | 569 - 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 - 1862 files changed, 460167 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.in 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.Zeus delete mode 100644 RELEASE_PROCESS delete mode 100644 TODO delete mode 100644 TODO-4.2.txt 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 acconfig.h.in delete mode 100644 acinclude.m4 delete mode 100644 apidoc-zend.txt delete mode 100644 apidoc.txt delete mode 100755 build/bsd_makefile delete mode 100644 build/build.mk delete mode 100644 build/build2.mk delete mode 100755 build/buildcheck.sh delete mode 100644 build/dynlib.mk delete mode 100755 build/fastgen.sh delete mode 100644 build/genif.sh delete mode 100644 build/library.mk delete mode 100644 build/ltlib.mk 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 build/sysv_makefile 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 dynlib.m4 delete mode 100644 ext/Makefile.in delete mode 100644 ext/aspell/CREDITS delete mode 100644 ext/aspell/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/bcmath/setup.stub delete mode 100644 ext/calendar/CREDITS delete mode 100644 ext/calendar/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/dba/setup.stub delete mode 100644 ext/dbase/CREDITS delete mode 100644 ext/dbase/Makefile.in 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/dbase/setup.stub delete mode 100644 ext/dbplus/CREDITS delete mode 100644 ext/dbplus/EXPERIMENTAL delete mode 100644 ext/dbplus/Makefile.in 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/Makefile.in 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/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/Makefile.in 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/Makefile.in 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/Makefile.in delete mode 100644 ext/exif/config.m4 delete mode 100644 ext/exif/exif.c delete mode 100644 ext/exif/exif.dsp delete mode 100644 ext/exif/php_exif.h delete mode 100755 ext/ext_skel delete mode 100644 ext/fbsql/CREDITS delete mode 100644 ext/fbsql/Makefile.in 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/Makefile.in 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/fdf/setup.stub delete mode 100644 ext/filepro/CREDITS delete mode 100644 ext/filepro/Makefile.in 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/filepro/setup.stub delete mode 100644 ext/fribidi/CREDITS delete mode 100644 ext/fribidi/Makefile.in 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/Makefile.in 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/Makefile.in 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/gd/setup.stub delete mode 100644 ext/gettext/CREDITS delete mode 100644 ext/gettext/Makefile.in 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/gettext/setup.stub delete mode 100644 ext/gmp/CREDITS delete mode 100644 ext/gmp/Makefile.in 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/hyperwave/CREDITS delete mode 100644 ext/hyperwave/Makefile.in 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/hyperwave/setup.stub delete mode 100644 ext/icap/CREDITS delete mode 100644 ext/icap/Makefile.in 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/skipif.inc delete mode 100644 ext/imap/CREDITS delete mode 100644 ext/imap/IMAP_Win32_HOWTO.txt delete mode 100644 ext/imap/Makefile.in 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/imap/setup.stub delete mode 100644 ext/informix/CREDITS delete mode 100644 ext/informix/Makefile.in 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/setup.stub 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/Makefile.in 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/Makefile.in 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/setup.stub 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/Makefile.in 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/ldap/setup.stub delete mode 100644 ext/mailparse/CREDITS delete mode 100644 ext/mailparse/EXPERIMENTAL delete mode 100644 ext/mailparse/Makefile.in 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/Makefile.in delete mode 100644 ext/mbstring/README_PHP3-i18n-ja delete mode 100644 ext/mbstring/config.m4 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/mcal/CREDITS delete mode 100644 ext/mcal/Makefile.in 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/Makefile.in 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/setup.stub delete mode 100644 ext/mcrypt/tests/001.phpt delete mode 100644 ext/mhash/CREDITS delete mode 100644 ext/mhash/Makefile.in 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/mhash/setup.stub delete mode 100644 ext/ming/CREDITS delete mode 100644 ext/ming/EXPERIMENTAL delete mode 100644 ext/ming/Makefile.in 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/Makefile.in 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/mnogosearch/setup.stub delete mode 100644 ext/msession/CREDITS delete mode 100644 ext/msession/Makefile.in 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/Makefile.in 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/msql/setup.stub 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/muscat/EXPERIMENTAL delete mode 100644 ext/muscat/LICENSE delete mode 100644 ext/muscat/LICENSE.about delete mode 100644 ext/muscat/Makefile.in delete mode 100644 ext/muscat/config.m4 delete mode 100644 ext/muscat/muscat.c delete mode 100644 ext/muscat/muscat.php delete mode 100644 ext/muscat/muscat_handles.h delete mode 100644 ext/muscat/muscat_net.c delete mode 100644 ext/muscat/muscat_net.h delete mode 100644 ext/muscat/php_muscat.h delete mode 100644 ext/mysql/CREDITS delete mode 100644 ext/mysql/Makefile.in delete mode 100644 ext/mysql/config.m4 delete mode 100644 ext/mysql/libmysql/Makefile.in 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/mysql/setup.stub delete mode 100644 ext/ncurses/CREDITS delete mode 100644 ext/ncurses/EXPERIMENTAL delete mode 100644 ext/ncurses/Makefile.in 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/Makefile.in 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/oci8/setup.stub delete mode 100644 ext/odbc/CREDITS delete mode 100644 ext/odbc/Makefile.in delete mode 100644 ext/odbc/config.m4 delete mode 100644 ext/odbc/php_odbc.c delete mode 100644 ext/odbc/php_odbc.h delete mode 100644 ext/odbc/php_velocis.h delete mode 100644 ext/odbc/setup.stub delete mode 100644 ext/odbc/velocis.c delete mode 100644 ext/openssl/CREDITS delete mode 100644 ext/openssl/EXPERIMENTAL delete mode 100644 ext/openssl/Makefile.in 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/Makefile.in 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/oracle/setup.stub delete mode 100644 ext/overload/CREDITS delete mode 100644 ext/overload/EXPERIMENTAL delete mode 100644 ext/overload/Makefile.in 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/Makefile.in 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/ovrimos/setup.stub delete mode 100644 ext/pcntl/CREDITS delete mode 100644 ext/pcntl/EXPERIMENTAL delete mode 100644 ext/pcntl/Makefile.in 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/Makefile.in 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/Makefile.in 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/pcre/setup.stub delete mode 100644 ext/pdf/CREDITS delete mode 100644 ext/pdf/Makefile.in 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/pdf/setup.stub delete mode 100644 ext/pfpro/CREDITS delete mode 100644 ext/pfpro/Makefile.in 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/Makefile.in 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/setup.stub 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/readline/setup.stub delete mode 100644 ext/recode/CREDITS delete mode 100644 ext/recode/Makefile.in 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/recode/setup.stub 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_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/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/xmlrpc/CREDITS delete mode 100644 ext/rpc/xmlrpc/EXPERIMENTAL delete mode 100644 ext/rpc/xmlrpc/Makefile.in delete mode 100644 ext/rpc/xmlrpc/config.m4 delete mode 100644 ext/rpc/xmlrpc/libxmlrpc/Makefile.in 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/Makefile.in delete mode 100644 ext/satellite/README delete mode 100644 ext/satellite/class.c delete mode 100644 ext/satellite/class.h delete mode 100644 ext/satellite/common.c delete mode 100644 ext/satellite/common.h delete mode 100644 ext/satellite/config.m4 delete mode 100644 ext/satellite/corba.c delete mode 100644 ext/satellite/corba.h delete mode 100644 ext/satellite/enum.c delete mode 100644 ext/satellite/enum.h delete mode 100644 ext/satellite/findtype.c delete mode 100644 ext/satellite/findtype.h delete mode 100644 ext/satellite/hashtable.c delete mode 100644 ext/satellite/hashtable.h delete mode 100644 ext/satellite/multiple_components.patch delete mode 100644 ext/satellite/namedvalue_to_zval.c delete mode 100644 ext/satellite/namedvalue_to_zval.h delete mode 100644 ext/satellite/object.c delete mode 100644 ext/satellite/object.h delete mode 100644 ext/satellite/php_orbit.c delete mode 100644 ext/satellite/php_orbit.h delete mode 100644 ext/satellite/struct.c delete mode 100644 ext/satellite/struct.h delete mode 100644 ext/satellite/tests/001.phpt delete mode 100644 ext/satellite/tests/002.phpt delete mode 100644 ext/satellite/tests/003.phpt delete mode 100644 ext/satellite/tests/004.phpt delete mode 100644 ext/satellite/tests/005.phpt delete mode 100644 ext/satellite/tests/random.idl delete mode 100644 ext/satellite/typecode.c delete mode 100644 ext/satellite/typecode.h delete mode 100644 ext/satellite/typemanager.c delete mode 100644 ext/satellite/typemanager.h delete mode 100644 ext/satellite/zval_to_namedvalue.c delete mode 100644 ext/satellite/zval_to_namedvalue.h delete mode 100644 ext/session/CREDITS delete mode 100644 ext/session/Makefile.in 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/setup.stub 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/shmop/CREDITS delete mode 100644 ext/shmop/Makefile.in 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/setup.stub 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/Makefile.in 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/Makefile.in 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.in 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/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/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/Makefile.in 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/Makefile.in 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/setup.stub delete mode 100644 ext/sybase_ct/CREDITS delete mode 100644 ext/sybase_ct/Makefile.in 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/setup.stub delete mode 100644 ext/sybase_ct/sybase_ct.dsp delete mode 100644 ext/sysvsem/CREDITS delete mode 100644 ext/sysvsem/Makefile.in delete mode 100644 ext/sysvsem/config.m4 delete mode 100644 ext/sysvsem/php_sysvsem.h delete mode 100644 ext/sysvsem/setup.stub delete mode 100644 ext/sysvsem/sysvsem.c delete mode 100644 ext/sysvshm/CREDITS delete mode 100644 ext/sysvshm/Makefile.in delete mode 100644 ext/sysvshm/config.m4 delete mode 100644 ext/sysvshm/php_sysvshm.h delete mode 100644 ext/sysvshm/setup.stub delete mode 100644 ext/sysvshm/sysvshm.c delete mode 100644 ext/vpopmail/CREDITS delete mode 100644 ext/vpopmail/EXPERIMENTAL delete mode 100644 ext/vpopmail/Makefile.in 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/Makefile.in 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/Makefile.in delete mode 100644 ext/xml/config.m4 delete mode 100644 ext/xml/expat/Changes delete mode 100644 ext/xml/expat/Makefile.in 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/Makefile.in delete mode 100644 ext/xmlrpc/config.m4 delete mode 100644 ext/xmlrpc/libxmlrpc/Makefile.in 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/Makefile.in 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/Makefile.in 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/setup.stub delete mode 100644 ext/yaz/yaz.dsp delete mode 100644 ext/yp/CREDITS delete mode 100644 ext/yp/Makefile.in delete mode 100644 ext/yp/config.m4 delete mode 100644 ext/yp/php_yp.h delete mode 100644 ext/yp/setup.stub delete mode 100644 ext/yp/yp.c delete mode 100644 ext/zip/CREDITS delete mode 100644 ext/zip/Makefile.in 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/Makefile.in delete mode 100644 ext/zlib/config0.m4 delete mode 100644 ext/zlib/php_zlib.h delete mode 100644 ext/zlib/setup.stub 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/internal_functions_win32.c 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.in delete mode 100644 pear/PEAR.php delete mode 100644 pear/PEAR/Autoloader.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/TODO 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/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/php.ini delete mode 100644 pear/tests/system.input delete mode 100644 pear/tests/user.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/Makefile.in delete mode 100644 sapi/README delete mode 100644 sapi/aolserver/CREDITS delete mode 100644 sapi/aolserver/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/php.sym delete mode 100644 sapi/cgi/php_getopt.h delete mode 100644 sapi/cli/CREDITS delete mode 100644 sapi/cli/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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.in 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/Makefile.in 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/Makefile.in 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/Makefile.in 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 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/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/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/php4dllts.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 f2b675c80e..0000000000 --- a/CODING_STANDARDS +++ /dev/null @@ -1,220 +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. - - -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 345084885c..0000000000 --- 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 19d5f0846c..0000000000 --- a/ChangeLog +++ /dev/null @@ -1,1513 +0,0 @@ -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 9d92dda73f..0000000000 Binary files a/ChangeLog.1999.gz and /dev/null differ diff --git a/ChangeLog.2000.gz b/ChangeLog.2000.gz deleted file mode 100644 index 91cd3b2425..0000000000 Binary files a/ChangeLog.2000.gz and /dev/null differ diff --git a/ChangeLog.2001.gz b/ChangeLog.2001.gz deleted file mode 100644 index 4f0a6f8241..0000000000 Binary files a/ChangeLog.2001.gz and /dev/null differ diff --git a/EXTENSIONS b/EXTENSIONS deleted file mode 100644 index e725cdf3ca..0000000000 --- a/EXTENSIONS +++ /dev/null @@ -1,462 +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 -------------------------------------------------------------------------------- -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: Andreas Karajannis -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 -MAINTENANCE: Unknown -STATUS: Unknown -SINCE: 4.0.1 -------------------------------------------------------------------------------- -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: Sascha Schumann -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 2d1f8eb68a..0000000000 --- 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 af5b01c49a..0000000000 --- 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.in b/Makefile.in deleted file mode 100644 index e2168a0ff6..0000000000 --- a/Makefile.in +++ /dev/null @@ -1,63 +0,0 @@ - -ZEND_DIR = $(srcdir)/Zend -SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) $(CLI_DIR) . $(PEAR_DIR) - -LTLIBRARY_NAME = libphp4.la -LTLIBRARY_SOURCES = stub.c - -LTLIBRARY_DEPENDENCIES = \ - Zend/libZend.la \ - sapi/$(PHP_SAPI)/libsapi.la \ - main/libmain.la \ - $(REGEX_LIB) \ - $(EXT_LTLIBS) \ - $(TSRM_LIB) - -LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) -LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) - -PROGRAM_NAME = php -PROGRAM_SOURCES = stub.c -PROGRAM_LDADD = libphp4.la $(EXT_PROGRAM_LDADD) -PROGRAM_LDFLAGS = -export-dynamic -PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD) - -targets = $(LTLIBRARY_NAME) $(PHP_PROGRAM) - -install_targets = install-sapi install-modules - -include $(top_srcdir)/build/rules.mk -include $(top_srcdir)/build/library.mk -include $(top_srcdir)/build/program.mk - -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)$(moduledir) && \ - echo "installing shared modules into $(moduledir)" && \ - rm -f modules/*.la && \ - cp modules/* $(INSTALL_ROOT)$(moduledir) >/dev/null 2>&1 || true - -install-tester: - @echo "Installing regression tester" - @$(mkinstalldirs) $(PEAR_INSTALLDIR) - @$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR) - -install-pear: install-modules - (cd pear && $(MAKE) install) - -install-su: install-pear install-tester - -.NOEXPORT: diff --git a/NEWS b/NEWS deleted file mode 100644 index fbdd90c132..0000000000 --- a/NEWS +++ /dev/null @@ -1,1824 +0,0 @@ -PHP 4 NEWS -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 200?, Version 4.2.0-dev -- 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 return a highlighted string instead of dumping - to standard output. (Derick) -- Added EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags to extract() - EXTR_IF_EXISTS only extracts a variable if it already exists - EXTR_PREFIX_IF_EXISTS only extracts the variable if it exists and - then it prepends the prefix to it. ie. if $PATH exists then - extract($_ENV,EXTR_PREFIX_IF_EXISTS,'e') would result in $e_PATH - This lets you do $a = $b = $c = true; extract($_REQUEST,EXTR_IF_EXISTS); - and you only get the global request variables you have defined imported - into your symbol table. (Rasmus) -- Fixed pg_pconnect(). It catches broken connection and reconnects to PostgreSQL - server always. When PostgreSQL is rebooted, web server reboot is not needed - to avoid errors. (Yasuo) -- Fix --enable-safe-mode. This configure option was not working. (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 (see http://exslt.org for details). To be - configured with --with-dom-exslt[=DIR] (and --with-dom-xslt) (chregu, jaroslaw) -- Don't touch any globals in session_unset() if register_globals is set - to 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) -- Update the XSLT extension to support Sablotron 0.8 (Petr Cimprich) -- Fixed a bug in preg_match()/preg_match_all() when matching strings containing - 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 second parameter to count() that can be used to specify either normal - or recursive counting. (patch by Vlad Bosinceanu ) -- Added mb_get_info() to get internal settings of mbstring. -- Added async query functions to PostgreSQL module (Yasuo) -- Added pg_copy_to()/pg_copy_from() for PostgreSQL module (Youichi, Yasuo) -- Added IPv6 support in FTP extension. (Stig Venaas) -- Added CLI (command line intrerface) sapi based on a cut-down version - of the CGI sapi which is more suited for writing shell scripts. Some of - the differences are: it prints no HTTP headers and it displays plain text - error messages. (Edin) -- Improve 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) -- Fix 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 ressource 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 which strips 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 a parameter to mysql_connect() to force a new database link to be - created. (Markus, Derick) -- Added ldap_sort() function. (Stig Venaas) -- Added md5_file(), which calculaties 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) -- New SAPI module for the WebJames server on RISC OS. (Alex Waugh) -- Made ldap_add (and 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) -- Fixed HTTP file upload support to handle big files better. (Jani) -- Added array_chunk() function that splits an array into chunks of specified - size. (Andrei) -- Fixed a bug which caused $HTTP_RAW_POST_DATA not to be populated on a missing - content-type even when always_populate_raw_post_data was On - fixed. (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) -- Have rand() and mt_rand() seed automatically if srand() or mt_srand() has - not been called. (Sterling) -- Added array_change_key_case() function that returns array with - 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' for settype(). (Jeroen) -- Added IPv6 support to gethostbyaddr(). - (Patch by Matthias Wimmer and venaas) -- Made the seed options to srand() and mt_srand() optional. If the seed is - not specified generate the most random seed possible. (Sterling) -- Fixed LONG_VARCHAR type crashing in ODBC extension. Patch by Walter Franzini. - (kalowsky) -- Made in_array() and search_array() 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 -- Added support for chinese encodings to htmlentities() and htmlspecialchars(). - (Patch by Alan Knowles and Wez) -- Improved support for autoconf-2.50+/libtool 1.4b+. (Jan Kneschke, Sascha) - -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) -- Enhance 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 c766837a87..0000000000 --- a/README.CVS-RULES +++ /dev/null @@ -1,105 +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 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 51e3b730e7..0000000000 --- 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 dae5b40098..0000000000 --- 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 1c6eea5200..0000000000 --- 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 d70d2e5d8b..0000000000 --- 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 1f2e9da770..0000000000 --- a/README.SELF-CONTAINED-EXTENSIONS +++ /dev/null @@ -1,174 +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: - - - Makefile template (Makefile.in) - - 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). - - -CREATING THE MAKEFILE TEMPLATE - - The Makefile Template (Makefile.in) contains three lines: - ------------------------------------------------------------------------------- -LTLIBRARY_SHARED_NAME = foobar.la -LTLIBRARY_SOURCES = foo.c bar.c - -include $(top_srcdir)/build/dynlib.mk ------------------------------------------------------------------------------- - - LTLIBRARY_SHARED_NAME specifies the name of the extension. - It must be of the form `ext-name.la'. - - LTLIBRARY_SOURCES specifies the names of the sources files. You can - name an arbitrary number of source files here. - - The final include directive includes the build rules (you usually - don't need to care about what happens there). rules.mk and other - files are installed by phpize which we will cover later. - - -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_EXTENSION(foobar, $ext_shared) -fi ------------------------------------------------------------------------------- - - PHP_ARG_ENABLE will automatically set the correct variables, so - that the extension will be enabled by PHP_EXTENSION in shared mode. - - 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 Makefile.in, config.m4 and the source files into one directory. - Then run phpize (this is installed during make install by PHP 4.0). - For example, if you configured PHP with --prefix=/php, you would run - - $ /php/bin/phpize - - This will automatically copy the necessary build files and create - configure from your config.m4. - - And that's it. You now have a self-contained extension. - -INSTALLING A SELF-CONTAINED EXTENSION - - An extension can be installed by running: - - $ ./configure \ - [--with-php-config=/path/to/php-config] - $ make install - -ADDING SHARED MODULE SUPPORT TO A MODULE - - In order to be useful, a self-contained extension must be loadable - as a shared module. I will explain now how you can add shared module - support to an existing module called foo. - - 1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will - automatically be able to use --with-foo=shared or - --enable-foo=shared. - - 2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable - building the extension. - - 3. Add the following line to Makefile.in: - - LTLIBRARY_SHARED_NAME = foo.la - - 4. 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 2ae89b7a51..0000000000 --- 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.Zeus b/README.Zeus deleted file mode 100644 index 0a2803c842..0000000000 --- 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 4e4d7f1936..0000000000 --- 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 c4ed690bb2..0000000000 --- a/TODO +++ /dev/null @@ -1,137 +0,0 @@ -Things to do or at least think about doing in the future. Name in -parenthesis means that person has taken on this project. - -Zend ----- - * allow foreach ($array as $k => &$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. - * 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 - * Add configure test to determine if dlsym() requires underscore and set - DLSYM_NEEDS_UNDERSCORE accordingly. Perl and zsh have it in configure, - for example. - -global ------- - * make everything on the language-level independent of your locale setings. - * make sure all source files have the "right" copyright. - * 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 - dependices. (eg ftp) - * --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?). - * on some platforms unimplemented function will just do nothing (e.g. symlink) - they should print a warning or not even be defined! - * implement javadoc based function docs template system. - * use thread-safe resolver functions (either require BIND 8 or adns). - * provide optional IPv6 support. - * make SAPI conform to CGI/1.1. Currently, all SAPI modules - define REMOTE_ADDR etc. themselves and reach only various level - of compliance. - * 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. - * add aliases to functions to conform to new naming conventions, e.g. - str_to_upper(). - * see what functions might need to be changed to use HashPosition, so - that the internal array pointer is not affected. - -documentation -------------- - * add remarks in the documentation which functions are not implemented on win32. - * add remarks in the documentation which functions are not binary-safe. - * improve documentation for the sablotron extension - * update curl documentation - * write documentation for the bzip2 extension - * write documentation for the zziplib 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/dav --------- - * rewrite. - -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 - * add option to preg_grep() to return entries that _don't_ match - -ext/sablot ----------- - * Re-write the error handling and reporting interface - * Cleanup the underlying code a bit - * Add proper support for the message handlers - -ext/session ------------ - * 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 classname 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(). - * array_add(). (Andrei) - * 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 useable 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 datatypes: - dateTime - binary - recordset - - 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-4.2.txt b/TODO-4.2.txt deleted file mode 100644 index 81e0b0d4e6..0000000000 --- a/TODO-4.2.txt +++ /dev/null @@ -1,33 +0,0 @@ -* 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). - -* Move most extensions and PEAR packages out of the PHP CVS tree, - include them again during release packaging. - -* Renaming functions, so that they all are conform to one standard form. - -* Allow foreach($array as $key => &$value). - -* Allow foreach($array as list($var1, $var2)). - -* Clean up "$instance = &new object" syntax (default to the =& behaviour?). - -* Allow to set a default value for call-by-reference-parameters. eg: - function hallo (&$pallo = NULL) {} - -* Change PHP error messages, so that they point to pages or sections in the - PHP Manual. - -* Fix Zend shallow copy issues with objects and arrays. - -* Make all extensions thread-safe. - -* 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. - -* Using arg_separator.input to implode args in the CGI sapi extension - and arg_separator.input to explode in php_build_argv(). diff --git a/TSRM/LICENSE b/TSRM/LICENSE deleted file mode 100644 index 8d208476e4..0000000000 --- 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 91e585b65c..0000000000 --- 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 82b4fedfde..0000000000 --- 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 65447c6df0..0000000000 --- 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 1a5693f5a2..0000000000 --- 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 374e8ff2fc..0000000000 --- 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 - -#ifdef HAVE_CONFIG_H -# 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 2b94cf35e7..0000000000 --- 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 1953172aef..0000000000 --- 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 aac1a8b982..0000000000 --- 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 fe8dee6f76..0000000000 --- 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 acfdd00b35..0000000000 --- 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 b0f1ad9e6f..0000000000 --- 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 e0f934e556..0000000000 --- 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 61462f1f96..0000000000 --- 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 405d8c7c8f..0000000000 --- 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 add5a50fa5..0000000000 --- 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 e9ad26a7ac..0000000000 --- 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 8c9e8198e7..0000000000 --- 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 ae8efd93e4..0000000000 --- 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 52afebe0da..0000000000 --- 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 09999af69e..0000000000 --- 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 7931beafc4..0000000000 --- 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/acconfig.h.in b/acconfig.h.in deleted file mode 100644 index f87979c2fd..0000000000 --- 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 96ee42f354..0000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,1194 +0,0 @@ -dnl $Id$ -dnl -dnl This file contains local autoconf functions. - -sinclude(dynlib.m4) - -dnl -dnl Disable building CLI -dnl -AC_DEFUN(PHP_DISABLE_CLI,[ - disable_cli=1 -]) - -dnl -dnl Separator into the configure --help display. -dnl -AC_DEFUN(PHP_HELP_SEPARATOR,[ -AC_ARG_ENABLE([],[ -$1 -],[]) -]) - -dnl -dnl PHP_TARGET_RDYNAMIC -dnl -dnl Checks whether -rdynamic is supported by the compiler. This -dnl is necessary for some targets to populate the global symbol -dnl table. Otherwise, dynamic modules would not be able to resolve -dnl PHP-related symbols. -dnl -dnl If successful, adds -rdynamic to PHP_LDFLAGS. -dnl -AC_DEFUN(PHP_TARGET_RDYNAMIC,[ - if test -n "$GCC"; then - dnl we should use a PHP-specific macro here - TSRM_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) - if test "$gcc_rdynamic" = "yes"; then - PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic" - fi - fi -]) - -AC_DEFUN(PHP_REMOVE_USR_LIB,[ - unset ac_new_flags - for i in [$]$1; do - case [$]i in - -L/usr/lib|-L/usr/lib/) ;; - *) ac_new_flags="[$]ac_new_flags [$]i" ;; - esac - done - $1=[$]ac_new_flags -]) - -AC_DEFUN(PHP_SETUP_OPENSSL,[ - if test "$PHP_OPENSSL" = "no"; then - PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl" - fi - - for i in $PHP_OPENSSL; do - if test -r $i/include/openssl/evp.h; then - OPENSSL_DIR=$i - OPENSSL_INC=$i/include - fi - done - - if test -z "$OPENSSL_DIR"; then - AC_MSG_ERROR([Cannot find OpenSSL's ]) - 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,[ -case [$]$1 in -shared,*) - ext_output="yes, shared" - ext_shared=yes - $1=`echo "[$]$1"|sed 's/^shared,//'` - ;; -shared) - ext_output="yes, shared" - ext_shared=yes - $1=yes - ;; -no) - ext_output=no - ext_shared=no - ;; -*) - ext_output=yes - ext_shared=no - ;; -esac - -if test "$php_always_shared" = "yes"; then - ext_output="yes, shared" - ext_shared=yes - test "[$]$1" = "no" && $1=yes -fi - -if test -n "$2"; then - AC_MSG_RESULT([$ext_output]) -fi -]) - -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,[ -if test -n "$2"; then - AC_MSG_CHECKING([$2]) -fi -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,[ -if test -n "$2"; then - AC_MSG_CHECKING([$2]) -fi -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_FAST_OUTPUT,[ - PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $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_GEN_CONFIG_VARS,[ - PHP_MKDIR_P_CHECK - echo creating config_vars.mk - > config_vars.mk - for i in $PHP_VAR_SUBST; do - eval echo "$i = \$$i" >> config_vars.mk - done -]) - -AC_DEFUN(PHP_GEN_MAKEFILES,[ - $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1 -]) - -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_target=shared -]) - -dnl -dnl PHP_BUILD_STATIC -dnl -AC_DEFUN(PHP_BUILD_STATIC,[ - php_build_target=static -]) - -dnl -dnl PHP_BUILD_PROGRAM -dnl -AC_DEFUN(PHP_BUILD_PROGRAM,[ - 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(AM_SET_LIBTOOL_VARIABLE,[ - LIBTOOL='$(SHELL) $(top_builddir)/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 - REGEX_LIB=regex/libregex.la - REGEX_DIR=regex - AC_DEFINE(HSREGEX,1,[ ]) - AC_DEFINE(REGEX,1,[ ]) - PHP_FAST_OUTPUT(regex/Makefile) -elif test "$REGEX_TYPE" = "system"; then - AC_DEFINE(REGEX,0,[ ]) -fi - -AC_MSG_CHECKING([which regex library to use]) -AC_MSG_RESULT([$REGEX_TYPE]) - -PHP_SUBST(REGEX_DIR) -PHP_SUBST(REGEX_LIB) -PHP_SUBST(HSREGEX) -]) - -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 -dnl PHP_EXTENSION(extname [, shared [,sapi_class]]) -dnl -dnl Includes an extension in the build. -dnl -dnl "extname" is the name of the ext/ subdir where the extension resides -dnl "shared" can be set to "shared" or "yes" to build the extension as -dnl a dynamically loadable library. Optional parameter "sapi_class" can -dnl be set to "cli" to mark extension build only with CLI or CGI sapi's. -dnl If "nocli" is passed the extension will be built only with a non-cli -dnl sapi. -dnl -AC_DEFUN(PHP_EXTENSION,[ - EXT_SUBDIRS="$EXT_SUBDIRS $1" - - if test -d "$abs_srcdir/ext/$1"; then -dnl ---------------------------------------------- Internal Module - ext_builddir=ext/$1 - ext_srcdir=$abs_srcdir/ext/$1 - else -dnl ---------------------------------------------- External Module - ext_builddir=. - ext_srcdir=$abs_srcdir - fi - - if test "$2" != "shared" && test "$2" != "yes" && test "$3" != "cli"; then -dnl ---------------------------------------------- Static module - LIB_BUILD($ext_builddir) - EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" - EXT_STATIC="$EXT_STATIC $1" - if test "$3" != "nocli"; then - EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" - EXT_CLI_STATIC="$EXT_CLI_STATIC $1" - fi - else - if test "$2" = "shared" || test "$2" = "yes"; then -dnl ---------------------------------------------- Shared module - LIB_BUILD($ext_builddir,yes) - AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module) - fi - fi - - if test "$2" != "shared" && test "$2" != "yes" && test "$3" = "cli"; then -dnl ---------------------------------------------- CLI only static module - LIB_BUILD($ext_builddir) - if test "$PHP_SAPI" = "cgi"; then - EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" - EXT_STATIC="$EXT_STATIC $1" - fi - EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la" - EXT_CLI_STATIC="$EXT_CLI_STATIC $1" - fi - - PHP_FAST_OUTPUT($ext_builddir/Makefile) -]) - -dnl -dnl Solaris requires main code to be position independent in order -dnl to let shared objects find symbols. Weird. Ugly. -dnl -dnl Must be run after all --with-NN options that let the user -dnl choose dynamic extensions, and after the gcc test. -dnl -AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[ - AC_MSG_CHECKING([whether -fPIC is required]) - if test -n "$EXT_SHARED"; then - os=`uname -sr 2>/dev/null` - case $os in - "SunOS 5.6"|"SunOS 5.7") - case $CC in - gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; - *) CFLAGS="$CFLAGS -fpic";; - esac - AC_MSG_RESULT([yes]);; - *) - AC_MSG_RESULT([no]);; - esac - else - AC_MSG_RESULT([no]) - fi -]) - -dnl -dnl 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,[ - case $withval in - shared) - shared=yes - withval=yes - ;; - shared,*) - shared=yes - withval=`echo $withval | sed -e 's/^shared,//'` - ;; - *) - shared=no - ;; - esac - if test -n "$php_always_shared"; then - shared=yes - fi -]) - -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(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH], $@)]) -AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY], $@)]) -AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH], $@)]) -AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE], $@)]) - -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 0add45301b..0000000000 --- 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 34eac2896c..0000000000 --- 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/bsd_makefile b/build/bsd_makefile deleted file mode 100755 index 6b443b2639..0000000000 --- a/build/bsd_makefile +++ /dev/null @@ -1,34 +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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -# cwd must be top_srcdir -test -f build/bsd_makefile || exit 2 - -test -f bsd_converted && exit 0 - -tmpfile=`mktemp /tmp/bsd_makefile.XXXXXX 2>/dev/null` || tmpfile="tmp.$$" -for i in build/*.mk; do - sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \ - && cp $tmpfile $i -done -rm -f $tmpfile - -touch bsd_converted -exit 0 diff --git a/build/build.mk b/build/build.mk deleted file mode 100644 index ae5246ea97..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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 fb27f3169a..0000000000 --- a/build/build2.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. | -# +----------------------------------------------------------------------+ -# | Authors: 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) $(makefile_in_files) configure $(config_h_in) - - -all: Zend/Makefile.am TSRM/Makefile.am $(targets) - -Zend/Makefile.am: - test -d Zend || (test -d ../Zend && ln -s ../Zend Zend) - -TSRM/Makefile.am: - test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM) - -acconfig.h: $(acconfig_h_SOURCES) - @echo rebuilding $@ - cat $(acconfig_h_SOURCES) > $@ - -$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files) - @echo rebuilding Makefile templates - @for i in $(LT_TARGETS); do \ - if test -f "$$i"; then \ - mv $$i $$i.bak; \ - cp $$i.bak $$i; \ - fi; \ - done - @test -f want_dependencies || flag=-i; \ - automake -a $$flag $(AMFLAGS) $(makefile_files) 2>&1 | $(SUPPRESS_WARNINGS) - @for i in $(LT_TARGETS); do mv $$i.bak $$i; done - -aclocal.m4: configure.in acinclude.m4 dynlib.m4 - aclocal 2>&1 | $(SUPPRESS_WARNINGS) - -SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times)'||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) - -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 9f8a499f7d..0000000000 --- a/build/buildcheck.sh +++ /dev/null @@ -1,92 +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.14 2002-01-24 23:31:45 markonen 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/dynlib.mk b/build/dynlib.mk deleted file mode 100644 index 7df8fc1795..0000000000 --- a/build/dynlib.mk +++ /dev/null @@ -1,24 +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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -all: all-recursive - -include $(builddir)/libs.mk - -include $(top_srcdir)/build/rules.mk diff --git a/build/fastgen.sh b/build/fastgen.sh deleted file mode 100755 index 78742c4497..0000000000 --- a/build/fastgen.sh +++ /dev/null @@ -1,80 +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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id: fastgen.sh,v 1.13 2001-12-11 15:28:53 sebastian Exp $ -# - -if test "$#" = "0"; then - echo "Usage: fastgen.sh " -fi - -srcdir=$1 -shift - -mkdir_p=$1 -shift - -bsd_makefile=$1 -shift - -top_srcdir=`(cd $srcdir; pwd)` -top_builddir=`pwd` - -if test "$mkdir_p" = "yes"; then - mkdir_p="mkdir -p" -else - mkdir_p="$top_srcdir/build/shtool mkdir -p" -fi - -if test "$bsd_makefile" = "yes"; then - (cd $top_srcdir; ./build/bsd_makefile) - - for makefile in $@; do - echo "fastgen.sh: creating $makefile" - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - $mkdir_p "$dir/" - - cat - $top_srcdir/$makefile.in <$makefile -top_srcdir = $top_srcdir -top_builddir = $top_builddir -srcdir = $top_srcdir/$dir -builddir = $top_builddir/$dir -VPATH = $top_srcdir/$dir -EOF - - test -z "$dir" && dir=. - touch $dir/.deps - done -else - for makefile in $@; do - echo "fastgen.sh: creating $makefile" - dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'` - $mkdir_p "$dir/" - - cat - $top_srcdir/$makefile.in <$makefile -top_srcdir = $top_srcdir -top_builddir = $top_builddir -srcdir = $top_srcdir/$dir -builddir = $top_builddir/$dir -VPATH = $top_srcdir/$dir -EOF - - test -z "$dir" && dir=. - touch $dir/.deps - done -fi diff --git a/build/genif.sh b/build/genif.sh deleted file mode 100644 index 947ec2ffaa..0000000000 --- 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/library.mk b/build/library.mk deleted file mode 100644 index 7eeafe7662..0000000000 --- a/build/library.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. | -# +----------------------------------------------------------------------+ -# | Authors: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) - -$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES) - $(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD) diff --git a/build/ltlib.mk b/build/ltlib.mk deleted file mode 100644 index 297b2849b4..0000000000 --- a/build/ltlib.mk +++ /dev/null @@ -1,24 +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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -targets = $(LTLIBRARY_NAME) - -include $(top_srcdir)/build/rules.mk -include $(top_srcdir)/build/library.mk - diff --git a/build/mkdep.awk b/build/mkdep.awk deleted file mode 100644 index 7728374bc6..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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 a4919fae87..0000000000 --- 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 92e8e97eb6..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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 e688aecd15..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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)/php - @if test "$(TESTS)" = ""; then \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(srcdir); \ - else \ - TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(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 8c51a37736..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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 fc21bd8dc5..0000000000 --- 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. | -# +----------------------------------------------------------------------+ -# | Authors: 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 4c1a7396fd..0000000000 --- a/build/shtool +++ /dev/null @@ -1,716 +0,0 @@ -#!/bin/sh -## -## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-2000 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.4.9 (16-Apr-2000) -## Ingredients: 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 Generate and 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.4.9 (16-Apr-2000)" - echo "Copyright (c) 1994-2000 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 '' - 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] [-i]' - echo ' [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' - echo '' - exit 0 -fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "GNU shtool 1.4.9 (16-Apr-2000)" - 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="" - 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 -fi - -## -## DISPATCH INTO SCRIPT BODY -## - -case $tool in - -echo ) - ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-2000 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 '%[uU]'`" != . ]; 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 host name - hostname='' - 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 - - # determine domain name - domainname='' - 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/%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-2000 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#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 - # (we do chmod last to preserve setuid bits) - 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 - ;; - -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-2000 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 ] && [ ".$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=$? - 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/build/sysv_makefile b/build/sysv_makefile deleted file mode 100755 index b9bd5a8c74..0000000000 --- a/build/sysv_makefile +++ /dev/null @@ -1,34 +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: Sascha Schumann | -# +----------------------------------------------------------------------+ -# -# $Id$ -# - -# cwd must be top_srcdir -test -f build/sysv_makefile || exit 2 - -test -f bsd_converted || exit 1 - -tmpfile=`mktemp /tmp/sysv_makefile.XXXXXX` || tmpfile="tmp.$$" -for i in build/*.mk; do - sed 's/^\.include "\(.*\)"/include \1/' $i >$tmpfile \ - && cp $tmpfile $i -done -rm -f $tmpfile - -rm bsd_converted -exit 0 diff --git a/buildconf b/buildconf deleted file mode 100755 index c3530e8614..0000000000 --- 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 28fcc5e22c..0000000000 --- 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 24794696d3..0000000000 --- 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 1abefb46d5..0000000000 --- a/configure.in +++ /dev/null @@ -1,1227 +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 -AM_INIT_AUTOMAKE(php, 4.2.0-dev, nodefine) -AM_CONFIG_HEADER(main/php_config.h) -AM_MAINTAINER_MODE - - - -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 -traditional-cpp";; -*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_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/* - -PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile) - - -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 -AM_PROG_CC_STDC -AC_PROG_CPP -AC_PROG_CXX -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=cgi -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) - -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 \ -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) - -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 - oldstyleextdir=no;; - *) - PHP_CONFIG_FILE_PATH=$libdir - oldstyleextdir=yes;; - esac -fi - -# compatibility -if test "x$with_pear" = "x" -a "x$enable_pear" = "xno"; 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 - PEAR_DIR=pear - PEAR_INSTALLDIR=$PHP_PEAR -fi - -if test "$PHP_PEAR" = "DEFAULT" -o "x$PHP_PEAR" = "xyes"; 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$ -# - - - -AC_DEFUN(LIB_SHARED_CONVENIENCE,[ - lib_target="\$(LTLIBRARY_NAME)" - cat >>$1<>$1<>$1<$lib_makefile<>$lib_makefile< -#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 ee3bc15457..0000000000 --- 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_EXTENSION(aspell) - 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 0b561d5ef1..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 7b4083ea13..0000000000 --- a/ext/bcmath/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -BC Math -Andi Gutmans diff --git a/ext/bcmath/Makefile.in b/ext/bcmath/Makefile.in deleted file mode 100644 index e57936fd81..0000000000 --- a/ext/bcmath/Makefile.in +++ /dev/null @@ -1,11 +0,0 @@ - -LTLIBRARY_NAME = libbcmath.la -LTLIBRARY_SOURCES = bcmath.c number.c -LTLIBRARY_SHARED_NAME = bcmath.la -LTLIBRARY_DEPENDENCIES = libbcmath/libbcmath.la -LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) -LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD) - -SUBDIRS = libbcmath - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c deleted file mode 100644 index e072c45a52..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 4d6e7bc028..0000000000 --- a/ext/bcmath/config.m4 +++ /dev/null @@ -1,14 +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_EXTENSION(bcmath, $ext_shared) - PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile) - LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes) - LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes) -fi diff --git a/ext/bcmath/libbcmath/AUTHORS b/ext/bcmath/libbcmath/AUTHORS deleted file mode 100644 index 982db9dc40..0000000000 --- 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 c4792dd27a..0000000000 --- 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 b8d459a2bb..0000000000 --- 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 6499b1cffb..0000000000 --- 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 8893a07827..0000000000 --- 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 e5be8201b3..0000000000 --- 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/Makefile.in b/ext/bcmath/libbcmath/Makefile.in deleted file mode 100644 index 0743bd7150..0000000000 --- a/ext/bcmath/libbcmath/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ - -LTLIBRARY_NAME = libbcmath.la -LTLIBRARY_DEPENDENCIES = src/libbcmath.la -LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) -LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD) - -SUBDIRS = src - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/bcmath/libbcmath/NEWS b/ext/bcmath/libbcmath/NEWS deleted file mode 100644 index 431d7b315d..0000000000 --- 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 cae5e5dc43..0000000000 --- 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 4d301dcacf..0000000000 --- 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 f23ba2904e..0000000000 --- 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 21cfb9255f..0000000000 --- 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 026fd039c7..0000000000 --- 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 3da89e949f..0000000000 --- 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 3f43f904be..0000000000 --- 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 fb974f1b4c..0000000000 --- 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 669b73ac58..0000000000 --- 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 ab74c882e9..0000000000 --- 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 e4b838ca92..0000000000 --- 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 cc8783edce..0000000000 --- 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 fab37d785e..0000000000 --- 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/Makefile.in b/ext/bcmath/libbcmath/src/Makefile.in deleted file mode 100644 index f4a235f94a..0000000000 --- a/ext/bcmath/libbcmath/src/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -LTLIBRARY_NAME = libbcmath.la -LTLIBRARY_SOURCES = add.c div.c init.c neg.c outofmem.c raisemod.c rt.c sub.c \ - compare.c divmod.c int2num.c num2long.c output.c recmul.c \ - sqrt.c zero.c debug.c doaddsub.c nearzero.c num2str.c raise.c \ - rmzero.c str2num.c - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c deleted file mode 100644 index 3b09af22b2..0000000000 --- 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 a6c7627b6b..0000000000 --- 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 2f094a6917..0000000000 --- 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 42c42a8948..0000000000 --- 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 ac1ee4ada7..0000000000 --- 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 e62817d00b..0000000000 --- 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 5458fc5dfc..0000000000 --- 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 4ff00b1102..0000000000 --- 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 34419c138f..0000000000 --- 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 ae16b65d8a..0000000000 --- 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 c864d77f1d..0000000000 --- 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 0a6e0836ad..0000000000 --- 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 c47ec9bbad..0000000000 --- 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 799a32d2ae..0000000000 --- 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 e41479d2d3..0000000000 --- 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 eaf4f444b2..0000000000 --- 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 5f2f03c208..0000000000 --- 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 cc9dd35a57..0000000000 --- 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 73f67af574..0000000000 --- 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 63f7a0cb79..0000000000 --- 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 2479104fe4..0000000000 --- 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 34b95b8898..0000000000 --- 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 210a7d89ea..0000000000 --- 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 2dd8eb5ecc..0000000000 --- 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 dce77ba4aa..0000000000 --- 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 d7959a100f..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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/bcmath/setup.stub b/ext/bcmath/setup.stub deleted file mode 100644 index c1cf263ef5..0000000000 --- a/ext/bcmath/setup.stub +++ /dev/null @@ -1,6 +0,0 @@ -# $Source$ -# $Id$ - -define_option enable-bcmath 'Enable bc style precision math functions' yesno \ - yes \ -' Enables bc style arbitrary precision math functions.' diff --git a/ext/calendar/CREDITS b/ext/calendar/CREDITS deleted file mode 100644 index a2904bd8b2..0000000000 --- a/ext/calendar/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Calendar -Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong diff --git a/ext/calendar/Makefile.in b/ext/calendar/Makefile.in deleted file mode 100644 index d3452efb26..0000000000 --- a/ext/calendar/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ - -LTLIBRARY_NAME = libcalendar.la -LTLIBRARY_SOURCES = calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c -LTLIBRARY_SHARED_NAME = calendar.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c deleted file mode 100644 index 46152d1c59..0000000000 --- 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 000918d7f1..0000000000 --- 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 96c3f96f68..0000000000 --- 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_EXTENSION(calendar, $ext_shared) -fi diff --git a/ext/calendar/dow.c b/ext/calendar/dow.c deleted file mode 100644 index 64ae008f77..0000000000 --- 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 0a2121e751..0000000000 --- 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 5b4dd53750..0000000000 --- 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 f48950901a..0000000000 --- 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 504f3c2d93..0000000000 --- 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 39bcbc7e65..0000000000 --- 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 73bc96aede..0000000000 --- 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 6621d13682..0000000000 --- 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 cc90a4653f..0000000000 --- a/ext/ccvs/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ccvs -Brendan W. McAdams, Doug DeJulio diff --git a/ext/ccvs/Makefile.in b/ext/ccvs/Makefile.in deleted file mode 100644 index 133e50c9c6..0000000000 --- a/ext/ccvs/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libccvs.la -LTLIBRARY_SOURCES = ccvs.c -LTLIBRARY_SHARED_NAME = ccvs.la -LTLIBRARY_SHARED_LIBADD = $(CCVS_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/ccvs/TODO b/ext/ccvs/TODO deleted file mode 100644 index ffcd7af4b2..0000000000 --- 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 1e57b6ca09..0000000000 --- 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 23119ce7bc..0000000000 --- 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 fd39e3e136..0000000000 --- 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_EXTENSION(ccvs, $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 2e7dd0e1b7..0000000000 --- a/ext/com/COM.c +++ /dev/null @@ -1,1850 +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)); - } - 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)); - } - 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 27bb7a0b21..0000000000 --- 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 6dccb556f8..0000000000 --- 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 2303481cee..0000000000 --- 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 99c17782df..0000000000 --- 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 358314f132..0000000000 --- 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 b8c534fa22..0000000000 --- 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 5c0155515b..0000000000 --- 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 54347461c8..0000000000 --- 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 3fd11f32e4..0000000000 --- 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 94cc1de43c..0000000000 --- a/ext/cpdf/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -cpdf -Uwe Steinmann diff --git a/ext/cpdf/Makefile.in b/ext/cpdf/Makefile.in deleted file mode 100644 index 7a74ccdba5..0000000000 --- a/ext/cpdf/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libcpdf.la -LTLIBRARY_SOURCES = cpdf.c - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/cpdf/config.m4 b/ext/cpdf/config.m4 deleted file mode 100644 index 4a0bec453d..0000000000 --- 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_EXTENSION(cpdf) - 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_EXTENSION(cpdf) - 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 66046dcae6..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 671482e134..0000000000 --- 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 48062fafeb..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 ab451cac09..0000000000 --- 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 6443e99646..0000000000 --- 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/Makefile.in b/ext/crack/Makefile.in deleted file mode 100644 index db85e885ec..0000000000 --- a/ext/crack/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libcrack.la -LTLIBRARY_SOURCES = crack.c -LTLIBRARY_SHARED_NAME = crack.la -LTLIBRARY_SHARED_LIBADD = $(CRACK_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/crack/config.m4 b/ext/crack/config.m4 deleted file mode 100644 index 8e01fcf46b..0000000000 --- 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/lib/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_EXTENSION(crack, $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 66deb04d3e..0000000000 --- a/ext/crack/crack.c +++ /dev/null @@ -1,270 +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: | - +----------------------------------------------------------------------+ - */ -/* $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) -{ - 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 3a6d313e27..0000000000 --- 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: | - +----------------------------------------------------------------------+ - */ - -/* $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 dc18ef5559..0000000000 --- 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 22de902709..0000000000 --- a/ext/ctype/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ctype -Hartmut Holzgraefe diff --git a/ext/ctype/Makefile.in b/ext/ctype/Makefile.in deleted file mode 100644 index 940398455b..0000000000 --- a/ext/ctype/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libctype.la -LTLIBRARY_SOURCES = ctype.c -LTLIBRARY_SHARED_NAME = ctype.la -LTLIBRARY_SHARED_LIBADD = $(CTYPE_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/ctype/README b/ext/ctype/README deleted file mode 100644 index 1e78a3d933..0000000000 --- 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 ba9ae62e17..0000000000 --- a/ext/ctype/config.m4 +++ /dev/null @@ -1,15 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_ENABLE(ctype, whether to enable ctype support, -[ --enable-ctype Enable ctype support]) - -if test "$PHP_CTYPE" != "no"; then - dnl If you will not be testing anything external, like existence of - dnl headers, libraries or functions in them, just uncomment the - dnl following line and you are ready to go. - AC_DEFINE(HAVE_CTYPE, 1, [ ]) - dnl Write more examples of tests here... - PHP_EXTENSION(ctype, $ext_shared) -fi diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c deleted file mode 100644 index f5b915a6f2..0000000000 --- a/ext/ctype/ctype.c +++ /dev/null @@ -1,313 +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: 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 - */ -static int ctype(int (*iswhat)(int), zval **c) -{ - switch (Z_TYPE_PP(c)) { - case IS_LONG: - return iswhat(Z_LVAL_PP(c)); - case IS_STRING: - { - char *p; - int n, len; - p=Z_STRVAL_PP(c); - len = Z_STRLEN_PP(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 5837b9b5d0..0000000000 --- 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 61c866ca74..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 da13514993..0000000000 --- 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 8ccc1c7f75..0000000000 --- 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 1e9f272a39..0000000000 --- a/ext/curl/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CURL -Sterling Hughes diff --git a/ext/curl/Makefile.in b/ext/curl/Makefile.in deleted file mode 100644 index 1e32fad8a2..0000000000 --- a/ext/curl/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ - -LTLIBRARY_NAME = libcurl.la -LTLIBRARY_SOURCES = curl.c -LTLIBRARY_SHARED_NAME = curl.la -LTLIBRARY_SHARED_LIBADD = $(CURL_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 deleted file mode 100644 index 29543baef3..0000000000 --- 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_EXTENSION(curl, $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 41f71b0a3a..0000000000 --- a/ext/curl/curl.c +++ /dev/null @@ -1,1090 +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; - ZEND_FETCH_RESOURCE(fp, FILE *, zvalue, -1, "File-Handle", php_file_le_fopen()); - 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 66095f0b8a..0000000000 --- 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 de4e1ca170..0000000000 --- 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 d9f4491a66..0000000000 --- a/ext/cybercash/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -CyberCash -Evan Klinger diff --git a/ext/cybercash/Makefile.in b/ext/cybercash/Makefile.in deleted file mode 100644 index 99ab73a904..0000000000 --- a/ext/cybercash/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libcybercash.la -LTLIBRARY_SOURCES = cybercash.c - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/cybercash/config.m4 b/ext/cybercash/config.m4 deleted file mode 100644 index 439b7026a0..0000000000 --- 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_EXTENSION(cybercash) - 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 0a28964ea1..0000000000 --- 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 83c47e1913..0000000000 --- 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 d52e5da6b1..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 fa183ff93b..0000000000 --- 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 2e5f3955ee..0000000000 --- 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/Makefile.in b/ext/cybermut/Makefile.in deleted file mode 100644 index 6344d0f4d1..0000000000 --- a/ext/cybermut/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libcybermut.la -LTLIBRARY_SOURCES = cybermut.c -LTLIBRARY_SHARED_NAME = cybermut.la -LTLIBRARY_SHARED_LIBADD = $(CYBERMUT_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/cybermut/config.m4 b/ext/cybermut/config.m4 deleted file mode 100644 index cfd56c5a38..0000000000 --- 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_EXTENSION(cybermut, $ext_shared) -fi diff --git a/ext/cybermut/cybermut.c b/ext/cybermut/cybermut.c deleted file mode 100644 index fe97ff6782..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 fabc94b5b2..0000000000 --- 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 10958ab321..0000000000 --- a/ext/cybermut/php_cybermut.h +++ /dev/null @@ -1,73 +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: 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 9fb02fd784..0000000000 --- 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 74371fa716..0000000000 --- a/ext/cyrus/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Cyrus -Sterling Hughes diff --git a/ext/cyrus/Makefile.in b/ext/cyrus/Makefile.in deleted file mode 100644 index 8d09befebb..0000000000 --- a/ext/cyrus/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libcyrus.la -LTLIBRARY_SOURCES = cyrus.c -LTLIBRARY_SHARED_NAME = cyrus.la -LTLIBRARY_SHARED_LIBADD = $(CYRUS_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/cyrus/config.m4 b/ext/cyrus/config.m4 deleted file mode 100644 index bab48776bf..0000000000 --- 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_EXTENSION(cyrus, $ext_shared) -fi diff --git a/ext/cyrus/cyrus.c b/ext/cyrus/cyrus.c deleted file mode 100644 index c97c40f558..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 557d823679..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 9efbe3fe52..0000000000 --- a/ext/db/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBM -Rasmus Lerdorf, Jim Winstead diff --git a/ext/db/Makefile.in b/ext/db/Makefile.in deleted file mode 100644 index f4531bed58..0000000000 --- a/ext/db/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libdb.la -LTLIBRARY_SOURCES = db.c - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/db/config.m4 b/ext/db/config.m4 deleted file mode 100644 index 5a3de1b567..0000000000 --- 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_EXTENSION(db) -fi diff --git a/ext/db/db.c b/ext/db/db.c deleted file mode 100644 index 09e58e2825..0000000000 --- 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 a514dba9aa..0000000000 --- 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 cc27363822..0000000000 --- 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 ea95d3d70a..0000000000 --- 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 d0bc710f08..0000000000 --- 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 319325c398..0000000000 --- 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 1becfcfdcd..0000000000 --- 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 de33201883..0000000000 --- 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 3428ce3948..0000000000 --- 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 2f06307693..0000000000 --- a/ext/dba/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -DBA -Sascha Schumann diff --git a/ext/dba/Makefile.in b/ext/dba/Makefile.in deleted file mode 100644 index b26ec1b92b..0000000000 --- a/ext/dba/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ - -LTLIBRARY_NAME = libdba.la -LTLIBRARY_SOURCES = dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \ - dba_ndbm.c dba_db3.c -LTLIBRARY_SHARED_NAME = dba.la -LTLIBRARY_SHARED_LIBADD = $(DBA_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/dba/config.m4 b/ext/dba/config.m4 deleted file mode 100644 index 86c7be00fd..0000000000 --- a/ext/dba/config.m4 +++ /dev/null @@ -1,235 +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/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 db-3 db3; 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_EXTENSION(dba,$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 f42cd35d5e..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 bcea596d59..0000000000 --- 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 d644dd5777..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 bbe729a0b6..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 abe3b514ed..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 b72eaa8819..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 50ab4f9652..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 bc09a4aa47..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 a046f0796b..0000000000 --- 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 2a95223a85..0000000000 --- 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 58bb0b62a0..0000000000 --- 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 c4451b90a0..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 4c963d18ed..0000000000 --- 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 3068404cfe..0000000000 --- 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 b1ebf15af3..0000000000 --- a/ext/dba/php_ndbm.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef PHP_NDBM_H -#define PHP_NDBM_H - -#if DBA_NDBM - -#include "php_dba.h" - -DBA_FUNCS(ndbm); - -#endif - -#endif diff --git a/ext/dba/setup.stub b/ext/dba/setup.stub deleted file mode 100644 index 0df17de7d1..0000000000 --- a/ext/dba/setup.stub +++ /dev/null @@ -1,6 +0,0 @@ -# $Source$ -# $Id$ - -define_option with-dba 'dba support?' yesnodir no \ -' Whether to build the dba extension.' - diff --git a/ext/dbase/CREDITS b/ext/dbase/CREDITS deleted file mode 100644 index ea6adcaf41..0000000000 --- a/ext/dbase/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -dBase -Jim Winstead diff --git a/ext/dbase/Makefile.in b/ext/dbase/Makefile.in deleted file mode 100644 index 780cf37fda..0000000000 --- a/ext/dbase/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ - -LTLIBRARY_NAME = libdbase.la -LTLIBRARY_SOURCES = dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c -LTLIBRARY_SHARED_NAME = dbase.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/dbase/config.m4 b/ext/dbase/config.m4 deleted file mode 100644 index 2c65e18559..0000000000 --- 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_EXTENSION(dbase, $ext_shared) -fi diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c deleted file mode 100644 index 002a0c3e18..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: Jim Winstead (jimw@php.net) | - +----------------------------------------------------------------------+ - */ - -/* $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 <= 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 63bb66dbcc..0000000000 --- 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 c7ee8fde71..0000000000 --- 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 e73d134907..0000000000 --- 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 9a17a3a91f..0000000000 --- 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 ad17bd4e3f..0000000000 --- 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 37fe8b0ea9..0000000000 --- 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 121a0e81e2..0000000000 --- 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 4bc3d29641..0000000000 --- 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 11ee63b107..0000000000 --- a/ext/dbase/dbf_rec.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 1993 Brad Eacker, - * (Music, Intuition, Software, and Computers) - * All Rights Reserved - */ - -#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 6407c702f6..0000000000 --- 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 a2c6ec6aec..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: Jim Winstead (jimw@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $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/dbase/setup.stub b/ext/dbase/setup.stub deleted file mode 100644 index 427ecf069d..0000000000 --- a/ext/dbase/setup.stub +++ /dev/null @@ -1,4 +0,0 @@ -# $Id$ -*- sh -*- - -define_option with-dbase 'dBase support? ' yesno no \ -' Whether to use the bundled dbase library.' diff --git a/ext/dbplus/CREDITS b/ext/dbplus/CREDITS deleted file mode 100644 index ad7e7425a3..0000000000 --- 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 6443e99646..0000000000 --- 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/Makefile.in b/ext/dbplus/Makefile.in deleted file mode 100644 index 6c6b0c9711..0000000000 --- a/ext/dbplus/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libdbplus.la -LTLIBRARY_SOURCES = dbplus.c php_dbplus.c -LTLIBRARY_SHARED_NAME = dbplus.la -LTLIBRARY_SHARED_LIBADD = $(DBPLUS_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/dbplus/README b/ext/dbplus/README deleted file mode 100644 index e313a10377..0000000000 --- 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 3232ff2000..0000000000 --- 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 - AC_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_EXTENSION(dbplus, $ext_shared) -fi diff --git a/ext/dbplus/dbplus.c b/ext/dbplus/dbplus.c deleted file mode 100644 index 38bd329986..0000000000 --- a/ext/dbplus/dbplus.c +++ /dev/null @@ -1,247 +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: 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 c00b23cf78..0000000000 --- a/ext/dbplus/php_dbplus.c +++ /dev/null @@ -1,1558 +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: 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 60889226b7..0000000000 --- a/ext/dbplus/php_dbplus.h +++ /dev/null @@ -1,124 +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: Hartmut Holzgraefe | - +----------------------------------------------------------------------+ - */ - -#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 2c56768952..0000000000 --- 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 3bc82c5fd3..0000000000 --- a/ext/dbx/CREDITS +++ /dev/null @@ -1,9 +0,0 @@ -dbx (database abstraction) - -core routines: Marc Boeren (marc@guidance.nl) -mysql support: Marc Boeren -odbc support: Marc Boeren -pgsql support: Rui Hirokawa (hirokawa@php.net) -mssql support: Marc Boeren -fbsql support: Frank M. Kromann (frank@frontbase.com) -initial oci8 support: Marc Boeren diff --git a/ext/dbx/INSTALL b/ext/dbx/INSTALL deleted file mode 100644 index d98e33a42d..0000000000 --- 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/Makefile.in b/ext/dbx/Makefile.in deleted file mode 100644 index 07965d071f..0000000000 --- a/ext/dbx/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ - -LTLIBRARY_NAME = libdbx.la -LTLIBRARY_SOURCES = dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c -LTLIBRARY_SHARED_NAME = dbx.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/dbx/config.m4 b/ext/dbx/config.m4 deleted file mode 100644 index 19fbbda70f..0000000000 --- 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_EXTENSION(dbx, $ext_shared) -fi diff --git a/ext/dbx/dbx.c b/ext/dbx/dbx.c deleted file mode 100644 index 19b00f8ae6..0000000000 --- a/ext/dbx/dbx.c +++ /dev/null @@ -1,805 +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 -/* 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" - -/* 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"); - } - 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; - 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_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"); - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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 bb2fa635b2..0000000000 --- a/ext/dbx/dbx.dsp +++ /dev/null @@ -1,165 +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 -# 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=.\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 8bfb9fe73a..0000000000 --- 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 3ab8bbd232..0000000000 --- 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 e36504b0cb..0000000000 --- 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 f905ed10be..0000000000 --- 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 2051da357f..0000000000 --- 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 b9873147b6..0000000000 --- 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 f9b14a1170..0000000000 --- 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 4ee58e0e77..0000000000 --- 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 be483df6c4..0000000000 --- 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 40f282b2bc..0000000000 --- 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 9a010ed455..0000000000 --- a/ext/dbx/dbx_pgsql.c +++ /dev/null @@ -1,279 +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 && Z_STRLEN_PP(password)>0) { - int len; - - len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port); - len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+35; - 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, 1); - 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); - - 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 && Z_STRLEN_PP(password)>0) { - int len; - - len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port); - len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+35; - 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, 1); - 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); - - 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, *num_rows_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 8da190bdcb..0000000000 --- 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/howto_extend_dbx.html b/ext/dbx/howto_extend_dbx.html deleted file mode 100644 index 1f9e57977c..0000000000 --- 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 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 d6e0286624..0000000000 --- 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 2281426230..0000000000 --- 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 78201a4ff6..0000000000 --- a/ext/dbx/tests/002.phpt +++ /dev/null @@ -1,27 +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 03eec20ddf..0000000000 --- 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 80baa53374..0000000000 --- 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 4ee7f7c5a7..0000000000 --- a/ext/dbx/tests/005.phpt +++ /dev/null @@ -1,90 +0,0 @@ ---TEST-- -dbx_query ---SKIPIF-- - ---POST-- ---GET-- ---FILE-- -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 \ No newline at end of file diff --git a/ext/dbx/tests/006.phpt b/ext/dbx/tests/006.phpt deleted file mode 100644 index cfe1e48b97..0000000000 --- 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 \ No newline at end of file diff --git a/ext/dbx/tests/007.phpt b/ext/dbx/tests/007.phpt deleted file mode 100644 index bfc8baa505..0000000000 --- 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 ac3f76fe94..0000000000 --- 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 b7a7bc5027..0000000000 --- a/ext/dbx/tests/dbx_test.p +++ /dev/null @@ -1,54 +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 316349df92..0000000000 --- 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 1bad104fba..0000000000 --- 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 e69de29bb2..0000000000 diff --git a/ext/dio/Makefile.in b/ext/dio/Makefile.in deleted file mode 100644 index c9ac3faf74..0000000000 --- a/ext/dio/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libdio.la -LTLIBRARY_SOURCES = dio.c -LTLIBRARY_SHARED_NAME = dio.la -LTLIBRARY_SHARED_LIBADD = $(DIO_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/dio/config.m4 b/ext/dio/config.m4 deleted file mode 100644 index 0250462e78..0000000000 --- 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_EXTENSION(dio, $ext_shared) -fi diff --git a/ext/dio/dio.c b/ext/dio/dio.c deleted file mode 100644 index 154ad1e06e..0000000000 --- a/ext/dio/dio.c +++ /dev/null @@ -1,428 +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: 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 7ab7ea4121..0000000000 --- a/ext/dio/php_dio.h +++ /dev/null @@ -1,63 +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: Sterling Hughes | | - +----------------------------------------------------------------------+ - */ - -#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 d527e1a961..0000000000 --- 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 368d09d4a5..0000000000 --- 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 6443e99646..0000000000 --- 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/Makefile.in b/ext/domxml/Makefile.in deleted file mode 100644 index 3b4b4c44a2..0000000000 --- a/ext/domxml/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libdomxml.la -LTLIBRARY_SOURCES = php_domxml.c -LTLIBRARY_SHARED_NAME = domxml.la -LTLIBRARY_SHARED_LIBADD = $(DOMXML_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/domxml/TODO b/ext/domxml/TODO deleted file mode 100644 index 680fc90bc8..0000000000 --- a/ext/domxml/TODO +++ /dev/null @@ -1,16 +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. diff --git a/ext/domxml/config.m4 b/ext/domxml/config.m4 deleted file mode 100644 index cbe6d9ad5c..0000000000 --- a/ext/domxml/config.m4 +++ /dev/null @@ -1,172 +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 - - PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD) - 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_EXTENSION(domxml, $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 - - 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 40768294e9..0000000000 --- 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 0979fd4541..0000000000 --- a/ext/domxml/php_domxml.c +++ /dev/null @@ -1,3609 +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$ */ - -/* 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) -#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) -#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_attributenode, domxml_elem_get_attribute_node, NULL) - PHP_FALIAS(set_attributenode, domxml_elem_set_attribute_node, NULL) - PHP_FALIAS(get_element_by_tagname, domxml_elem_get_element_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 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); - 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; - 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); - if (content) { - add_property_long(wrapper, "type", Z_TYPE_P(nodep)); - 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 */ -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_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_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); - 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, *arg1; - xmlNode *nodep; - - 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); - } else { - WRONG_PARAM_COUNT; - } - - convert_to_string(arg1); - - /* FIXME: not implemented */ - 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, *arg1; - xmlNode *nodep; - - 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); - } else { - WRONG_PARAM_COUNT; - } - - convert_to_string(arg1); - - /* FIXME: not implemented */ - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ 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; -} -/* }}} */ - -/* {{{ proto string domxml_elem_get_element_by_tagname(string tagname) - Returns element for given attribute */ -PHP_FUNCTION(domxml_elem_get_element_by_tagname) -{ - zval *id, *arg1; - xmlNode *nodep; - - 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); - } else { - WRONG_PARAM_COUNT; - } - - convert_to_string(arg1); - - /* FIXME: not implemented */ - -} -/* }}} */ - -/* 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]) - Dumps document into string */ -PHP_FUNCTION(domxml_dump_mem) -{ - zval *id; - xmlDoc *docp; - xmlChar *mem; - int size; - - DOMXML_PARAM_NONE(docp, id, le_domxmldocp); - xmlDocDumpMemory(docp, &mem, &size); - if (!size) { - RETURN_FALSE; - } - RETURN_STRINGL(mem, size, 1); -} -/* }}} */ - -/* {{{ proto int domxml_dump_mem_file([object doc_handle],filename,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 compressmode = 0; - char *file; - DOMXML_PARAM_THREE(docp, id, le_domxmldocp, "s|l", &file, &file_len, &compressmode); - - xmlSetCompressMode (compressmode); - 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) -{ - 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) -{ - 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)); - } - 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|a|b", &idxml, &idparams, &xpath_params) == FAILURE) { - RETURN_FALSE; - } - - DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp); - - if (idparams) { - params = php_domxslt_make_params(idparams, xpath_params); - } - - 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 b7f118f87e..0000000000 --- a/ext/domxml/php_domxml.h +++ /dev/null @@ -1,190 +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 (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_element_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); -#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 154522c6f8..0000000000 --- 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 6443e99646..0000000000 --- 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 8cad7bab8f..0000000000 --- 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 f507f3d2f3..0000000000 --- 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 a0b151f68a..0000000000 --- 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 3b0b67c02f..0000000000 --- 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 b56af145e2..0000000000 --- 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 82a12a1d83..0000000000 --- a/ext/ereg/ereg.c +++ /dev/null @@ -1,657 +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"); - 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 e9ac4661cc..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 c1d1e0c232..0000000000 --- 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 d43362fbfc..0000000000 --- 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 27b0331b9b..0000000000 --- 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 cea9b67b66..0000000000 --- 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 6e82e1dae0..0000000000 --- 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 6227f810b7..0000000000 --- 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 670b273882..0000000000 --- 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 c0feaeb169..0000000000 --- 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 5f40ff7917..0000000000 --- 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 0b88dcf1ed..0000000000 --- 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 cc98334e75..0000000000 --- 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 657338a2c1..0000000000 --- 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 5a0118ac44..0000000000 --- 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 252b246c7b..0000000000 --- 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 0b939461bd..0000000000 --- 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 6efafebf60..0000000000 --- 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 bf71e3a814..0000000000 --- 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 2cb668c24f..0000000000 --- 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 100c8a7f71..0000000000 --- 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 d89012bda1..0000000000 --- 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 e8f1ad4299..0000000000 --- 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 7b7df8126c..0000000000 --- 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 b39c5e178c..0000000000 --- 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 b87ded340b..0000000000 --- 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 7cd39a59ae..0000000000 --- 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 3db9e4ad1a..0000000000 --- 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 7888d02368..0000000000 --- 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 9fd618a13b..0000000000 --- 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 188bdb775b..0000000000 --- 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 c05846177f..0000000000 --- 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 cd4a96025f..0000000000 --- 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 f63c252518..0000000000 --- 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 a9b7aaa00a..0000000000 --- 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 edd9c05969..0000000000 --- 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 1f60ff4900..0000000000 --- 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 78c0a0912a..0000000000 --- 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 50b6dbfd3a..0000000000 --- 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 b2646f842f..0000000000 --- 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 db61d1ca07..0000000000 --- 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 4996ef4c97..0000000000 --- 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 30d28fd02f..0000000000 --- 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 4eda774f58..0000000000 --- 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 d5342c7436..0000000000 --- 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 ec3329fa7c..0000000000 --- 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 ec4d19ed0e..0000000000 --- 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 961a60fa76..0000000000 --- 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 a24816f182..0000000000 --- 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 b7f532f769..0000000000 --- a/ext/exif/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -EXIF -Rasmus Lerdorf diff --git a/ext/exif/Makefile.in b/ext/exif/Makefile.in deleted file mode 100644 index cfac66a574..0000000000 --- a/ext/exif/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libexif.la -LTLIBRARY_SOURCES = exif.c -LTLIBRARY_SHARED_NAME = exif.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 deleted file mode 100644 index 128d74be73..0000000000 --- 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_EXTENSION(exif, $ext_shared) -fi diff --git a/ext/exif/exif.c b/ext/exif/exif.c deleted file mode 100644 index ed4064eed6..0000000000 --- a/ext/exif/exif.c +++ /dev/null @@ -1,1294 +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 | - +----------------------------------------------------------------------+ - */ -/* Much of the code in this module was borrowed from the public domain - jhead.c package with the author's consent. The main changes have been - to eliminate all the global variables to make it thread safe and to wrap - it in the PHP 4 API. - - Aug.3 2001 - Added support for multiple M_COM entries - Rasmus - - 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 - -#include "php_exif.h" -#include -#include "php_ini.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" - -typedef unsigned char uchar; - -#ifndef TRUE - #define TRUE 1 - #define FALSE 0 -#endif - -#define EXIF_MAX_COMMENTS 12 - -/* {{{ structs - 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 { - char FileName [120]; - time_t FileDateTime; - unsigned FileSize; - char CameraMake [32]; - char CameraModel [64]; - char DateTime [20]; - int Height, Width; - int IsColor; - int FlashUsed; - float FocalLength; - float ExposureTime; - float ApertureFNumber; - float Distance; - float CCDWidth; - char *Comments[EXIF_MAX_COMMENTS]; - int numComments; - double FocalplaneXRes; - double FocalplaneUnits; - int ExifImageWidth; - int MotorolaOrder; - int Orientation; - char GPSinfo[48]; - int ISOspeed; - char ExifVersion[16]; - char Copyright[32]; - char Software[32]; - char *Thumbnail; - int ThumbnailSize; - int ThumbnailOffset; - /* Olympus vars */ - int SpecialMode; - int JpegQual; - int Macro; - int DigiZoom; - char SoftwareRelease[16]; - char PictInfo[64]; - char CameraId[64]; - /* End Olympus vars */ -} ImageInfoType; - -/* This structure is used to store a section of a Jpeg file. */ -typedef struct { - uchar *Data; - int Type; - unsigned Size; -} Section_t; -/* }}} */ - -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 - -/* {{{ exif_functions[] - */ -function_entry exif_functions[] = { - PHP_FE(read_exif_data, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -PHP_MINFO_FUNCTION(exif); - -/* {{{ exif_module_entry - */ -zend_module_entry exif_module_entry = { - STANDARD_MODULE_HEADER, - "exif", - exif_functions, - NULL, NULL, - NULL, NULL, - PHP_MINFO(exif), - NO_VERSION_YET, - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_EXIF -ZEND_GET_MODULE(exif) -#endif - -/* {{{ 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_end(); -} -/* }}} */ - -/* {{{ 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_SOF0 0xC0 /* Start Of Frame N */ -#define M_SOF1 0xC1 /* N indicates which compression process */ -#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 /* 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_JFIF 0xE0 -#define M_EXIF 0xE1 -#define M_COM 0xFE /* COMment */ - - -#define PSEUDO_IMAGE_MARKER 0x123; /* Extra value. */ - -/* }}} */ - -/* {{{ Get16m - Get 16 bits motorola order (always) for jpeg header stuff. -*/ -static int Get16m(void *Short) -{ - return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1]; -} -/* }}} */ - -/* {{{ 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 process_COM (ImageInfoType *ImageInfo, uchar *Data, int length) -{ - int ch; - char Comment[250]; - int nch; - int a; - - if(ImageInfo->numComments == EXIF_MAX_COMMENTS) return; - - nch = 0; - - if (length > 200) length = 200; /* Truncate if it won't fit in our structure. */ - - for (a=2;anumComments; - - (ImageInfo->Comments)[a] = emalloc(nch+1); - strcpy(ImageInfo->Comments[a], Comment); - (ImageInfo->numComments)++; -} -/* }}} */ - -/* {{{ process_SOFn - * Process a SOFn marker. This is useful for the image dimensions */ -static void process_SOFn (ImageInfoType *ImageInfo, uchar *Data, int marker) -{ - int data_precision, num_components; - const char *process; - - data_precision = Data[2]; - ImageInfo->Height = Get16m(Data+3); - ImageInfo->Width = Get16m(Data+5); - num_components = Data[7]; - - if (num_components == 3) { - ImageInfo->IsColor = 1; - } else { - ImageInfo->IsColor = 0; - } - - 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; - } -} -/* }}} */ - -/* {{{ format description defines - Describes format descriptor -*/ -static int ExifBytesPerFormat[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8}; -#define NUM_FORMATS 12 - -#define FMT_BYTE 1 -#define FMT_STRING 2 -#define FMT_USHORT 3 -#define FMT_ULONG 4 -#define FMT_URATIONAL 5 -#define FMT_SBYTE 6 -#define FMT_UNDEFINED 7 -#define FMT_SSHORT 8 -#define FMT_SLONG 9 -#define FMT_SRATIONAL 10 -#define FMT_SINGLE 11 -#define FMT_DOUBLE 12 - -/* - Describes tag values -*/ - -#define TAG_EXIF_OFFSET 0x8769 -#define TAG_INTEROP_OFFSET 0xa005 - -#define TAG_COMPRESSION 0x0103 - -#define TAG_MAKE 0x010F -#define TAG_MODEL 0x0110 -#define TAG_ORIENTATION 0x0112 - -#define TAG_SOFTWARE 0x0131 - -/* Olympus specific tags */ -#define TAG_SPECIALMODE 0x0200 -#define TAG_JPEGQUAL 0x0201 -#define TAG_MACRO 0x0202 -#define TAG_DIGIZOOM 0x0204 -#define TAG_SOFTWARERELEASE 0x0207 -#define TAG_PICTINFO 0x0208 -#define TAG_CAMERAID 0x0209 -/* end Olympus specific tags */ - -#define TAG_COPYRIGHT 0x8298 - -#define TAG_EXPOSURETIME 0x829A -#define TAG_FNUMBER 0x829D - -#define TAG_GPSINFO 0x8825 -#define TAG_ISOSPEED 0x8827 -#define TAG_EXIFVERSION 0x9000 - -#define TAG_SHUTTERSPEED 0x9201 -#define TAG_APERTURE 0x9202 -#define TAG_MAXAPERTURE 0x9205 -#define TAG_FOCALLENGTH 0x920A - -#define TAG_DATETIME_ORIGINAL 0x9003 -#define TAG_USERCOMMENT 0x9286 - -#define TAG_SUBJECT_DISTANCE 0x9206 -#define TAG_LIGHT_SOURCE 0x9208 -#define TAG_FLASH 0x9209 - -#define TAG_FOCALPLANEXRES 0xa20E -#define TAG_FOCALPLANEUNITS 0xa210 -#define TAG_IMAGEWIDTH 0xA002 -/* }}} */ - -/* {{{ TabTable[] - */ -static const struct { - unsigned short Tag; - char *Desc; -} TagTable[] = { - { 0x100, "ImageWidth"}, - { 0x101, "ImageLength"}, - { 0x102, "BitsPerSample"}, - { 0x103, "Compression"}, - { 0x106, "PhotometricInterpretation"}, - { 0x10A, "FillOrder"}, - { 0x10D, "DocumentName"}, - { 0x10E, "ImageDescription"}, - { 0x10F, "Make"}, - { 0x110, "Model"}, - { 0x111, "StripOffsets"}, - { 0x112, "Orientation"}, - { 0x115, "SamplesPerPixel"}, - { 0x116, "RowsPerStrip"}, - { 0x117, "StripByteCounts"}, - { 0x11A, "XResolution"}, - { 0x11B, "YResolution"}, - { 0x11C, "PlanarConfiguration"}, - { 0x128, "ResolutionUnit"}, - { 0x12D, "TransferFunction"}, - { 0x131, "Software"}, - { 0x132, "DateTime"}, - { 0x13B, "Artist"}, - { 0x13E, "WhitePoint"}, - { 0x13F, "PrimaryChromaticities"}, - { 0x156, "TransferRange"}, - { 0x200, "JPEGProc"}, - { 0x201, "JPEGInterchangeFormat"}, - { 0x202, "JPEGInterchangeFormatLength"}, - { 0x211, "YCbCrCoefficients"}, - { 0x212, "YCbCrSubSampling"}, - { 0x213, "YCbCrPositioning"}, - { 0x214, "ReferenceBlackWhite"}, - { 0x1000, "RelatedImageFileFormat"}, - { 0x828D, "CFARepeatPatternDim"}, - { 0x828E, "CFAPattern"}, - { 0x828F, "BatteryLevel"}, - { 0x8298, "Copyright"}, - { 0x829A, "ExposureTime"}, - { 0x829D, "FNumber"}, - { 0x83BB, "IPTC/NAA"}, - { 0x8769, "ExifOffset"}, - { 0x8773, "InterColorProfile"}, - { 0x8822, "ExposureProgram"}, - { 0x8824, "SpectralSensitivity"}, - { 0x8825, "GPSInfo"}, - { 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"}, - { 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"}, - { 0, NULL} -} ; -/* }}} */ - -/* {{{ Get16u - * Convert a 16 bit unsigned value from file's native byte order */ -static int Get16u(void *Short, int MotorolaOrder) -{ - if (MotorolaOrder) { - return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1]; - } else { - return (((uchar *)Short)[1] << 8) | ((uchar *)Short)[0]; - } -} -/* }}} */ - -/* {{{ Get32s - * Convert a 32 bit signed value from file's native byte order */ -static int Get32s(void *Long, int MotorolaOrder) -{ - if (MotorolaOrder) { - return ((( char *)Long)[0] << 24) | (((uchar *)Long)[1] << 16) - | (((uchar *)Long)[2] << 8 ) | (((uchar *)Long)[3] << 0 ); - } else { - return ((( char *)Long)[3] << 24) | (((uchar *)Long)[2] << 16) - | (((uchar *)Long)[1] << 8 ) | (((uchar *)Long)[0] << 0 ); - } -} -/* }}} */ - -/* {{{ Get32u - * Convert a 32 bit unsigned value from file's native byte order */ -static unsigned Get32u(void *Long, int MotorolaOrder) -{ - return (unsigned)Get32s(Long, MotorolaOrder) & 0xffffffff; -} -/* }}} */ - -/* {{{ ConvertAnyFormat - * Evaluate number, be it int, rational, or float from directory. */ -static double ConvertAnyFormat(void *ValuePtr, int Format, int MotorolaOrder) -{ - double Value; - Value = 0; - - switch(Format) { - case FMT_SBYTE: Value = *(signed char *)ValuePtr; break; - case FMT_BYTE: Value = *(uchar *)ValuePtr; break; - - case FMT_USHORT: Value = Get16u(ValuePtr, MotorolaOrder); break; - case FMT_ULONG: Value = Get32u(ValuePtr, MotorolaOrder); break; - - case FMT_URATIONAL: - case FMT_SRATIONAL: - { - int Num, Den; - Num = Get32s(ValuePtr, MotorolaOrder); - Den = Get32s(4+(char *)ValuePtr, MotorolaOrder); - if (Den == 0) { - Value = 0; - } else { - Value = (double)Num/Den; - } - break; - } - - case FMT_SSHORT: Value = (signed short)Get16u(ValuePtr, MotorolaOrder); break; - case FMT_SLONG: Value = Get32s(ValuePtr, MotorolaOrder); break; - - /* Not sure if this is correct (never seen float used in Exif format) */ - case FMT_SINGLE: Value = (double)*(float *)ValuePtr; break; - case FMT_DOUBLE: Value = *(double *)ValuePtr; break; - } - return Value; -} -/* }}} */ - -/* {{{ ExtractThumbnail - * Grab the thumbnail - by Matt Bonneau */ -static void ExtractThumbnail(ImageInfoType *ImageInfo, char *OffsetBase, unsigned ExifLength) { - /* according to exif2.1, the thumbnail is not supposed to be greater than 64K */ - if (ImageInfo->ThumbnailSize > 65536) { - php_error(E_WARNING, "Illegal thumbnail size"); - return; - } - - ImageInfo->Thumbnail = emalloc(ImageInfo->ThumbnailSize); - if (!ImageInfo->Thumbnail) { - php_error(E_WARNING, "Could not allocate memory for thumbnail"); - return; - } else { - /* Check to make sure we are not going to go past the ExifLength */ - if ((unsigned)(ImageInfo->ThumbnailOffset + ImageInfo->ThumbnailSize) > ExifLength) { - php_error(E_WARNING, "Thumbnail goes beyond exif header boundary"); - return; - } else { - memcpy(ImageInfo->Thumbnail, OffsetBase + ImageInfo->ThumbnailOffset, ImageInfo->ThumbnailSize); - } - } -} -/* }}} */ - -/* {{{ ProcessExifDir - * Process one of the nested EXIF directories. */ -static void ProcessExifDir(ImageInfoType *ImageInfo, char *DirStart, char *OffsetBase, unsigned ExifLength, char *LastExifRefd) -{ - int de; - int a; - int NumDirEntries; - int NextDirOffset; - - - NumDirEntries = Get16u(DirStart, ImageInfo->MotorolaOrder); - - if ((DirStart+2+NumDirEntries*12) > (OffsetBase+ExifLength)) { - php_error(E_WARNING, "Illegally sized directory"); - return; - } - - - /* - if (ShowTags) { - printf("Directory with %d entries\n", NumDirEntries); - } - */ - - for (de=0;deMotorolaOrder); - Format = Get16u(DirEntry+2, ImageInfo->MotorolaOrder); - Components = Get32u(DirEntry+4, ImageInfo->MotorolaOrder); - - if ((Format-1) >= NUM_FORMATS) { - /* (-1) catches illegal zero case as unsigned underflows to positive large. */ - php_error(E_WARNING, "Illegal format code in EXIF dir"); - return; - } - - ByteCount = Components * ExifBytesPerFormat[Format]; - - if (ByteCount > 4) { - unsigned OffsetVal; - OffsetVal = Get32u(DirEntry+8, ImageInfo->MotorolaOrder); - /* If its bigger than 4 bytes, the dir entry contains an offset. */ - if (OffsetVal+ByteCount > ExifLength) { - /* Bogus pointer offset and / or bytecount value */ -/* printf("Offset %d bytes %d ExifLen %d\n", OffsetVal, ByteCount, ExifLength); */ - - php_error(E_WARNING, "Illegal pointer offset value in EXIF"); - return; - } - ValuePtr = OffsetBase+OffsetVal; - } else { - /* 4 bytes or less and value is in the dir entry itself */ - ValuePtr = DirEntry+8; - } - - if (LastExifRefd < ValuePtr+ByteCount) { - /* - Keep track of last byte in the exif header that was actually referenced. - That way, we know where the discardable thumbnail data begins. - */ - LastExifRefd = ValuePtr+ByteCount; - } - - /* Extract useful components of tag */ - switch(Tag) { - - case TAG_MAKE: - strlcpy(ImageInfo->CameraMake, ValuePtr, sizeof(ImageInfo->CameraMake)); - break; - - case TAG_MODEL: - strlcpy(ImageInfo->CameraModel, ValuePtr, sizeof(ImageInfo->CameraModel)); - break; - - case TAG_GPSINFO: - strlcpy(ImageInfo->GPSinfo, ValuePtr, sizeof(ImageInfo->GPSinfo)); - break; - - case TAG_EXIFVERSION: - strlcpy(ImageInfo->ExifVersion, ValuePtr, sizeof(ImageInfo->ExifVersion)); - break; - - case TAG_COPYRIGHT: - strlcpy(ImageInfo->Copyright, ValuePtr, sizeof(ImageInfo->Copyright)); - break; - - case TAG_SOFTWARE: - strlcpy(ImageInfo->Software, ValuePtr, sizeof(ImageInfo->Software)); - break; - - case TAG_ORIENTATION: - ImageInfo->Orientation = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - break; - - case TAG_ISOSPEED: - ImageInfo->ISOspeed = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - break; - - case TAG_DATETIME_ORIGINAL: - strlcpy(ImageInfo->DateTime, ValuePtr, sizeof(ImageInfo->DateTime)); - break; - - case TAG_USERCOMMENT: - /* Olympus has this padded with trailing spaces. Remove these first. */ - for (a=ByteCount;;) { - a--; - if ((ValuePtr)[a] == ' ') { - (ValuePtr)[a] = '\0'; - } else { - break; - } - if (a == 0) break; - } - - /* Copy the comment */ - if (memcmp(ValuePtr, "ASCII", 5) == 0) { - for (a=5;a<10;a++) { - int c; int l; - c = (ValuePtr)[a]; - if (c != '\0' && c != ' ') { - l = strlen(a+ValuePtr)+1; - l = (l<200)?l:201; - (ImageInfo->Comments)[ImageInfo->numComments] = emalloc(l); - strlcpy((ImageInfo->Comments)[ImageInfo->numComments], a+ValuePtr, l); - ImageInfo->numComments++; - break; - } - } - - } else { - int l; - - l = strlen(ValuePtr)+1; - l = (l<200)?l:201; - (ImageInfo->Comments)[ImageInfo->numComments] = emalloc(l); - strlcpy((ImageInfo->Comments)[ImageInfo->numComments], ValuePtr, l); - } - 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)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - 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(ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder)*log(2)*0.5); - } - break; - - case TAG_FOCALLENGTH: - /* Nice digital cameras actually save the focal length as a function - of how farthey are zoomed in. */ - ImageInfo->FocalLength = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - 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)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - break; - - case TAG_EXPOSURETIME: - /* Simplest way of expressing exposure time, so I trust it most. - (overwrite previously computd value if there is one) */ - ImageInfo->ExposureTime = (float)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - 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. */ - if (ImageInfo->ExposureTime == 0) { - ImageInfo->ExposureTime - = (float)(1/exp(ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder)*log(2))); - } - break; - - case TAG_FLASH: - if (ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder)) { - ImageInfo->FlashUsed = 1; - } - break; - - case TAG_IMAGEWIDTH: - ImageInfo->ExifImageWidth = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - break; - - case TAG_FOCALPLANEXRES: - ImageInfo->FocalplaneXRes = ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder); - break; - - case TAG_FOCALPLANEUNITS: - switch((int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->MotorolaOrder)) { - 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_LIGHT_SOURCE: - /* Rarely set or useful. */ - break; - - case TAG_SPECIALMODE: - ImageInfo->SpecialMode = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->SpecialMode); - break; - - case TAG_JPEGQUAL: /* I think that this is a pointer to the thumbnail - let's see */ - ImageInfo->ThumbnailOffset = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->ThumbnailOffset); - - /* see if we know the size */ - if (ImageInfo->ThumbnailSize) { - ExtractThumbnail(ImageInfo, OffsetBase, ExifLength); - } - /*ImageInfo->JpegQual = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->JpegQual);*/ - break; - - case TAG_MACRO: /* I think this is the size of the Thumbnail */ - ImageInfo->ThumbnailSize = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->ThumbnailSize); - - /* see if we have the offset */ - if (ImageInfo->ThumbnailOffset) { - ExtractThumbnail(ImageInfo, OffsetBase, ExifLength); - } - /*ImageInfo->Macro = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->Macro);*/ - break; - - case TAG_DIGIZOOM: - ImageInfo->DigiZoom = (int)ConvertAnyFormat(ValuePtr, Format, ImageInfo->DigiZoom); - break; - - case TAG_SOFTWARERELEASE: - strlcpy(ImageInfo->SoftwareRelease, ValuePtr, sizeof(ImageInfo->SoftwareRelease)); - break; - - case TAG_PICTINFO: - strlcpy(ImageInfo->PictInfo, ValuePtr, sizeof(ImageInfo->PictInfo)); - break; - - case TAG_CAMERAID: - strlcpy(ImageInfo->CameraId, ValuePtr, sizeof(ImageInfo->CameraId)); - break; - } - - if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET) { - char *SubdirStart; - SubdirStart = OffsetBase + Get32u(ValuePtr, ImageInfo->MotorolaOrder); - if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ExifLength) { - php_error(E_WARNING, "Illegal subdirectory link"); - return; - } - ProcessExifDir(ImageInfo, SubdirStart, OffsetBase, ExifLength, LastExifRefd); - continue; - } - } - /* - * Hack to make it process IDF1 I hope - * There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail - */ - NextDirOffset = Get32u(DirStart+2+12*de, ImageInfo->MotorolaOrder); - if (NextDirOffset) { - if (OffsetBase + NextDirOffset < OffsetBase || OffsetBase + NextDirOffset > OffsetBase+ExifLength) { - php_error(E_WARNING, "Illegal directory offset"); - return; - } - ProcessExifDir(ImageInfo, OffsetBase + NextDirOffset, OffsetBase, ExifLength, LastExifRefd); - } -} -/* }}} */ - -/* {{{ process_EXIF - Process an EXIF marker - Describes all the drivel that most digital cameras include... -*/ -static void process_EXIF (ImageInfoType *ImageInfo, char *CharBuf, unsigned int length, char *LastExifRefd) -{ - ImageInfo->FlashUsed = 0; /* If it s from a digicam, and it used flash, it says so. */ - LastExifRefd = CharBuf; - - ImageInfo->FocalplaneXRes = 0; - ImageInfo->FocalplaneUnits = 0; - ImageInfo->ExifImageWidth = 0; - - /* set the thumbnail stuff to nothing so we can test to see if they get set up */ - ImageInfo->Thumbnail = NULL; - ImageInfo->ThumbnailSize = 0; - - { /* Check the EXIF header component */ - static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; - if (memcmp(CharBuf+2, ExifHeader, 6)) { - php_error(E_WARNING, "Incorrect Exif header"); - return; - } - } - - if (memcmp(CharBuf+8, "II", 2) == 0) { -/* if (ShowTags) printf("Exif section in Intel order\n"); */ - ImageInfo->MotorolaOrder = 0; - } else { - if (memcmp(CharBuf+8, "MM", 2) == 0) { -/* if (ShowTags) printf("Exif section in Motorola order\n"); */ - ImageInfo->MotorolaOrder = 1; - } else { - php_error(E_WARNING, "Invalid Exif alignment marker."); - return; - } - } - - /* Check the next two values for correctness. */ - if (Get16u(CharBuf+10, ImageInfo->MotorolaOrder) != 0x2a - || Get32u(CharBuf+12, ImageInfo->MotorolaOrder) != 0x08) { - php_error(E_WARNING, "Invalid Exif start (1)"); - return; - } - - /* First directory starts 16 bytes in. Offsets start at 8 bytes in. */ - ProcessExifDir(ImageInfo, CharBuf+16, CharBuf+8, length-6, LastExifRefd); - - /* MB: This is where I will make my attempt to get the tumbnail */ - - - /* Compute the CCD width, in milimeters. */ - if (ImageInfo->FocalplaneXRes != 0) { - ImageInfo->CCDWidth = (float)(ImageInfo->ExifImageWidth * ImageInfo->FocalplaneUnits / ImageInfo->FocalplaneXRes); - } -} -/* }}} */ - -/* {{{ scan_JPEG_header - * Parse the marker stream until SOS or EOI is seen; */ -static int scan_JPEG_header (ImageInfoType *ImageInfo, FILE *infile, Section_t *Sections, int *SectionsRead, int ReadAll, char *LastExifRefd) -{ - int a; -/* - int HaveCom = FALSE; -*/ - a = fgetc(infile); - if (a != 0xff || fgetc(infile) != M_SOI) { - return FALSE; - } - - for(*SectionsRead=0;*SectionsRead < 19;) { - int itemlen; - int marker = 0; - int ll, lh, got; - uchar *Data; - - for (a=0;a<7;a++) { - marker = fgetc(infile); - if (marker != 0xff) break; - } - 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; - } - - Sections[*SectionsRead].Type = marker; - - /* Read the length of the section. */ - lh = fgetc(infile); - ll = fgetc(infile); - - itemlen = (lh << 8) | ll; - - if (itemlen < 2) { - php_error(E_WARNING, "invalid marker"); - return FALSE; - } - - Sections[*SectionsRead].Size = itemlen; - - Data = (uchar *)emalloc(itemlen+1); /* Add 1 to allow sticking a 0 at the end. */ - Sections[*SectionsRead].Data = Data; - - /* Store first two pre-read bytes. */ - Data[0] = (uchar)lh; - Data[1] = (uchar)ll; - - got = fread(Data+2, 1, itemlen-2, infile); /* Read the whole section. */ - if (got != itemlen-2) { - php_error(E_WARNING, "reading from file"); - return FALSE; - } - *SectionsRead += 1; - - /*printf("Marker '%x' size %d\n", marker, itemlen);*/ - switch(marker) { - case M_SOS: /* stop before hitting compressed data */ - /* If reading entire image is requested, read the rest of the data. */ - if (ReadAll) { - int cp, ep, size; - /* Determine how much file is left. */ - cp = ftell(infile); - fseek(infile, 0, SEEK_END); - ep = ftell(infile); - fseek(infile, cp, SEEK_SET); - - size = ep-cp; - Data = (uchar *)emalloc(size); - if (Data == NULL) { - php_error(E_WARNING, "could not allocate data for entire image"); - return FALSE; - } - - got = fread(Data, 1, size, infile); - if (got != size) { - php_error(E_WARNING, "could not read the rest of the image"); - return FALSE; - } - - Sections[*SectionsRead].Data = Data; - Sections[*SectionsRead].Size = size; - Sections[*SectionsRead].Type = PSEUDO_IMAGE_MARKER; - (*SectionsRead)++; - /* - *HaveAll = 1; - */ - efree(Data); - } - return TRUE; - - case M_EOI: /* in case it's a tables-only JPEG stream */ - php_error(E_WARNING, "No image in jpeg!"); - return FALSE; - - case M_COM: /* Comment section */ - /* - if (HaveCom) { - (*SectionsRead) -= 1; - efree(Sections[*SectionsRead].Data); - } else { - process_COM(ImageInfo, Data, itemlen); - HaveCom = TRUE; - } - */ - process_COM(ImageInfo, Data, itemlen); - break; - - case M_EXIF: - if (*SectionsRead <= 2) { - /* Seen files from some 'U-lead' software with Vivitar scanner - that uses marker 31 later in the file (no clue what for!) */ - process_EXIF(ImageInfo, (char *)Data, itemlen, LastExifRefd); - } - break; - - case M_JFIF: - /* Regular jpegs always have this tag, exif images have the - * exif marker instead, althogh ACDsee will write images with - * both markers. this program will re-create this marker on - * absence of exif marker. Hence no need to keep the copy - * from the file. */ - efree(Sections[--(*SectionsRead)].Data); - 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: - process_SOFn(ImageInfo, Data, marker); - break; - default: - /* skip any other marker silently. */ - break; - } - } - return TRUE; -} -/* }}} */ - -/* {{{ DiscardData - Discard read data. -*/ -void DiscardData(Section_t *Sections, int *SectionsRead) -{ - int a; - for (a=0;a<*SectionsRead-1;a++) { - efree(Sections[a].Data); - } - *SectionsRead = 0; -} -/* }}} */ - -/* {{{ ReadJpegFile - Read image data. -*/ -int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, - int *SectionsRead, char *FileName, - int ReadAll, char *LastExifRefd TSRMLS_DC) -{ - FILE *infile; - int ret; - char *tmp; - - infile = VCWD_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */ - - if (infile == NULL) { - php_error(E_WARNING, "Unable to open '%s'", FileName); - return FALSE; - } -/* CurrentFile = FileName; */ - - /* Start with an empty image information structure. */ - memset(ImageInfo, 0, sizeof(*ImageInfo)); - memset(Sections, 0, sizeof(*Sections)); - - tmp = php_basename(FileName, strlen(FileName), NULL, 0); - strlcpy(ImageInfo->FileName, tmp, sizeof(ImageInfo->FileName)); - efree(tmp); - ImageInfo->FocalLength = 0; - ImageInfo->ExposureTime = 0; - ImageInfo->ApertureFNumber = 0; - ImageInfo->Distance = 0; - ImageInfo->CCDWidth = 0; - ImageInfo->FlashUsed = -1; - ImageInfo->SpecialMode = -1; - ImageInfo->JpegQual = -1; - ImageInfo->Macro = -1; - ImageInfo->DigiZoom = -1; - - { - /* Store file date/time. */ - struct stat st; - 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 = scan_JPEG_header(ImageInfo, infile, Sections, SectionsRead, ReadAll, LastExifRefd); - if (!ret) { - php_error(E_WARNING, "Invalid Jpeg file: '%s'\n", FileName); - return FALSE; - } - - fclose(infile); - - return ret; -} -/* }}} */ - -/* {{{ php_read_jpeg_exif - */ -int php_read_jpeg_exif(ImageInfoType *ImageInfo, char *FileName, int ReadAll TSRMLS_DC) -{ - Section_t Sections[20]; - int SectionsRead; - char *LastExifRefd=NULL; - int ret; - /* int i; */ - - ImageInfo->MotorolaOrder = 0; - - ret = ReadJpegFile(ImageInfo, Sections, &SectionsRead, FileName, ReadAll, LastExifRefd TSRMLS_CC); - /* - * Thought this might pick out the embedded thumbnail, but it doesn't work. -RL - for (i=0;i0) { - ImageInfo->Thumbnail = emalloc(thumbsize+5); - ImageInfo->ThumbnailSize = thumbsize; - ImageInfo->Thumbnail[0] = 0xff; - ImageInfo->Thumbnail[1] = 0xd8; - ImageInfo->Thumbnail[2] = 0xff; - memcpy(ImageInfo->Thumbnail+4, Sections[i].Data, thumbsize+4); - } - } - } - */ - if (ret != FALSE) { - DiscardData(Sections, &SectionsRead); - } - return(ret); -} -/* }}} */ - -/* {{{ proto string read_exif_data(string filename [, int readall]) - Reads the EXIF header data from a JPEG file */ -PHP_FUNCTION(read_exif_data) -{ - pval **p_name, **p_readall, *tmpi; - int ac = ZEND_NUM_ARGS(), ret, readall=1; - ImageInfoType ImageInfo; - char tmp[64]; - - if ((ac < 1 || ac > 2) || zend_get_parameters_ex(ac, &p_name, &p_readall) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(p_name); - - if(ac == 2) { - convert_to_long_ex(p_readall); - readall = Z_LVAL_PP(p_readall); - } - - ret = php_read_jpeg_exif(&ImageInfo, Z_STRVAL_PP(p_name), readall TSRMLS_CC); - - if (ret==FALSE || array_init(return_value) == FAILURE) { - RETURN_FALSE; - } - add_assoc_string(return_value, "FileName", ImageInfo.FileName, 1); - add_assoc_long(return_value, "FileDateTime", ImageInfo.FileDateTime); - add_assoc_long(return_value, "FileSize", ImageInfo.FileSize); - if (ImageInfo.CameraMake[0]) { - add_assoc_string(return_value, "CameraMake", ImageInfo.CameraMake, 1); - } - if (ImageInfo.CameraModel[0]) { - add_assoc_string(return_value, "CameraModel", ImageInfo.CameraModel, 1); - } - if (ImageInfo.DateTime[0]) { - add_assoc_string(return_value, "DateTime", ImageInfo.DateTime, 1); - } - add_assoc_long(return_value, "Height", ImageInfo.Height); - add_assoc_long(return_value, "Width", ImageInfo.Width); - add_assoc_long(return_value, "IsColor", ImageInfo.IsColor); - if(ImageInfo.FlashUsed >= 0) { - add_assoc_long(return_value, "FlashUsed", ImageInfo.FlashUsed); - } - if (ImageInfo.FocalLength) { - sprintf(tmp, "%4.1fmm", ImageInfo.FocalLength); - add_assoc_string(return_value, "FocalLength", tmp, 1); - if(ImageInfo.CCDWidth) { - sprintf(tmp, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); - add_assoc_string(return_value, "35mmFocalLength", tmp, 1); - } - add_assoc_double(return_value, "RawFocalLength", ImageInfo.FocalLength); - } - if(ImageInfo.ExposureTime) { - if(ImageInfo.ExposureTime <= 0.5) { - sprintf(tmp, "%6.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); - } else { - sprintf(tmp, "%6.3f s", ImageInfo.ExposureTime); - } - add_assoc_string(return_value, "ExposureTime", tmp, 1); - add_assoc_double(return_value, "RawExposureTime", ImageInfo.ExposureTime); - } - if(ImageInfo.ApertureFNumber) { - sprintf(tmp, "f/%4.1f", ImageInfo.ApertureFNumber); - add_assoc_string(return_value, "ApertureFNumber", tmp, 1); - add_assoc_double(return_value, "RawApertureFNumber", ImageInfo.ApertureFNumber); - } - if(ImageInfo.Distance) { - if(ImageInfo.Distance<0) { - add_assoc_string(return_value, "FocusDistance", "Infinite", 1); - } else { - sprintf(tmp, "%5.2fm", ImageInfo.Distance); - add_assoc_string(return_value, "FocusDistance", tmp, 1); - } - add_assoc_double(return_value, "RawFocusDistance", ImageInfo.Distance); - } - if(ImageInfo.CCDWidth) { - add_assoc_double(return_value, "CCDWidth", ImageInfo.CCDWidth); - } - if(ImageInfo.Orientation) { - add_assoc_long(return_value, "Orientation", ImageInfo.Orientation); - } - if (ImageInfo.GPSinfo[0]) { - add_assoc_string(return_value, "GPSinfo", ImageInfo.GPSinfo, 1); - } - if(ImageInfo.ISOspeed) { - add_assoc_long(return_value, "ISOspeed", ImageInfo.ISOspeed); - } - if (ImageInfo.ExifVersion[0]) { - add_assoc_string(return_value, "ExifVersion", ImageInfo.ExifVersion, 1); - } - if (ImageInfo.Copyright[0]) { - add_assoc_string(return_value, "Copyright", ImageInfo.Copyright, 1); - } - if (ImageInfo.Software[0]) { - add_assoc_string(return_value, "Software", ImageInfo.Software, 1); - } - if(ImageInfo.numComments) { - if(ImageInfo.numComments==1) { - add_assoc_string(return_value, "Comments", (ImageInfo.Comments)[0], 0); - } else { - int i; - - MAKE_STD_ZVAL(tmpi); - array_init(tmpi); - for(i=0; i= 0) { - add_assoc_long(return_value, "SpecialMode", ImageInfo.SpecialMode); - } - if(ImageInfo.JpegQual >= 0) { - add_assoc_long(return_value, "JpegQual", ImageInfo.JpegQual); - } - if(ImageInfo.Macro >= 0) { - add_assoc_long(return_value, "Macro", ImageInfo.Macro); - } - if(ImageInfo.DigiZoom >= 0) { - add_assoc_long(return_value, "DigiZoom", ImageInfo.DigiZoom); - } - if (ImageInfo.SoftwareRelease[0]) { - add_assoc_string(return_value, "SoftwareRelease", ImageInfo.SoftwareRelease, 1); - } - if (ImageInfo.PictInfo[0]) { - add_assoc_string(return_value, "PictInfo", ImageInfo.PictInfo, 1); - } - if (ImageInfo.CameraId[0]) { - add_assoc_string(return_value, "CameraId", ImageInfo.CameraId, 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/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index a75a69f139..0000000000 --- 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 de9974198c..0000000000 --- a/ext/exif/php_exif.h +++ /dev/null @@ -1,24 +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 | - +----------------------------------------------------------------------+ - */ - -#if HAVE_EXIF -extern zend_module_entry exif_module_entry; -#define phpext_exif_ptr &exif_module_entry - -PHP_FUNCTION(read_exif_data); -#endif diff --git a/ext/ext_skel b/ext/ext_skel deleted file mode 100755 index 0cde813344..0000000000 --- a/ext/ext_skel +++ /dev/null @@ -1,289 +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_EXTENSION($extname, \$ext_shared) -fi -eof - -$ECHO_N " Makefile.in$ECHO_C" -cat >Makefile.in <.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 6cdce39a6e..0000000000 --- a/ext/fbsql/php_fbsql.c +++ /dev/null @@ -1,3454 +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: Frank M. Kromann frank@frontbase.com> | - +----------------------------------------------------------------------+ - */ - -/* $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) - -/* 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) - - {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); - 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] == 'I') - { - 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;"; - 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, 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 bool fbsql_free_result(int 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 1ad4f1f2ba..0000000000 --- a/ext/fbsql/php_fbsql.h +++ /dev/null @@ -1,143 +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: Frank M. Kromann frank@frontbase.com> | - +----------------------------------------------------------------------+ - */ - -/* $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_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 57c33cc4b3..0000000000 --- a/ext/fdf/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FDF -Uwe Steinmann diff --git a/ext/fdf/Makefile.in b/ext/fdf/Makefile.in deleted file mode 100644 index 49f3ad54b2..0000000000 --- a/ext/fdf/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ - -LTLIBRARY_NAME = libfdf.la -LTLIBRARY_SOURCES = fdf.c -LTLIBRARY_SHARED_NAME = fdf.la -LTLIBRARY_SHARED_LIBADD = $(FDFTK_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/fdf/config.m4 b/ext/fdf/config.m4 deleted file mode 100644 index b05770eeb6..0000000000 --- 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_EXTENSION(fdf, $ext_shared) -fi diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c deleted file mode 100644 index cd2e0a3245..0000000000 --- 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 487ca42828..0000000000 --- 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 2e0a0deda8..0000000000 --- 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/fdf/setup.stub b/ext/fdf/setup.stub deleted file mode 100644 index 9637713bde..0000000000 --- a/ext/fdf/setup.stub +++ /dev/null @@ -1,7 +0,0 @@ -# $Source$ -# $Id$ - -define_option with-fdftk 'Acrobat Forms (Ftf Toolkit 2.0) support? ' yesnodir \ - 'no /usr/local ftktk install' \ -' Whether to use the Ftf Toolkit support to write/read .fdf-files.\n - Tested for version 2.0!' diff --git a/ext/filepro/CREDITS b/ext/filepro/CREDITS deleted file mode 100644 index c272432c04..0000000000 --- a/ext/filepro/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FilePro -Chad Robinson diff --git a/ext/filepro/Makefile.in b/ext/filepro/Makefile.in deleted file mode 100644 index 8fe3a41a93..0000000000 --- a/ext/filepro/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ - -LTLIBRARY_NAME = libfilepro.la -LTLIBRARY_SOURCES = filepro.c -LTLIBRARY_SHARED_NAME = filepro.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/filepro/config.m4 b/ext/filepro/config.m4 deleted file mode 100644 index 8d7fb49e20..0000000000 --- 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_EXTENSION(filepro, $ext_shared) -fi diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c deleted file mode 100644 index 319f94cdf4..0000000000 --- a/ext/filepro/filepro.c +++ /dev/null @@ -1,576 +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: 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[256]; /* FIX - should really be the max filename length */ - char readbuf[256]; - char *strtok_buf = NULL; - int i; - FP_FIELD *new_field, *tmp; - FP_TLS_VARS; - - if (ZEND_NUM_ARGS() != 1 || getParameters(ht, 1, &dir) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string(dir); - - /* FIX - we should really check and free these if they are used! */ - FP_GLOBAL(fp_database) = NULL; - FP_GLOBAL(fp_fieldlist) = NULL; - FP_GLOBAL(fp_fcount) = -1; - FP_GLOBAL(fp_keysize) = -1; - - sprintf(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, 250, 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, 250, 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 */ - sprintf(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[1024]; /* FIX - Work out better buffering! */ - 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 */ - sprintf(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); - if (fread(readbuf, lp->width, 1, fp) != 1) { - php_error(E_WARNING, "filePro: cannot read data: [%d] %s", - errno, strerror(errno)); - fclose(fp); - RETURN_FALSE; - } - readbuf[lp->width] = '\0'; - fclose(fp); - RETURN_STRING(readbuf, 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/filepro/filepro.dsp b/ext/filepro/filepro.dsp deleted file mode 100644 index 441b14e592..0000000000 --- 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 65e7105199..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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/filepro/setup.stub b/ext/filepro/setup.stub deleted file mode 100644 index 7107744f02..0000000000 --- a/ext/filepro/setup.stub +++ /dev/null @@ -1,5 +0,0 @@ -# $Source$ -# $Id$ - -define_option with-filepro 'filePro support? ' yesno no \ -' Whether to use the bundled filePro library. Read-access only.' diff --git a/ext/fribidi/CREDITS b/ext/fribidi/CREDITS deleted file mode 100644 index d14739ac6e..0000000000 --- a/ext/fribidi/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FRIBIDI -Onn Ben-Zvi diff --git a/ext/fribidi/Makefile.in b/ext/fribidi/Makefile.in deleted file mode 100644 index d7dd435353..0000000000 --- a/ext/fribidi/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libfribidi.la -LTLIBRARY_SOURCES = fribidi.c -LTLIBRARY_SHARED_NAME = fribidi.la -LTLIBRARY_SHARED_LIBADD = $(FRIBIDI_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk -EXTRA_INCLUDES = $(FRIBIDI_INCLUDE) diff --git a/ext/fribidi/README b/ext/fribidi/README deleted file mode 100644 index db96b170a4..0000000000 --- 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 381e800a25..0000000000 --- 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_EXTENSION(fribidi, $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 ea28ab4984..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 6a603d604e..0000000000 --- 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 1b5572de3f..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 fdaf681c21..0000000000 --- a/ext/ftp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -FTP -Andrew Skalski diff --git a/ext/ftp/Makefile.in b/ext/ftp/Makefile.in deleted file mode 100644 index 169973b7e1..0000000000 --- a/ext/ftp/Makefile.in +++ /dev/null @@ -1,6 +0,0 @@ - -LTLIBRARY_NAME = libftp.la -LTLIBRARY_SOURCES = php_ftp.c ftp.c -LTLIBRARY_SHARED_NAME = ftp.la - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/ftp/config.m4 b/ext/ftp/config.m4 deleted file mode 100644 index d93860e6e6..0000000000 --- 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_EXTENSION(ftp, $ext_shared) -fi diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c deleted file mode 100644 index e44186ec39..0000000000 --- a/ext/ftp/ftp.c +++ /dev/null @@ -1,1289 +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$ */ - -#include "php.h" - -#if HAVE_FTP - -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#ifdef PHP_WIN32 -#include -#else -#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" - -/* define closesocket macro for portability */ -#ifndef PHP_WIN32 -#undef closesocket -#define closesocket close -#endif - -/* sends an ftp command, returns true on success, false on error. - * it sends the string "cmd args\r\n" if args is non-null, or - * "cmd\r\n" if args is null - */ -static int ftp_putcmd( ftpbuf_t *ftp, - const char *cmd, - const char *args); - -/* wrapper around send/recv to handle timeouts */ -static int my_send(ftpbuf_t *ftp, 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, 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, FILE *outfp, 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') - putc('\r', outfp); - if (*ptr != '\r') - putc(*ptr, outfp); - lastch = *ptr; - } - } - else { - fwrite(data->buf, rcvd, 1, outfp); - } - } - - if (type == FTPTYPE_ASCII && lastch == '\r') - putc('\r', outfp); - - data = data_close(data); - - if (ferror(outfp)) { - 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, FILE *infp, int insocket, int issock, 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 = FP_FGETC(insocket, infp, issock))!=EOF && !FP_FEOF(insocket, infp, issock)) { - /* 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 (!issock && ferror(infp)) - 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; - } - - size = sizeof(php_sockaddr_storage); - - /* passive connection handler */ - if (ftp->pasv) { - /* clear the ready status */ - ftp->pasv = 1; - - /* connect */ - 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); - - 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 416c36df83..0000000000 --- a/ext/ftp/ftp.h +++ /dev/null @@ -1,158 +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, FILE *outfp, 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, FILE *infp, - int insocket, int issock, 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 49ed65ff94..0000000000 --- a/ext/ftp/php_ftp.c +++ /dev/null @@ -1,782 +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; \ - } - -#define FILEP(fp, pval) ZEND_FETCH_RESOURCE(fp, FILE *, &pval, -1, "File-Handle", php_file_le_fopen()); - -/* {{{ 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; - FILE *fp; - 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); - FILEP(fp, z_file); - XTYPE(xtype, mode); - - if (!ftp_get(ftp, fp, file, xtype) || ferror(fp)) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - - if (ferror(fp)) { - 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; - FILE *outfp, *tmpfp; - int ch; - 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 - */ - if ((tmpfp = tmpfile()) == NULL) { - php_error(E_WARNING, "%s(): error opening tmpfile", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - if (!ftp_get(ftp, tmpfp, remote, xtype) || ferror(tmpfp)) { - fclose(tmpfp); - php_error(E_WARNING, "ftp_get: %s", ftp->inbuf); - RETURN_FALSE; - } - -#ifdef PHP_WIN32 - if ((outfp = VCWD_FOPEN(local, "wb")) == NULL) { -#else - if ((outfp = VCWD_FOPEN(local, "w")) == NULL) { -#endif - fclose(tmpfp); - php_error(E_WARNING, "%s(): error opening %s", get_active_function_name(TSRMLS_C), local); - RETURN_FALSE; - } - - rewind(tmpfp); - while ((ch = getc(tmpfp)) != EOF) - putc(ch, outfp); - - if (ferror(tmpfp) || ferror(outfp)) { - fclose(tmpfp); - fclose(outfp); - php_error(E_WARNING, "%s(): error writing %s", get_active_function_name(TSRMLS_C), local); - RETURN_FALSE; - } - - fclose(tmpfp); - fclose(outfp); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ 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 type, mode, remote_len; - void *rsrc; - 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); - rsrc = zend_fetch_resource(&z_file TSRMLS_CC, -1, "File-Handle", &type, 3, php_file_le_fopen(), php_file_le_popen(), php_file_le_socket()); - ZEND_VERIFY_RESOURCE(rsrc); - XTYPE(xtype, mode); - - if (!ftp_put(ftp, remote, (FILE*)rsrc, *(int*) rsrc, (type==php_file_le_socket()), 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; - FILE *infp; - char *remote, *local; - int remote_len, local_len, mode; - - 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); - -#ifdef PHP_WIN32 - if ((infp = VCWD_FOPEN(local, "rb")) == NULL) { -#else - if ((infp = VCWD_FOPEN(local, "r")) == NULL) { -#endif - php_error(E_WARNING, "%s(): error opening %s", get_active_function_name(TSRMLS_C), local); - RETURN_FALSE; - } - if (!ftp_put(ftp, remote, infp, 0, 0, xtype) || ferror(infp)) { - fclose(infp); - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ftp->inbuf); - RETURN_FALSE; - } - fclose(infp); - - 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 4172ed295e..0000000000 --- a/ext/ftp/php_ftp.h +++ /dev/null @@ -1,66 +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 _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 8cdeef9338..0000000000 --- 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/Makefile.in b/ext/gd/Makefile.in deleted file mode 100644 index c1b73be7fb..0000000000 --- a/ext/gd/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ - -LTLIBRARY_NAME = libgd.la -LTLIBRARY_SOURCES = gd.c gdcache.c gdttf.c gdt1.c -LTLIBRARY_SHARED_NAME = gd.la -LTLIBRARY_SHARED_LIBADD = $(GD_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 deleted file mode 100644 index f2723db7b8..0000000000 --- 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_EXTENSION(gd, $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 e5f8aa200e..0000000000 --- a/ext/gd/gd.c +++ /dev/null @@ -1,3622 +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) - PHP_FE(imagecreatefrompng, NULL) - PHP_FE(imagecreatefromgif, NULL) - PHP_FE(imagecreatefromjpeg, NULL) - PHP_FE(imagecreatefromwbmp, NULL) - PHP_FE(imagecreatefromxbm, NULL) - PHP_FE(imagecreatefromxpm, NULL) - PHP_FE(imagecreatefromgd, NULL) - PHP_FE(imagecreatefromgd2, NULL) - PHP_FE(imagecreatefromgd2part, NULL) - - PHP_FE(imagepng, NULL) - PHP_FE(imagegif, NULL) - PHP_FE(imagejpeg, NULL) - PHP_FE(imagewbmp, NULL) - PHP_FE(imagegd, NULL) - PHP_FE(imagegd2, NULL) - - PHP_FE(imagedestroy, NULL) - PHP_FE(imagegammacorrect, NULL) - PHP_FE(imagefill, NULL) - PHP_FE(imagefilledpolygon, NULL) - PHP_FE(imagefilledrectangle, NULL) - PHP_FE(imagefilltoborder, NULL) - PHP_FE(imagefontwidth, NULL) - PHP_FE(imagefontheight, NULL) - PHP_FE(imageinterlace, NULL) - PHP_FE(imageline, NULL) - PHP_FE(imageloadfont, NULL) - PHP_FE(imagepolygon, NULL) - PHP_FE(imagerectangle, NULL) - PHP_FE(imagesetpixel, NULL) - PHP_FE(imagestring, NULL) - PHP_FE(imagestringup, NULL) - PHP_FE(imagesx, NULL) - PHP_FE(imagesy, NULL) - PHP_FE(imagedashedline, NULL) - PHP_FE(imagettfbbox, NULL) - PHP_FE(imagettftext, NULL) - PHP_FE(imageftbbox, NULL) - PHP_FE(imagefttext, NULL) - 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) - PHP_FE(imagetypes, NULL) - - PHP_FE(jpeg2wbmp, NULL) - PHP_FE(png2wbmp, NULL) - PHP_FE(image2wbmp, NULL) - - {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; - FILE *fp; - int issock=0, socketd=0; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); - } - - convert_to_string_ex(file); - -#ifdef PHP_WIN32 - fp = VCWD_FOPEN(Z_STRVAL_PP(file), "rb"); -#else - fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC); -#endif - if (fp == NULL) { - php_error(E_WARNING, "ImageFontLoad: unable to open file"); - 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 = fread(&font[b], 1, hdr_size - b, fp))) - b += n; - if (!n) { - fclose(fp); - efree(font); - if (feof(fp)) { - php_error(E_WARNING, "ImageFontLoad: end of file while reading header"); - } else { - php_error(E_WARNING, "ImageFontLoad: error while reading header"); - } - RETURN_FALSE; - } - i = ftell(fp); - fseek(fp, 0, SEEK_END); - body_size_check = ftell(fp) - hdr_size; - fseek(fp, 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 = fread(&font->data[b], 1, body_size - b, fp))) - b += n; - if (!n) { - fclose(fp); - efree(font->data); - efree(font); - if (feof(fp)) { - php_error(E_WARNING, "ImageFontLoad: end of file while reading body"); - } else { - php_error(E_WARNING, "ImageFontLoad: error while reading body"); - } - RETURN_FALSE; - } - fclose(fp); - - /* 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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "%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_ERROR, "ImageCreateFromString: Only available with GD 1.5+"); -#endif -} -/* }}} */ - -size_t php_fread_all(char **buf, int socket, FILE *fp, int issock); - -/* {{{ _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; - char *fn=NULL; - FILE *fp; - int issock=0, socketd=0; - 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); - -#ifdef PHP_WIN32 - fp = VCWD_FOPEN(fn, "rb"); -#else - fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL TSRMLS_CC); -#endif - if (!fp && !socketd) { - php_strip_url_passwd(fn); - php_error(E_WARNING, "%s: Unable to open '%s' for reading", get_active_function_name(TSRMLS_C), fn); - RETURN_FALSE; - } - -#ifndef USE_GD_IOCTX - ioctx_func_p = NULL; /* don't allow sockets without IOCtx */ -#endif - - if(issock && !ioctx_func_p) { - php_error(E_WARNING, "%s: Sockets are not supported for image type '%s'", get_active_function_name(TSRMLS_C), tn); - RETURN_FALSE; - } - - if(issock && socketd) { -#ifdef USE_GD_IOCTX - gdIOCtx* io_ctx; - size_t buff_size; - char *buff, *buff_em; - - buff_size = php_fread_all(&buff_em, socketd, fp, issock); - - if(!buff_size) { - php_error(E_WARNING,"%s: Cannot read image data", get_active_function_name(TSRMLS_C)); - RETURN_FALSE; - } - - buff = malloc(buff_size); /* Should be malloc! GD uses free */ - memcpy(buff, buff_em, buff_size); - efree(buff_em); - - 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)); - RETURN_FALSE; - } - 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 { - 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); - fclose(fp); - } - - if (!im) { - php_error(E_WARNING,"%s: '%s' is not a valid %s file", get_active_function_name(TSRMLS_C), fn, tn); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, im, le_gd); -} -/* }}} */ - -/* {{{ 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_ERROR, "%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 e8e3f99a19..0000000000 --- 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 3c599cab65..0000000000 --- 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 b89f5610ac..0000000000 --- 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 06bf0ee6ce..0000000000 --- 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 3f5eefd090..0000000000 --- a/ext/gd/gdt1.c +++ /dev/null @@ -1,549 +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: 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 f9aa9759a6..0000000000 --- a/ext/gd/gdt1.h +++ /dev/null @@ -1,36 +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: 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 393f0bdbf7..0000000000 --- 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 4f32129702..0000000000 --- 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 613f624cfd..0000000000 --- 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/gd/setup.stub b/ext/gd/setup.stub deleted file mode 100644 index 64668ae0fb..0000000000 --- a/ext/gd/setup.stub +++ /dev/null @@ -1,6 +0,0 @@ -define_option with-gd 'GD support?' yesnodir \ - "yes /usr GD install" \ -' Whether to include GD support. If PHP can find the GD libraries\n - on your system, it will be included automatically. You should enter\n - something here if you do not want to include GD support or if you\n - have installed GD in some unusual directory.' diff --git a/ext/gettext/CREDITS b/ext/gettext/CREDITS deleted file mode 100644 index acaebd7fae..0000000000 --- a/ext/gettext/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GetText -Alex Plotnick diff --git a/ext/gettext/Makefile.in b/ext/gettext/Makefile.in deleted file mode 100644 index 522c367c4d..0000000000 --- a/ext/gettext/Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ - -LTLIBRARY_NAME = libgettext.la -LTLIBRARY_SOURCES = gettext.c -LTLIBRARY_SHARED_NAME = gettext.la -LTLIBRARY_SHARED_LIBADD = $(GETTEXT_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 deleted file mode 100644 index d5d4578938..0000000000 --- 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_EXTENSION(gettext, $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 f36b2e48b0..0000000000 --- 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 8150a17d84..0000000000 --- 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 bc4cfb93c4..0000000000 --- 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/gettext/setup.stub b/ext/gettext/setup.stub deleted file mode 100644 index cc9fdd43c8..0000000000 --- a/ext/gettext/setup.stub +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ - -define_option with-gettext 'gettext support?' yesnodir \ - "yes /usr/local" \ -' Whether to include gettext support.' - diff --git a/ext/gmp/CREDITS b/ext/gmp/CREDITS deleted file mode 100644 index 7e0346dc24..0000000000 --- a/ext/gmp/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -GNU GMP support -Stanislav Malyshev diff --git a/ext/gmp/Makefile.in b/ext/gmp/Makefile.in deleted file mode 100644 index 5a63346585..0000000000 --- a/ext/gmp/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libgmp.la -LTLIBRARY_SOURCES = gmp.c -LTLIBRARY_SHARED_NAME = gmp.la -LTLIBRARY_LIBADD = $(GMP_LIBADD) -LTLIBRARY_SHARED_LIBADD = $(GMP_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/gmp/README b/ext/gmp/README deleted file mode 100644 index e142e2e031..0000000000 --- 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 81098a9cc1..0000000000 --- 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 2d32dd741e..0000000000 --- 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_EXTENSION(gmp, $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 1bfd9f7392..0000000000 --- a/ext/gmp/gmp.c +++ /dev/null @@ -1,1230 +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: 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, /* Replace with NULL if there's nothing to do at request start */ - NULL, /* Replace with NULL if there's nothing to do at request end */ - 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; - - *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 (base==0) { - if(numstr[0] == '0' && (numstr[1] == 'x' || numstr[1] == 'X')) { - base=16; - } else { - base=10; - } - } - ret = mpz_init_set_str(**gmpnumber, numstr, base); - } - break; - default: - zend_error(E_WARNING,"Unable to convert variable to GMP - wrong type"); - efree(*gmpnumber); - return FAILURE; - } - - return ret?FAILURE: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); - 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 63062c3c1c..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 a2f520d527..0000000000 --- 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 2f32450474..0000000000 --- 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/hyperwave/CREDITS b/ext/hyperwave/CREDITS deleted file mode 100644 index b01b16907f..0000000000 --- a/ext/hyperwave/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -HyperWave -Uwe Steinmann diff --git a/ext/hyperwave/Makefile.in b/ext/hyperwave/Makefile.in deleted file mode 100644 index b66d82cfda..0000000000 --- a/ext/hyperwave/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libhyperwave.la -LTLIBRARY_SOURCES = hw.c hg_comm.c - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/hyperwave/config.m4 b/ext/hyperwave/config.m4 deleted file mode 100644 index 45391481bc..0000000000 --- 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_EXTENSION(hyperwave) - 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 5b72dbb194..0000000000 --- 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 645d3b88d7..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 c699f51c8d..0000000000 --- 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. | - +----------------------------------------------------------------------+ - | Authors: 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 fb70ac148f..0000000000 --- a/ext/hyperwave/hw.c +++ /dev/null @@ -1,4540 +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$ */ - -#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 -#ifdef HAVE_MMAP -#include -#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