From: Ard Biesheuvel Date: Sat, 12 Jun 2004 17:09:33 +0000 (+0000) Subject: Folding markers X-Git-Tag: php-5.0.0~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a312bb5ee3e5520fd3a9cbea301867a7d8132d47;p=php Folding markers --- diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 8b8ad371d3..c9a6c8e975 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -31,7 +31,7 @@ #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; @@ -78,11 +78,12 @@ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long li 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; @@ -106,10 +107,11 @@ static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) 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; @@ -187,9 +189,10 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_le 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; @@ -262,9 +265,10 @@ static long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len T 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; @@ -302,9 +306,10 @@ static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unqu 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; @@ -314,9 +319,10 @@ static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) } 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; @@ -326,9 +332,10 @@ static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) } 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; @@ -338,9 +345,10 @@ static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) } 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; @@ -372,15 +380,17 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TS } 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; @@ -401,8 +411,9 @@ static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval } 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, @@ -415,6 +426,7 @@ static struct pdo_dbh_methods firebird_methods = { 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) /* {{{ */ @@ -475,10 +487,11 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM } /* }}} */ -pdo_driver_t pdo_firebird_driver = { +pdo_driver_t pdo_firebird_driver = { /* {{{ */ PDO_DRIVER_HEADER(firebird), pdo_firebird_handle_factory }; +/* }}} */ /* * Local variables: diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index eca73de00b..4b7b3eb354 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -35,7 +35,7 @@ #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; @@ -47,9 +47,10 @@ static void free_sqlda(XSQLDA const *sqlda) } } } +/* }}} */ /* 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; @@ -73,9 +74,10 @@ static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) 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; @@ -111,9 +113,10 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) 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; @@ -140,9 +143,10 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt TSRMLS_DC) } 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]; @@ -161,7 +165,7 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) } /* 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) { @@ -189,11 +193,13 @@ static void set_param_type(enum pdo_param_type *param_type, XSQLVAR const *var) 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]; @@ -304,8 +310,9 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsign } 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; @@ -417,8 +424,9 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat } 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; @@ -438,6 +446,7 @@ static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, long attr, zval *val TS } return 1; } +/* }}} */ static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TSRMLS_DC) { @@ -456,6 +465,7 @@ static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, long attr, zval *val TS } return 1; } +/* }}} */ struct pdo_stmt_methods firebird_stmt_methods = { firebird_stmt_dtor, @@ -467,6 +477,7 @@ struct pdo_stmt_methods firebird_stmt_methods = { firebird_stmt_set_attribute, firebird_stmt_get_attribute }; +/* }}} */ /* * Local variables: diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index bdb946f108..4e63546942 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -30,14 +30,12 @@ #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, @@ -55,9 +53,7 @@ zend_module_entry pdo_firebird_module_entry = { 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); @@ -65,9 +61,7 @@ PHP_MINIT_FUNCTION(pdo_firebird) } /* }}} */ -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(pdo_firebird) +PHP_MSHUTDOWN_FUNCTION(pdo_firebird) /* {{{ */ { php_pdo_unregister_driver(&pdo_firebird_driver); @@ -75,9 +69,7 @@ PHP_MSHUTDOWN_FUNCTION(pdo_firebird) } /* }}} */ -/* {{{ 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");