예제 #1
0
파일: myhtml.c 프로젝트: adrianhust/myhtml
myhtml_status_t myhtml_parse_fragment_single(myhtml_tree_t* tree, myhtml_encoding_t encoding, const char* html, size_t html_size, myhtml_tag_id_t tag_id, enum myhtml_namespace my_namespace)
{
    if(tree->flags & MyHTML_TREE_FLAGS_PARSE_END)
    {
        myhtml_tree_clean(tree);
        mythread_queue_clean(tree->queue);
        mythread_clean(tree->myhtml->thread);
    }
    
    if(tag_id == 0)
        tag_id = MyHTML_TAG_DIV;
    
    if(my_namespace == 0)
        my_namespace = MyHTML_NAMESPACE_HTML;
    
    tree->flags |= MyHTML_TREE_FLAGS_SINGLE_MODE;
    
    myhtml_tokenizer_fragment_init(tree, tag_id, my_namespace);
    myhtml_encoding_set(tree, encoding);
    
    myhtml_tokenizer_begin(tree, html, html_size);
    myhtml_tokenizer_end(tree);
    
    return MyHTML_STATUS_OK;
}
예제 #2
0
파일: myhtml.c 프로젝트: adrianhust/myhtml
myhtml_status_t myhtml_parse_chunk(myhtml_tree_t* tree, const char* html, size_t html_size)
{
    if(tree->flags & MyHTML_TREE_FLAGS_PARSE_END)
    {
        myhtml_tree_clean(tree);
        mythread_queue_clean(tree->queue);
        mythread_clean(tree->myhtml->thread);
    }
    
    myhtml_tokenizer_chunk(tree, html, html_size);
    
    return MyHTML_STATUS_OK;
}
예제 #3
0
파일: myhtml.c 프로젝트: adrianhust/myhtml
myhtml_status_t myhtml_parse(myhtml_tree_t* tree, myhtml_encoding_t encoding, const char* html, size_t html_size)
{
    if(tree->flags & MyHTML_TREE_FLAGS_PARSE_END) {
        myhtml_tree_clean(tree);
        mythread_queue_clean(tree->queue);
        mythread_clean(tree->myhtml->thread);
    }
    
    myhtml_encoding_set(tree, encoding);
    
    myhtml_tokenizer_begin(tree, html, html_size);
    myhtml_tokenizer_end(tree);
    
    return MyHTML_STATUS_OK;
}
예제 #4
0
파일: myhtml.c 프로젝트: adrianhust/myhtml
myhtml_status_t myhtml_parse_chunk_fragment(myhtml_tree_t* tree, const char* html, size_t html_size, myhtml_tag_id_t tag_id, enum myhtml_namespace my_namespace)
{
    if(tree->flags & MyHTML_TREE_FLAGS_PARSE_END)
    {
        myhtml_tree_clean(tree);
        mythread_queue_clean(tree->queue);
        mythread_clean(tree->myhtml->thread);
    }
    
    if(tag_id == 0)
        tag_id = MyHTML_TAG_DIV;
    
    if(my_namespace == 0)
        my_namespace = MyHTML_NAMESPACE_HTML;
    
    myhtml_tokenizer_fragment_init(tree, tag_id, my_namespace);
    
    myhtml_tokenizer_chunk(tree, html, html_size);
    
    return MyHTML_STATUS_OK;
}
예제 #5
0
파일: myhtml.c 프로젝트: eriknstr/myhtml
void myhtml_clean(myhtml_t* myhtml)
{
    mythread_clean(myhtml->thread);
    
    mcobject_async_node_all_clean(myhtml->async_incoming_buf);
}
예제 #6
0
파일: myhtml.c 프로젝트: CSRedRat/myhtml
void myhtml_clean(myhtml_t* myhtml)
{
    mythread_clean(myhtml->thread);
}