This source file includes following definitions.
- xlinkGetDefaultHandler
- xlinkSetDefaultHandler
- xlinkGetDefaultDetect
- xlinkSetDefaultDetect
- xlinkIsLink
#define IN_LIBXML
#include "libxml.h"
#ifdef LIBXML_XPTR_ENABLED
#include <string.h>
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/valid.h>
#include <libxml/xlink.h>
#include <libxml/globals.h>
#define XLINK_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xlink/namespace/")
#define XHTML_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xhtml/")
static xlinkHandlerPtr xlinkDefaultHandler = NULL;
static xlinkNodeDetectFunc xlinkDefaultDetect = NULL;
xlinkHandlerPtr
xlinkGetDefaultHandler(void) {
return(xlinkDefaultHandler);
}
void
xlinkSetDefaultHandler(xlinkHandlerPtr handler) {
xlinkDefaultHandler = handler;
}
xlinkNodeDetectFunc
xlinkGetDefaultDetect (void) {
return(xlinkDefaultDetect);
}
void
xlinkSetDefaultDetect (xlinkNodeDetectFunc func) {
xlinkDefaultDetect = func;
}
xlinkType
xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) {
xmlChar *type = NULL, *role = NULL;
xlinkType ret = XLINK_TYPE_NONE;
if (node == NULL) return(XLINK_TYPE_NONE);
if (doc == NULL) doc = node->doc;
if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
} else if ((node->ns != NULL) &&
(xmlStrEqual(node->ns->href, XHTML_NAMESPACE))) {
}
type = xmlGetNsProp(node, BAD_CAST"type", XLINK_NAMESPACE);
if (type != NULL) {
if (xmlStrEqual(type, BAD_CAST "simple")) {
ret = XLINK_TYPE_SIMPLE;
} if (xmlStrEqual(type, BAD_CAST "extended")) {
role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE);
if (role != NULL) {
xmlNsPtr xlink;
xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE);
if (xlink == NULL) {
if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset"))
ret = XLINK_TYPE_EXTENDED_SET;
} else {
xmlChar buf[200];
snprintf((char *) buf, sizeof(buf), "%s:external-linkset",
(char *) xlink->prefix);
buf[sizeof(buf) - 1] = 0;
if (xmlStrEqual(role, buf))
ret = XLINK_TYPE_EXTENDED_SET;
}
}
ret = XLINK_TYPE_EXTENDED;
}
}
if (type != NULL) xmlFree(type);
if (role != NULL) xmlFree(role);
return(ret);
}
#endif
#define bottom_xlink
#include "elfgcchack.h"