2002-11-06 01:47:06 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 17:33:29 +00:00
|
|
|
| PHP Version 5 |
|
2002-11-06 01:47:06 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2008-12-31 11:15:49 +00:00
|
|
|
| Copyright (c) 1997-2009 The PHP Group |
|
2002-11-06 01:47:06 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2002-11-06 01:47:06 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 12:51:34 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2002-11-06 01:47:06 +00:00
|
|
|
| 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: Marcus Boerger <helly@php.net> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2003-02-18 20:48:05 +00:00
|
|
|
#ifndef PHP_LIB_FLATFILE_H
|
|
|
|
#define PHP_LIB_FLATFILE_H
|
2002-11-06 01:47:06 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *dptr;
|
2002-11-13 16:28:44 +00:00
|
|
|
size_t dsize;
|
2002-11-06 01:47:06 +00:00
|
|
|
} datum;
|
|
|
|
|
|
|
|
typedef struct {
|
2002-11-06 04:16:18 +00:00
|
|
|
char *lockfn;
|
|
|
|
int lockfd;
|
2002-11-06 01:47:06 +00:00
|
|
|
php_stream *fp;
|
2002-11-13 16:28:44 +00:00
|
|
|
size_t CurrentFlatFilePos;
|
2002-11-06 01:47:06 +00:00
|
|
|
datum nextkey;
|
2002-11-06 09:17:51 +00:00
|
|
|
} flatfile;
|
2002-11-06 01:47:06 +00:00
|
|
|
|
2002-11-07 23:03:16 +00:00
|
|
|
#define FLATFILE_INSERT 1
|
|
|
|
#define FLATFILE_REPLACE 0
|
2002-11-06 01:47:06 +00:00
|
|
|
|
2002-11-19 01:06:42 +00:00
|
|
|
int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC);
|
|
|
|
datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC);
|
|
|
|
int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC);
|
|
|
|
int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC);
|
|
|
|
datum flatfile_firstkey(flatfile *dba TSRMLS_DC);
|
|
|
|
datum flatfile_nextkey(flatfile *dba TSRMLS_DC);
|
2002-12-30 13:07:30 +00:00
|
|
|
char *flatfile_version();
|
2002-11-06 01:47:06 +00:00
|
|
|
|
|
|
|
#endif
|