diff options
author | Sean Finney <seanius@debian.org> | 2010-02-07 22:19:53 +0100 |
---|---|---|
committer | Sean Finney <seanius@debian.org> | 2010-02-07 22:27:07 +0100 |
commit | c852c28a88fccf6e34a2cb091fdfa72bce2b59c7 (patch) | |
tree | 91f01b0d06916c78262404096bfd466b8e95e5b5 /ext/sqlite3/php_sqlite3_structs.h | |
parent | 176cbd0bc99e20bb21f92f0b72df728eafc1e2ce (diff) | |
parent | 0fab6db7cac8d2be99579dd049f812a8ff98e74f (diff) | |
download | php-c852c28a88fccf6e34a2cb091fdfa72bce2b59c7.tar.gz |
Merge branch 'upstream-experimental' into upstream-sid
Diffstat (limited to 'ext/sqlite3/php_sqlite3_structs.h')
-rw-r--r-- | ext/sqlite3/php_sqlite3_structs.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h new file mode 100644 index 000000000..866871e75 --- /dev/null +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -0,0 +1,124 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2009 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: | + | http://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. | + +----------------------------------------------------------------------+ + | Authors: Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +/* $Id: php_sqlite3_structs.h 279456 2009-04-27 18:16:46Z scottmac $ */ + +#ifndef PHP_SQLITE_STRUCTS_H +#define PHP_SQLITE_STRUCTS_H + +#include <sqlite3.h> + +/* for backwards compatability reasons */ +#ifndef SQLITE_OPEN_READONLY +#define SQLITE_OPEN_READONLY 0x00000001 +#endif + +#ifndef SQLITE_OPEN_READWRITE +#define SQLITE_OPEN_READWRITE 0x00000002 +#endif + +#ifndef SQLITE_OPEN_CREATE +#define SQLITE_OPEN_CREATE 0x00000004 +#endif + +/* Structure for SQLite Statement Parameter. */ +struct php_sqlite3_bound_param { + long param_number; + char *name; + int name_len; + long type; + + zval *parameter; +}; + +struct php_sqlite3_fci { + zend_fcall_info fci; + zend_fcall_info_cache fcc; +}; + +/* Structure for SQLite function. */ +typedef struct _php_sqlite3_func { + struct _php_sqlite3_func *next; + + const char *func_name; + int argc; + + zval *func, *step, *fini; + struct php_sqlite3_fci afunc, astep, afini; +} php_sqlite3_func; + +/* Structure for SQLite Database object. */ +typedef struct _php_sqlite3_db_object { + zend_object zo; + int initialised; + sqlite3 *db; + php_sqlite3_func *funcs; + zend_bool exception; + + zend_llist free_list; +} php_sqlite3_db_object; + +/* Structure for SQLite Database object. */ +typedef struct _php_sqlite3_agg_context { + zval *zval_context; + long row_count; +} php_sqlite3_agg_context; + +typedef struct _php_sqlite3_stmt_object php_sqlite3_stmt; +typedef struct _php_sqlite3_result_object php_sqlite3_result; + +/* sqlite3 objects to be destroyed */ +typedef struct _php_sqlite3_free_list { + zval *stmt_obj_zval; + php_sqlite3_stmt *stmt_obj; +} php_sqlite3_free_list; + +/* Structure for SQLite Result object. */ +struct _php_sqlite3_result_object { + zend_object zo; + php_sqlite3_db_object *db_obj; + php_sqlite3_stmt *stmt_obj; + zval *stmt_obj_zval; + + int is_prepared_statement; + int complete; +}; + +/* Structure for SQLite Statement object. */ +struct _php_sqlite3_stmt_object { + zend_object zo; + sqlite3_stmt *stmt; + php_sqlite3_db_object *db_obj; + zval *db_obj_zval; + + int initialised; + + /* Keep track of the zvals for bound parameters */ + HashTable *bound_params; +}; + +#endif + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + */ |