From 95018fc5c0f129a281ddaa1f508e84597e8e70e9 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Fri, 8 Nov 2002 01:03:53 +0000 Subject: -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 --- ext/dba/php_dba.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ext/dba/php_dba.h') 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 -- cgit v1.2.1