#if PHP_API_VERSION >= 19990421
element = emalloc(sizeof(pval));
- element->EA=0;
- element->refcount=1;
+ INIT_PZVAL(element);
#endif
if ((mode & OCI_NUM) || (! (mode & OCI_ASSOC))) { /* OCI_NUM is default */
oci8_make_pval(element,statement,column, "OCIFetchInto",mode);
#if PHP_API_VERSION >= 19990421
- element->EA = 0;
- element->refcount = 1;
+ INIT_PZVAL(element);
_php3_hash_index_update(array->value.ht, i, (void *)&element, sizeof(pval*), NULL);
#else
_php3_hash_index_update(array->value.ht, i, (void *)element, sizeof(pval), NULL);
#if PHP_API_VERSION >= 19990421
tmp = emalloc(sizeof(pval));
- tmp->EA = 0;
- tmp->refcount = 1;
+ INIT_PZVAL(tmp);
#endif
array_init(tmp);
#if PHP_API_VERSION >= 19990421
- tmp->EA = 0;
- tmp->refcount = 1;
+ INIT_PZVAL(tmp);
#endif
memcpy(namebuf,columns[ i ]->name, columns[ i ]->name_len);
#if PHP_API_VERSION < 19990421
_php3_hash_index_update(outarrs[ i ]->value.ht, rows, (void *)element, sizeof(pval), NULL);
#else
- element->refcount = 1;
- element->EA = 0;
+ INIT_PZVAL(element);
_php3_hash_index_update((*(outarrs[ i ]))->value.ht, rows, (void *)&element, sizeof(pval*), NULL);
#endif
}
} else {
#if PHP_API_VERSION >= 19990421
tmp = emalloc(sizeof(pval));
- tmp->EA = 0;
- tmp->refcount = 1;
+ INIT_PZVAL(tmp);
#endif
tmp->type = IS_STRING;
for (i=0; i<num_subpats; i++) {
match_sets[i] = (zval *)emalloc(sizeof(zval));
array_init(match_sets[i]);
- match_sets[i]->EA = 0;
- match_sets[i]->refcount = 1;
+ INIT_PZVAL(match_sets[i]);
}
}
/* Allocate the result set array */
result_set = emalloc(sizeof(zval));
array_init(result_set);
- result_set->EA = 0;
- result_set->refcount = 1;
+ INIT_PZVAL(result_set);
/* Add all the subpatterns to it */
for (i=0; i<count; i++) {
object_handle = (pval *) emalloc(sizeof(pval));
*object_handle = *return_value;
pval_copy_constructor(object_handle);
- object_handle->refcount = 1;
- object_handle->EA=0;
+ INIT_PZVAL(object_handle);
zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL);
pval_destructor(&function_name->element);
} else {
entry = *entry_ptr;
/* add value elements */
- if (entry->EA) {
+ if (entry->EA.is_ref) {
tmp = (pval *)emalloc(sizeof(pval));
*tmp = *entry;
pval_copy_constructor(tmp);
- tmp->EA=0;
+ tmp->EA.is_ref=0;
+ tmp->EA.locks = 0;
tmp->refcount=0;
entry=tmp;
}
*return_value = **entry;
pval_copy_constructor(return_value);
- return_value->refcount=1;
- return_value->EA=0;
+ INIT_PZVAL(return_value);
}
void array_current(INTERNAL_FUNCTION_PARAMETERS)
data = (zval *)emalloc(sizeof(zval));
*data = *entry;
zval_copy_ctor(data);
- data->EA = 0;
- data->refcount = 1;
+ INIT_PZVAL(data);
zend_hash_update(EG(active_symbol_table), finalname,
strlen(finalname)+1, &data, sizeof(zval *), NULL);
data = (zval *)emalloc(sizeof(zval));
*data = *value;
zval_copy_ctor(data);
- data->EA = 0;
- data->refcount = 1;
+ INIT_PZVAL(data);
zend_hash_update(return_value->value.ht, entry->value.str.val,
entry->value.str.len+1, &data, sizeof(zval *), NULL);
zend_hash_get_current_data(stack->value.ht, (void **)&val);
*return_value = **val;
zval_copy_ctor(return_value);
- return_value->refcount=1;
- return_value->EA=0;
+ INIT_PZVAL(return_value);
/* Delete the first or last value */
new_hash = _phpi_splice(stack->value.ht, (off_the_end) ? -1 : 0, 1, NULL, 0, NULL);
zend_hash_internal_pointer_reset(input->value.ht);
while(zend_hash_get_current_data(input->value.ht, (void **)&entry) == SUCCESS) {
new_val = (zval *)emalloc(sizeof(zval));
- new_val->EA = 0;
- new_val->refcount = 1;
+ INIT_PZVAL(new_val);
switch (zend_hash_get_current_key(input->value.ht, &string_key, &num_key)) {
case HASH_KEY_IS_STRING:
if (_php3_hash_find(return_value->value.ht,key,strlen(key) + 1,(void **) &element) == FAILURE) {
values = emalloc(sizeof(pval));
- values->EA = 0;
- values->refcount = 1;
+ INIT_PZVAL(values);
if (array_init(values) == FAILURE) {
php3_error(E_ERROR, "Unable to initialize array");
RETURN_FALSE;
postdata_ptr->type = IS_STRING;
postdata_ptr->value.str.val = (char *) estrdup(buf);
postdata_ptr->value.str.len = cnt;
- postdata_ptr->refcount=1;
- postdata_ptr->EA=0;
+ INIT_PZVAL(postdata_ptr);
_php3_hash_add(&symbol_table, "HTTP_FDF_DATA", sizeof("HTTP_FDF_DATA"), postdata_ptr, sizeof(pval *),NULL);
}
#endif
/* If the array doesn't exist, create it */
if (_php3_hash_find(EG(active_symbol_table), var, var_len+1, (void **) &arr_ptr) == FAILURE) {
arr1 = (pval *) emalloc(sizeof(pval));
- arr1->refcount=1;
- arr1->EA=0;
+ INIT_PZVAL(arr1);
if (array_init(arr1)==FAILURE) {
return;
}
_php3_hash_update(EG(active_symbol_table), var, var_len+1, &arr1, sizeof(pval *), NULL);
if (track_vars_array) {
arr2 = (pval *) emalloc(sizeof(pval));
- arr2->refcount=1;
- arr2->EA=0;
+ INIT_PZVAL(arr2);
if (array_init(arr2)==FAILURE) {
return;
}
if ((*arr_ptr)->type!=IS_ARRAY) {
if (--(*arr_ptr) > 0) {
*arr_ptr = (pval *) emalloc(sizeof(pval));
- (*arr_ptr)->refcount=1;
- (*arr_ptr)->EA=0;
+ INIT_PZVAL(*arr_ptr);
} else {
pval_destructor(*arr_ptr);
}
}
if (track_vars_array) {
arr2 = (pval *) emalloc(sizeof(pval));
- arr2->refcount=1;
- arr2->EA=0;
+ INIT_PZVAL(arr2);
if (array_init(arr2)==FAILURE) {
return;
}
}
/* Now create the element */
entry = (pval *) emalloc(sizeof(pval));
- entry->refcount=1;
- entry->EA=0;
+ INIT_PZVAL(entry);
entry->value.str.val = val;
entry->value.str.len = val_len;
entry->type = IS_STRING;
pval *entry = (pval *) emalloc(sizeof(pval));
entry->type = IS_STRING;
- entry->refcount=1;
- entry->EA=0;
+ INIT_PZVAL(entry);
entry->value.str.val = val;
entry->value.str.len = val_len;
_php3_hash_update(EG(active_symbol_table), var, var_len+1, (void *) &entry, sizeof(pval *),NULL);
if (PG(track_vars)) {
array_ptr = (pval *) emalloc(sizeof(pval));
array_init(array_ptr);
- array_ptr->refcount=1;
- array_ptr->EA=0;
+ INIT_PZVAL(array_ptr);
switch (arg) {
case PARSE_POST:
_php3_hash_add(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), &array_ptr, sizeof(pval *),NULL);
} else {
(*rval)->type = IS_LONG;
}
- (*rval)->refcount = 1;
- (*rval)->EA = 0;
+ INIT_PZVAL(*rval);
(*rval)->value.lval = atol(q + 2);
return 1;
}
(*p)++;
(*rval)->type = IS_DOUBLE;
- (*rval)->refcount = 1;
- (*rval)->EA = 0;
+ INIT_PZVAL(*rval);
(*rval)->value.dval = atof(q + 2);
return 1;
(*rval)->type = IS_STRING;
(*rval)->value.str.val = str;
(*rval)->value.str.len = i;
- (*rval)->refcount = 1;
- (*rval)->EA = 0;
+ INIT_PZVAL(*rval);
return 1;
case 'a':
(*rval)->type = IS_ARRAY;
- (*rval)->refcount = 1;
- (*rval)->EA = 0;
+ INIT_PZVAL(*rval);
(*p) += 2;
i = atoi(*p);
(*rval)->value.ht = (HashTable *) emalloc(sizeof(HashTable));
case 'o':
(*rval)->type = IS_OBJECT;
- (*rval)->refcount = 1;
- (*rval)->EA = 0;
+ INIT_PZVAL(*rval);
(*p) += 2;
i = atoi(*p);
(*rval)->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
ret->type = IS_LONG;
ret->value.lval = value;
- ret->EA = 0;
- ret->refcount = 1;
+ INIT_PZVAL(ret);
return ret;
}
ret->type = IS_STRING;
ret->value.str.len = len;
- ret->EA = 0;
- ret->refcount = 1;
+ INIT_PZVAL(ret);
ret->value.str.val = estrndup(str, len);
return ret;
}
return;
}
- values->EA = 0;
- values->refcount = 1;
+ INIT_PZVAL(values);
_php3_hash_update(parser->info->value.ht, name, strlen(name)+1, (void *) &values, sizeof(pval*), (void **) &element);
}
int atcnt = 0;
tag = emalloc(sizeof(pval));
- tag->EA = 0;
- tag->refcount = 1;
+ INIT_PZVAL(tag);
atr = emalloc(sizeof(pval));
- atr->EA = 0;
- atr->refcount = 1;
+ INIT_PZVAL(atr);
array_init(tag);
array_init(atr);
tag = emalloc(sizeof(pval));
array_init(tag);
- tag->EA = 0;
- tag->refcount = 1;
+ INIT_PZVAL(tag);
php3i_add_to_info(parser,((char *) name) + parser->toffset);
tmp->value.str.len = strlen(p + 1);
tmp->value.str.val = estrndup(p + 1, tmp->value.str.len);
tmp->type = IS_STRING;
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
/* environmental variables never take precedence over get/post/cookie variables */
_php3_hash_add(&EG(symbol_table), t, p - *env + 1, &tmp, sizeof(pval *), NULL);
efree(t);
tmp->value.str.len = 0;
tmp->value.str.val = empty_string;
}
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
tmp->type = IS_STRING;
_php3_hash_update(&EG(symbol_table), t, strlen(t)+1, &tmp, sizeof(pval *), NULL);
}
tmp = (pval *) emalloc(sizeof(pval));
tmp->value.str.len = strlen(((request_rec *) SG(server_context))->uri);
tmp->value.str.val = estrndup(((request_rec *) SG(server_context))->uri, tmp->value.str.len);
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
tmp->type = IS_STRING;
_php3_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) &tmp, sizeof(pval *), NULL);
}
tmp->value.str.val = emalloc(((pi)?strlen(pi):0) + 1);
tmp->value.str.len = _php3_sprintf(tmp->value.str.val, "%s", (pi ? pi : "")); /* SAFE */
tmp->type = IS_STRING;
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
#else
int l = 0;
char *sn;
tmp->value.str.val = emalloc(l + 1);
tmp->value.str.len = _php3_sprintf(tmp->value.str.val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */
tmp->type = IS_STRING;
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
#endif
_php3_hash_update(&EG(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) & tmp, sizeof(pval *), NULL);
}
php3_error(E_WARNING, "Unable to create argv array");
} else {
arr->type = IS_ARRAY;
- arr->refcount=1;
- arr->EA=0;
+ INIT_PZVAL(arr);
_php3_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(pval *), NULL);
}
/* now pick out individual entries */
tmp->type = IS_STRING;
tmp->value.str.len = strlen(ss);
tmp->value.str.val = estrndup(ss, tmp->value.str.len);
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
count++;
if (_php3_hash_next_index_insert(arr->value.ht, &tmp, sizeof(pval *), NULL)==FAILURE) {
if (tmp->type == IS_STRING) {
tmp = (pval *) emalloc(sizeof(pval));
tmp->value.lval = count;
tmp->type = IS_LONG;
- tmp->refcount=1;
- tmp->EA=0;
+ INIT_PZVAL(tmp);
_php3_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &tmp, sizeof(pval *), NULL);
}
if (PG(track_vars)) {
http_post_vars = (pval *) emalloc(sizeof(pval));
array_init(http_post_vars);
- http_post_vars->refcount=1;
- http_post_vars->EA=0;
+ INIT_PZVAL(http_post_vars);
zend_hash_add(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), &http_post_vars, sizeof(pval *), NULL);
}