#include "php_pdo_firebird_int.h"
/* map driver specific error message to PDO error */
-void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC)
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H
: (pdo_firebird_db_handle *)dbh->driver_data;
break;
}
}
+/* }}} */
#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC)
/* called by PDO to close a db handle */
-static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
return 0;
}
+/* }}} */
/* called by PDO to prepare an SQL query */
-static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt,
- long options, zval *driver_options TSRMLS_DC)
+static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, /* {{{ */
+ pdo_stmt_t *stmt, long options, zval *driver_options TSRMLS_DC)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
pdo_firebird_stmt *S = NULL;
return 0;
}
+/* }}} */
/* called by PDO to execute a statement that doesn't produce a result */
-static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC)
+static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
isc_stmt_handle stmt = NULL;
return ret;
}
+/* }}} */
/* called by the PDO SQL parser to add quotes to values that are copied into SQL */
-static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen,
+static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, /* {{{ */
char **quoted, int *quotedlen TSRMLS_DC)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
return 1;
}
}
+/* }}} */
/* called by PDO to start a transaction */
-static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
}
return 1;
}
+/* }}} */
/* called by PDO to commit a transaction */
-static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
}
return 1;
}
+/* }}} */
/* called by PDO to rollback a transaction */
-static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
}
return 1;
}
+/* }}} */
/* called by PDO to set a driver-specific dbh attribute */
-static int firebird_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+static int firebird_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
}
return 0;
}
+/* }}} */
/* called by PDO to get a driver-specific dbh attribute */
-static int firebird_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
+static int firebird_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
{
return 0;
}
+/* }}} */
/* called by PDO to retrieve driver-specific information about an error that has occurred */
-static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
ISC_STATUS *s = H->isc_status;
}
return 1;
}
+/* }}} */
-static struct pdo_dbh_methods firebird_methods = {
+static struct pdo_dbh_methods firebird_methods = { /* {{{ */
firebird_handle_closer,
firebird_handle_preparer,
firebird_handle_doer,
pdo_firebird_fetch_error_func,
firebird_handle_get_attribute,
};
+/* }}} */
/* the driver-specific PDO handle constructor */
static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
}
/* }}} */
-pdo_driver_t pdo_firebird_driver = {
+pdo_driver_t pdo_firebird_driver = { /* {{{ */
PDO_DRIVER_HEADER(firebird),
pdo_firebird_handle_factory
};
+/* }}} */
/*
* Local variables:
#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC)
/* free the allocated space for passing field values to the db and back */
-static void free_sqlda(XSQLDA const *sqlda)
+static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
{
int i;
}
}
}
+/* }}} */
/* called by PDO to clean up a statement handle */
-static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
int i;
return 1;
}
+/* }}} */
/* called by PDO to execute a prepared query */
-static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
return 0;
}
+/* }}} */
/* called by PDO to fetch the next row from a statement */
-static int firebird_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC)
+static int firebird_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
}
return 0;
}
+/* }}} */
/* called by PDO to retrieve information about the fields being returned */
-static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
struct pdo_column_data *col = &stmt->columns[colno];
}
/* internal function to override return types of parameters */
-static void set_param_type(enum pdo_param_type *param_type, XSQLVAR const *var)
+static void set_param_type(enum pdo_param_type *param_type, XSQLVAR const *var) /* {{{ */
{
/* set the param type after the field type */
switch (var->sqltype & ~1) {
break;
}
}
+/* }}} */
#define FETCH_BUF(buf,type,len) ((buf) = (buf) ? (buf) : \
emalloc((len) ? (len * sizeof(type)) : ((len) = sizeof(type))))
-static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len TSRMLS_DC)
+static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
+ unsigned long *len TSRMLS_DC)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
XSQLVAR const *var = &S->out_sqlda.sqlvar[colno];
}
return 1;
}
+/* }}} */
-static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
+static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */
enum pdo_param_event event_type TSRMLS_DC)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
}
return 1;
}
+/* }}} */
-static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC)
+static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
}
return 1;
}
+/* }}} */
static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC)
{
}
return 1;
}
+/* }}} */
struct pdo_stmt_methods firebird_stmt_methods = {
firebird_stmt_dtor,
firebird_stmt_set_attribute,
firebird_stmt_get_attribute
};
+/* }}} */
/*
* Local variables:
#include "php_pdo_firebird.h"
#include "php_pdo_firebird_int.h"
-/* {{{ pdo_firebird_functions[] */
-function_entry pdo_firebird_functions[] = {
+function_entry pdo_firebird_functions[] = { /* {{{ */
{NULL, NULL, NULL}
};
/* }}} */
-/* {{{ pdo_firebird_module_entry */
-zend_module_entry pdo_firebird_module_entry = {
+zend_module_entry pdo_firebird_module_entry = { /* {{{ */
STANDARD_MODULE_HEADER,
"PDO_Firebird",
pdo_firebird_functions,
ZEND_GET_MODULE(pdo_firebird)
#endif
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(pdo_firebird)
+PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */
{
php_pdo_register_driver(&pdo_firebird_driver);
}
/* }}} */
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(pdo_firebird)
+PHP_MSHUTDOWN_FUNCTION(pdo_firebird) /* {{{ */
{
php_pdo_unregister_driver(&pdo_firebird_driver);
}
/* }}} */
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(pdo_firebird)
+PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
{
php_info_print_table_start();
php_info_print_table_header(2, "PDO Driver for Firebird/InterBase", "enabled");