diff options
Diffstat (limited to 'ext/pdo_oci/oci_statement.c')
-rw-r--r-- | ext/pdo_oci/oci_statement.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 7c86a23dcc..92f726bb9b 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -36,7 +36,7 @@ #define STMT_CALL(name, params) \ do { \ S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \ + S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__); \ if (S->last_err) { \ return 0; \ } \ @@ -45,15 +45,15 @@ #define STMT_CALL_MSG(name, msg, params) \ do { \ S->last_err = name params; \ - S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \ + S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__); \ if (S->last_err) { \ return 0; \ } \ } while(0) -static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC); +static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob); -static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ +static int oci_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; HashTable *BC = stmt->bound_columns; @@ -116,7 +116,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ return 1; } /* }}} */ -static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ +static int oci_stmt_execute(pdo_stmt_t *stmt) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; ub4 rowcount; @@ -188,10 +188,9 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv { struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - TSRMLS_FETCH(); if (!param || !param->parameter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen"); + php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen"); return OCI_ERROR; } @@ -220,10 +219,9 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d { struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx; pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data; - TSRMLS_FETCH(); if (!param || !param->parameter) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen"); + php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen"); return OCI_ERROR; } @@ -258,7 +256,7 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d return OCI_CONTINUE; } /* }}} */ -static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */ +static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; @@ -372,7 +370,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa * wanted to bind a lob locator into it from the query * */ - stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing TSRMLS_CC); + stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing); if (stm) { OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE); php_stream_to_zval(stm, param->parameter); @@ -437,7 +435,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa return 1; } /* }}} */ -static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */ +static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset) /* {{{ */ { #if HAVE_OCISTMTFETCH2 ub4 ociori; @@ -481,7 +479,6 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp) { pdo_oci_column *col = (pdo_oci_column*)octxp; - TSRMLS_FETCH(); switch (col->dtype) { case SQLT_BLOB: @@ -493,7 +490,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, + php_error_docref(NULL, E_WARNING, "unhandled datatype in oci_define_callback; this should not happen"); return OCI_ERROR; } @@ -501,7 +498,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid return OCI_CONTINUE; } -static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */ +static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; OCIParam *param = NULL; @@ -611,7 +608,7 @@ struct oci_lob_self { ub4 offset; }; -static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) +static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; ub4 amt; @@ -631,7 +628,7 @@ static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count T return amt; } -static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) +static size_t oci_blob_read(php_stream *stream, char *buf, size_t count) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; ub4 amt; @@ -653,7 +650,7 @@ static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_D return amt; } -static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC) +static int oci_blob_close(php_stream *stream, int close_handle) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; pdo_stmt_t *stmt = self->stmt; @@ -663,18 +660,18 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC) efree(self); } - php_pdo_stmt_delref(stmt TSRMLS_CC); + php_pdo_stmt_delref(stmt); return 0; } -static int oci_blob_flush(php_stream *stream TSRMLS_DC) +static int oci_blob_flush(php_stream *stream) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; OCILobFlushBuffer(self->S->H->svc, self->S->err, self->lob, 0); return 0; } -static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC) +static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset) { struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract; @@ -698,7 +695,7 @@ static php_stream_ops oci_blob_stream_ops = { NULL }; -static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC) +static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob) { php_stream *stm; struct oci_lob_self *self = ecalloc(1, sizeof(*self)); @@ -710,7 +707,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS stm = php_stream_alloc(&oci_blob_stream_ops, self, 0, "r+b"); if (stm) { - php_pdo_stmt_addref(stmt TSRMLS_CC); + php_pdo_stmt_addref(stmt); return stm; } @@ -718,7 +715,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS return NULL; } -static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) /* {{{ */ +static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees) /* {{{ */ { pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data; pdo_oci_column *C = &S->cols[colno]; @@ -734,7 +731,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo if (C->dtype == SQLT_BLOB || C->dtype == SQLT_CLOB) { if (C->data) { - *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data TSRMLS_CC); + *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data); OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY); } *len = 0; @@ -746,7 +743,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo return 1; } else { /* it was truncated */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno); + php_error_docref(NULL, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno); *ptr = C->data; *len = C->fetched_len; |