cvs: php4 /ext/pgsql pgsql.c php_pgsql.h
| From: | Yasuo Ohgaki | Date: | Wed, 06 Feb 2002 07:16:10 +0000 |
| Subject: | cvs: php4 /ext/pgsql pgsql.c php_pgsql.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9299@lists.php.net to get a copy of this message | ||
yohgaki Wed Feb 6 02:16:10 2002 EDT
Modified files:
/php4/ext/pgsql pgsql.c php_pgsql.h
Log:
Make module specified functions to static.
Added TSRMLS_D/C, get rid of one TSRMLS_FETCH.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.146 php4/ext/pgsql/pgsql.c:1.147
--- php4/ext/pgsql/pgsql.c:1.146 Thu Jan 24 19:43:50 2002
+++ php4/ext/pgsql/pgsql.c Wed Feb 6 02:16:10 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.146 2002/01/25 00:43:50 yohgaki Exp $ */
+/* $Id: pgsql.c,v 1.147 2002/02/06 07:16:10 yohgaki Exp $ */
#include <stdlib.h>
@@ -182,10 +182,8 @@
/* {{{ php_pgsql_set_default_link
*/
-static void php_pgsql_set_default_link(int id)
+static void php_pgsql_set_default_link(int id TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_list_addref(id);
if (PGG(default_link) != -1) {
@@ -400,14 +398,13 @@
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
-
}
/* }}} */
/* {{{ php_pgsql_do_connect
*/
-void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
+static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *host=NULL,*port=NULL,*options=NULL,*tty=NULL,*dbname=NULL,*connstring=NULL;
char *hashed_details;
@@ -590,7 +587,7 @@
if (ptr && (type==le_link || type==le_plink)) {
Z_LVAL_P(return_value) = link;
zend_list_addref(link);
- php_pgsql_set_default_link(link);
+ php_pgsql_set_default_link(link TSRMLS_CC);
Z_TYPE_P(return_value) = IS_RESOURCE;
efree(hashed_details);
return;
@@ -629,13 +626,14 @@
PGG(num_links)++;
}
efree(hashed_details);
- php_pgsql_set_default_link(Z_LVAL_P(return_value));
+ php_pgsql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
}
/* }}} */
+#if 0
/* {{{ php_pgsql_get_default_link
*/
-int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
+static int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
if (PGG(default_link)==-1) { /* no link opened yet, implicitly open one */
ht = 0;
@@ -644,6 +642,7 @@
return PGG(default_link);
}
/* }}} */
+#endif
/* {{{ proto resource pg_connect([string connection_string] | [string host, string port [, string
options [, string tty,]] string database)
Open a PostgreSQL connection */
@@ -711,7 +710,7 @@
/* {{{ php_pgsql_get_link_info
*/
-void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
+static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{
zval **pgsql_link = NULL;
int id = -1;
@@ -890,7 +889,7 @@
/* {{{ php_pgsql_get_result_info
*/
-void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
+static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{
zval **result;
PGresult *pgsql_result;
@@ -965,7 +964,7 @@
/* {{{ get_field_name
*/
-char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
{
PGresult *result;
char hashed_oid_key[32];
@@ -1017,7 +1016,7 @@
/* {{{ php_pgsql_get_field_info
*/
-void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
+static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{
zval **result, **field;
PGresult *pgsql_result;
@@ -1049,7 +1048,7 @@
Z_TYPE_P(return_value) = IS_LONG;
break;
case PHP_PG_FIELD_TYPE:
- Z_STRVAL_P(return_value) = get_field_name(pg_result->conn, PQftype(pgsql_result,
Z_LVAL_PP(field)), &EG(regular_list));
+ Z_STRVAL_P(return_value) = get_field_name(pg_result->conn, PQftype(pgsql_result,
Z_LVAL_PP(field)), &EG(regular_list) TSRMLS_CC);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
break;
@@ -1294,7 +1293,7 @@
/* {{{ php_pgsql_data_info
*/
-void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
+static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{
zval **result, **row, **field;
PGresult *pgsql_result;
@@ -2444,7 +2443,7 @@
/* {{{ php_pgsql_do_async
*/
-void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
+static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
{
zval *pgsql_link;
int id = -1;
Index: php4/ext/pgsql/php_pgsql.h
diff -u php4/ext/pgsql/php_pgsql.h:1.37 php4/ext/pgsql/php_pgsql.h:1.38
--- php4/ext/pgsql/php_pgsql.h:1.37 Thu Jan 24 19:43:50 2002
+++ php4/ext/pgsql/php_pgsql.h Wed Feb 6 02:16:10 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.37 2002/01/25 00:43:50 yohgaki Exp $ */
+/* $Id: php_pgsql.h,v 1.38 2002/02/06 07:16:10 yohgaki Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -123,14 +123,14 @@
PHP_FUNCTION(pg_escape_bytea);
#endif
-void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
-int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS);
-void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list);
-void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type);
+static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
+/* static int php_pgsql_get_default_link(INTERNAL_FUNCTION_PARAMETERS); */
+static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
+static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC);
+static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
+static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
+static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type);
typedef struct pgLofp {
PGconn *conn;