cvs: /php4/ext/hyperwave hw.c
| From: | Uwe Steinmann | Date: | Thu, 05 Aug 1999 17:40:05 +0000 |
| Subject: | cvs: /php4/ext/hyperwave hw.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3148@lists.php.net to get a copy of this message | ||
steinm Thu Aug 5 13:40:05 1999 EDT
Modified files:
/php4/ext/hyperwave hw.c
Log:
zend_hash_update() seems to be a bit different form php3_hash_update
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.13 php4/ext/hyperwave/hw.c:1.14
--- php4/ext/hyperwave/hw.c:1.13 Thu Aug 5 12:25:10 1999
+++ php4/ext/hyperwave/hw.c Thu Aug 5 13:39:34 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.13 1999/08/05 16:25:10 steinm Exp $ */
+/* $Id: hw.c,v 1.14 1999/08/05 17:39:34 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -225,13 +225,17 @@
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 @@
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 @@
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 @@
/* 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 */
}