Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!-- |
| 3 | win32/defgen.xsl |
| 4 | This stylesheet is used to transform doc/libxml2-api.xml into a pseudo-source, |
| 5 | which can then be preprocessed to get the .DEF file for the Microsoft's linker. |
| 6 | |
| 7 | Use any XSLT processor to produce a file called libxml2.def.src in the win32 |
| 8 | subdirectory, for example, run xsltproc from the win32 subdirectory: |
| 9 | |
| 10 | xsltproc -o libxml2.def.src defgen.xsl ../doc/libxml2-api.xml |
| 11 | |
| 12 | Once that finishes, rest assured, the Makefile will know what to do with the |
| 13 | generated file. |
| 14 | |
| 15 | April 2003, Igor Zlatkovic <igor@zlatkovic.com> |
| 16 | --> |
| 17 | <!DOCTYPE xsl:stylesheet [ <!ENTITY nl '
'> ]> |
| 18 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 19 | <xsl:strip-space elements="*"/> |
| 20 | <xsl:output method="text"/> |
| 21 | <xsl:template match="/"> |
| 22 | <xsl:text>#define LIBXML2_COMPILING_MSCCDEF&nl;</xsl:text> |
| 23 | <xsl:text>#include "../include/libxml/xmlversion.h"&nl;</xsl:text> |
| 24 | <xsl:text>LIBRARY libxml2&nl;</xsl:text> |
| 25 | <xsl:text>EXPORTS&nl;</xsl:text> |
| 26 | <xsl:for-each select="/api/symbols/*[self::variable or self::function]"> |
| 27 | <!-- Basic tests --> |
| 28 | <xsl:if test="@file = 'c14n'"> |
| 29 | <xsl:text>#ifdef LIBXML_C14N_ENABLED&nl;</xsl:text> |
| 30 | </xsl:if> |
| 31 | <xsl:if test="@file = 'catalog'"> |
| 32 | <xsl:text>#ifdef LIBXML_CATALOG_ENABLED&nl;</xsl:text> |
| 33 | </xsl:if> |
| 34 | <xsl:if test="@file = 'debugXML'"> |
| 35 | <xsl:text>#ifdef LIBXML_DEBUG_ENABLED&nl;</xsl:text> |
| 36 | </xsl:if> |
| 37 | <xsl:if test="@file = 'DOCBParser'"> |
| 38 | <xsl:text>#ifdef LIBXML_DOCB_ENABLED&nl;</xsl:text> |
| 39 | </xsl:if> |
| 40 | <xsl:if test="(@file = 'HTMLparser') |
| 41 | or (@file = 'HTMLtree') |
| 42 | or (@file = 'nanohtml')"> |
| 43 | <xsl:text>#ifdef LIBXML_HTML_ENABLED&nl;</xsl:text> |
| 44 | </xsl:if> |
| 45 | <xsl:if test="@file = 'nanoftp'"> |
| 46 | <xsl:text>#ifdef LIBXML_FTP_ENABLED&nl;</xsl:text> |
| 47 | </xsl:if> |
| 48 | <xsl:if test="(@file = 'relaxng') |
| 49 | or (@file = 'xmlschemas') |
Igor Zlatkovic | 451c8a9 | 2003-04-28 12:55:43 +0000 | [diff] [blame^] | 50 | or (@file = 'xmlschemastypes')"> |
Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 51 | <xsl:text>#ifdef LIBXML_SCHEMAS_ENABLED&nl;</xsl:text> |
| 52 | </xsl:if> |
| 53 | <xsl:if test="@file = 'xinclude'"> |
| 54 | <xsl:text>#ifdef LIBXML_XINCLUDE_ENABLED&nl;</xsl:text> |
| 55 | </xsl:if> |
| 56 | <xsl:if test="@file = 'xlink'"> |
| 57 | <xsl:text>#ifdef LIBXML_XLINK_ENABLED&nl;</xsl:text> |
| 58 | </xsl:if> |
| 59 | <xsl:if test="@file = 'xmlautomata'"> |
| 60 | <xsl:text>#ifdef LIBXML_AUTOMATA_ENABLED&nl;</xsl:text> |
| 61 | </xsl:if> |
Igor Zlatkovic | 451c8a9 | 2003-04-28 12:55:43 +0000 | [diff] [blame^] | 62 | <xsl:if test="(@file = 'xmlregexp') |
| 63 | or (@file = 'xmlunicode')"> |
Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 64 | <xsl:text>#ifdef LIBXML_REGEXP_ENABLED&nl;</xsl:text> |
| 65 | </xsl:if> |
| 66 | <xsl:if test="(@file = 'xpath') |
| 67 | or (@file = 'xpathInternals')"> |
| 68 | <xsl:text>#ifdef LIBXML_XPATH_ENABLED&nl;</xsl:text> |
| 69 | </xsl:if> |
| 70 | <xsl:if test="@file = 'xpointer'"> |
| 71 | <xsl:text>#ifdef LIBXML_XPTR_ENABLED&nl;</xsl:text> |
| 72 | </xsl:if> |
| 73 | <!-- Extended tests --> |
| 74 | <xsl:if test="(@name = 'htmlDefaultSAXHandlerInit') |
| 75 | or (@name = 'htmlInitAutoClose') |
| 76 | or (@name = 'htmlCreateFileParserCtxt') |
| 77 | or (@name = 'inithtmlDefaultSAXHandler') |
| 78 | or (@name = 'xmlIsXHTML') |
| 79 | or (@name = 'xmlIOHTTPOpenW') |
| 80 | or (@name = 'xmlRegisterHTTPPostCallbacks') |
| 81 | or (@name = 'xmlIOHTTPMatch') |
| 82 | or (@name = 'xmlIOHTTPOpen') |
| 83 | or (@name = 'xmlIOHTTPRead') |
| 84 | or (@name = 'xmlIOHTTPClose')"> |
| 85 | <xsl:text>#ifdef LIBXML_HTML_ENABLED&nl;</xsl:text> |
| 86 | </xsl:if> |
| 87 | <xsl:if test="(@name = 'docbDefaultSAXHandlerInit') |
| 88 | or (@name = 'initdocbDefaultSAXHandler')"> |
| 89 | <xsl:text>#ifdef LIBXML_DOCB_ENABLED&nl;</xsl:text> |
| 90 | </xsl:if> |
| 91 | <xsl:if test="@name = 'xmlValidBuildContentModel'"> |
| 92 | <xsl:text>#ifdef LIBXML_REGEXP_ENABLED&nl;</xsl:text> |
| 93 | </xsl:if> |
| 94 | <xsl:if test="(@name = 'xmlIOFTPMatch') |
| 95 | or (@name = 'xmlIOFTPOpen') |
| 96 | or (@name = 'xmlIOFTPRead') |
| 97 | or (@name = 'xmlIOFTPClose')"> |
| 98 | <xsl:text>#ifdef LIBXML_FTP_ENABLED&nl;</xsl:text> |
| 99 | </xsl:if> |
| 100 | <xsl:if test="(@name = 'xmlTextReaderRelaxNGValidate') |
| 101 | or (@name = 'xmlTextReaderRelaxNGSetSchema')"> |
| 102 | <xsl:text>#ifdef LIBXML_SCHEMAS_ENABLED&nl;</xsl:text> |
| 103 | </xsl:if> |
| 104 | <xsl:if test="(@name = 'xmlXPathDebugDumpObject') |
| 105 | or (@name = 'xmlXPathDebugDumpCompExpr')"> |
| 106 | <xsl:text>#ifdef LIBXML_DEBUG_ENABLED&nl;</xsl:text> |
| 107 | </xsl:if> |
| 108 | <xsl:if test="(@name = 'xmlMallocLoc') |
| 109 | or (@name = 'xmlMallocAtomicLoc') |
| 110 | or (@name = 'xmlReallocLoc') |
| 111 | or (@name = 'xmlMemStrdupLoc')"> |
| 112 | <xsl:text>#ifdef DEBUG_MEMORY_LOCATION&nl;</xsl:text> |
| 113 | </xsl:if> |
| 114 | <!-- Symbol --> |
| 115 | <xsl:choose> |
| 116 | <xsl:when test="(@name = 'xmlMalloc') |
| 117 | or (@name = 'xmlMallocAtomic') |
| 118 | or (@name = 'xmlRealloc') |
| 119 | or (@name = 'xmlFree') |
| 120 | or (@name = 'xmlMemStrdup')"> |
| 121 | <xsl:text>#ifdef LIBXML_THREAD_ALLOC_ENABLED&nl;</xsl:text> |
| 122 | <xsl:text>__</xsl:text> |
| 123 | <xsl:value-of select="@name"/> |
| 124 | <xsl:text>&nl;</xsl:text> |
| 125 | <xsl:text>#else&nl;</xsl:text> |
| 126 | <xsl:value-of select="@name"/> |
| 127 | <xsl:text> DATA&nl;</xsl:text> |
| 128 | <xsl:text>#endif&nl;</xsl:text> |
| 129 | </xsl:when> |
| 130 | <xsl:when test="(@name = 'docbDefaultSAXHandler') |
| 131 | or (@name = 'htmlDefaultSAXHandler') |
| 132 | or (@name = 'oldXMLWDcompatibility') |
| 133 | or (@name = 'xmlBufferAllocScheme') |
| 134 | or (@name = 'xmlDefaultBufferSize') |
| 135 | or (@name = 'xmlDefaultSAXHandler') |
| 136 | or (@name = 'xmlDefaultSAXLocator') |
| 137 | or (@name = 'xmlDoValidityCheckingDefaultValue') |
| 138 | or (@name = 'xmlGenericError') |
| 139 | or (@name = 'xmlGenericErrorContext') |
| 140 | or (@name = 'xmlGetWarningsDefaultValue') |
| 141 | or (@name = 'xmlIndentTreeOutput') |
| 142 | or (@name = 'xmlTreeIndentString') |
| 143 | or (@name = 'xmlKeepBlanksDefaultValue') |
| 144 | or (@name = 'xmlLineNumbersDefaultValue') |
| 145 | or (@name = 'xmlLoadExtDtdDefaultValue') |
| 146 | or (@name = 'xmlParserDebugEntities') |
| 147 | or (@name = 'xmlParserVersion') |
| 148 | or (@name = 'xmlPedanticParserDefaultValue') |
| 149 | or (@name = 'xmlSaveNoEmptyTags') |
| 150 | or (@name = 'xmlSubstituteEntitiesDefaultValue') |
| 151 | or (@name = 'xmlRegisterNodeDefaultValue') |
| 152 | or (@name = 'xmlDeregisterNodeDefaultValue')"> |
| 153 | <xsl:text>#ifdef LIBXML_THREAD_ENABLED&nl;</xsl:text> |
| 154 | <xsl:if test="@name = 'docbDefaultSAXHandler'"> |
| 155 | <xsl:text>#ifdef LIBXML_DOCB_ENABLED&nl;</xsl:text> |
| 156 | </xsl:if> |
| 157 | <xsl:if test="@name = 'htmlDefaultSAXHandler'"> |
| 158 | <xsl:text>#ifdef LIBXML_HTML_ENABLED&nl;</xsl:text> |
| 159 | </xsl:if> |
| 160 | <xsl:text>__</xsl:text> |
| 161 | <xsl:value-of select="@name"/> |
| 162 | <xsl:text>&nl;</xsl:text> |
| 163 | <xsl:if test="@name = 'docbDefaultSAXHandler'"> |
| 164 | <xsl:text>#endif&nl;</xsl:text> |
| 165 | </xsl:if> |
| 166 | <xsl:if test="@name = 'htmlDefaultSAXHandler'"> |
| 167 | <xsl:text>#endif&nl;</xsl:text> |
| 168 | </xsl:if> |
| 169 | <xsl:text>#else&nl;</xsl:text> |
| 170 | <xsl:if test="@name = 'docbDefaultSAXHandler'"> |
| 171 | <xsl:text>#ifdef LIBXML_DOCB_ENABLED&nl;</xsl:text> |
| 172 | </xsl:if> |
| 173 | <xsl:if test="@name = 'htmlDefaultSAXHandler'"> |
| 174 | <xsl:text>#ifdef LIBXML_HTML_ENABLED&nl;</xsl:text> |
| 175 | </xsl:if> |
| 176 | <xsl:value-of select="@name"/> |
| 177 | <xsl:text> DATA&nl;</xsl:text> |
| 178 | <xsl:if test="@name = 'docbDefaultSAXHandler'"> |
| 179 | <xsl:text>#endif&nl;</xsl:text> |
| 180 | </xsl:if> |
| 181 | <xsl:if test="@name = 'htmlDefaultSAXHandler'"> |
| 182 | <xsl:text>#endif&nl;</xsl:text> |
| 183 | </xsl:if> |
| 184 | <xsl:text>#endif&nl;</xsl:text> |
| 185 | </xsl:when> |
| 186 | <xsl:otherwise> |
| 187 | <xsl:value-of select="@name"/> |
| 188 | <xsl:if test="self::variable"> |
| 189 | <xsl:text> DATA</xsl:text> |
| 190 | </xsl:if> |
| 191 | <xsl:text>&nl;</xsl:text> |
| 192 | </xsl:otherwise> |
| 193 | </xsl:choose> |
| 194 | <!-- Basic tests (close) --> |
| 195 | <xsl:if test="@file = 'c14n'"> |
| 196 | <xsl:text>#endif&nl;</xsl:text> |
| 197 | </xsl:if> |
| 198 | <xsl:if test="@file = 'catalog'"> |
| 199 | <xsl:text>#endif&nl;</xsl:text> |
| 200 | </xsl:if> |
| 201 | <xsl:if test="@file = 'debugXML'"> |
| 202 | <xsl:text>#endif&nl;</xsl:text> |
| 203 | </xsl:if> |
| 204 | <xsl:if test="@file = 'DOCBParser'"> |
| 205 | <xsl:text>#endif&nl;</xsl:text> |
| 206 | </xsl:if> |
| 207 | <xsl:if test="(@file = 'HTMLparser') |
| 208 | or (@file = 'HTMLtree') |
| 209 | or (@file = 'nanohtml')"> |
| 210 | <xsl:text>#endif&nl;</xsl:text> |
| 211 | </xsl:if> |
| 212 | <xsl:if test="@file = 'nanoftp'"> |
| 213 | <xsl:text>#endif&nl;</xsl:text> |
| 214 | </xsl:if> |
| 215 | <xsl:if test="(@file = 'relaxng') |
| 216 | or (@file = 'xmlschemas') |
Igor Zlatkovic | 451c8a9 | 2003-04-28 12:55:43 +0000 | [diff] [blame^] | 217 | or (@file = 'xmlschemastypes')"> |
Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 218 | <xsl:text>#endif&nl;</xsl:text> |
| 219 | </xsl:if> |
| 220 | <xsl:if test="@file = 'xinclude'"> |
| 221 | <xsl:text>#endif&nl;</xsl:text> |
| 222 | </xsl:if> |
| 223 | <xsl:if test="@file = 'xlink'"> |
| 224 | <xsl:text>#endif&nl;</xsl:text> |
| 225 | </xsl:if> |
| 226 | <xsl:if test="@file = 'xmlautomata'"> |
| 227 | <xsl:text>#endif&nl;</xsl:text> |
| 228 | </xsl:if> |
Igor Zlatkovic | 451c8a9 | 2003-04-28 12:55:43 +0000 | [diff] [blame^] | 229 | <xsl:if test="(@file = 'xmlregexp') |
| 230 | or (@file = 'xmlunicode')"> |
Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 231 | <xsl:text>#endif&nl;</xsl:text> |
| 232 | </xsl:if> |
| 233 | <xsl:if test="(@file = 'xpath') |
| 234 | or (@file = 'xpathInternals')"> |
| 235 | <xsl:text>#endif&nl;</xsl:text> |
| 236 | </xsl:if> |
| 237 | <xsl:if test="@file = 'xpointer'"> |
| 238 | <xsl:text>#endif&nl;</xsl:text> |
| 239 | </xsl:if> |
| 240 | <!-- Extended tests (close) --> |
| 241 | <xsl:if test="(@name = 'htmlDefaultSAXHandlerInit') |
| 242 | or (@name = 'htmlInitAutoClose') |
| 243 | or (@name = 'htmlCreateFileParserCtxt') |
| 244 | or (@name = 'inithtmlDefaultSAXHandler') |
| 245 | or (@name = 'xmlIsXHTML') |
| 246 | or (@name = 'xmlIOHTTPOpenW') |
| 247 | or (@name = 'xmlRegisterHTTPPostCallbacks') |
| 248 | or (@name = 'xmlIOHTTPMatch') |
| 249 | or (@name = 'xmlIOHTTPOpen') |
| 250 | or (@name = 'xmlIOHTTPRead') |
| 251 | or (@name = 'xmlIOHTTPClose')"> |
| 252 | <xsl:text>#endif&nl;</xsl:text> |
| 253 | </xsl:if> |
| 254 | <xsl:if test="(@name = 'docbDefaultSAXHandlerInit') |
| 255 | or (@name = 'initdocbDefaultSAXHandler')"> |
| 256 | <xsl:text>#endif&nl;</xsl:text> |
| 257 | </xsl:if> |
| 258 | <xsl:if test="@name = 'xmlValidBuildContentModel'"> |
| 259 | <xsl:text>#endif&nl;</xsl:text> |
| 260 | </xsl:if> |
| 261 | <xsl:if test="(@name = 'xmlIOFTPMatch') |
| 262 | or (@name = 'xmlIOFTPOpen') |
| 263 | or (@name = 'xmlIOFTPRead') |
| 264 | or (@name = 'xmlIOFTPClose')"> |
| 265 | <xsl:text>#endif&nl;</xsl:text> |
| 266 | </xsl:if> |
| 267 | <xsl:if test="(@name = 'xmlTextReaderRelaxNGValidate') |
| 268 | or (@name = 'xmlTextReaderRelaxNGSetSchema')"> |
| 269 | <xsl:text>#endif&nl;</xsl:text> |
| 270 | </xsl:if> |
| 271 | <xsl:if test="(@name = 'xmlXPathDebugDumpObject') |
| 272 | or (@name = 'xmlXPathDebugDumpCompExpr')"> |
| 273 | <xsl:text>#endif&nl;</xsl:text> |
| 274 | </xsl:if> |
| 275 | <xsl:if test="(@name = 'xmlMallocLoc') |
| 276 | or (@name = 'xmlMallocAtomicLoc') |
| 277 | or (@name = 'xmlReallocLoc') |
| 278 | or (@name = 'xmlMemStrdupLoc')"> |
| 279 | <xsl:text>#endif&nl;</xsl:text> |
| 280 | </xsl:if> |
| 281 | </xsl:for-each> |
Igor Zlatkovic | 32249d0 | 2003-04-28 00:15:59 +0000 | [diff] [blame] | 282 | </xsl:template> |
| 283 | </xsl:stylesheet> |
| 284 | |