Change log:95336cb92b..191d55580eFull diff:95336cb92b..191d55580eRoll chromium third_party 4e16929f46..3a8f2a9e1e Change log:4e16929f46..3a8f2a9e1eChanged dependencies: * src/tools:c44a3f5eca..f524a53b81DEPS diff:95336cb92b..191d55580e/DEPS No update to Clang. TBR=titovartem@google.com, BUG=None CQ_INCLUDE_TRYBOTS=master.internal.tryserver.corp.webrtc:linux_internal Change-Id: Ic9c4a62b050383646e9fcf5cc07a5653c14ac06e Reviewed-on: https://webrtc-review.googlesource.com/76120 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23205}
83 lines
1.8 KiB
C
83 lines
1.8 KiB
C
/*
|
|
* testModule.c : a small tester program for xmlModule
|
|
*
|
|
* See Copyright for the status of this software.
|
|
*
|
|
* joelwreed@comcast.net
|
|
*/
|
|
|
|
#include "libxml.h"
|
|
#ifdef LIBXML_MODULES_ENABLED
|
|
#include <libxml/xmlversion.h>
|
|
|
|
#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdarg.h>
|
|
|
|
#include <libxml/xmlmemory.h>
|
|
#include <libxml/debugXML.h>
|
|
#include <libxml/xmlmodule.h>
|
|
|
|
#ifdef _WIN32
|
|
#define MODULE_PATH "."
|
|
#include <stdlib.h> /* for _MAX_PATH */
|
|
#ifndef __MINGW32__
|
|
#define PATH_MAX _MAX_PATH
|
|
#endif
|
|
#else
|
|
#define MODULE_PATH ".libs"
|
|
#endif
|
|
|
|
/* Used for SCO Openserver*/
|
|
#ifndef PATH_MAX
|
|
#ifdef _POSIX_PATH_MAX
|
|
#define PATH_MAX _POSIX_PATH_MAX
|
|
#else
|
|
#define PATH_MAX 4096
|
|
#endif
|
|
#endif
|
|
|
|
typedef int (*hello_world_t)(void);
|
|
|
|
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
|
|
xmlChar filename[PATH_MAX];
|
|
xmlModulePtr module = NULL;
|
|
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);
|
|
|
|
module = xmlModuleOpen((const char*)filename, 0);
|
|
if (module)
|
|
{
|
|
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);
|
|
}
|
|
|
|
xmlMemoryDump();
|
|
|
|
return(0);
|
|
}
|
|
|
|
#else
|
|
#include <stdio.h>
|
|
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
|
|
printf("%s : Module support not compiled in\n", argv[0]);
|
|
return(0);
|
|
}
|
|
#endif /* LIBXML_SCHEMAS_ENABLED */
|