From be076e9b0611e941d9cdf297a8988ddd6639fa74 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 4 Jan 2005 20:18:14 +0000 Subject: applied patch from Bjorn Reese, plus some cleanups fixed the stylesheet to * xmlmodule.c include/libxml/xmlmodule.h: applied patch from Bjorn Reese, plus some cleanups * elfgcchack.h doc/elfgcchack.xsl: fixed the stylesheet to add the new header * doc/* testapi.c: regenerated the API Daniel --- testModule.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'testModule.c') diff --git a/testModule.c b/testModule.c index e5e9bd6d..a878e036 100644 --- a/testModule.c +++ b/testModule.c @@ -35,12 +35,22 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { hello_world_t hello_world = NULL; /* build the module filename, and confirm the module exists */ - xmlStrPrintf(filename, sizeof(filename), "%s/testdso%s", (const xmlChar*)MODULE_PATH, (const xmlChar*)LIBXML_MODULE_EXTENSION); + xmlStrPrintf(filename, sizeof(filename), "%s/testdso%s", + (const xmlChar*)MODULE_PATH, + (const xmlChar*)LIBXML_MODULE_EXTENSION); module = xmlModuleOpen((const char*)filename); if (module) { - hello_world = (hello_world_t)xmlModuleSymbol(module, "hello_world"); + if (xmlModuleSymbol(module, "hello_world", (void **) &hello_world)) { + fprintf(stderr, "Failure to lookup\n"); + return(1); + } + if (hello_world == NULL) { + fprintf(stderr, "Lookup returned NULL\n"); + return(1); + } + (*hello_world)(); xmlModuleClose(module); -- cgit v1.2.3