diff options
author | Jeroen van Wolffelaar <jeroen@php.net> | 2001-09-25 21:58:48 +0000 |
---|---|---|
committer | Jeroen van Wolffelaar <jeroen@php.net> | 2001-09-25 21:58:48 +0000 |
commit | c03328857394bef36ffa9678d33079ad96e4a4e4 (patch) | |
tree | c0fb250db3b1bb996fc305bf56c2b74eb6d00935 /ext/sybase_ct | |
parent | 158d34c9a57816326e141e88e1409d9f377dc2ea (diff) | |
download | php-git-c03328857394bef36ffa9678d33079ad96e4a4e4.tar.gz |
Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know.
Diffstat (limited to 'ext/sybase_ct')
-rw-r--r-- | ext/sybase_ct/php_sybase_ct.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index 66b6ed29d4..47670e921e 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -97,7 +97,7 @@ ZEND_DECLARE_MODULE_GLOBALS(sybase) static int _clean_invalid_results(list_entry *le TSRMLS_DC) { - if (le->type == le_result) { + if (Z_TYPE_P(le) == le_result) { sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; if (!sybase_ptr->valid) { @@ -555,7 +555,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } /* hash it up */ - new_le.type = le_plink; + Z_TYPE(new_le) = 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) { ct_close(sybase_ptr->connection, CS_UNUSED); @@ -569,7 +569,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } else { /* we do */ CS_INT con_status; - if (le->type != le_plink) { + if (Z_TYPE_P(le) != le_plink) { efree(hashed_details); RETURN_FALSE; } @@ -623,7 +623,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) int type, link; void *ptr; - if (index_ptr->type != le_index_ptr) { + if (Z_TYPE_P(index_ptr) != le_index_ptr) { efree(hashed_details); RETURN_FALSE; } @@ -632,7 +632,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(link); Z_LVAL_P(return_value) = SybCtG(default_link) = link; - return_value->type = IS_RESOURCE; + Z_TYPE_P(return_value) = IS_RESOURCE; efree(hashed_details); return; } else { @@ -657,7 +657,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); - new_index_ptr.type = le_index_ptr; + 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) { ct_close(sybase_ptr->connection, CS_UNUSED); ct_con_drop(sybase_ptr->connection); @@ -979,9 +979,9 @@ static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr) if (indicators[j] == -1) { /* null value */ ZVAL_FALSE(&result->data[i][j]); } else { - result->data[i][j].value.str.len = lengths[j]-1; /* we don't need the NULL in the length */ - result->data[i][j].value.str.val = estrndup(tmp_buffer[j], lengths[j]); - result->data[i][j].type = IS_STRING; + result->Z_STRLEN(data[i][j]) = lengths[j]-1; /* we don't need the NULL in the length */ + result->Z_STRVAL(data[i][j]) = estrndup(tmp_buffer[j], lengths[j]); + result->Z_TYPE(data[i][j]) = IS_STRING; } } } @@ -1009,7 +1009,7 @@ static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr) result->fields[i].column_source = empty_string; result->fields[i].max_length = datafmt[i].maxlength-1; result->fields[i].numeric = numerics[i]; - result->fields[i].type = types[i]; + result->Z_TYPE(fields[i]) = types[i]; } } @@ -1081,7 +1081,7 @@ PHP_FUNCTION(sybase_query) /* On Solaris 11.5, ct_command() can be moved outside the * loop, but not on Linux 11.0. */ - if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, (*query)->value.str.val, CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { + if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, Z_STRVAL_PP(query), CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { /* If this didn't work, the connection is screwed but * ct-lib might not set CS_CONSTAT_DEAD. So set our own * flag. This happens sometimes when the database is restarted @@ -1249,7 +1249,7 @@ PHP_FUNCTION(sybase_free_result) WRONG_PARAM_COUNT; } - if (sybase_result_index->type==IS_RESOURCE + if (Z_TYPE_P(sybase_result_index)==IS_RESOURCE && Z_LVAL_P(sybase_result_index)==0) { RETURN_FALSE; } @@ -1284,7 +1284,7 @@ PHP_FUNCTION(sybase_num_rows) ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); Z_LVAL_P(return_value) = result->num_rows; - return_value->type = IS_LONG; + Z_TYPE_P(return_value) = IS_LONG; } /* }}} */ @@ -1303,7 +1303,7 @@ PHP_FUNCTION(sybase_num_fields) ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); Z_LVAL_P(return_value) = result->num_fields; - return_value->type = IS_LONG; + Z_TYPE_P(return_value) = IS_LONG; } /* }}} */ @@ -1365,7 +1365,7 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) ALLOC_ZVAL(tmp); *tmp = result->data[result->cur_row][i]; INIT_PZVAL(tmp); - if (PG(magic_quotes_runtime) && tmp->type == IS_STRING) { + if (PG(magic_quotes_runtime) && Z_TYPE_P(tmp) == IS_STRING) { Z_STRVAL_P(tmp) = php_addslashes(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), &Z_STRLEN_P(tmp), 0 TSRMLS_CC); } else { pval_copy_constructor(tmp); @@ -1383,7 +1383,7 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) PHP_FUNCTION(sybase_fetch_object) { php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (return_value->type==IS_ARRAY) { + if (Z_TYPE_P(return_value)==IS_ARRAY) { object_and_properties_init(return_value, &zend_standard_class_def, Z_ARRVAL_P(return_value)); } } @@ -1514,7 +1514,7 @@ PHP_FUNCTION(sybase_fetch_field) add_property_long(return_value, "max_length", result->fields[field_offset].max_length); add_property_string(return_value, "column_source", result->fields[field_offset].column_source, 1); add_property_long(return_value, "numeric", result->fields[field_offset].numeric); - add_property_string(return_value, "type", php_sybase_get_field_name(result->fields[field_offset].type), 1); + add_property_string(return_value, "type", php_sybase_get_field_name(result->Z_TYPE(fields[field_offset])), 1); } /* }}} */ @@ -1568,7 +1568,7 @@ PHP_FUNCTION(sybase_result) RETURN_FALSE; } - switch(field->type) { + switch(Z_TYPE_P(field)) { case IS_STRING: { int i; @@ -1626,7 +1626,7 @@ PHP_FUNCTION(sybase_affected_rows) ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le_plink); Z_LVAL_P(return_value) = sybase_ptr->affected_rows; - return_value->type = IS_LONG; + Z_TYPE_P(return_value) = IS_LONG; } /* }}} */ |