static bool init_libxml2_functions (void) { #ifdef WINDOWSNT if (libxml2_loaded_p ()) return true; else { HMODULE library; if (!(library = w32_delayed_load (Qlibxml2))) { message1 ("libxml2 library not found"); return false; } if (! load_dll_functions (library)) goto bad_library; Vlibrary_cache = Fcons (Fcons (Qlibxml2, Qt), Vlibrary_cache); return true; } bad_library: Vlibrary_cache = Fcons (Fcons (Qlibxml2, Qnil), Vlibrary_cache); return false; #else /* !WINDOWSNT */ return true; #endif /* !WINDOWSNT */ }
static int init_libxml2_functions (void) { #ifdef WINDOWSNT if (libxml2_loaded_p ()) return 1; else { HMODULE library; if (!(library = w32_delayed_load (Qlibxml2_dll))) { message1 ("libxml2 library not found"); return 0; } /* LOAD_XML2_FN jumps to bad_library if it fails to find the named function. */ LOAD_XML2_FN (library, htmlReadMemory); LOAD_XML2_FN (library, xmlReadMemory); LOAD_XML2_FN (library, xmlDocGetRootElement); LOAD_XML2_FN (library, xmlFreeDoc); LOAD_XML2_FN (library, xmlCleanupParser); LOAD_XML2_FN (library, xmlCheckVersion); Vlibrary_cache = Fcons (Fcons (Qlibxml2_dll, Qt), Vlibrary_cache); return 1; } bad_library: Vlibrary_cache = Fcons (Fcons (Qlibxml2_dll, Qnil), Vlibrary_cache); return 0; #else /* !WINDOWSNT */ return 1; #endif /* !WINDOWSNT */ }
void xml_cleanup_parser (void) { if (libxml2_loaded_p ()) fn_xmlCleanupParser (); }