summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorUwe Steinmann <steinm@php.net>1999-08-05 17:39:35 +0000
committerUwe Steinmann <steinm@php.net>1999-08-05 17:39:35 +0000
commitf81c6b18f40488899273092b61ae52963fed30a4 (patch)
tree850f560ddd1668e6743da0b238f0b34b697f2395 /ext
parentd172a6b581d8af9041b18d014f92ea5846c93c09 (diff)
downloadphp-git-f81c6b18f40488899273092b61ae52963fed30a4.tar.gz
zend_hash_update() seems to be a bit different form php3_hash_update
Diffstat (limited to 'ext')
-rw-r--r--ext/hyperwave/hw.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c
index cd4d8823ed..f1e807661c 100644
--- a/ext/hyperwave/hw.c
+++ b/ext/hyperwave/hw.c
@@ -225,13 +225,17 @@ int make_return_objrec(pval **return_value, char **objrecs, int count)
int make_return_array_from_objrec(pval **return_value, char *objrec) {
char *attrname, *str, *temp, language[3], *title;
int iTitle, iDesc, iKeyword;
- pval title_arr;
- pval desc_arr;
- pval keyword_arr;
+ zval *title_arr;
+ zval *desc_arr;
+ zval *keyword_arr;
int hasTitle = 0;
int hasDescription = 0;
int hasKeyword = 0;
+ title_arr = (zval *) emalloc(sizeof(zval));
+ desc_arr = (zval *) emalloc(sizeof(zval));
+ keyword_arr = (zval *) emalloc(sizeof(zval));
+
if (array_init(*return_value) == FAILURE) {
(*return_value)->type = IS_STRING;
(*return_value)->value.str.val = empty_string;
@@ -248,21 +252,21 @@ int make_return_array_from_objrec(pval **return_value, char *objrec) {
iDesc = 0;
iKeyword = 0;
if(0 == strncmp(attrname, "Title=", 6)) {
- if ((hasTitle == 0) && (array_init(&title_arr) == FAILURE)) {
+ if ((hasTitle == 0) && (array_init(title_arr) == FAILURE)) {
return -1;
}
hasTitle = 1;
str += 6;
iTitle = 1;
} else if(0 == strncmp(attrname, "Description=", 12)) {
- if ((hasDescription == 0) && (array_init(&desc_arr) == FAILURE)) {
+ if ((hasDescription == 0) && (array_init(desc_arr) == FAILURE)) {
return -1;
}
hasDescription = 1;
str += 12;
iDesc = 1;
} else if(0 == strncmp(attrname, "Keyword=", 8)) {
- if ((hasKeyword == 0) && (array_init(&keyword_arr) == FAILURE)) {
+ if ((hasKeyword == 0) && (array_init(keyword_arr) == FAILURE)) {
return -1;
}
hasKeyword = 1;
@@ -279,11 +283,11 @@ int make_return_array_from_objrec(pval **return_value, char *objrec) {
title = str;
if(iTitle)
- add_assoc_string(&title_arr, language, title, 1);
+ add_assoc_string(title_arr, language, title, 1);
else if(iDesc)
- add_assoc_string(&desc_arr, language, title, 1);
+ add_assoc_string(desc_arr, language, title, 1);
else if(iKeyword)
- add_assoc_string(&keyword_arr, language, title, 1);
+ add_assoc_string(keyword_arr, language, title, 1);
}
attrname = strtok(NULL, "\n");
}
@@ -291,21 +295,21 @@ int make_return_array_from_objrec(pval **return_value, char *objrec) {
/* Add the title array, if we have one */
if(hasTitle) {
- zend_hash_update((*return_value)->value.ht, "Title", 6, &title_arr, sizeof(pval), NULL);
+ zend_hash_update((*return_value)->value.ht, "Title", 6, &title_arr, sizeof(zval *), NULL);
/* The title array can now be freed, but I don't know how */
}
if(hasDescription) {
/* Add the description array, if we have one */
- zend_hash_update((*return_value)->value.ht, "Description", 12, &desc_arr, sizeof(pval), NULL);
+ zend_hash_update((*return_value)->value.ht, "Description", 12, &desc_arr, sizeof(zval *), NULL);
/* The description array can now be freed, but I don't know how */
}
if(hasKeyword) {
/* Add the keyword array, if we have one */
- zend_hash_update((*return_value)->value.ht, "Keyword", 8, &keyword_arr, sizeof(pval), NULL);
+ zend_hash_update((*return_value)->value.ht, "Keyword", 8, &keyword_arr, sizeof(zval *), NULL);
/* The keyword array can now be freed, but I don't know how */
}