Download src/php/php-src/ext/dba/php_dba.h from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 4.57 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dba/php_dba.h
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/dba/php_dba.h
-
curl -L -o php_dba.h https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/dba/php_dba.h
4.57 kB
| /* | |
| +----------------------------------------------------------------------+ | |
| | Copyright (c) The PHP Group | | |
| +----------------------------------------------------------------------+ | |
| | This source file is subject to version 3.01 of the PHP license, | | |
| | that is bundled with this package in the file LICENSE, and is | | |
| | available through the world-wide-web at the following url: | | |
| | https://www.php.net/license/3_01.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. | | |
| +----------------------------------------------------------------------+ | |
| | Author: Sascha Schumann <sascha@schumann.cx> | | |
| +----------------------------------------------------------------------+ | |
| */ | |
| 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 mode; /* LOCK_EX,LOCK_SH */ | |
| } dba_lock; | |
| typedef struct dba_info { | |
| /* public */ | |
| void *dbf; /* ptr to private data or whatever */ | |
| zend_string *path; | |
| dba_mode_t mode; | |
| php_stream *fp; /* this is the database stream for builtin handlers */ | |
| int fd; | |
| int file_permission; | |
| zend_long map_size; | |
| /* -1 for default driver flags */ | |
| zend_long driver_flags; | |
| /* private */ | |
| int flags; /* whether and how dba did locking and other flags*/ | |
| const struct dba_handler *hnd; | |
| dba_lock lock; | |
| } dba_info; | |
| typedef struct dba_connection { | |
| dba_info *info; | |
| zend_string *hash; | |
| zend_object std; | |
| } dba_connection; | |
| extern zend_module_entry dba_module_entry; | |
| typedef struct dba_handler { | |
| const char *name; /* handler name */ | |
| int flags; /* whether and how dba does locking and other flags*/ | |
| zend_result (*open)(dba_info *, const char **error); | |
| void (*close)(dba_info *); | |
| zend_string* (*fetch)(dba_info *, zend_string *, int); | |
| zend_result (*update)(dba_info *, zend_string *, zend_string *, int); | |
| zend_result (*exists)(dba_info *, zend_string *); | |
| zend_result (*delete)(dba_info *, zend_string *); | |
| zend_string* (*firstkey)(dba_info *); | |
| zend_string* (*nextkey)(dba_info *); | |
| zend_result (*optimize)(dba_info *); | |
| zend_result (*sync)(dba_info *); | |
| char* (*info)(const struct dba_handler *hnd, dba_info *); | |
| /* dba_info==NULL: Handler info, dba_info!=NULL: Database info */ | |
| } dba_handler; | |
| /* common prototypes which must be supplied by modules */ | |