/* the same check, but with a call to DBA_ID_DONE before returning */ #define DBA_WRITE_CHECK_WITH_ID \ if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \ DBA_ID_DONE; \ RETURN_FALSE; \ } /* }}} */ /* {{{ globals */ static dba_handler handler[] = { #if DBA_GDBM DBA_HND(gdbm, DBA_LOCK_EXT) /* Locking done in library if set */ #endif #if DBA_DBM DBA_HND(dbm, DBA_LOCK_ALL) /* No lock in lib */ #endif #if DBA_NDBM DBA_HND(ndbm, DBA_LOCK_ALL) /* Could be done in library: filemode = 0644 + S_ENFMT */ #endif #if DBA_CDB DBA_HND(cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ #endif #if DBA_CDB_BUILTIN DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ #endif #if DBA_DB1 DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */
/* 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)