int main(void) { char *empty = (char *)""; wget_info_printf("%d\n", wget_base64_is_string("")); // base64.c wget_buffer_alloc(0); // buffer.c wget_buffer_printf((wget_buffer_t *)1, "%s", ""); // buffer_printf.c strlcpy((char *)"", "", 0); // strlcpy.c wget_css_parse_buffer((const char *)1, 0, NULL, NULL, NULL); // css.c wget_decompress_close(NULL); // decompressor.c wget_hashmap_create(0, 0, NULL, NULL); // hashmap.c wget_fdgetline(&empty, (size_t *)1, 0); // io.c wget_iri_parse("", NULL); // iri.c wget_list_free((wget_list_t **)1); // list.c wget_debug_write("", 0); // log.c wget_logger_set_file(NULL, ""); // logger.c wget_tcp_set_connect_timeout(NULL, 0); // net.c wget_netrc_deinit(NULL); // netrc.c wget_strdup(""); // mem.c // wget_popenf("r", "%s", ""); // pipe.c // wget_bsprintf(NULL, NULL, "%s", ""); // printf.c wget_ssl_set_config_int(0, 0); // ssl_[gnutls].c wget_stringmap_create(0); // stringmap.c if (wget_strcmp("", "")) {}; // utils.c wget_vector_set_destructor(NULL, NULL); // vector.c wget_malloc(1); // xalloc.c wget_xml_parse_buffer("", NULL, NULL, 0); // xml.c }
wget_metalink_t *wget_metalink_parse(const char *xml) { wget_metalink_t *metalink = xcalloc(1, sizeof(wget_metalink_t)); _metalink_context_t ctx = { .metalink = metalink, .priority = 999999, .location = "-" }; wget_xml_parse_buffer(xml, _metalink_parse, &ctx, 0); return metalink; } void wget_metalink_free(wget_metalink_t **metalink) { if (metalink && *metalink) { xfree((*metalink)->name); wget_vector_free(&(*metalink)->mirrors); wget_vector_free(&(*metalink)->hashes); wget_vector_free(&(*metalink)->pieces); xfree(*metalink); } } static int G_GNUC_WGET_PURE _compare_mirror(wget_metalink_mirror_t **m1, wget_metalink_mirror_t **m2) { return (*m1)->priority - (*m2)->priority; } void wget_metalink_sort_mirrors(wget_metalink_t *metalink) { if (metalink) { wget_vector_setcmpfunc(metalink->mirrors, (int(*)(const void *, const void *))_compare_mirror); wget_vector_sort(metalink->mirrors); } }
/** * \param[in] atom Atom XML data * \param[in,out] urls Pointer to return vector of URLs * * Finds all URLs within the Atom XML data \p atom and returns them * as vector in \p urls. * */ void wget_atom_get_urls_inline(const char *atom, wget_vector_t **urls) { struct atom_context context = { .urls = NULL }; wget_xml_parse_buffer(atom, _atom_get_url, &context, XML_HINT_REMOVE_EMPTY_CONTENT); *urls = context.urls; }