Back to index

php5  5.3.10
php_sqlite3_structs.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 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    | Authors: Scott MacVicar <scottmac@php.net>                           |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_sqlite3_structs.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_SQLITE_STRUCTS_H
00022 #define PHP_SQLITE_STRUCTS_H
00023 
00024 #include <sqlite3.h>
00025 
00026 /* for backwards compatability reasons */
00027 #ifndef SQLITE_OPEN_READONLY
00028 #define SQLITE_OPEN_READONLY 0x00000001
00029 #endif
00030 
00031 #ifndef SQLITE_OPEN_READWRITE
00032 #define SQLITE_OPEN_READWRITE 0x00000002
00033 #endif
00034 
00035 #ifndef SQLITE_OPEN_CREATE
00036 #define SQLITE_OPEN_CREATE 0x00000004
00037 #endif
00038 
00039 /* Structure for SQLite Statement Parameter. */
00040 struct php_sqlite3_bound_param  {
00041        long param_number;
00042        char *name;
00043        int name_len;
00044        long type;
00045 
00046        zval *parameter;
00047 };
00048 
00049 struct php_sqlite3_fci {
00050        zend_fcall_info fci;
00051        zend_fcall_info_cache fcc;
00052 };
00053 
00054 /* Structure for SQLite function. */
00055 typedef struct _php_sqlite3_func {
00056        struct _php_sqlite3_func *next;
00057 
00058        const char *func_name;
00059        int argc;
00060 
00061        zval *func, *step, *fini;
00062        struct php_sqlite3_fci afunc, astep, afini;
00063 } php_sqlite3_func;
00064 
00065 /* Structure for SQLite Database object. */
00066 typedef struct _php_sqlite3_db_object  {
00067        zend_object zo;
00068        int initialised;
00069        sqlite3 *db;
00070        php_sqlite3_func *funcs;
00071        zend_bool exception;
00072 
00073        zend_llist free_list;
00074 } php_sqlite3_db_object;
00075 
00076 /* Structure for SQLite Database object. */
00077 typedef struct _php_sqlite3_agg_context  {
00078        zval *zval_context;
00079        long row_count;
00080 } php_sqlite3_agg_context;
00081 
00082 typedef struct _php_sqlite3_stmt_object php_sqlite3_stmt;
00083 typedef struct _php_sqlite3_result_object php_sqlite3_result;
00084 
00085 /* sqlite3 objects to be destroyed */
00086 typedef struct _php_sqlite3_free_list {
00087        zval *stmt_obj_zval;
00088        php_sqlite3_stmt *stmt_obj;
00089 } php_sqlite3_free_list;
00090 
00091 /* Structure for SQLite Result object. */
00092 struct _php_sqlite3_result_object  {
00093        zend_object zo;
00094        php_sqlite3_db_object *db_obj;
00095        php_sqlite3_stmt *stmt_obj;
00096        zval *stmt_obj_zval;
00097        
00098        int is_prepared_statement;
00099        int complete;
00100 };
00101 
00102 /* Structure for SQLite Statement object. */
00103 struct _php_sqlite3_stmt_object  {
00104        zend_object zo;
00105        sqlite3_stmt *stmt;
00106        php_sqlite3_db_object *db_obj;
00107        zval *db_obj_zval;
00108 
00109        int initialised;
00110 
00111        /* Keep track of the zvals for bound parameters */
00112        HashTable *bound_params;
00113 };
00114 
00115 #endif
00116 
00117 
00118 /*
00119  * Local variables:
00120  * tab-width: 4
00121  * c-basic-offset: 4
00122  * indent-tabs-mode: t
00123  * End:
00124  */