mirror of
https://github.com/lexborisov/Modest
synced 2024-11-22 13:51:39 +03:00
Added function mycss_entry_selectors for get selectors object from mycss entry https://github.com/lexborisov/Modest/issues/3#issuecomment-261920007
This commit is contained in:
parent
58dcf7ec02
commit
61741ce6c5
@ -80,7 +80,7 @@ int main(int argc, const char * argv[])
|
|||||||
mycss_status_t out_status;
|
mycss_status_t out_status;
|
||||||
modest_finder_t *finder = modest_finder_create_simple(html_tree, NULL);
|
modest_finder_t *finder = modest_finder_create_simple(html_tree, NULL);
|
||||||
|
|
||||||
mycss_selectors_list_t *list = mycss_selectors_parse(css_entry->selectors, MyHTML_ENCODING_UTF_8, selector, strlen(selector), &out_status);
|
mycss_selectors_list_t *list = mycss_selectors_parse(mycss_entry_selectors(css_entry), MyHTML_ENCODING_UTF_8, selector, strlen(selector), &out_status);
|
||||||
|
|
||||||
myhtml_collection_t *collection = modest_finder_by_selectors_list(finder, list, html_tree->node_html, NULL);
|
myhtml_collection_t *collection = modest_finder_by_selectors_list(finder, list, html_tree->node_html, NULL);
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ int main(int argc, const char * argv[])
|
|||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
|
|
||||||
fprintf(stdout, "Selector:\n\t");
|
fprintf(stdout, "Selector:\n\t");
|
||||||
mycss_selectors_serialization_list(css_entry->selectors, list, serialization_callback, NULL);
|
mycss_selectors_serialization_list(mycss_entry_selectors(css_entry), list, serialization_callback, NULL);
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
|
|
||||||
printf("\nFound result:\n");
|
printf("\nFound result:\n");
|
||||||
@ -101,7 +101,7 @@ int main(int argc, const char * argv[])
|
|||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
|
|
||||||
// destroy all
|
// destroy all
|
||||||
mycss_selectors_list_destroy(css_entry->selectors, list, true);
|
mycss_selectors_list_destroy(mycss_entry_selectors(css_entry), list, true);
|
||||||
myhtml_collection_destroy(collection);
|
myhtml_collection_destroy(collection);
|
||||||
|
|
||||||
/* destroy Modest finder */
|
/* destroy Modest finder */
|
||||||
|
@ -119,6 +119,9 @@ mycss_entry_t * mycss_entry_destroy(mycss_entry_t* entry, bool self_destroy);
|
|||||||
|
|
||||||
void mycss_entry_end(mycss_entry_t* entry);
|
void mycss_entry_end(mycss_entry_t* entry);
|
||||||
|
|
||||||
|
/* api */
|
||||||
|
mycss_selectors_t * mycss_entry_selectors(mycss_entry_t* entry);
|
||||||
|
|
||||||
mycss_token_ready_callback_f mycss_entry_token_ready_callback(mycss_entry_t* entry, mycss_token_ready_callback_f callback_f);
|
mycss_token_ready_callback_f mycss_entry_token_ready_callback(mycss_entry_t* entry, mycss_token_ready_callback_f callback_f);
|
||||||
|
|
||||||
size_t mycss_entry_token_count(mycss_entry_t* entry);
|
size_t mycss_entry_token_count(mycss_entry_t* entry);
|
||||||
|
@ -206,6 +206,12 @@ void mycss_entry_end(mycss_entry_t* entry)
|
|||||||
/* need some code */
|
/* need some code */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* api */
|
||||||
|
mycss_selectors_t * mycss_entry_selectors(mycss_entry_t* entry)
|
||||||
|
{
|
||||||
|
return entry->selectors;
|
||||||
|
}
|
||||||
|
|
||||||
myhtml_string_t * mycss_entry_string_create_and_init(mycss_entry_t* entry, size_t string_size)
|
myhtml_string_t * mycss_entry_string_create_and_init(mycss_entry_t* entry, size_t string_size)
|
||||||
{
|
{
|
||||||
myhtml_string_t *str = mcobject_malloc(entry->mcobject_string_entries, NULL);
|
myhtml_string_t *str = mcobject_malloc(entry->mcobject_string_entries, NULL);
|
||||||
|
@ -119,6 +119,9 @@ mycss_entry_t * mycss_entry_destroy(mycss_entry_t* entry, bool self_destroy);
|
|||||||
|
|
||||||
void mycss_entry_end(mycss_entry_t* entry);
|
void mycss_entry_end(mycss_entry_t* entry);
|
||||||
|
|
||||||
|
/* api */
|
||||||
|
mycss_selectors_t * mycss_entry_selectors(mycss_entry_t* entry);
|
||||||
|
|
||||||
mycss_token_ready_callback_f mycss_entry_token_ready_callback(mycss_entry_t* entry, mycss_token_ready_callback_f callback_f);
|
mycss_token_ready_callback_f mycss_entry_token_ready_callback(mycss_entry_t* entry, mycss_token_ready_callback_f callback_f);
|
||||||
|
|
||||||
size_t mycss_entry_token_count(mycss_entry_t* entry);
|
size_t mycss_entry_token_count(mycss_entry_t* entry);
|
||||||
|
Loading…
Reference in New Issue
Block a user