Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:09:33

0001 /**
0002  * @file
0003  * 
0004  * @brief unfinished XLink detection module
0005  * 
0006  * This module is deprecated, don't use.
0007  *
0008  * @copyright See Copyright for the status of this software.
0009  *
0010  * @author Daniel Veillard
0011  */
0012 
0013 #ifndef __XML_XLINK_H__
0014 #define __XML_XLINK_H__
0015 
0016 #include <libxml/xmlversion.h>
0017 #include <libxml/tree.h>
0018 
0019 #ifdef LIBXML_XPTR_ENABLED
0020 
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024 
0025 /** @cond ignore */
0026 
0027 /**
0028  * Various defines for the various Link properties.
0029  *
0030  * NOTE: the link detection layer will try to resolve QName expansion
0031  *       of namespaces. If "foo" is the prefix for "http://foo.com/"
0032  *       then the link detection layer will expand role="foo:myrole"
0033  *       to "http://foo.com/:myrole".
0034  * NOTE: the link detection layer will expand URI-References found on
0035  *       href attributes by using the base mechanism if found.
0036  */
0037 typedef xmlChar *xlinkHRef;
0038 typedef xmlChar *xlinkRole;
0039 typedef xmlChar *xlinkTitle;
0040 
0041 typedef enum {
0042     XLINK_TYPE_NONE = 0,
0043     XLINK_TYPE_SIMPLE,
0044     XLINK_TYPE_EXTENDED,
0045     XLINK_TYPE_EXTENDED_SET
0046 } xlinkType;
0047 
0048 typedef enum {
0049     XLINK_SHOW_NONE = 0,
0050     XLINK_SHOW_NEW,
0051     XLINK_SHOW_EMBED,
0052     XLINK_SHOW_REPLACE
0053 } xlinkShow;
0054 
0055 typedef enum {
0056     XLINK_ACTUATE_NONE = 0,
0057     XLINK_ACTUATE_AUTO,
0058     XLINK_ACTUATE_ONREQUEST
0059 } xlinkActuate;
0060 
0061 /** @endcond */
0062 
0063 /**
0064  * This is the prototype for the link detection routine.
0065  * It calls the default link detection callbacks upon link detection.
0066  *
0067  * @param ctx  user data pointer
0068  * @param node  the node to check
0069  */
0070 typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNode *node);
0071 
0072 /*
0073  * The link detection module interact with the upper layers using
0074  * a set of callback registered at parsing time.
0075  */
0076 
0077 /**
0078  * This is the prototype for a simple link detection callback.
0079  *
0080  * @param ctx  user data pointer
0081  * @param node  the node carrying the link
0082  * @param href  the target of the link
0083  * @param role  the role string
0084  * @param title  the link title
0085  */
0086 typedef void
0087 (*xlinkSimpleLinkFunk)  (void *ctx,
0088              xmlNode *node,
0089              const xlinkHRef href,
0090              const xlinkRole role,
0091              const xlinkTitle title);
0092 
0093 /**
0094  * This is the prototype for a extended link detection callback.
0095  *
0096  * @param ctx  user data pointer
0097  * @param node  the node carrying the link
0098  * @param nbLocators  the number of locators detected on the link
0099  * @param hrefs  pointer to the array of locator hrefs
0100  * @param roles  pointer to the array of locator roles
0101  * @param nbArcs  the number of arcs detected on the link
0102  * @param from  pointer to the array of source roles found on the arcs
0103  * @param to  pointer to the array of target roles found on the arcs
0104  * @param show  array of values for the show attributes found on the arcs
0105  * @param actuate  array of values for the actuate attributes found on the arcs
0106  * @param nbTitles  the number of titles detected on the link
0107  * @param titles  array of titles detected on the link
0108  * @param langs  array of xml:lang values for the titles
0109  */
0110 typedef void
0111 (*xlinkExtendedLinkFunk)(void *ctx,
0112              xmlNode *node,
0113              int nbLocators,
0114              const xlinkHRef *hrefs,
0115              const xlinkRole *roles,
0116              int nbArcs,
0117              const xlinkRole *from,
0118              const xlinkRole *to,
0119              xlinkShow *show,
0120              xlinkActuate *actuate,
0121              int nbTitles,
0122              const xlinkTitle *titles,
0123              const xmlChar **langs);
0124 
0125 /**
0126  * This is the prototype for a extended link set detection callback.
0127  *
0128  * @param ctx  user data pointer
0129  * @param node  the node carrying the link
0130  * @param nbLocators  the number of locators detected on the link
0131  * @param hrefs  pointer to the array of locator hrefs
0132  * @param roles  pointer to the array of locator roles
0133  * @param nbTitles  the number of titles detected on the link
0134  * @param titles  array of titles detected on the link
0135  * @param langs  array of xml:lang values for the titles
0136  */
0137 typedef void
0138 (*xlinkExtendedLinkSetFunk) (void *ctx,
0139                  xmlNode *node,
0140                  int nbLocators,
0141                  const xlinkHRef *hrefs,
0142                  const xlinkRole *roles,
0143                  int nbTitles,
0144                  const xlinkTitle *titles,
0145                  const xmlChar **langs);
0146 
0147 typedef struct _xlinkHandler xlinkHandler;
0148 typedef xlinkHandler *xlinkHandlerPtr;
0149 /**
0150  * This is the structure containing a set of Links detection callbacks.
0151  *
0152  * There is no default xlink callbacks, if one want to get link
0153  * recognition activated, those call backs must be provided before parsing.
0154  */
0155 struct _xlinkHandler {
0156     xlinkSimpleLinkFunk simple;
0157     xlinkExtendedLinkFunk extended;
0158     xlinkExtendedLinkSetFunk set;
0159 };
0160 
0161 /*
0162  * The default detection routine, can be overridden, they call the default
0163  * detection callbacks.
0164  */
0165 
0166 XML_DEPRECATED
0167 XMLPUBFUN xlinkNodeDetectFunc
0168         xlinkGetDefaultDetect   (void);
0169 XML_DEPRECATED
0170 XMLPUBFUN void
0171         xlinkSetDefaultDetect   (xlinkNodeDetectFunc func);
0172 
0173 /*
0174  * Routines to set/get the default handlers.
0175  */
0176 XML_DEPRECATED
0177 XMLPUBFUN xlinkHandler *
0178         xlinkGetDefaultHandler  (void);
0179 XML_DEPRECATED
0180 XMLPUBFUN void
0181         xlinkSetDefaultHandler  (xlinkHandler *handler);
0182 
0183 /*
0184  * Link detection module itself.
0185  */
0186 XML_DEPRECATED
0187 XMLPUBFUN xlinkType
0188         xlinkIsLink     (xmlDoc *doc,
0189                      xmlNode *node);
0190 
0191 #ifdef __cplusplus
0192 }
0193 #endif
0194 
0195 #endif /* LIBXML_XPTR_ENABLED */
0196 
0197 #endif /* __XML_XLINK_H__ */