Back to index

php5  5.3.10
php_pdo_sqlite_int.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   | Author: Wez Furlong <wez@php.net>                                    |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_pdo_sqlite_int.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_PDO_SQLITE_INT_H
00022 #define PHP_PDO_SQLITE_INT_H
00023 
00024 #include <sqlite3.h>
00025 
00026 typedef struct {
00027        const char *file;
00028        int line;
00029        unsigned int errcode;
00030        char *errmsg;
00031 } pdo_sqlite_error_info;
00032 
00033 struct pdo_sqlite_fci {
00034        zend_fcall_info fci;
00035        zend_fcall_info_cache fcc;
00036 };
00037 
00038 struct pdo_sqlite_func {
00039        struct pdo_sqlite_func *next;
00040 
00041        zval *func, *step, *fini;
00042        int argc;
00043        const char *funcname;
00044        
00045        /* accelerated callback references */
00046        struct pdo_sqlite_fci afunc, astep, afini;
00047 };
00048 
00049 typedef struct {
00050        sqlite3 *db;
00051        pdo_sqlite_error_info einfo;
00052        struct pdo_sqlite_func *funcs;
00053 } pdo_sqlite_db_handle;
00054 
00055 typedef struct {
00056        pdo_sqlite_db_handle        *H;
00057        sqlite3_stmt *stmt;
00058        unsigned pre_fetched:1;
00059        unsigned done:1;
00060 } pdo_sqlite_stmt;
00061 
00062 extern pdo_driver_t pdo_sqlite_driver;
00063 
00064 extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
00065 #define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
00066 #define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
00067 
00068 extern struct pdo_stmt_methods sqlite_stmt_methods;
00069 #endif