1999-04-22 07:37:47 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:32:16 +08:00
|
|
|
| PHP Version 4 |
|
1999-04-22 07:37:47 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2003-01-01 00:08:15 +08:00
|
|
|
| Copyright (c) 1997-2003 The PHP Group |
|
1999-04-22 07:37:47 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 09:40:02 +08:00
|
|
|
| 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. |
|
1999-04-22 07:37:47 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 16:29:35 +08:00
|
|
|
| Authors: Rasmus Lerdorf <rasmus@php.net> |
|
1999-04-22 07:37:47 +08:00
|
|
|
| Jim Winstead <jimw@php.net> |
|
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 09:40:02 +08:00
|
|
|
*/
|
1999-04-22 07:37:47 +08:00
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
2000-07-03 07:46:51 +08:00
|
|
|
#ifndef PHP_DB_H
|
|
|
|
#define PHP_DB_H
|
1999-04-22 07:37:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef DLEXPORT
|
|
|
|
#define DLEXPORT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-12-18 04:55:31 +08:00
|
|
|
extern zend_module_entry dbm_module_entry;
|
1999-05-03 19:11:23 +08:00
|
|
|
#define phpext_db_ptr &dbm_module_entry
|
1999-04-22 07:37:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
2000-06-10 16:48:01 +08:00
|
|
|
#if defined(PHP_WIN32) && !defined(COMPILE_DL_DB)
|
1999-05-03 19:11:23 +08:00
|
|
|
#undef phpext_db_ptr
|
|
|
|
#define phpext_db_ptr NULL
|
1999-04-22 07:37:47 +08:00
|
|
|
#endif
|
|
|
|
|
2001-08-15 01:46:19 +08:00
|
|
|
dbm_info *php_find_dbm(pval *id TSRMLS_DC);
|
2002-01-20 12:55:40 +08:00
|
|
|
void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
2001-08-15 01:46:19 +08:00
|
|
|
dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC);
|
|
|
|
char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC);
|
2002-08-27 08:44:07 +08:00
|
|
|
int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int replace_mode TSRMLS_DC);
|
2002-06-29 08:40:34 +08:00
|
|
|
int php_dbm_exists(dbm_info *info, char *key TSRMLS_DC);
|
|
|
|
int php_dbm_delete(dbm_info *info, char *key TSRMLS_DC);
|
|
|
|
char *php_dbm_first_key(dbm_info *info TSRMLS_DC);
|
2001-08-15 01:46:19 +08:00
|
|
|
char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC);
|
1999-04-22 07:37:47 +08:00
|
|
|
|
|
|
|
/* db file functions */
|
1999-07-27 04:09:08 +08:00
|
|
|
PHP_MINIT_FUNCTION(db);
|
|
|
|
PHP_RINIT_FUNCTION(db);
|
|
|
|
PHP_MINFO_FUNCTION(db);
|
|
|
|
|
1999-05-21 18:06:25 +08:00
|
|
|
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);
|
1999-04-22 07:37:47 +08:00
|
|
|
|
2000-07-03 07:46:51 +08:00
|
|
|
#endif /* PHP_DB_H */
|