summaryrefslogtreecommitdiff
path: root/ext/dba/php_dba.h
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-11-08 01:03:53 +0000
committerMarcus Boerger <helly@php.net>2002-11-08 01:03:53 +0000
commit95018fc5c0f129a281ddaa1f508e84597e8e70e9 (patch)
tree9b6c9bcdc2c5cd21a172f08a25b74f6e5e4d1773 /ext/dba/php_dba.h
parent28c2fb66813794e61f54c792fc3d42151c90881c (diff)
downloadphp-git-95018fc5c0f129a281ddaa1f508e84597e8e70e9.tar.gz
-lock support moved from dba_flatfile.c to dba.c
-flatfile, cdb, cdb_make use locking now #locking is blocking per default use 'rt', 'wt', ct' or 'nt' for non blocking alias #test access to a database file. #locking uses flock() which will be emulated or warned if that is not eally #possible in ext/standard/flock_compat.c
Diffstat (limited to 'ext/dba/php_dba.h')
-rw-r--r--ext/dba/php_dba.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h
index c0c1bfc672..661f6af97b 100644
--- a/ext/dba/php_dba.h
+++ b/ext/dba/php_dba.h
@@ -24,12 +24,19 @@
#if HAVE_DBA
typedef enum {
+ /* do not allow 0 here */
DBA_READER = 1,
DBA_WRITER,
DBA_TRUNC,
DBA_CREAT
} dba_mode_t;
+typedef struct dba_lock {
+ php_stream *fp;
+ int fd;
+ char *name;
+} dba_lock;
+
typedef struct dba_info {
/* public */
void *dbf; /* ptr to private data or whatever */
@@ -40,8 +47,18 @@ typedef struct dba_info {
zval ***argv;
/* private */
struct dba_handler *hnd;
+ dba_lock lock;
} dba_info;
+#define DBA_LOCK_READER (1)
+#define DBA_LOCK_WRITER (2)
+#define DBA_LOCK_CREAT (4)
+#define DBA_LOCK_TRUNC (8)
+
+#define DBA_LOCK_EXT (0)
+#define DBA_LOCK_ALL (DBA_LOCK_READER|DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC)
+#define DBA_LOCK_WCT (DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC)
+
extern zend_module_entry dba_module_entry;
#define dba_module_ptr &dba_module_entry