encodePtr enc, *enc_ptr;
if (sdl->encoders == NULL) {
- sdl->encoders = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT);
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
smart_str_appends(&nscat, ns);
smart_str_appendc(&nscat, ':');
if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
enc = *enc_ptr;
if (enc->details.ns) {
- sdl_free(enc->details.ns);
+ efree(enc->details.ns);
}
if (enc->details.type_str) {
- sdl_free(enc->details.type_str);
+ efree(enc->details.type_str);
}
} else {
enc_ptr = NULL;
- enc = sdl_malloc(sizeof(encode));
+ enc = emalloc(sizeof(encode));
}
memset(enc, 0, sizeof(encode));
- enc->details.ns = sdl_strdup(ns);
- enc->details.type_str = sdl_strdup(type);
+ enc->details.ns = estrdup(ns);
+ enc->details.type_str = estrdup(type);
enc->details.sdl_type = cur_type;
enc->to_xml = sdl_guess_convert_xml;
enc->to_zval = sdl_guess_convert_zval;
xmlAttrPtr tns;
if (!ctx->sdl->types) {
- ctx->sdl->types = sdl_malloc(sizeof(HashTable));
- zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, SDL_PERSISTENT);
+ ctx->sdl->types = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx->sdl->types, 0, NULL, delete_type, 0);
}
if (!ctx->attributes) {
ctx->attributes = emalloc(sizeof(HashTable));
/* Anonymous type inside <element> or <restriction> */
sdlTypePtr newType, *ptr;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_SIMPLE;
if (name != NULL) {
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
} else {
- newType->name = sdl_strdup(cur_type->name);
- newType->namens = sdl_strdup(cur_type->namens);
+ newType->name = estrdup(cur_type->name);
+ newType->namens = estrdup(cur_type->namens);
}
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
if (sdl->encoders == NULL) {
- sdl->encoders = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT);
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
- cur_type->encode = sdl_malloc(sizeof(encode));
+ cur_type->encode = emalloc(sizeof(encode));
memset(cur_type->encode, 0, sizeof(encode));
- cur_type->encode->details.ns = sdl_strdup(newType->namens);
- cur_type->encode->details.type_str = sdl_strdup(newType->name);
+ cur_type->encode->details.ns = estrdup(newType->namens);
+ cur_type->encode->details.type_str = estrdup(newType->name);
cur_type->encode->details.sdl_type = *ptr;
cur_type->encode->to_xml = sdl_guess_convert_xml;
cur_type->encode->to_zval = sdl_guess_convert_zval;
} else if (name != NULL) {
sdlTypePtr newType, *ptr;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_SIMPLE;
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
if (cur_type == NULL) {
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
} else {
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
zend_hash_update(cur_type->elements, newType->name, strlen(newType->name)+1, &newType, sizeof(sdlTypePtr), (void **)&ptr);
}
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = sdl_strdup(type);
- newType->namens = sdl_strdup(nsptr->href);
+ newType->name = estrdup(type);
+ newType->namens = estrdup(nsptr->href);
newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
}
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'itemType' attribute and subtype");
}
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = sdl_strdup("anonymous");
- newType->namens = sdl_strdup(tsn->children->content);
+ newType->name = estrdup("anonymous");
+ newType->namens = estrdup(tsn->children->content);
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = sdl_strdup(type);
- newType->namens = sdl_strdup(nsptr->href);
+ newType->name = estrdup(type);
+ newType->namens = estrdup(nsptr->href);
newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
}
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: union has both 'memberTypes' attribute and subtypes");
}
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = sdl_strdup("anonymous");
- newType->namens = sdl_strdup(tsn->children->content);
+ newType->name = estrdup("anonymous");
+ newType->namens = estrdup(tsn->children->content);
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
zend_hash_next_index_insert(cur_type->elements, &newType, sizeof(sdlTypePtr), (void **)&tmp);
}
if (cur_type->restrictions == NULL) {
- cur_type->restrictions = sdl_malloc(sizeof(sdlRestrictions));
+ cur_type->restrictions = emalloc(sizeof(sdlRestrictions));
memset(cur_type->restrictions, 0, sizeof(sdlRestrictions));
}
schema_restriction_var_char(trav, &enumval);
if (cur_type->restrictions->enumeration == NULL) {
- cur_type->restrictions->enumeration = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, SDL_PERSISTENT);
+ cur_type->restrictions->enumeration = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->restrictions->enumeration, 0, NULL, delete_restriction_var_char, 0);
}
zend_hash_add(cur_type->restrictions->enumeration, enumval->value, strlen(enumval->value)+1, &enumval, sizeof(sdlRestrictionCharPtr), NULL);
} else {
xmlAttrPtr fixed, value;
if ((*valptr) == NULL) {
- (*valptr) = sdl_malloc(sizeof(sdlRestrictionInt));
+ (*valptr) = emalloc(sizeof(sdlRestrictionInt));
}
memset((*valptr), 0, sizeof(sdlRestrictionInt));
xmlAttrPtr fixed, value;
if ((*valptr) == NULL) {
- (*valptr) = sdl_malloc(sizeof(sdlRestrictionChar));
+ (*valptr) = emalloc(sizeof(sdlRestrictionChar));
}
memset((*valptr), 0, sizeof(sdlRestrictionChar));
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: missing restriction value");
}
- (*valptr)->value = sdl_strdup(value->children->content);
+ (*valptr)->value = estrdup(value->children->content);
return TRUE;
}
xmlAttrPtr attr;
sdlContentModelPtr newModel;
- newModel = sdl_malloc(sizeof(sdlContentModel));
+ newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_ALL;
- newModel->u.content = sdl_malloc(sizeof(HashTable));
- zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT);
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
if (model == NULL) {
cur_type->model = newModel;
} else {
smart_str_appends(&key, type);
smart_str_0(&key);
- newModel = sdl_malloc(sizeof(sdlContentModel));
+ newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_GROUP_REF;
newModel->u.group_ref = estrdup(key.c);
if (type) {efree(type);}
if (ns) {efree(ns);}
} else {
- newModel = sdl_malloc(sizeof(sdlContentModel));
+ newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_SEQUENCE; /* will be redefined */
- newModel->u.content = sdl_malloc(sizeof(HashTable));
- zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT);
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
smart_str_appends(&key, ns->children->content);
smart_str_appendc(&key, ':');
if (cur_type == NULL) {
sdlTypePtr newType;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
if (sdl->groups == NULL) {
- sdl->groups = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->groups, 0, NULL, delete_type, SDL_PERSISTENT);
+ sdl->groups = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->groups, 0, NULL, delete_type, 0);
}
if (zend_hash_add(sdl->groups, key.c, key.len+1, (void**)&newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group '%s' already defined",key.c);
xmlAttrPtr attr;
sdlContentModelPtr newModel;
- newModel = sdl_malloc(sizeof(sdlContentModel));
+ newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_CHOICE;
- newModel->u.content = sdl_malloc(sizeof(HashTable));
- zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT);
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
if (model == NULL) {
cur_type->model = newModel;
} else {
xmlAttrPtr attr;
sdlContentModelPtr newModel;
- newModel = sdl_malloc(sizeof(sdlContentModel));
+ newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_SEQUENCE;
- newModel->u.content = sdl_malloc(sizeof(HashTable));
- zend_hash_init(newModel->u.content, 0, NULL, delete_model, SDL_PERSISTENT);
+ newModel->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
if (model == NULL) {
cur_type->model = newModel;
} else {
/* Anonymous type inside <element> */
sdlTypePtr newType, *ptr;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_COMPLEX;
if (name != NULL) {
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
} else {
- newType->name = sdl_strdup(cur_type->name);
- newType->namens = sdl_strdup(cur_type->namens);
+ newType->name = estrdup(cur_type->name);
+ newType->namens = estrdup(cur_type->namens);
}
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
if (sdl->encoders == NULL) {
- sdl->encoders = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, SDL_PERSISTENT);
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
- cur_type->encode = sdl_malloc(sizeof(encode));
+ cur_type->encode = emalloc(sizeof(encode));
memset(cur_type->encode, 0, sizeof(encode));
- cur_type->encode->details.ns = sdl_strdup(newType->namens);
- cur_type->encode->details.type_str = sdl_strdup(newType->name);
+ cur_type->encode->details.ns = estrdup(newType->namens);
+ cur_type->encode->details.type_str = estrdup(newType->name);
cur_type->encode->details.sdl_type = *ptr;
cur_type->encode->to_xml = sdl_guess_convert_xml;
cur_type->encode->to_zval = sdl_guess_convert_zval;
} else if (name) {
sdlTypePtr newType, *ptr;
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_COMPLEX;
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
sdlTypePtr newType;
smart_str key = {0};
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
if (ref) {
if (nsptr != NULL) {
smart_str_appends(&nscat, nsptr->href);
smart_str_appendc(&nscat, ':');
- newType->namens = sdl_strdup(nsptr->href);
+ newType->namens = estrdup(nsptr->href);
}
smart_str_appends(&nscat, type);
- newType->name = sdl_strdup(type);
+ newType->name = estrdup(type);
smart_str_0(&nscat);
if (type) {efree(type);}
if (ns) {efree(ns);}
newType->ref = estrdup(nscat.c);
smart_str_free(&nscat);
} else {
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
}
newType->nillable = FALSE;
if (cur_type == NULL) {
if (sdl->elements == NULL) {
- sdl->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ sdl->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->elements, 0, NULL, delete_type, 0);
}
addHash = sdl->elements;
smart_str_appends(&key, newType->namens);
smart_str_appends(&key, newType->name);
} else {
if (cur_type->elements == NULL) {
- cur_type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->elements, 0, NULL, delete_type, SDL_PERSISTENT);
+ cur_type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->elements, 0, NULL, delete_type, 0);
}
addHash = cur_type->elements;
smart_str_appends(&key, newType->name);
smart_str_free(&key);
if (model != NULL) {
- sdlContentModelPtr newModel = sdl_malloc(sizeof(sdlContentModel));
+ sdlContentModelPtr newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_ELEMENT;
newModel->u.element = newType;
if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'fixed' attributes");
}
- cur_type->fixed = sdl_strdup(attr->children->content);
+ cur_type->fixed = estrdup(attr->children->content);
}
attr = get_attribute(attrs, "default");
} else if (ref != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'default' and 'fixed' attributes");
}
- cur_type->def = sdl_strdup(attr->children->content);
+ cur_type->def = estrdup(attr->children->content);
}
/* type = QName */
HashTable *addHash;
smart_str key = {0};
- newAttr = sdl_malloc(sizeof(sdlAttribute));
+ newAttr = emalloc(sizeof(sdlAttribute));
memset(newAttr, 0, sizeof(sdlAttribute));
if (ref) {
addHash = ctx->attributes;
} else {
if (cur_type->attributes == NULL) {
- cur_type->attributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, SDL_PERSISTENT);
+ cur_type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0);
}
addHash = cur_type->attributes;
}
attr = attrType->properties;
while (attr != NULL) {
if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) {
- newAttr->def = sdl_strdup(attr->children->content);
+ newAttr->def = estrdup(attr->children->content);
} else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) {
- newAttr->fixed = sdl_strdup(attr->children->content);
+ newAttr->fixed = estrdup(attr->children->content);
} else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) {
if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) {
newAttr->form = XSD_FORM_QUALIFIED;
} else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) {
/* skip */
} else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) {
- newAttr->name = sdl_strdup(attr->children->content);
+ newAttr->name = estrdup(attr->children->content);
} else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) {
/* already processed */
} else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) {
xmlNsPtr nsptr;
char *value, *ns;
- ext = sdl_malloc(sizeof(sdlExtraAttribute));
+ ext = emalloc(sizeof(sdlExtraAttribute));
memset(ext, 0, sizeof(sdlExtraAttribute));
parse_namespace(attr->children->content, &value, &ns);
nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
if (nsptr) {
- ext->ns = sdl_strdup(nsptr->href);
- ext->val = sdl_strdup(value);
+ ext->ns = estrdup(nsptr->href);
+ ext->val = estrdup(value);
} else {
- ext->val = sdl_strdup(attr->children->content);
+ ext->val = estrdup(attr->children->content);
}
if (ns) {efree(ns);}
efree(value);
if (!newAttr->extraAttributes) {
- newAttr->extraAttributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, SDL_PERSISTENT);
+ newAttr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
}
smart_str_appends(&key2, nsPtr->href);
} else if (type != NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has both 'type' attribute and subtype");
}
- dummy_type = sdl_malloc(sizeof(sdlType));
+ dummy_type = emalloc(sizeof(sdlType));
memset(dummy_type, 0, sizeof(sdlType));
- dummy_type->name = sdl_strdup("anonymous");
- dummy_type->namens = sdl_strdup(tsn->children->content);
+ dummy_type->name = estrdup("anonymous");
+ dummy_type->namens = estrdup(tsn->children->content);
schema_simpleType(sdl, tsn, trav, dummy_type);
newAttr->encode = dummy_type->encode;
delete_type(&dummy_type);
if (ns == NULL) {
ns = tsn;
}
- newType = sdl_malloc(sizeof(sdlType));
+ newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = sdl_strdup(name->children->content);
- newType->namens = sdl_strdup(ns->children->content);
+ newType->name = estrdup(name->children->content);
+ newType->namens = estrdup(ns->children->content);
smart_str_appends(&key, newType->namens);
smart_str_appendc(&key, ':');
xmlNsPtr nsptr;
if (cur_type->attributes == NULL) {
- cur_type->attributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, SDL_PERSISTENT);
+ cur_type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(cur_type->attributes, 0, NULL, delete_attribute, 0);
}
- newAttr = sdl_malloc(sizeof(sdlAttribute));
+ newAttr = emalloc(sizeof(sdlAttribute));
memset(newAttr, 0, sizeof(sdlAttribute));
parse_namespace(ref->children->content, &group_name, &ns);
sdlExtraAttributePtr *attr = (sdlExtraAttributePtr*)attribute;
sdlExtraAttributePtr new_attr;
- new_attr = sdl_malloc(sizeof(sdlExtraAttribute));
+ new_attr = emalloc(sizeof(sdlExtraAttribute));
memcpy(new_attr, *attr, sizeof(sdlExtraAttribute));
*attr = new_attr;
if (new_attr->ns) {
- new_attr->ns = sdl_strdup(new_attr->ns);
+ new_attr->ns = estrdup(new_attr->ns);
}
if (new_attr->val) {
- new_attr->val = sdl_strdup(new_attr->val);
+ new_attr->val = estrdup(new_attr->val);
}
}
if (zend_hash_find(ctx->attributes, attr->ref, strlen(attr->ref)+1, (void**)&tmp) == SUCCESS) {
schema_attribute_fixup(ctx, *tmp);
if ((*tmp)->name != NULL && attr->name == NULL) {
- attr->name = sdl_strdup((*tmp)->name);
+ attr->name = estrdup((*tmp)->name);
}
if ((*tmp)->def != NULL && attr->def == NULL) {
- attr->def = sdl_strdup((*tmp)->def);
+ attr->def = estrdup((*tmp)->def);
}
if ((*tmp)->fixed != NULL && attr->fixed == NULL) {
- attr->fixed = sdl_strdup((*tmp)->fixed);
+ attr->fixed = estrdup((*tmp)->fixed);
}
if (attr->form == XSD_FORM_DEFAULT) {
attr->form = (*tmp)->form;
if ((*tmp)->extraAttributes != NULL) {
xmlNodePtr node;
- attr->extraAttributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, SDL_PERSISTENT);
+ attr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
}
attr->encode = (*tmp)->encode;
if (attr->name == NULL && attr->ref != NULL) {
char *name = strrchr(attr->ref, ':');
if (*name) {
- attr->name = sdl_strdup(name+1);
+ attr->name = estrdup(name+1);
} else{
- attr->name = sdl_strdup(attr->ref);
+ attr->name = estrdup(attr->ref);
}
}
efree(attr->ref);
schema_attribute_fixup(ctx,*tmp_attr);
- newAttr = sdl_malloc(sizeof(sdlAttribute));
+ newAttr = emalloc(sizeof(sdlAttribute));
memcpy(newAttr, *tmp_attr, sizeof(sdlAttribute));
- if (newAttr->def) {newAttr->def = sdl_strdup(newAttr->def);}
- if (newAttr->fixed) {newAttr->fixed = sdl_strdup(newAttr->fixed);}
- if (newAttr->name) {newAttr->name = sdl_strdup(newAttr->name);}
+ if (newAttr->def) {newAttr->def = estrdup(newAttr->def);}
+ if (newAttr->fixed) {newAttr->fixed = estrdup(newAttr->fixed);}
+ if (newAttr->name) {newAttr->name = estrdup(newAttr->name);}
if (newAttr->extraAttributes) {
xmlNodePtr node;
- HashTable *ht = sdl_malloc(sizeof(HashTable));
- zend_hash_init(ht, 0, NULL, delete_extra_attribute, SDL_PERSISTENT);
+ HashTable *ht = emalloc(sizeof(HashTable));
+ zend_hash_init(ht, 0, NULL, delete_extra_attribute, 0);
zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
newAttr->extraAttributes = ht;
}
case XSD_CONTENT_ALL:
case XSD_CONTENT_CHOICE:
zend_hash_destroy(tmp->u.content);
- sdl_free(tmp->u.content);
+ efree(tmp->u.content);
break;
case XSD_CONTENT_GROUP_REF:
efree(tmp->u.group_ref);
break;
}
- sdl_free(tmp);
+ efree(tmp);
}
void delete_type(void *data)
{
sdlTypePtr type = *((sdlTypePtr*)data);
if (type->name) {
- sdl_free(type->name);
+ efree(type->name);
}
if (type->namens) {
- sdl_free(type->namens);
+ efree(type->namens);
}
if (type->def) {
- sdl_free(type->def);
+ efree(type->def);
}
if (type->fixed) {
- sdl_free(type->fixed);
+ efree(type->fixed);
}
if (type->elements) {
zend_hash_destroy(type->elements);
- sdl_free(type->elements);
+ efree(type->elements);
}
if (type->attributes) {
zend_hash_destroy(type->attributes);
- sdl_free(type->attributes);
+ efree(type->attributes);
}
if (type->model) {
delete_model((void**)&type->model);
delete_restriction_var_char(&type->restrictions->pattern);
if (type->restrictions->enumeration) {
zend_hash_destroy(type->restrictions->enumeration);
- sdl_free(type->restrictions->enumeration);
+ efree(type->restrictions->enumeration);
}
- sdl_free(type->restrictions);
+ efree(type->restrictions);
}
- sdl_free(type);
+ efree(type);
}
void delete_extra_attribute(void *attribute)
sdlExtraAttributePtr attr = *((sdlExtraAttributePtr*)attribute);
if (attr->ns) {
- sdl_free(attr->ns);
+ efree(attr->ns);
}
if (attr->val) {
- sdl_free(attr->val);
+ efree(attr->val);
}
- sdl_free(attr);
+ efree(attr);
}
void delete_attribute(void *attribute)
sdlAttributePtr attr = *((sdlAttributePtr*)attribute);
if (attr->def) {
- sdl_free(attr->def);
+ efree(attr->def);
}
if (attr->fixed) {
- sdl_free(attr->fixed);
+ efree(attr->fixed);
}
if (attr->name) {
- sdl_free(attr->name);
+ efree(attr->name);
}
if (attr->ref) {
- sdl_free(attr->ref);
+ efree(attr->ref);
}
if (attr->extraAttributes) {
zend_hash_destroy(attr->extraAttributes);
- sdl_free(attr->extraAttributes);
+ efree(attr->extraAttributes);
}
- sdl_free(attr);
+ efree(attr);
}
void delete_restriction_var_int(void *rvi)
{
sdlRestrictionIntPtr ptr = *((sdlRestrictionIntPtr*)rvi);
if (ptr) {
- sdl_free(ptr);
+ efree(ptr);
}
}
sdlRestrictionCharPtr ptr = *((sdlRestrictionCharPtr*)srvc);
if (ptr) {
if (ptr->value) {
- sdl_free(ptr->value);
+ efree(ptr->value);
}
- sdl_free(ptr);
+ efree(ptr);
}
}
if (!include) {
targetNamespace = get_attribute(definitions->properties, "targetNamespace");
if (targetNamespace) {
- tmpsdl->target_ns = sdl_strdup(targetNamespace->children->content);
+ tmpsdl->target_ns = estrdup(targetNamespace->children->content);
}
}
tmp = get_attribute(body->properties, "namespace");
if (tmp) {
- binding->ns = sdl_strdup(tmp->children->content);
+ binding->ns = estrdup(tmp->children->content);
}
tmp = get_attribute(body->properties, "parts");
if (tmp) {
whiteSpace_collapse(tmp->children->content);
- binding->parts = sdl_strdup(tmp->children->content);
+ binding->parts = estrdup(tmp->children->content);
}
if (binding->use == SOAP_ENCODED) {
} else if (tmp == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle");
} else {
- binding->encodingStyle = sdl_strdup(tmp->children->content);
+ binding->encodingStyle = estrdup(tmp->children->content);
}
}
} else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing part '%s' in <message>",tmp->children->content);
}
- h = sdl_malloc(sizeof(sdlSoapBindingFunctionHeader));
+ h = emalloc(sizeof(sdlSoapBindingFunctionHeader));
memset(h, 0, sizeof(sdlSoapBindingFunctionHeader));
- h->name = sdl_strdup(tmp->children->content);
+ h->name = estrdup(tmp->children->content);
tmp = get_attribute(part->properties, "type");
if (tmp != NULL) {
tmp = get_attribute(header->properties, "namespace");
if (tmp) {
- h->ns = sdl_strdup(tmp->children->content);
+ h->ns = estrdup(tmp->children->content);
}
if (h->use == SOAP_ENCODED) {
} else if (tmp == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle");
} else {
- h->encodingStyle = sdl_strdup(tmp->children->content);
+ h->encodingStyle = estrdup(tmp->children->content);
}
}
if (binding->headers == NULL) {
- binding->headers = sdl_malloc(sizeof(HashTable));
- zend_hash_init(binding->headers, 0, NULL, delete_header, SDL_PERSISTENT);
+ binding->headers = emalloc(sizeof(HashTable));
+ zend_hash_init(binding->headers, 0, NULL, delete_header, 0);
}
if (h->ns) {
}
message = *tmp;
- parameters = sdl_malloc(sizeof(HashTable));
- zend_hash_init(parameters, 0, NULL, delete_parameter, SDL_PERSISTENT);
+ parameters = emalloc(sizeof(HashTable));
+ zend_hash_init(parameters, 0, NULL, delete_parameter, 0);
trav = message->children;
while (trav != NULL) {
php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
}
part = trav;
- param = sdl_malloc(sizeof(sdlParam));
+ param = emalloc(sizeof(sdlParam));
memset(param,0,sizeof(sdlParam));
param->order = 0;
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No name associated with <part> '%s'", message->name);
}
- param->paramName = sdl_strdup(name->children->content);
+ param->paramName = estrdup(name->children->content);
type = get_attribute(part->properties, "type");
if (type != NULL) {
int i,n;
memset(&ctx,0,sizeof(ctx));
- ctx.sdl = sdl_malloc(sizeof(sdl));
+ ctx.sdl = emalloc(sizeof(sdl));
memset(ctx.sdl, 0, sizeof(sdl));
- ctx.sdl->source = sdl_strdup(struri);
- zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, SDL_PERSISTENT);
+ ctx.sdl->source = estrdup(struri);
+ zend_hash_init(&ctx.sdl->functions, 0, NULL, delete_function, 0);
zend_hash_init(&ctx.docs, 0, NULL, delete_document, 0);
zend_hash_init(&ctx.messages, 0, NULL, NULL, 0);
port = trav;
- tmpbinding = sdl_malloc(sizeof(sdlBinding));
+ tmpbinding = emalloc(sizeof(sdlBinding));
memset(tmpbinding, 0, sizeof(sdlBinding));
bindingAttr = get_attribute(port->properties, "binding");
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No location associated with <port>");
}
- tmpbinding->location = sdl_strdup(location->children->content);
+ tmpbinding->location = estrdup(location->children->content);
ctype = strrchr(bindingAttr->children->content,':');
if (ctype == NULL) {
xmlNodePtr soapBindingNode;
xmlAttrPtr tmp;
- soapBinding = sdl_malloc(sizeof(sdlSoapBinding));
+ soapBinding = emalloc(sizeof(sdlSoapBinding));
memset(soapBinding, 0, sizeof(sdlSoapBinding));
soapBinding->style = SOAP_DOCUMENT;
if (strncmp(tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT))) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content);
}
- soapBinding->transport = sdl_strdup(tmp->children->content);
+ soapBinding->transport = estrdup(tmp->children->content);
}
}
tmpbinding->bindingAttributes = (void *)soapBinding;
if (name == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'name' attribute for <binding>");
}
- tmpbinding->name = sdl_strdup(name->children->content);
+ tmpbinding->name = estrdup(name->children->content);
type = get_attribute(binding->properties, "type");
if (type == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
}
- function = sdl_malloc(sizeof(sdlFunction));
- function->functionName = sdl_strdup(op_name->children->content);
+ function = emalloc(sizeof(sdlFunction));
+ function->functionName = estrdup(op_name->children->content);
function->requestParameters = NULL;
function->responseParameters = NULL;
function->responseName = NULL;
xmlNodePtr soapOperation;
xmlAttrPtr tmp;
- soapFunctionBinding = sdl_malloc(sizeof(sdlSoapBindingFunction));
+ soapFunctionBinding = emalloc(sizeof(sdlSoapBindingFunction));
memset(soapFunctionBinding, 0, sizeof(sdlSoapBindingFunction));
soapBinding = (sdlSoapBindingPtr)tmpbinding->bindingAttributes;
soapFunctionBinding->style = soapBinding->style;
if (soapOperation) {
tmp = get_attribute(soapOperation->properties, "soapAction");
if (tmp) {
- soapFunctionBinding->soapAction = sdl_strdup(tmp->children->content);
+ soapFunctionBinding->soapAction = estrdup(tmp->children->content);
}
tmp = get_attribute(soapOperation->properties, "style");
name = get_attribute(input->properties, "name");
if (name != NULL) {
- function->requestName = sdl_strdup(name->children->content);
+ function->requestName = estrdup(name->children->content);
} else {
- function->requestName = sdl_strdup(function->functionName);
+ function->requestName = estrdup(function->functionName);
}
if (tmpbinding->bindingType == BINDING_SOAP) {
name = get_attribute(output->properties, "name");
if (name != NULL) {
- function->responseName = sdl_strdup(name->children->content);
+ function->responseName = estrdup(name->children->content);
} else if (input == NULL) {
- function->responseName = sdl_strdup(function->functionName);
+ function->responseName = estrdup(function->functionName);
} else {
int len = strlen(function->functionName);
- function->responseName = sdl_malloc(len + sizeof("Response"));
+ function->responseName = emalloc(len + sizeof("Response"));
memcpy(function->responseName, function->functionName, len);
memcpy(function->responseName+len, "Response", sizeof("Response"));
}
efree(tmp);
if (function->requestName != NULL && strcmp(function->requestName,function->functionName) != 0) {
if (ctx.sdl->requests == NULL) {
- ctx.sdl->requests = sdl_malloc(sizeof(HashTable));
- zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, SDL_PERSISTENT);
+ ctx.sdl->requests = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx.sdl->requests, 0, NULL, NULL, 0);
}
tmp = estrdup(function->requestName);
len = strlen(tmp);
}
if (!ctx.sdl->bindings) {
- ctx.sdl->bindings = sdl_malloc(sizeof(HashTable));
- zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, SDL_PERSISTENT);
+ ctx.sdl->bindings = emalloc(sizeof(HashTable));
+ zend_hash_init(ctx.sdl->bindings, 0, NULL, delete_binding, 0);
}
zend_hash_add(ctx.sdl->bindings, tmpbinding->name, strlen(tmpbinding->name), &tmpbinding, sizeof(sdlBindingPtr), NULL);
if (len == 0) {
return NULL;
} else {
- s = sdl_malloc(len+1);
+ s = emalloc(len+1);
WSDL_CACHE_GET_N(s, len, in);
s[len] = '\0';
return s;
attr->encode = encoders[i];
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- attr->extraAttributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, SDL_PERSISTENT);
+ attr->extraAttributes = emalloc(sizeof(HashTable));
+ zend_hash_init(attr->extraAttributes, i, NULL, delete_extra_attribute, 0);
while (i > 0) {
- sdlExtraAttributePtr x = sdl_malloc(sizeof(sdlExtraAttribute));
+ sdlExtraAttributePtr x = emalloc(sizeof(sdlExtraAttribute));
sdl_deserialize_key(attr->extraAttributes, x, in);
x->ns = sdl_deserialize_string(in);
x->val = sdl_deserialize_string(in);
static sdlRestrictionIntPtr sdl_deserialize_resriction_int(char **in)
{
if (**in == 1) {
- sdlRestrictionIntPtr x = sdl_malloc(sizeof(sdlRestrictionInt));
+ sdlRestrictionIntPtr x = emalloc(sizeof(sdlRestrictionInt));
WSDL_CACHE_SKIP(1, in);
WSDL_CACHE_GET_INT(x->value, in);
WSDL_CACHE_GET_1(x->fixed, char, in);
static sdlRestrictionCharPtr sdl_deserialize_resriction_char(char **in)
{
if (**in == 1) {
- sdlRestrictionCharPtr x = sdl_malloc(sizeof(sdlRestrictionChar));
+ sdlRestrictionCharPtr x = emalloc(sizeof(sdlRestrictionChar));
WSDL_CACHE_SKIP(1, in);
x->value = sdl_deserialize_string(in);
WSDL_CACHE_GET_1(x->fixed, char, in);
static sdlContentModelPtr sdl_deserialize_model(sdlTypePtr *types, sdlTypePtr *elements, char **in)
{
int i;
- sdlContentModelPtr model = sdl_malloc(sizeof(sdlContentModel));
+ sdlContentModelPtr model = emalloc(sizeof(sdlContentModel));
WSDL_CACHE_GET_1(model->kind, sdlContentKind, in);
WSDL_CACHE_GET_INT(model->min_occurs, in);
case XSD_CONTENT_CHOICE:
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- model->u.content = sdl_malloc(sizeof(HashTable));
- zend_hash_init(model->u.content, i, NULL, delete_model, SDL_PERSISTENT);
+ model->u.content = emalloc(sizeof(HashTable));
+ zend_hash_init(model->u.content, i, NULL, delete_model, 0);
while (i > 0) {
sdlContentModelPtr x = sdl_deserialize_model(types, elements, in);
zend_hash_next_index_insert(model->u.content,&x,sizeof(sdlContentModelPtr),NULL);
if (**in == 1) {
WSDL_CACHE_SKIP(1, in);
- type->restrictions = sdl_malloc(sizeof(sdlRestrictions));
+ type->restrictions = emalloc(sizeof(sdlRestrictions));
/*memset(type->restrictions, 0, sizeof(sdlRestrictions));*/
type->restrictions->minExclusive = sdl_deserialize_resriction_int(in);
type->restrictions->minInclusive = sdl_deserialize_resriction_int(in);
type->restrictions->pattern = sdl_deserialize_resriction_char(in);
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- type->restrictions->enumeration = sdl_malloc(sizeof(HashTable));
- zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, SDL_PERSISTENT);
+ type->restrictions->enumeration = emalloc(sizeof(HashTable));
+ zend_hash_init(type->restrictions->enumeration, i, NULL, delete_restriction_var_char, 0);
while (i > 0) {
sdlRestrictionCharPtr x = sdl_deserialize_resriction_char(in);
sdl_deserialize_key(type->restrictions->enumeration, x, in);
if (i > 0) {
elements = do_alloca((i+1) * sizeof(sdlTypePtr));
elements[0] = NULL;
- type->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(type->elements, i, NULL, delete_type, SDL_PERSISTENT);
+ type->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(type->elements, i, NULL, delete_type, 0);
while (i > 0) {
- sdlTypePtr t = sdl_malloc(sizeof(sdlType));
+ sdlTypePtr t = emalloc(sizeof(sdlType));
memset(t, 0, sizeof(sdlType));
sdl_deserialize_key(type->elements, t, in);
sdl_deserialize_type(t, types, encoders, in);
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- type->attributes = sdl_malloc(sizeof(HashTable));
- zend_hash_init(type->attributes, i, NULL, delete_attribute, SDL_PERSISTENT);
+ type->attributes = emalloc(sizeof(HashTable));
+ zend_hash_init(type->attributes, i, NULL, delete_attribute, 0);
while (i > 0) {
- sdlAttributePtr attr = sdl_malloc(sizeof(sdlAttribute));
+ sdlAttributePtr attr = emalloc(sizeof(sdlAttribute));
memset(attr, 0, sizeof(sdlAttribute));
sdl_deserialize_key(type->attributes, attr, in);
sdl_deserialize_attribute(attr, encoders, in);
body->encodingStyle = sdl_deserialize_string(in);
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- body->headers = sdl_malloc(sizeof(HashTable));
- zend_hash_init(body->headers, i, NULL, delete_header, SDL_PERSISTENT);
+ body->headers = emalloc(sizeof(HashTable));
+ zend_hash_init(body->headers, i, NULL, delete_header, 0);
while (i > 0) {
- sdlSoapBindingFunctionHeaderPtr tmp = sdl_malloc(sizeof(sdlSoapBindingFunctionHeader));
+ sdlSoapBindingFunctionHeaderPtr tmp = emalloc(sizeof(sdlSoapBindingFunctionHeader));
sdl_deserialize_key(body->headers, tmp, in);
WSDL_CACHE_GET_1(tmp->use, sdlEncodingUse, in);
tmp->name = sdl_deserialize_string(in);
WSDL_CACHE_GET_INT(i, in);
if (i == 0) {return NULL;}
- ht = sdl_malloc(sizeof(HashTable));
- zend_hash_init(ht, i, NULL, delete_parameter, SDL_PERSISTENT);
+ ht = emalloc(sizeof(HashTable));
+ zend_hash_init(ht, i, NULL, delete_parameter, 0);
while (i > 0) {
- sdlParamPtr param = sdl_malloc(sizeof(sdlParam));
+ sdlParamPtr param = emalloc(sizeof(sdlParam));
sdl_deserialize_key(ht, param, in);
param->paramName = sdl_deserialize_string(in);
WSDL_CACHE_GET_INT(param->order, in);
}
WSDL_CACHE_SKIP(i, &in);
- sdl = sdl_malloc(sizeof(*sdl));
+ sdl = emalloc(sizeof(*sdl));
memset(sdl, 0, sizeof(*sdl));
sdl->source = sdl_deserialize_string(&in);
types = do_alloca((i+1)*sizeof(sdlTypePtr));
types[0] = NULL;
while (i > 0) {
- types[i] = sdl_malloc(sizeof(sdlType));
+ types[i] = emalloc(sizeof(sdlType));
memset(types[i], 0, sizeof(sdlType));
i--;
}
i = num_encoders;
encoders[0] = NULL;
while (i > 0) {
- encoders[i] = sdl_malloc(sizeof(encode));
+ encoders[i] = emalloc(sizeof(encode));
memset(encoders[i], 0, sizeof(encode));
i--;
}
i = 1;
if (num_groups > 0) {
- sdl->groups = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->groups, num_groups, NULL, delete_type, SDL_PERSISTENT);
+ sdl->groups = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->groups, num_groups, NULL, delete_type, 0);
while (i < num_groups+1) {
sdl_deserialize_key(sdl->groups, types[i], &in);
sdl_deserialize_type(types[i], types, encoders, &in);
}
if (num_types > 0) {
- sdl->types = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->types, num_types, NULL, delete_type, SDL_PERSISTENT);
+ sdl->types = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->types, num_types, NULL, delete_type, 0);
while (i < num_groups+num_types+1) {
sdl_deserialize_key(sdl->types, types[i], &in);
sdl_deserialize_type(types[i], types, encoders, &in);
}
if (num_elements > 0) {
- sdl->elements = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->elements, num_elements, NULL, delete_type, SDL_PERSISTENT);
+ sdl->elements = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->elements, num_elements, NULL, delete_type, 0);
while (i < num_groups+num_types+num_elements+1) {
sdl_deserialize_key(sdl->elements, types[i], &in);
sdl_deserialize_type(types[i], types, encoders, &in);
i = 1;
if (num_encoders > 0) {
- sdl->encoders = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, SDL_PERSISTENT);
+ sdl->encoders = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->encoders, num_encoders, NULL, delete_encoder, 0);
while (i < num_encoders+1) {
sdl_deserialize_key(sdl->encoders, encoders[i], &in);
sdl_deserialize_encoder(encoders[i], types, &in);
WSDL_CACHE_GET_INT(num_bindings, &in);
bindings = do_alloca(num_bindings*sizeof(sdlBindingPtr));
if (num_bindings > 0) {
- sdl->bindings = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, SDL_PERSISTENT);
+ sdl->bindings = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, 0);
for (i = 0; i < num_bindings; i++) {
- sdlBindingPtr binding = sdl_malloc(sizeof(sdlBinding));
+ sdlBindingPtr binding = emalloc(sizeof(sdlBinding));
memset(binding, 0, sizeof(sdlBinding));
sdl_deserialize_key(sdl->bindings, binding, &in);
binding->name = sdl_deserialize_string(&in);
WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in);
if (binding->bindingType == BINDING_SOAP) {
if (*in != 0) {
- sdlSoapBindingPtr soap_binding = binding->bindingAttributes = sdl_malloc(sizeof(sdlSoapBinding));
+ sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding));
WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
soap_binding->transport = sdl_deserialize_string(&in);
} else {
/* deserialize functions */
WSDL_CACHE_GET_INT(num_func, &in);
- zend_hash_init(&sdl->functions, num_func, NULL, delete_function, SDL_PERSISTENT);
+ zend_hash_init(&sdl->functions, num_func, NULL, delete_function, 0);
functions = do_alloca(num_func*sizeof(sdlFunctionPtr));
for (i = 0; i < num_func; i++) {
int binding_num;
- sdlFunctionPtr func = sdl_malloc(sizeof(sdlFunction));
+ sdlFunctionPtr func = emalloc(sizeof(sdlFunction));
sdl_deserialize_key(&sdl->functions, func, &in);
func->functionName = sdl_deserialize_string(&in);
func->requestName = sdl_deserialize_string(&in);
}
if (func->binding && func->binding->bindingType == BINDING_SOAP) {
if (*in != 0) {
- sdlSoapBindingFunctionPtr binding = func->bindingAttributes = sdl_malloc(sizeof(sdlSoapBindingFunction));
+ sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction));
memset(binding, 0, sizeof(sdlSoapBindingFunction));
WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
binding->soapAction = sdl_deserialize_string(&in);
/* deserialize requests */
WSDL_CACHE_GET_INT(i, &in);
if (i > 0) {
- sdl->requests = sdl_malloc(sizeof(HashTable));
- zend_hash_init(sdl->requests, i, NULL, NULL, SDL_PERSISTENT);
+ sdl->requests = emalloc(sizeof(HashTable));
+ zend_hash_init(sdl->requests, i, NULL, NULL, 0);
while (i > 0) {
int function_num;
{
sdlPtr sdl = NULL;
char* old_error_code = SOAP_GLOBAL(error_code);
-#ifdef SDL_CACHE
- sdlPtr *hndl;
- SOAP_GLOBAL(error_code) = "WSDL";
- if (zend_hash_find(SOAP_GLOBAL(sdls), uri, strlen(uri), (void **)&hndl) == FAILURE) {
- sdl = load_wsdl(uri);
- zend_hash_add(SOAP_GLOBAL(sdls), uri, strlen(uri), &sdl, sizeof(sdlPtr), NULL);
- } else {
- sdl = *hndl;
- }
-#else
SOAP_GLOBAL(error_code) = "WSDL";
if (SOAP_GLOBAL(cache_enabled)) {
char fn[MAXPATHLEN];
} else {
sdl = load_wsdl(uri);
}
-#endif
SOAP_GLOBAL(error_code) = old_error_code;
return sdl;
}
zend_hash_destroy(&tmp->functions);
if (tmp->source) {
- sdl_free(tmp->source);
+ efree(tmp->source);
}
if (tmp->target_ns) {
- sdl_free(tmp->target_ns);
+ efree(tmp->target_ns);
}
if (tmp->elements) {
zend_hash_destroy(tmp->elements);
- sdl_free(tmp->elements);
+ efree(tmp->elements);
}
if (tmp->encoders) {
zend_hash_destroy(tmp->encoders);
- sdl_free(tmp->encoders);
+ efree(tmp->encoders);
}
if (tmp->types) {
zend_hash_destroy(tmp->types);
- sdl_free(tmp->types);
+ efree(tmp->types);
}
if (tmp->groups) {
zend_hash_destroy(tmp->groups);
- sdl_free(tmp->groups);
+ efree(tmp->groups);
}
if (tmp->bindings) {
zend_hash_destroy(tmp->bindings);
- sdl_free(tmp->bindings);
+ efree(tmp->bindings);
}
if (tmp->requests) {
zend_hash_destroy(tmp->requests);
- sdl_free(tmp->requests);
+ efree(tmp->requests);
}
- sdl_free(tmp);
+ efree(tmp);
}
void delete_sdl_ptr(void *handle)
sdlBindingPtr binding = *((sdlBindingPtr*)data);
if (binding->location) {
- sdl_free(binding->location);
+ efree(binding->location);
}
if (binding->name) {
- sdl_free(binding->name);
+ efree(binding->name);
}
if (binding->bindingType == BINDING_SOAP) {
sdlSoapBindingPtr soapBind = binding->bindingAttributes;
if (soapBind && soapBind->transport) {
- sdl_free(soapBind->transport);
+ efree(soapBind->transport);
}
- sdl_free(soapBind);
+ efree(soapBind);
}
- sdl_free(binding);
+ efree(binding);
}
static void delete_sdl_soap_binding_function_body(sdlSoapBindingFunctionBody body)
{
if (body.ns) {
- sdl_free(body.ns);
+ efree(body.ns);
}
if (body.parts) {
- sdl_free(body.parts);
+ efree(body.parts);
}
if (body.encodingStyle) {
- sdl_free(body.encodingStyle);
+ efree(body.encodingStyle);
}
if (body.headers) {
zend_hash_destroy(body.headers);
- sdl_free(body.headers);
+ efree(body.headers);
}
}
sdlFunctionPtr function = *((sdlFunctionPtr*)data);
if (function->functionName) {
- sdl_free(function->functionName);
+ efree(function->functionName);
}
if (function->requestName) {
- sdl_free(function->requestName);
+ efree(function->requestName);
}
if (function->responseName) {
- sdl_free(function->responseName);
+ efree(function->responseName);
}
if (function->requestParameters) {
zend_hash_destroy(function->requestParameters);
- sdl_free(function->requestParameters);
+ efree(function->requestParameters);
}
if (function->responseParameters) {
zend_hash_destroy(function->responseParameters);
- sdl_free(function->responseParameters);
+ efree(function->responseParameters);
}
if (function->bindingAttributes &&
function->binding && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr soapFunction = function->bindingAttributes;
if (soapFunction->soapAction) {
- sdl_free(soapFunction->soapAction);
+ efree(soapFunction->soapAction);
}
delete_sdl_soap_binding_function_body(soapFunction->input);
delete_sdl_soap_binding_function_body(soapFunction->output);
- sdl_free(soapFunction);
+ efree(soapFunction);
}
- sdl_free(function);
+ efree(function);
}
static void delete_parameter(void *data)
{
sdlParamPtr param = *((sdlParamPtr*)data);
if (param->paramName) {
- sdl_free(param->paramName);
+ efree(param->paramName);
}
- sdl_free(param);
+ efree(param);
}
static void delete_header(void *data)
{
sdlSoapBindingFunctionHeaderPtr hdr = *((sdlSoapBindingFunctionHeaderPtr*)data);
if (hdr->name) {
- sdl_free(hdr->name);
+ efree(hdr->name);
}
if (hdr->ns) {
- sdl_free(hdr->ns);
+ efree(hdr->ns);
}
if (hdr->encodingStyle) {
- sdl_free(hdr->encodingStyle);
+ efree(hdr->encodingStyle);
}
- sdl_free(hdr);
+ efree(hdr);
}
static void delete_document(void *doc_ptr)