Back to index

php5  5.3.10
flatfile.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2010 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Marcus Boerger <helly@php.net>                               |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: flatfile.h 293036 2010-01-03 09:23:27Z sebastian $ */
00020 
00021 #ifndef PHP_LIB_FLATFILE_H
00022 #define PHP_LIB_FLATFILE_H
00023 
00024 typedef struct {
00025        char *dptr;
00026        size_t dsize;
00027 } datum;
00028 
00029 typedef struct {
00030        char *lockfn;
00031        int lockfd;
00032        php_stream *fp;
00033        size_t CurrentFlatFilePos;
00034        datum nextkey;
00035 } flatfile;
00036 
00037 #define FLATFILE_INSERT 1
00038 #define FLATFILE_REPLACE 0
00039 
00040 int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC);
00041 datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC);
00042 int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC);
00043 int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC);
00044 datum flatfile_firstkey(flatfile *dba TSRMLS_DC);
00045 datum flatfile_nextkey(flatfile *dba TSRMLS_DC);
00046 char *flatfile_version();
00047 
00048 #endif