rename php_pq_clear_res -> php_pqres_clear
authorMichael Wallner <mike@php.net>
Tue, 3 May 2016 12:55:44 +0000 (14:55 +0200)
committerMichael Wallner <mike@php.net>
Tue, 3 May 2016 12:55:44 +0000 (14:55 +0200)
src/php_pq_misc.c
src/php_pq_misc.h
src/php_pqconn.c
src/php_pqcopy.c
src/php_pqcur.c
src/php_pqstm.c
src/php_pqtxn.c
src/php_pqtypes.c

index 296c6b54157ec86998c0f6f76b75999126cc3499..ba591834fe6c6abc2a75aea16298d7fc424df29f 100644 (file)
@@ -31,7 +31,7 @@
 
 
 /* clear result object associated with a result handle */
-void php_pq_clear_res(PGresult *r) {
+void php_pqres_clear(PGresult *r) {
        php_pq_object_t *o = PQresultInstanceData(r, php_pqconn_event);
 
        if (o) {
@@ -43,12 +43,12 @@ void php_pq_clear_res(PGresult *r) {
 }
 
 /* clear any asynchronous results */
-void php_pq_clear_conn(PGconn *conn) {
+void php_pqconn_clear(PGconn *conn) {
        PGresult *r;
        php_pqconn_event_data_t *evdata = PQinstanceData(conn, php_pqconn_event);
 
        while ((r = PQgetResult(conn))) {
-               php_pq_clear_res(r);
+               php_pqres_clear(r);
        }
 
        if (evdata && evdata->obj) {
@@ -66,19 +66,19 @@ void php_pq_clear_conn(PGconn *conn) {
 
 /* safe wrappers to clear any asynchronous wrappers before querying synchronously */
 PGresult *php_pq_exec(PGconn *conn, const char *query) {
-       php_pq_clear_conn(conn);
+       php_pqconn_clear(conn);
        return PQexec(conn, query);
 }
 PGresult *php_pq_exec_params(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const * paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) {
-       php_pq_clear_conn(conn);
+       php_pqconn_clear(conn);
        return PQexecParams(conn, command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat);
 }
 PGresult *php_pq_prepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes) {
-       php_pq_clear_conn(conn);
+       php_pqconn_clear(conn);
        return PQprepare(conn, stmtName, query, nParams, paramTypes);
 }
 PGresult *php_pq_exec_prepared(PGconn *conn, const char *stmtName, int nParams, const char *const * paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) {
-       php_pq_clear_conn(conn);
+       php_pqconn_clear(conn);
        return PQexecPrepared(conn, stmtName, nParams, paramValues, paramLengths, paramFormats, resultFormat);
 }
 
index c4fed18dde4d3530cceaa456d628603fbada311f..eee535bf55589b6af3a81490f34e1e758c10a419 100644 (file)
@@ -28,9 +28,9 @@ typedef enum {
 #include "php_pqres.h"
 
 /* clear result object associated with a result handle */
-extern void php_pq_clear_res(PGresult *r);
+extern void php_pqres_clear(PGresult *r);
 /* clear any asynchronous results */
-extern void php_pq_clear_conn(PGconn *conn);
+extern void php_pqconn_clear(PGconn *conn);
 /* safe wrappers to clear any asynchronous wrappers before querying synchronously */
 extern PGresult *php_pq_exec(PGconn *conn, const char *query);
 extern PGresult *php_pq_exec_params(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const * paramValues, const int *paramLengths, const int *paramFormats, int resultFormat);
index ad1a0a986ae66699c87ac6f13c8f6ed6ec466a03..1caf4d831d19cde25a0b193193c1f0c133f614f5 100644 (file)
@@ -563,7 +563,7 @@ php_resource_factory_ops_t *php_pqconn_get_resource_factory_ops(void)
 static void php_pqconn_wakeup(php_persistent_handle_factory_t *f, void **handle TSRMLS_DC)
 {
        PGresult *res = PQexec(*handle, "");
-       php_pq_clear_res(res);
+       php_pqres_clear(res);
 
        if (CONNECTION_OK != PQstatus(*handle)) {
                PQreset(*handle);
@@ -597,7 +597,7 @@ static int apply_unlisten(void *p TSRMLS_DC, int argc, va_list argv, zend_hash_k
        PGresult *res = unlisten(obj->intern->conn, key->arKey, key->nKeyLength - 1 TSRMLS_CC);
 
        if (res) {
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 
        return ZEND_HASH_APPLY_REMOVE;
@@ -624,7 +624,7 @@ static void php_pqconn_retire(php_persistent_handle_factory_t *f, void **handle
        }
        /* clean up async results */
        while ((res = PQgetResult(*handle))) {
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 
        /* clean up transaction & session */
@@ -638,7 +638,7 @@ static void php_pqconn_retire(php_persistent_handle_factory_t *f, void **handle
        }
 
        if (res) {
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 
        if (evdata) {
@@ -783,7 +783,7 @@ static PHP_METHOD(pqconn, unlisten)
 
                        if (res) {
                                php_pqres_success(res TSRMLS_CC);
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
                }
        }
@@ -894,7 +894,7 @@ static PHP_METHOD(pqconn, listen) {
                                                obj->intern->poller = PQconsumeInput;
                                                php_pqconn_add_listener(obj, channel_str, channel_len, &listener TSRMLS_CC);
                                        }
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                }
 
                                php_pqconn_notify_listeners(obj TSRMLS_CC);
@@ -979,7 +979,7 @@ static PHP_METHOD(pqconn, notify) {
                                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to notify listeners (%s)", PHP_PQerrorMessage(obj->intern->conn));
                        } else {
                                php_pqres_success(res TSRMLS_CC);
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        php_pqconn_notify_listeners(obj TSRMLS_CC);
@@ -1074,7 +1074,7 @@ static PHP_METHOD(pqconn, exec) {
                        } else if (SUCCESS == php_pqres_success(res TSRMLS_CC)) {
                                php_pq_object_to_zval_no_addref(PQresultInstanceData(res, php_pqconn_event), &return_value TSRMLS_CC);
                        } else {
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        php_pqconn_notify_listeners(obj TSRMLS_CC);
@@ -1181,7 +1181,7 @@ static PHP_METHOD(pqconn, execParams) {
                                if (SUCCESS == php_pqres_success(res TSRMLS_CC)) {
                                        php_pq_object_to_zval_no_addref(PQresultInstanceData(res, php_pqconn_event), &return_value TSRMLS_CC);
                                } else {
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                }
 
                                php_pqconn_notify_listeners(obj TSRMLS_CC);
@@ -1254,7 +1254,7 @@ ZEND_RESULT_CODE php_pqconn_prepare(zval *object, php_pqconn_object_t *obj, cons
                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to prepare statement (%s)", PHP_PQerrorMessage(obj->intern->conn));
        } else {
                rv = php_pqres_success(res TSRMLS_CC);
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
                php_pqconn_notify_listeners(obj TSRMLS_CC);
        }
 
@@ -1369,7 +1369,7 @@ ZEND_RESULT_CODE php_pqconn_declare(zval *object, php_pqconn_object_t *obj, cons
                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to declare cursor (%s)", PHP_PQerrorMessage(obj->intern->conn));
        } else {
                rv = php_pqres_success(res TSRMLS_CC);
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
                php_pqconn_notify_listeners(obj TSRMLS_CC);
        }
 
@@ -1606,7 +1606,7 @@ ZEND_RESULT_CODE php_pqconn_start_transaction(zval *zconn, php_pqconn_object_t *
                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to start transaction (%s)", PHP_PQerrorMessage(conn_obj->intern->conn));
                } else {
                        rv = php_pqres_success(res TSRMLS_CC);
-                       php_pq_clear_res(res);
+                       php_pqres_clear(res);
                        php_pqconn_notify_listeners(conn_obj TSRMLS_CC);
                }
 
index d4a042a97613cfa1ed426789db68dfe14b4a88fc..c073798efde10630bdc7b6606a3457d15e02b413 100644 (file)
@@ -164,7 +164,7 @@ static PHP_METHOD(pqcopy, __construct) {
                                        php_pq_object_addref(conn_obj TSRMLS_CC);
                                }
 
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        smart_str_free(&cmd);
@@ -232,7 +232,7 @@ static PHP_METHOD(pqcopy, end) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to fetch COPY result (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                } else {
                                        php_pqres_success(res TSRMLS_CC);
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                }
                        }
 
@@ -277,7 +277,7 @@ static PHP_METHOD(pqcopy, get) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to fetch COPY result (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                } else {
                                        php_pqres_success(res TSRMLS_CC);
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                        RETVAL_FALSE;
                                }
                                break;
index cda7ebc9aa521abcc53ce3f3c3b803a166200185..e24c042915c695ea7626f6510761f45d791dd9eb 100644 (file)
@@ -48,7 +48,7 @@ static void cur_close(php_pqcur_object_t *obj, zend_bool async, zend_bool silent
                        }
                } else {
                        if ((res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c))) {
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        } else if (!silent) {
                                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to close cursor (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                        }
index e075860193d97f249ac12ebae8f29482ff7473d2..b82adcfbe96e4f17f144d8a76597f8d6364bb1a2 100644 (file)
@@ -52,7 +52,7 @@ static void php_pqstm_deallocate(php_pqstm_object_t *obj, zend_bool async, zend_
                                PGresult *res;
 
                                if ((res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c))) {
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                } else if (!silent) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to deallocate statement (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                }
@@ -350,7 +350,7 @@ static PHP_METHOD(pqstm, desc) {
                                                add_next_index_long(return_value, PQparamtype(res, p));
                                        }
                                }
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                                php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
                        }
                }
index 423026634fd2247607a344c12daa6ec6b546dc1e..e90a2d8738313c6e4214eb808ab5c948c7d36d1b 100644 (file)
@@ -58,7 +58,7 @@ static void php_pqtxn_object_free(void *o TSRMLS_DC)
                        PGresult *res = php_pq_exec(obj->intern->conn->intern->conn, "ROLLBACK");
 
                        if (res) {
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
                }
                php_pq_object_delref(obj->intern->conn TSRMLS_CC);
@@ -166,7 +166,7 @@ static void php_pqtxn_object_write_isolation(zval *object, void *o, zval *value
 
        if (res) {
                php_pqres_success(res TSRMLS_CC);
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 }
 
@@ -183,7 +183,7 @@ static void php_pqtxn_object_write_readonly(zval *object, void *o, zval *value T
 
        if (res) {
                php_pqres_success(res TSRMLS_CC);
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 }
 
@@ -200,7 +200,7 @@ static void php_pqtxn_object_write_deferrable(zval *object, void *o, zval *value
 
        if (res) {
                php_pqres_success(res TSRMLS_CC);
-               php_pq_clear_res(res);
+               php_pqres_clear(res);
        }
 }
 
@@ -297,7 +297,7 @@ static PHP_METHOD(pqtxn, savepoint) {
                                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to create %s (%s)", cmd.c, PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                        } else {
                                php_pqres_success(res TSRMLS_CC);
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        smart_str_free(&cmd);
@@ -379,7 +379,7 @@ static PHP_METHOD(pqtxn, commit) {
                                                obj->intern->open = 0;
                                        }
                                }
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        smart_str_free(&cmd);
@@ -475,7 +475,7 @@ static PHP_METHOD(pqtxn, rollback) {
                                                obj->intern->open = 0;
                                        }
                                }
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        smart_str_free(&cmd);
@@ -556,7 +556,7 @@ static PHP_METHOD(pqtxn, exportSnapshot) {
                                        RETVAL_STRING(PQgetvalue(res, 0, 0), 1);
                                }
 
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                        }
 
                        php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
@@ -627,7 +627,7 @@ static PHP_METHOD(pqtxn, importSnapshot) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to import transaction snapshot (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                } else {
                                        php_pqres_success(res TSRMLS_CC);
-                                       php_pq_clear_res(res);
+                                       php_pqres_clear(res);
                                }
 
                                smart_str_free(&cmd);
index e3bc6235b6fbaac10249ec2feedb05725dd026f1..25cdc1e7a546fefe5c133e31a0831e85865700fb 100644 (file)
@@ -309,7 +309,7 @@ static PHP_METHOD(pqtypes, refresh) {
                                        }
                                }
 
-                               php_pq_clear_res(res);
+                               php_pqres_clear(res);
                                php_pqconn_notify_listeners(obj->intern->conn TSRMLS_CC);
                        }
                }