Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
libxml/xlink.h@0:03b5121a232e, 2016-08-25 (annotated)
- Committer:
- pcercuei
- Date:
- Thu Aug 25 10:05:35 2016 +0000
- Revision:
- 0:03b5121a232e
Add basic C files of libxml2 2.9.4
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pcercuei | 0:03b5121a232e | 1 | /* |
| pcercuei | 0:03b5121a232e | 2 | * Summary: unfinished XLink detection module |
| pcercuei | 0:03b5121a232e | 3 | * Description: unfinished XLink detection module |
| pcercuei | 0:03b5121a232e | 4 | * |
| pcercuei | 0:03b5121a232e | 5 | * Copy: See Copyright for the status of this software. |
| pcercuei | 0:03b5121a232e | 6 | * |
| pcercuei | 0:03b5121a232e | 7 | * Author: Daniel Veillard |
| pcercuei | 0:03b5121a232e | 8 | */ |
| pcercuei | 0:03b5121a232e | 9 | |
| pcercuei | 0:03b5121a232e | 10 | #ifndef __XML_XLINK_H__ |
| pcercuei | 0:03b5121a232e | 11 | #define __XML_XLINK_H__ |
| pcercuei | 0:03b5121a232e | 12 | |
| pcercuei | 0:03b5121a232e | 13 | #include <libxml/xmlversion.h> |
| pcercuei | 0:03b5121a232e | 14 | #include <libxml/tree.h> |
| pcercuei | 0:03b5121a232e | 15 | |
| pcercuei | 0:03b5121a232e | 16 | #ifdef LIBXML_XPTR_ENABLED |
| pcercuei | 0:03b5121a232e | 17 | |
| pcercuei | 0:03b5121a232e | 18 | #ifdef __cplusplus |
| pcercuei | 0:03b5121a232e | 19 | extern "C" { |
| pcercuei | 0:03b5121a232e | 20 | #endif |
| pcercuei | 0:03b5121a232e | 21 | |
| pcercuei | 0:03b5121a232e | 22 | /** |
| pcercuei | 0:03b5121a232e | 23 | * Various defines for the various Link properties. |
| pcercuei | 0:03b5121a232e | 24 | * |
| pcercuei | 0:03b5121a232e | 25 | * NOTE: the link detection layer will try to resolve QName expansion |
| pcercuei | 0:03b5121a232e | 26 | * of namespaces. If "foo" is the prefix for "http://foo.com/" |
| pcercuei | 0:03b5121a232e | 27 | * then the link detection layer will expand role="foo:myrole" |
| pcercuei | 0:03b5121a232e | 28 | * to "http://foo.com/:myrole". |
| pcercuei | 0:03b5121a232e | 29 | * NOTE: the link detection layer will expand URI-Refences found on |
| pcercuei | 0:03b5121a232e | 30 | * href attributes by using the base mechanism if found. |
| pcercuei | 0:03b5121a232e | 31 | */ |
| pcercuei | 0:03b5121a232e | 32 | typedef xmlChar *xlinkHRef; |
| pcercuei | 0:03b5121a232e | 33 | typedef xmlChar *xlinkRole; |
| pcercuei | 0:03b5121a232e | 34 | typedef xmlChar *xlinkTitle; |
| pcercuei | 0:03b5121a232e | 35 | |
| pcercuei | 0:03b5121a232e | 36 | typedef enum { |
| pcercuei | 0:03b5121a232e | 37 | XLINK_TYPE_NONE = 0, |
| pcercuei | 0:03b5121a232e | 38 | XLINK_TYPE_SIMPLE, |
| pcercuei | 0:03b5121a232e | 39 | XLINK_TYPE_EXTENDED, |
| pcercuei | 0:03b5121a232e | 40 | XLINK_TYPE_EXTENDED_SET |
| pcercuei | 0:03b5121a232e | 41 | } xlinkType; |
| pcercuei | 0:03b5121a232e | 42 | |
| pcercuei | 0:03b5121a232e | 43 | typedef enum { |
| pcercuei | 0:03b5121a232e | 44 | XLINK_SHOW_NONE = 0, |
| pcercuei | 0:03b5121a232e | 45 | XLINK_SHOW_NEW, |
| pcercuei | 0:03b5121a232e | 46 | XLINK_SHOW_EMBED, |
| pcercuei | 0:03b5121a232e | 47 | XLINK_SHOW_REPLACE |
| pcercuei | 0:03b5121a232e | 48 | } xlinkShow; |
| pcercuei | 0:03b5121a232e | 49 | |
| pcercuei | 0:03b5121a232e | 50 | typedef enum { |
| pcercuei | 0:03b5121a232e | 51 | XLINK_ACTUATE_NONE = 0, |
| pcercuei | 0:03b5121a232e | 52 | XLINK_ACTUATE_AUTO, |
| pcercuei | 0:03b5121a232e | 53 | XLINK_ACTUATE_ONREQUEST |
| pcercuei | 0:03b5121a232e | 54 | } xlinkActuate; |
| pcercuei | 0:03b5121a232e | 55 | |
| pcercuei | 0:03b5121a232e | 56 | /** |
| pcercuei | 0:03b5121a232e | 57 | * xlinkNodeDetectFunc: |
| pcercuei | 0:03b5121a232e | 58 | * @ctx: user data pointer |
| pcercuei | 0:03b5121a232e | 59 | * @node: the node to check |
| pcercuei | 0:03b5121a232e | 60 | * |
| pcercuei | 0:03b5121a232e | 61 | * This is the prototype for the link detection routine. |
| pcercuei | 0:03b5121a232e | 62 | * It calls the default link detection callbacks upon link detection. |
| pcercuei | 0:03b5121a232e | 63 | */ |
| pcercuei | 0:03b5121a232e | 64 | typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node); |
| pcercuei | 0:03b5121a232e | 65 | |
| pcercuei | 0:03b5121a232e | 66 | /* |
| pcercuei | 0:03b5121a232e | 67 | * The link detection module interact with the upper layers using |
| pcercuei | 0:03b5121a232e | 68 | * a set of callback registered at parsing time. |
| pcercuei | 0:03b5121a232e | 69 | */ |
| pcercuei | 0:03b5121a232e | 70 | |
| pcercuei | 0:03b5121a232e | 71 | /** |
| pcercuei | 0:03b5121a232e | 72 | * xlinkSimpleLinkFunk: |
| pcercuei | 0:03b5121a232e | 73 | * @ctx: user data pointer |
| pcercuei | 0:03b5121a232e | 74 | * @node: the node carrying the link |
| pcercuei | 0:03b5121a232e | 75 | * @href: the target of the link |
| pcercuei | 0:03b5121a232e | 76 | * @role: the role string |
| pcercuei | 0:03b5121a232e | 77 | * @title: the link title |
| pcercuei | 0:03b5121a232e | 78 | * |
| pcercuei | 0:03b5121a232e | 79 | * This is the prototype for a simple link detection callback. |
| pcercuei | 0:03b5121a232e | 80 | */ |
| pcercuei | 0:03b5121a232e | 81 | typedef void |
| pcercuei | 0:03b5121a232e | 82 | (*xlinkSimpleLinkFunk) (void *ctx, |
| pcercuei | 0:03b5121a232e | 83 | xmlNodePtr node, |
| pcercuei | 0:03b5121a232e | 84 | const xlinkHRef href, |
| pcercuei | 0:03b5121a232e | 85 | const xlinkRole role, |
| pcercuei | 0:03b5121a232e | 86 | const xlinkTitle title); |
| pcercuei | 0:03b5121a232e | 87 | |
| pcercuei | 0:03b5121a232e | 88 | /** |
| pcercuei | 0:03b5121a232e | 89 | * xlinkExtendedLinkFunk: |
| pcercuei | 0:03b5121a232e | 90 | * @ctx: user data pointer |
| pcercuei | 0:03b5121a232e | 91 | * @node: the node carrying the link |
| pcercuei | 0:03b5121a232e | 92 | * @nbLocators: the number of locators detected on the link |
| pcercuei | 0:03b5121a232e | 93 | * @hrefs: pointer to the array of locator hrefs |
| pcercuei | 0:03b5121a232e | 94 | * @roles: pointer to the array of locator roles |
| pcercuei | 0:03b5121a232e | 95 | * @nbArcs: the number of arcs detected on the link |
| pcercuei | 0:03b5121a232e | 96 | * @from: pointer to the array of source roles found on the arcs |
| pcercuei | 0:03b5121a232e | 97 | * @to: pointer to the array of target roles found on the arcs |
| pcercuei | 0:03b5121a232e | 98 | * @show: array of values for the show attributes found on the arcs |
| pcercuei | 0:03b5121a232e | 99 | * @actuate: array of values for the actuate attributes found on the arcs |
| pcercuei | 0:03b5121a232e | 100 | * @nbTitles: the number of titles detected on the link |
| pcercuei | 0:03b5121a232e | 101 | * @title: array of titles detected on the link |
| pcercuei | 0:03b5121a232e | 102 | * @langs: array of xml:lang values for the titles |
| pcercuei | 0:03b5121a232e | 103 | * |
| pcercuei | 0:03b5121a232e | 104 | * This is the prototype for a extended link detection callback. |
| pcercuei | 0:03b5121a232e | 105 | */ |
| pcercuei | 0:03b5121a232e | 106 | typedef void |
| pcercuei | 0:03b5121a232e | 107 | (*xlinkExtendedLinkFunk)(void *ctx, |
| pcercuei | 0:03b5121a232e | 108 | xmlNodePtr node, |
| pcercuei | 0:03b5121a232e | 109 | int nbLocators, |
| pcercuei | 0:03b5121a232e | 110 | const xlinkHRef *hrefs, |
| pcercuei | 0:03b5121a232e | 111 | const xlinkRole *roles, |
| pcercuei | 0:03b5121a232e | 112 | int nbArcs, |
| pcercuei | 0:03b5121a232e | 113 | const xlinkRole *from, |
| pcercuei | 0:03b5121a232e | 114 | const xlinkRole *to, |
| pcercuei | 0:03b5121a232e | 115 | xlinkShow *show, |
| pcercuei | 0:03b5121a232e | 116 | xlinkActuate *actuate, |
| pcercuei | 0:03b5121a232e | 117 | int nbTitles, |
| pcercuei | 0:03b5121a232e | 118 | const xlinkTitle *titles, |
| pcercuei | 0:03b5121a232e | 119 | const xmlChar **langs); |
| pcercuei | 0:03b5121a232e | 120 | |
| pcercuei | 0:03b5121a232e | 121 | /** |
| pcercuei | 0:03b5121a232e | 122 | * xlinkExtendedLinkSetFunk: |
| pcercuei | 0:03b5121a232e | 123 | * @ctx: user data pointer |
| pcercuei | 0:03b5121a232e | 124 | * @node: the node carrying the link |
| pcercuei | 0:03b5121a232e | 125 | * @nbLocators: the number of locators detected on the link |
| pcercuei | 0:03b5121a232e | 126 | * @hrefs: pointer to the array of locator hrefs |
| pcercuei | 0:03b5121a232e | 127 | * @roles: pointer to the array of locator roles |
| pcercuei | 0:03b5121a232e | 128 | * @nbTitles: the number of titles detected on the link |
| pcercuei | 0:03b5121a232e | 129 | * @title: array of titles detected on the link |
| pcercuei | 0:03b5121a232e | 130 | * @langs: array of xml:lang values for the titles |
| pcercuei | 0:03b5121a232e | 131 | * |
| pcercuei | 0:03b5121a232e | 132 | * This is the prototype for a extended link set detection callback. |
| pcercuei | 0:03b5121a232e | 133 | */ |
| pcercuei | 0:03b5121a232e | 134 | typedef void |
| pcercuei | 0:03b5121a232e | 135 | (*xlinkExtendedLinkSetFunk) (void *ctx, |
| pcercuei | 0:03b5121a232e | 136 | xmlNodePtr node, |
| pcercuei | 0:03b5121a232e | 137 | int nbLocators, |
| pcercuei | 0:03b5121a232e | 138 | const xlinkHRef *hrefs, |
| pcercuei | 0:03b5121a232e | 139 | const xlinkRole *roles, |
| pcercuei | 0:03b5121a232e | 140 | int nbTitles, |
| pcercuei | 0:03b5121a232e | 141 | const xlinkTitle *titles, |
| pcercuei | 0:03b5121a232e | 142 | const xmlChar **langs); |
| pcercuei | 0:03b5121a232e | 143 | |
| pcercuei | 0:03b5121a232e | 144 | /** |
| pcercuei | 0:03b5121a232e | 145 | * This is the structure containing a set of Links detection callbacks. |
| pcercuei | 0:03b5121a232e | 146 | * |
| pcercuei | 0:03b5121a232e | 147 | * There is no default xlink callbacks, if one want to get link |
| pcercuei | 0:03b5121a232e | 148 | * recognition activated, those call backs must be provided before parsing. |
| pcercuei | 0:03b5121a232e | 149 | */ |
| pcercuei | 0:03b5121a232e | 150 | typedef struct _xlinkHandler xlinkHandler; |
| pcercuei | 0:03b5121a232e | 151 | typedef xlinkHandler *xlinkHandlerPtr; |
| pcercuei | 0:03b5121a232e | 152 | struct _xlinkHandler { |
| pcercuei | 0:03b5121a232e | 153 | xlinkSimpleLinkFunk simple; |
| pcercuei | 0:03b5121a232e | 154 | xlinkExtendedLinkFunk extended; |
| pcercuei | 0:03b5121a232e | 155 | xlinkExtendedLinkSetFunk set; |
| pcercuei | 0:03b5121a232e | 156 | }; |
| pcercuei | 0:03b5121a232e | 157 | |
| pcercuei | 0:03b5121a232e | 158 | /* |
| pcercuei | 0:03b5121a232e | 159 | * The default detection routine, can be overridden, they call the default |
| pcercuei | 0:03b5121a232e | 160 | * detection callbacks. |
| pcercuei | 0:03b5121a232e | 161 | */ |
| pcercuei | 0:03b5121a232e | 162 | |
| pcercuei | 0:03b5121a232e | 163 | XMLPUBFUN xlinkNodeDetectFunc XMLCALL |
| pcercuei | 0:03b5121a232e | 164 | xlinkGetDefaultDetect (void); |
| pcercuei | 0:03b5121a232e | 165 | XMLPUBFUN void XMLCALL |
| pcercuei | 0:03b5121a232e | 166 | xlinkSetDefaultDetect (xlinkNodeDetectFunc func); |
| pcercuei | 0:03b5121a232e | 167 | |
| pcercuei | 0:03b5121a232e | 168 | /* |
| pcercuei | 0:03b5121a232e | 169 | * Routines to set/get the default handlers. |
| pcercuei | 0:03b5121a232e | 170 | */ |
| pcercuei | 0:03b5121a232e | 171 | XMLPUBFUN xlinkHandlerPtr XMLCALL |
| pcercuei | 0:03b5121a232e | 172 | xlinkGetDefaultHandler (void); |
| pcercuei | 0:03b5121a232e | 173 | XMLPUBFUN void XMLCALL |
| pcercuei | 0:03b5121a232e | 174 | xlinkSetDefaultHandler (xlinkHandlerPtr handler); |
| pcercuei | 0:03b5121a232e | 175 | |
| pcercuei | 0:03b5121a232e | 176 | /* |
| pcercuei | 0:03b5121a232e | 177 | * Link detection module itself. |
| pcercuei | 0:03b5121a232e | 178 | */ |
| pcercuei | 0:03b5121a232e | 179 | XMLPUBFUN xlinkType XMLCALL |
| pcercuei | 0:03b5121a232e | 180 | xlinkIsLink (xmlDocPtr doc, |
| pcercuei | 0:03b5121a232e | 181 | xmlNodePtr node); |
| pcercuei | 0:03b5121a232e | 182 | |
| pcercuei | 0:03b5121a232e | 183 | #ifdef __cplusplus |
| pcercuei | 0:03b5121a232e | 184 | } |
| pcercuei | 0:03b5121a232e | 185 | #endif |
| pcercuei | 0:03b5121a232e | 186 | |
| pcercuei | 0:03b5121a232e | 187 | #endif /* LIBXML_XPTR_ENABLED */ |
| pcercuei | 0:03b5121a232e | 188 | |
| pcercuei | 0:03b5121a232e | 189 | #endif /* __XML_XLINK_H__ */ |
| pcercuei | 0:03b5121a232e | 190 |