diff --git a/examples/modest/css_property_to_node.c b/examples/modest/css_property_to_node.c index 02436d0..faf356d 100644 --- a/examples/modest/css_property_to_node.c +++ b/examples/modest/css_property_to_node.c @@ -68,9 +68,10 @@ mycss_entry_t * parse_css(const char* data, size_t data_size) return entry; } -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } void print_result(modest_t* modest, myhtml_tree_t* myhtml_tree, myhtml_tree_node_t* scope_node, mycss_entry_t *mycss_entry) diff --git a/examples/modest/css_real_and_default_property_to_node.c b/examples/modest/css_real_and_default_property_to_node.c index dc33e26..35f9d68 100644 --- a/examples/modest/css_real_and_default_property_to_node.c +++ b/examples/modest/css_real_and_default_property_to_node.c @@ -29,9 +29,10 @@ #define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0) #define check_status(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0) -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } myhtml_tree_t * parse_html(const char* data, size_t data_size, myhtml_callback_tree_node_f cai, void* cai_ctx) diff --git a/examples/modest/selectors_find_nodes_low_level.c b/examples/modest/selectors_find_nodes_low_level.c index 04e0499..94395e1 100644 --- a/examples/modest/selectors_find_nodes_low_level.c +++ b/examples/modest/selectors_find_nodes_low_level.c @@ -32,13 +32,16 @@ #define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0) #define CHECK_STATUS(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0) -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } -void serialization_bad_selectors(const char* buffer, size_t size, void* ctx) { +mystatus_t serialization_bad_selectors(const char* buffer, size_t size, void* ctx) +{ printf("%.*s", (int)size, buffer); + return MyCORE_STATUS_OK; } myhtml_tree_t * parse_html(const char* data, size_t data_size) diff --git a/examples/modest/selectors_prepare_low_level.c b/examples/modest/selectors_prepare_low_level.c index db37b54..39b7e58 100644 --- a/examples/modest/selectors_prepare_low_level.c +++ b/examples/modest/selectors_prepare_low_level.c @@ -29,13 +29,16 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } -void serialization_bad_selectors(const char* buffer, size_t size, void* ctx) { - printf("%.*s", (int)size, buffer); +mystatus_t serialization_bad_selectors(const char* data, size_t len, void* ctx) +{ + printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } myhtml_tree_t * parse_html(myhtml_t* myhtml, const char* data, size_t data_size) diff --git a/examples/modest/style_attr_low_level.c b/examples/modest/style_attr_low_level.c index 0d816f7..549c8b3 100644 --- a/examples/modest/style_attr_low_level.c +++ b/examples/modest/style_attr_low_level.c @@ -33,9 +33,10 @@ #define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0) #define CHECK_STATUS(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0) -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } myhtml_tree_t * parse_html(const char* data, size_t data_size) diff --git a/examples/mycss/css_low_level.c b/examples/mycss/css_low_level.c index 4a8252f..199bb88 100644 --- a/examples/mycss/css_low_level.c +++ b/examples/mycss/css_low_level.c @@ -74,9 +74,10 @@ struct res_data load_data_file(const char* filename) return res; } -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/mycss/declaration_low_level.c b/examples/mycss/declaration_low_level.c index cd5c814..9d2aaf9 100644 --- a/examples/mycss/declaration_low_level.c +++ b/examples/mycss/declaration_low_level.c @@ -25,9 +25,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/mycss/selectors_low_level.c b/examples/mycss/selectors_low_level.c index 9cde3f3..0137adb 100644 --- a/examples/mycss/selectors_low_level.c +++ b/examples/mycss/selectors_low_level.c @@ -25,9 +25,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/mycss/stylesheet_low_level.c b/examples/mycss/stylesheet_low_level.c index ad8ce6b..92369cb 100644 --- a/examples/mycss/stylesheet_low_level.c +++ b/examples/mycss/stylesheet_low_level.c @@ -24,9 +24,10 @@ #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/attributes_high_level.c b/examples/myhtml/attributes_high_level.c index 4f3fe16..f47df26 100644 --- a/examples/myhtml/attributes_high_level.c +++ b/examples/myhtml/attributes_high_level.c @@ -23,9 +23,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/chunks_high_level.c b/examples/myhtml/chunks_high_level.c index 78e3e80..6be8295 100644 --- a/examples/myhtml/chunks_high_level.c +++ b/examples/myhtml/chunks_high_level.c @@ -24,9 +24,10 @@ #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/custom_tree_high_level.c b/examples/myhtml/custom_tree_high_level.c index 9e5ad85..1a42ecc 100644 --- a/examples/myhtml/custom_tree_high_level.c +++ b/examples/myhtml/custom_tree_high_level.c @@ -26,9 +26,10 @@ #include "example.h" -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/fragment_high_level.c b/examples/myhtml/fragment_high_level.c index 853ee54..4c8b084 100644 --- a/examples/myhtml/fragment_high_level.c +++ b/examples/myhtml/fragment_high_level.c @@ -23,9 +23,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/insert_in_appropriate_place_high_level.c b/examples/myhtml/insert_in_appropriate_place_high_level.c index 8b3410a..ef11f5d 100644 --- a/examples/myhtml/insert_in_appropriate_place_high_level.c +++ b/examples/myhtml/insert_in_appropriate_place_high_level.c @@ -23,9 +23,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/modify_and_serialize.c b/examples/myhtml/modify_and_serialize.c index f960006..cbd3a83 100644 --- a/examples/myhtml/modify_and_serialize.c +++ b/examples/myhtml/modify_and_serialize.c @@ -22,9 +22,10 @@ * @param size * @param ptr */ -void write_output(const char *buffer, size_t size, void *ptr) +mystatus_t write_output(const char* data, size_t len, void* ctx) { - fwrite(buffer, 1, size, stdout); + printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } /** diff --git a/examples/myhtml/nodes_by_attr_key_high_level.c b/examples/myhtml/nodes_by_attr_key_high_level.c index d5c6cd7..0521f46 100644 --- a/examples/myhtml/nodes_by_attr_key_high_level.c +++ b/examples/myhtml/nodes_by_attr_key_high_level.c @@ -74,9 +74,10 @@ struct res_html load_html_file(const char* filename) return res; } -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/nodes_by_attr_value_high_level.c b/examples/myhtml/nodes_by_attr_value_high_level.c index 2729538..a113973 100644 --- a/examples/myhtml/nodes_by_attr_value_high_level.c +++ b/examples/myhtml/nodes_by_attr_value_high_level.c @@ -157,9 +157,10 @@ struct res_argv get_argv(int len, int argc, const char ** argv) return rargv; } -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/parse_without_whitespace.c b/examples/myhtml/parse_without_whitespace.c index d90c049..f5455c9 100644 --- a/examples/myhtml/parse_without_whitespace.c +++ b/examples/myhtml/parse_without_whitespace.c @@ -73,9 +73,10 @@ struct res_html load_html_file(const char* filename) return res; } -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/examples/myhtml/string_manipulate_high_level.c b/examples/myhtml/string_manipulate_high_level.c index 79726e6..ca6d74b 100644 --- a/examples/myhtml/string_manipulate_high_level.c +++ b/examples/myhtml/string_manipulate_high_level.c @@ -23,9 +23,10 @@ #include #include -void serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t serialization_callback(const char* data, size_t len, void* ctx) { printf("%.*s", (int)len, data); + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/test/mycss/declaration.c b/test/mycss/declaration.c index 5b2c361..852f410 100644 --- a/test/mycss/declaration.c +++ b/test/mycss/declaration.c @@ -256,7 +256,7 @@ test_stat_t test_read_dir(const char* dir_path, test_read_dir_callback_f callbac bool test_process_elements(test_data_t *test_data, myhtml_collection_t *collection, test_stat_t* result_stat); mycore_string_raw_t test_process_result_from_node(test_data_t *test_data, myhtml_tree_node_t *node); mycore_string_raw_t test_process_serialize_stype(test_data_t *test_data, const char* style, size_t style_size); -void test_process_serialize_callback(const char* buffer, size_t size, void* ctx); +mystatus_t test_process_serialize_callback(const char* buffer, size_t size, void* ctx); bool test_process_callback(const char* filename, size_t filename_len, void* context) { @@ -367,7 +367,7 @@ mycore_string_raw_t test_process_serialize_stype(test_data_t *test_data, const c return str; } -void test_process_serialize_callback(const char* buffer, size_t size, void* ctx) +mystatus_t test_process_serialize_callback(const char* buffer, size_t size, void* ctx) { mycore_string_raw_t *str = (mycore_string_raw_t*)ctx; @@ -376,6 +376,8 @@ void test_process_serialize_callback(const char* buffer, size_t size, void* ctx) memcpy(&str->data[ str->length ], buffer, sizeof(char) * size); str->length += size; + + return MyCORE_STATUS_OK; } int main(int argc, const char * argv[]) diff --git a/test/myurl/url.c b/test/myurl/url.c index 603a20f..96369e2 100644 --- a/test/myurl/url.c +++ b/test/myurl/url.c @@ -94,10 +94,12 @@ test_res_t test_load_file(const char* filename) return (test_res_t){file_data, (size_t)size}; } -void test_serialization_callback(const char* data, size_t len, void* ctx) +mystatus_t test_serialization_callback(const char* data, size_t len, void* ctx) { mycore_string_t *str = ctx; mycore_string_append(str, data, len); + + return MyCORE_STATUS_OK; } myurl_entry_t * test_parse_url(const char *data, size_t length, myurl_entry_t* base_url)