diff options
Diffstat (limited to 'ext/soap/php_schema.c')
| -rw-r--r-- | ext/soap/php_schema.c | 131 |
1 files changed, 129 insertions, 2 deletions
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 4e8787d1c..903c2cf3d 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_schema.c,v 1.58.2.4 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: php_schema.c,v 1.58.2.6 2006/04/09 23:35:51 andrei Exp $ */ #include "php_soap.h" #include "libxml/uri.h" @@ -2117,7 +2117,7 @@ static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr) } if (attr->name == NULL && attr->ref != NULL) { char *name = strrchr(attr->ref, ':'); - if (*name) { + if (name) { attr->name = estrdup(name+1); } else{ attr->name = estrdup(attr->ref); @@ -2358,6 +2358,28 @@ void delete_model(void *handle) efree(tmp); } +void delete_model_persistent(void *handle) +{ + sdlContentModelPtr tmp = *((sdlContentModelPtr*)handle); + switch (tmp->kind) { + case XSD_CONTENT_ELEMENT: + case XSD_CONTENT_GROUP: + break; + case XSD_CONTENT_SEQUENCE: + case XSD_CONTENT_ALL: + case XSD_CONTENT_CHOICE: + zend_hash_destroy(tmp->u.content); + free(tmp->u.content); + break; + case XSD_CONTENT_GROUP_REF: + free(tmp->u.group_ref); + break; + default: + break; + } + free(tmp); +} + void delete_type(void *data) { sdlTypePtr type = *((sdlTypePtr*)data); @@ -2405,6 +2427,53 @@ void delete_type(void *data) efree(type); } +void delete_type_persistent(void *data) +{ + sdlTypePtr type = *((sdlTypePtr*)data); + if (type->name) { + free(type->name); + } + if (type->namens) { + free(type->namens); + } + if (type->def) { + free(type->def); + } + if (type->fixed) { + free(type->fixed); + } + if (type->elements) { + zend_hash_destroy(type->elements); + free(type->elements); + } + if (type->attributes) { + zend_hash_destroy(type->attributes); + free(type->attributes); + } + if (type->model) { + delete_model_persistent((void**)&type->model); + } + if (type->restrictions) { + delete_restriction_var_int_persistent(&type->restrictions->minExclusive); + delete_restriction_var_int_persistent(&type->restrictions->minInclusive); + delete_restriction_var_int_persistent(&type->restrictions->maxExclusive); + delete_restriction_var_int_persistent(&type->restrictions->maxInclusive); + delete_restriction_var_int_persistent(&type->restrictions->totalDigits); + delete_restriction_var_int_persistent(&type->restrictions->fractionDigits); + delete_restriction_var_int_persistent(&type->restrictions->length); + delete_restriction_var_int_persistent(&type->restrictions->minLength); + delete_restriction_var_int_persistent(&type->restrictions->maxLength); + delete_restriction_var_char_persistent(&type->restrictions->whiteSpace); + delete_restriction_var_char_persistent(&type->restrictions->pattern); + if (type->restrictions->enumeration) { + zend_hash_destroy(type->restrictions->enumeration); + free(type->restrictions->enumeration); + } + free(type->restrictions); + } + free(type); +} + void delete_extra_attribute(void *attribute) { sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute); @@ -2418,6 +2487,19 @@ void delete_extra_attribute(void *attribute) efree(attr); } +void delete_extra_attribute_persistent(void *attribute) +{ + sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute); + + if (attr->ns) { + free(attr->ns); + } + if (attr->val) { + free(attr->val); + } + free(attr); +} + void delete_attribute(void *attribute) { sdlAttributePtr attr = *((sdlAttributePtr*)attribute); @@ -2444,6 +2526,32 @@ void delete_attribute(void *attribute) efree(attr); } +void delete_attribute_persistent(void *attribute) +{ + sdlAttributePtr attr = *((sdlAttributePtr*)attribute); + + if (attr->def) { + free(attr->def); + } + if (attr->fixed) { + free(attr->fixed); + } + if (attr->name) { + free(attr->name); + } + if (attr->namens) { + free(attr->namens); + } + if (attr->ref) { + free(attr->ref); + } + if (attr->extraAttributes) { + zend_hash_destroy(attr->extraAttributes); + free(attr->extraAttributes); + } + free(attr); +} + void delete_restriction_var_int(void *rvi) { sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi); @@ -2452,6 +2560,14 @@ void delete_restriction_var_int(void *rvi) } } +void delete_restriction_var_int_persistent(void *rvi) +{ + sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi); + if (ptr) { + free(ptr); + } +} + void delete_restriction_var_char(void *srvc) { sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc); @@ -2462,3 +2578,14 @@ void delete_restriction_var_char(void *srvc) efree(ptr); } } + +void delete_restriction_var_char_persistent(void *srvc) +{ + sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc); + if (ptr) { + if (ptr->value) { + free(ptr->value); + } + free(ptr); + } +} |
