myhtml_status_t myhtml_tag_init(myhtml_tree_t *tree, myhtml_tag_t *tags) { tags->context_size = MyHTML_TAG_LAST_ENTRY + 128; tags->context = (myhtml_tag_context_t*)mymalloc(sizeof(myhtml_tag_context_t) * tags->context_size); if(tags->context == NULL) return MyHTML_STATUS_TAGS_ERROR_MEMORY_ALLOCATION; tags->mchar_node = mchar_async_node_add(tree->myhtml->mchar); tags->tree = mctree_create(32); tags->mchar = tree->myhtml->mchar; tags->tag_index = tree->myhtml->tag_index; myhtml_tag_clean(tags); return MyHTML_STATUS_OK; }
myhtml_status_t myhtml_tag_init(myhtml_tree_t *tree, myhtml_tag_t *tags) { tags->mcsimple_context = mcsimple_create(); if(tags->mcsimple_context == NULL) return MyHTML_STATUS_TAGS_ERROR_MEMORY_ALLOCATION; mcsimple_init(tags->mcsimple_context, 128, 1024, sizeof(myhtml_tag_context_t)); tags->mchar_node = mchar_async_node_add(tree->myhtml->mchar); tags->tree = mctree_create(32); tags->mchar = tree->myhtml->mchar; tags->tag_index = tree->myhtml->tag_index; tags->tags_count = MyHTML_TAG_LAST_ENTRY; myhtml_tag_clean(tags); return MyHTML_STATUS_OK; }