int curr_row;
char **col_names;
int alloc_rows;
- char **table;
int mode;
+ char **table;
};
struct php_sqlite_db {
sqlite *db;
int last_err_code;
zend_bool is_persistent;
- int rsrc_id;
+ long rsrc_id;
HashTable callbacks;
};
Opens a persistent handle to a SQLite database. Will create the database if it does not exist. */
PHP_FUNCTION(sqlite_popen)
{
- int mode = 0666;
+ long mode = 0666;
char *filename, *fullpath, *hashkey;
long filename_len, hashkeylen;
zval *errmsg = NULL;
fullpath = estrndup(filename, filename_len);
}
- hashkeylen = spprintf(&hashkey, 0, "sqlite_pdb_%s:%d", fullpath, mode);
+ hashkeylen = spprintf(&hashkey, 0, "sqlite_pdb_%s:%ld", fullpath, mode);
/* do we have an existing persistent connection ? */
if (SUCCESS == zend_hash_find(&EG(persistent_list), hashkey, hashkeylen+1, (void*)&le)) {
Opens a SQLite database. Will create the database if it does not exist. */
PHP_FUNCTION(sqlite_open)
{
- int mode = 0666;
+ long mode = 0666;
char *filename, *fullpath = NULL;
long filename_len;
zval *errmsg = NULL;
Opens a SQLite database and creates an object for it. Will create the database if it does not exist. */
PHP_FUNCTION(sqlite_factory)
{
- int mode = 0666;
+ long mode = 0666;
char *filename;
long filename_len;
zval *errmsg = NULL;
/* }}} */
/* {{{ sqlite_query */
-void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, int mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
+void sqlite_query(zval *object, struct php_sqlite_db *db, char *sql, long sql_len, long mode, int buffered, zval *return_value, struct php_sqlite_result **prres TSRMLS_DC)
{
struct php_sqlite_result res, *rres;
int ret;
struct php_sqlite_db *db;
char *sql;
long sql_len;
- int mode = PHPSQLITE_BOTH;
+ long mode = PHPSQLITE_BOTH;
char *errtext = NULL;
zval *object = getThis();
struct php_sqlite_db *db;
char *sql;
long sql_len;
- int mode = PHPSQLITE_BOTH;
+ long mode = PHPSQLITE_BOTH;
char *errtext = NULL;
zval *object = getThis();
PHP_FUNCTION(sqlite_fetch_all)
{
zval *zres, *ent;
- int mode = PHPSQLITE_BOTH;
+ long mode = PHPSQLITE_BOTH;
zend_bool decode_binary = 1;
struct php_sqlite_result *res;
zval *object = getThis();
struct php_sqlite_result *rres;
char *sql;
long sql_len;
- int mode = PHPSQLITE_BOTH;
+ long mode = PHPSQLITE_BOTH;
char *errtext = NULL;
zend_bool decode_binary = 1;
zval *object = getThis();
PHP_FUNCTION(sqlite_current)
{
zval *zres;
- int mode = PHPSQLITE_BOTH;
+ long mode = PHPSQLITE_BOTH;
zend_bool decode_binary = 1;
struct php_sqlite_result *res;
zval *object = getThis();
{
zval *zres;
struct php_sqlite_result *res;
- int field;
+ long field;
zval *object = getThis();
if (object) {
}
if (field < 0 || field >= res->ncolumns) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "field %d out of range", field);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "field %ld out of range", field);
RETURN_FALSE;
}
{
zval *zres;
struct php_sqlite_result *res;
- int row;
+ long row;
zval *object = getThis();
if (object) {
}
if (row < 0 || row >= res->nrows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "row %d out of range", row);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "row %ld out of range", row);
RETURN_FALSE;
}