myhtml_status_t myhtml_tag_index_init(myhtml_tag_t* tags, myhtml_tag_index_t* idx_tags) { mcobject_async_status_t mcstatus; tags->mcobject_node = mcobject_async_node_add(tags->tag_index, &mcstatus); if(mcstatus != MCOBJECT_ASYNC_STATUS_OK) return MyHTML_STATUS_TAGS_ERROR_MCOBJECT_CREATE; idx_tags->tags_size = tags->tags_count + 128; idx_tags->tags_length = 0; idx_tags->tags = (myhtml_tag_index_entry_t*)calloc(idx_tags->tags_size, sizeof(myhtml_tag_index_entry_t)); if(idx_tags->tags == NULL) return MyHTML_STATUS_TAGS_ERROR_INDEX_MEMORY_ALLOCATION; return MyHTML_STATUS_OK; }
myhtml_status_t myhtml_tag_index_init(myhtml_tag_t* tags, myhtml_tag_index_t* idx_tags) { mcobject_async_status_t mcstatus; idx_tags->index_id = mcobject_async_node_add(tags->index_nodes, &mcstatus); if(mcstatus != MCOBJECT_ASYNC_STATUS_OK) { idx_tags->tags = NULL; return MyHTML_STATUS_TAGS_ERROR_MCOBJECT_CREATE_NODE; } idx_tags->tags_size = tags->context_size; idx_tags->tags_length = 0; idx_tags->tags = (myhtml_tag_index_entry_t*)calloc(idx_tags->tags_size, sizeof(myhtml_tag_index_entry_t)); if(idx_tags->tags == NULL) return MyHTML_STATUS_TAGS_ERROR_INDEX_MEMORY_ALLOCATION; return MyHTML_STATUS_OK; }