diff options
author | SVN Migration <svn@php.net> | 2002-02-03 20:42:11 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2002-02-03 20:42:11 +0000 |
commit | 3f4d2c4b7f8b693011c798b216864b851c78d4f0 (patch) | |
tree | 4ab02ad88854f08c97e416bbe488051c48ad69d0 /ext/dba | |
parent | 493563652160eda6c935db127ae9310248f6719d (diff) | |
download | php-git-PRE_ISSET_PATCH.tar.gz |
This commit was manufactured by cvs2svn to create tag 'PRE_ISSET_PATCH'.PRE_ISSET_PATCH
Diffstat (limited to 'ext/dba')
-rw-r--r-- | ext/dba/CREDITS | 2 | ||||
-rw-r--r-- | ext/dba/Makefile.in | 8 | ||||
-rw-r--r-- | ext/dba/config.m4 | 235 | ||||
-rw-r--r-- | ext/dba/dba.c | 523 | ||||
-rw-r--r-- | ext/dba/dba.dsp | 157 | ||||
-rw-r--r-- | ext/dba/dba_cdb.c | 218 | ||||
-rw-r--r-- | ext/dba/dba_db2.c | 201 | ||||
-rw-r--r-- | ext/dba/dba_db3.c | 208 | ||||
-rw-r--r-- | ext/dba/dba_dbm.c | 184 | ||||
-rw-r--r-- | ext/dba/dba_gdbm.c | 187 | ||||
-rw-r--r-- | ext/dba/dba_ndbm.c | 164 | ||||
-rw-r--r-- | ext/dba/php_cdb.h | 12 | ||||
-rw-r--r-- | ext/dba/php_db2.h | 12 | ||||
-rw-r--r-- | ext/dba/php_db3.h | 12 | ||||
-rw-r--r-- | ext/dba/php_dba.h | 104 | ||||
-rw-r--r-- | ext/dba/php_dbm.h | 12 | ||||
-rw-r--r-- | ext/dba/php_gdbm.h | 12 | ||||
-rw-r--r-- | ext/dba/php_ndbm.h | 12 | ||||
-rw-r--r-- | ext/dba/setup.stub | 6 |
19 files changed, 0 insertions, 2269 deletions
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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_CDB -#include "php_cdb.h" - -#include <sys/types.h> -#include <unistd.h> -#include <fcntl.h> - -#include <cdb.h> -#include <cdbmake.h> - -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DB2 -#include "php_db2.h" -#include <sys/stat.h> - -#include <string.h> -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DB3 -#include "php_db3.h" -#include <sys/stat.h> - -#include <string.h> -#ifdef DB3_INCLUDE_FILE -#include DB3_INCLUDE_FILE -#else -#include <db.h> -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_DBM -#include "php_dbm.h" - -#include <dbm.h> - -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_GDBM -#include "php_gdbm.h" - -#include <gdbm.h> - -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#include "php.h" - -#if DBA_NDBM -#include "php_ndbm.h" - -#include <fcntl.h> -#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 <sascha@schumann.cx> | - +----------------------------------------------------------------------+ - */ - -/* $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.' - |