Path: blob/master/venv/Lib/site-packages/lxml/includes/libxml/xlink.h
811 views
/*1* Summary: unfinished XLink detection module2* Description: unfinished XLink detection module3*4* Copy: See Copyright for the status of this software.5*6* Author: Daniel Veillard7*/89#ifndef __XML_XLINK_H__10#define __XML_XLINK_H__1112#include <libxml/xmlversion.h>13#include <libxml/tree.h>1415#ifdef LIBXML_XPTR_ENABLED1617#ifdef __cplusplus18extern "C" {19#endif2021/**22* Various defines for the various Link properties.23*24* NOTE: the link detection layer will try to resolve QName expansion25* of namespaces. If "foo" is the prefix for "http://foo.com/"26* then the link detection layer will expand role="foo:myrole"27* to "http://foo.com/:myrole".28* NOTE: the link detection layer will expand URI-Refences found on29* href attributes by using the base mechanism if found.30*/31typedef xmlChar *xlinkHRef;32typedef xmlChar *xlinkRole;33typedef xmlChar *xlinkTitle;3435typedef enum {36XLINK_TYPE_NONE = 0,37XLINK_TYPE_SIMPLE,38XLINK_TYPE_EXTENDED,39XLINK_TYPE_EXTENDED_SET40} xlinkType;4142typedef enum {43XLINK_SHOW_NONE = 0,44XLINK_SHOW_NEW,45XLINK_SHOW_EMBED,46XLINK_SHOW_REPLACE47} xlinkShow;4849typedef enum {50XLINK_ACTUATE_NONE = 0,51XLINK_ACTUATE_AUTO,52XLINK_ACTUATE_ONREQUEST53} xlinkActuate;5455/**56* xlinkNodeDetectFunc:57* @ctx: user data pointer58* @node: the node to check59*60* This is the prototype for the link detection routine.61* It calls the default link detection callbacks upon link detection.62*/63typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);6465/*66* The link detection module interact with the upper layers using67* a set of callback registered at parsing time.68*/6970/**71* xlinkSimpleLinkFunk:72* @ctx: user data pointer73* @node: the node carrying the link74* @href: the target of the link75* @role: the role string76* @title: the link title77*78* This is the prototype for a simple link detection callback.79*/80typedef void81(*xlinkSimpleLinkFunk) (void *ctx,82xmlNodePtr node,83const xlinkHRef href,84const xlinkRole role,85const xlinkTitle title);8687/**88* xlinkExtendedLinkFunk:89* @ctx: user data pointer90* @node: the node carrying the link91* @nbLocators: the number of locators detected on the link92* @hrefs: pointer to the array of locator hrefs93* @roles: pointer to the array of locator roles94* @nbArcs: the number of arcs detected on the link95* @from: pointer to the array of source roles found on the arcs96* @to: pointer to the array of target roles found on the arcs97* @show: array of values for the show attributes found on the arcs98* @actuate: array of values for the actuate attributes found on the arcs99* @nbTitles: the number of titles detected on the link100* @title: array of titles detected on the link101* @langs: array of xml:lang values for the titles102*103* This is the prototype for a extended link detection callback.104*/105typedef void106(*xlinkExtendedLinkFunk)(void *ctx,107xmlNodePtr node,108int nbLocators,109const xlinkHRef *hrefs,110const xlinkRole *roles,111int nbArcs,112const xlinkRole *from,113const xlinkRole *to,114xlinkShow *show,115xlinkActuate *actuate,116int nbTitles,117const xlinkTitle *titles,118const xmlChar **langs);119120/**121* xlinkExtendedLinkSetFunk:122* @ctx: user data pointer123* @node: the node carrying the link124* @nbLocators: the number of locators detected on the link125* @hrefs: pointer to the array of locator hrefs126* @roles: pointer to the array of locator roles127* @nbTitles: the number of titles detected on the link128* @title: array of titles detected on the link129* @langs: array of xml:lang values for the titles130*131* This is the prototype for a extended link set detection callback.132*/133typedef void134(*xlinkExtendedLinkSetFunk) (void *ctx,135xmlNodePtr node,136int nbLocators,137const xlinkHRef *hrefs,138const xlinkRole *roles,139int nbTitles,140const xlinkTitle *titles,141const xmlChar **langs);142143/**144* This is the structure containing a set of Links detection callbacks.145*146* There is no default xlink callbacks, if one want to get link147* recognition activated, those call backs must be provided before parsing.148*/149typedef struct _xlinkHandler xlinkHandler;150typedef xlinkHandler *xlinkHandlerPtr;151struct _xlinkHandler {152xlinkSimpleLinkFunk simple;153xlinkExtendedLinkFunk extended;154xlinkExtendedLinkSetFunk set;155};156157/*158* The default detection routine, can be overridden, they call the default159* detection callbacks.160*/161162XMLPUBFUN xlinkNodeDetectFunc XMLCALL163xlinkGetDefaultDetect (void);164XMLPUBFUN void XMLCALL165xlinkSetDefaultDetect (xlinkNodeDetectFunc func);166167/*168* Routines to set/get the default handlers.169*/170XMLPUBFUN xlinkHandlerPtr XMLCALL171xlinkGetDefaultHandler (void);172XMLPUBFUN void XMLCALL173xlinkSetDefaultHandler (xlinkHandlerPtr handler);174175/*176* Link detection module itself.177*/178XMLPUBFUN xlinkType XMLCALL179xlinkIsLink (xmlDocPtr doc,180xmlNodePtr node);181182#ifdef __cplusplus183}184#endif185186#endif /* LIBXML_XPTR_ENABLED */187188#endif /* __XML_XLINK_H__ */189190191