/* }}} */
/* {{{ function_entry mbstring_functions[] */
-function_entry mbstring_functions[] = {
+zval_function_entry mbstring_functions[] = {
PHP_FE(mb_convert_case, NULL)
PHP_FE(mb_strtoupper, NULL)
PHP_FE(mb_strtolower, NULL)
Returns part of a string */
PHP_FUNCTION(mb_strcut)
{
- pval **arg1, **arg2, **arg3, **arg4;
+ zval **arg1, **arg2, **arg3, **arg4;
int argc, from, len;
mbfl_string string, result, *ret;
Trim the string in terminal width */
PHP_FUNCTION(mb_strimwidth)
{
- pval **arg1, **arg2, **arg3, **arg4, **arg5;
+ zval **arg1, **arg2, **arg3, **arg4, **arg5;
int from, width;
mbfl_string string, result, marker, *ret;
Returns converted string in desired encoding */
PHP_FUNCTION(mb_convert_encoding)
{
- pval **arg_str, **arg_new, **arg_old;
+ zval **arg_str, **arg_new, **arg_old;
int i;
size_t size, l, n;
char *_from_encodings, *ret, *s_free = NULL;
Encodings of the given string is returned (as a string) */
PHP_FUNCTION(mb_detect_encoding)
{
- pval **arg_str, **arg_list, **arg_strict;
+ zval **arg_str, **arg_list, **arg_strict;
mbfl_string string;
const char *ret;
enum mbfl_no_encoding *elist;
Converts the string resource in variables to desired encoding */
PHP_FUNCTION(mb_convert_variables)
{
- pval ***args, ***stack, **var, **hash_entry;
+ zval ***args, ***stack, **var, **hash_entry;
HashTable *target_hash;
mbfl_string string, result, *ret;
enum mbfl_no_encoding from_encoding, to_encoding;
if (argc < 3) {
WRONG_PARAM_COUNT;
}
- args = (pval ***)ecalloc(argc, sizeof(pval **));
+ args = (zval ***)ecalloc(argc, sizeof(zval **));
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
efree((void *)args);
WRONG_PARAM_COUNT;
/* auto detect */
from_encoding = mbfl_no_encoding_invalid;
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0);
+ stack = (zval ***)safe_emalloc(stack_max, sizeof(zval **), 0);
stack_level = 0;
identd = mbfl_encoding_detector_new(elist, elistsz);
if (identd != NULL) {
if (Z_TYPE_PP(hash_entry) == IS_ARRAY || Z_TYPE_PP(hash_entry) == IS_OBJECT) {
if (stack_level >= stack_max) {
stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
- ptmp = erealloc(stack, sizeof(pval **)*stack_max);
- stack = (pval ***)ptmp;
+ ptmp = erealloc(stack, sizeof(zval **)*stack_max);
+ stack = (zval ***)ptmp;
}
stack[stack_level] = var;
stack_level++;
/* convert */
if (convd != NULL) {
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0);
+ stack = (zval ***)safe_emalloc(stack_max, sizeof(zval **), 0);
stack_level = 0;
n = 2;
while (n < argc || stack_level > 0) {
if (Z_TYPE_PP(hash_entry) == IS_ARRAY || Z_TYPE_PP(hash_entry) == IS_OBJECT) {
if (stack_level >= stack_max) {
stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
- ptmp = erealloc(stack, sizeof(pval **)*stack_max);
- stack = (pval ***)ptmp;
+ ptmp = erealloc(stack, sizeof(zval **)*stack_max);
+ stack = (zval ***)ptmp;
}
stack[stack_level] = var;
stack_level++;
static void
php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
{
- pval **arg1, **arg2, **arg3, **hash_entry;
+ zval **arg1, **arg2, **arg3, **hash_entry;
HashTable *target_hash;
int argc, i, *convmap, *mapelm, mapsize=0;
mbfl_string string, result, *ret;
} sybase_field;
typedef struct {
- pval ***data;
+ zval ***data;
sybase_field *fields;
sybase_link *sybase_ptr;
int cur_row,cur_field;
#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,
/* }}} */
-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;
}
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;
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) {
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;
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++;
}
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++;
}