diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:13 -0400 |
commit | 0a36161e13484a99ccf69bb38f206462d27cc6d6 (patch) | |
tree | d5107db4b7369603ac7c753829e8972ee74949f7 /ext/sybase/php_sybase_db.c | |
parent | ce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (diff) | |
download | php-0a36161e13484a99ccf69bb38f206462d27cc6d6.tar.gz |
Imported Upstream version 5.1.2upstream/5.1.2
Diffstat (limited to 'ext/sybase/php_sybase_db.c')
-rw-r--r-- | ext/sybase/php_sybase_db.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index 731d99e0f..0a262e430 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -2,12 +2,12 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2005 The PHP Group | + | Copyright (c) 1997-2006 The PHP Group | +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | + | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_db.c,v 1.66 2005/08/06 05:42:42 fmk Exp $ */ +/* $Id: php_sybase_db.c,v 1.66.2.5 2006/01/01 12:50:16 sniper Exp $ */ #ifdef HAVE_CONFIG_H @@ -72,7 +72,7 @@ typedef struct { } sybase_field; typedef struct { - pval ***data; + zval ***data; sybase_field *fields; sybase_link *sybase_ptr; int cur_row,cur_field; @@ -80,7 +80,7 @@ typedef struct { } sybase_result; -function_entry sybase_functions[] = { +zend_function_entry sybase_functions[] = { PHP_FE(sybase_connect, NULL) PHP_FE(sybase_pconnect, NULL) PHP_FE(sybase_close, NULL) @@ -140,7 +140,7 @@ THREAD_LS sybase_module php_sybase_module; #define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval **result_ptr, int column_type); +static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,zval **result_ptr, int column_type); /* error handler */ static int php_sybase_error_handler(DBPROCESS *dbproc,int severity,int dberr, @@ -168,7 +168,7 @@ static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate } -static int _clean_invalid_results(list_entry *le TSRMLS_DC) +static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC) { if (Z_TYPE_P(le) == php_sybase_module.le_result) { sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; @@ -437,11 +437,11 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) persistent=0; } if (persistent) { - list_entry *le; + zend_rsrc_list_entry *le; /* try to find if we already have this link in our persistent list */ if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ - list_entry new_le; + zend_rsrc_list_entry new_le; if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); @@ -466,7 +466,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); Z_TYPE(new_le) = php_sybase_module.le_plink; new_le.ptr = sybase_ptr; - if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { + if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(zend_rsrc_list_entry),NULL)==FAILURE) { free(sybase_ptr); goto err_link; } @@ -495,7 +495,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) Z_LVAL_P(return_value) = zend_list_insert(sybase_ptr,php_sybase_module.le_plink); Z_TYPE_P(return_value) = IS_LONG; } else { /* non persistent */ - list_entry *index_ptr,new_index_ptr; + zend_rsrc_list_entry *index_ptr,new_index_ptr; /* first we check the hash for the hashed_details key. if it exists, * it should point us to the right offset where the actual sybase link sits. @@ -544,7 +544,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) /* add it to the hash */ new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); Z_TYPE(new_index_ptr) = le_index_ptr; - if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { + if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry),NULL)==FAILURE) { goto err_link; } php_sybase_module.num_links++; @@ -671,7 +671,7 @@ PHP_FUNCTION(sybase_select_db) /* }}} */ -static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval **result_ptr, int column_type) +static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,zval **result_ptr, int column_type) { zval *result; @@ -840,7 +840,7 @@ PHP_FUNCTION(sybase_query) } result = (sybase_result *) emalloc(sizeof(sybase_result)); - result->data = (pval ***) safe_emalloc(sizeof(pval **), SYBASE_ROWS_BLOCK, 0); + result->data = (zval ***) safe_emalloc(sizeof(zval **), SYBASE_ROWS_BLOCK, 0); result->sybase_ptr = sybase_ptr; result->cur_field=result->cur_row=result->num_rows=0; result->num_fields = num_fields; @@ -849,9 +849,9 @@ PHP_FUNCTION(sybase_query) while (retvalue!=FAIL && retvalue!=NO_MORE_ROWS) { result->num_rows++; if (result->num_rows > blocks_initialized*SYBASE_ROWS_BLOCK) { - result->data = (pval ***) erealloc(result->data,sizeof(pval **)*SYBASE_ROWS_BLOCK*(++blocks_initialized)); + result->data = (zval ***) erealloc(result->data,sizeof(zval **)*SYBASE_ROWS_BLOCK*(++blocks_initialized)); } - result->data[i] = (pval **) safe_emalloc(sizeof(pval *), num_fields, 0); + result->data[i] = (zval **) safe_emalloc(sizeof(zval *), num_fields, 0); for (j=1; j<=num_fields; j++) { php_sybase_get_column_content(sybase_ptr, j, &result->data[i][j-1], column_types[j-1]); if (!php_sybase_module.compatability_mode) { @@ -1041,7 +1041,7 @@ PHP_FUNCTION(sybase_fetch_row) zval **sybase_result_index; int type,i,id; sybase_result *result; - pval *field_content; + zval *field_content; if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index)==FAILURE) { WRONG_PARAM_COUNT; @@ -1063,7 +1063,7 @@ PHP_FUNCTION(sybase_fetch_row) array_init(return_value); for (i=0; i<result->num_fields; i++) { ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); } result->cur_row++; } @@ -1097,9 +1097,9 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) for (i=0; i<result->num_fields; i++) { ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); + zend_hash_index_update(Z_ARRVAL_P(return_value), i, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); ZVAL_ADDREF(result->data[result->cur_row][i]); - zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &result->data[result->cur_row][i], sizeof(pval *), NULL); + zend_hash_update(Z_ARRVAL_P(return_value), result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &result->data[result->cur_row][i], sizeof(zval *), NULL); } result->cur_row++; } @@ -1354,7 +1354,7 @@ PHP_FUNCTION(sybase_result) } *return_value = *result->data[Z_LVAL_PP(row)][field_offset]; - pval_copy_constructor(return_value); + zval_copy_ctor(return_value); } /* }}} */ |