From 44496bf3ecc32757c78b5d8f12df571597f0e0c0 Mon Sep 17 00:00:00 2001 From: Igor Zlatkovic Date: Mon, 25 Aug 2003 10:01:24 +0000 Subject: Exportability taint of the headers --- libexslt/exslt.h | 27 ++++++------- libexslt/exsltconfig.h.in | 17 -------- libexslt/exsltexports.h | 92 ++++++++++++++++++++++++++++++++++++++++++++ libxslt/attributes.h | 13 +++++-- libxslt/documents.h | 16 ++++---- libxslt/extensions.h | 68 ++++++++++++++++---------------- libxslt/extra.h | 10 +++-- libxslt/functions.h | 21 +++++----- libxslt/imports.h | 13 ++++--- libxslt/keys.h | 12 +++--- libxslt/namespaces.h | 14 ++++--- libxslt/numbersInternals.h | 1 + libxslt/pattern.h | 15 ++++---- libxslt/preproc.h | 7 ++-- libxslt/security.h | 23 +++++------ libxslt/templates.h | 23 +++++------ libxslt/transform.h | 63 +++++++++++++++--------------- libxslt/variables.h | 29 +++++++------- libxslt/xslt.h | 24 +++--------- libxslt/xsltInternals.h | 41 ++++++++++---------- libxslt/xsltexports.h | 92 ++++++++++++++++++++++++++++++++++++++++++++ libxslt/xsltutils.h | 65 ++++++++++++++++--------------- libxslt/xsltwin32config.h.in | 17 -------- win32/Makefile.msvc | 16 +++++++- 24 files changed, 448 insertions(+), 271 deletions(-) create mode 100644 libexslt/exsltexports.h create mode 100644 libxslt/xsltexports.h diff --git a/libexslt/exslt.h b/libexslt/exslt.h index f8612358..dca38233 100644 --- a/libexslt/exslt.h +++ b/libexslt/exslt.h @@ -3,16 +3,17 @@ #define __EXSLT_H__ #include +#include "exsltexports.h" #include "exsltconfig.h" #ifdef __cplusplus extern "C" { #endif -LIBEXSLT_PUBLIC extern const char *exsltLibraryVersion; -LIBEXSLT_PUBLIC extern const int exsltLibexsltVersion; -LIBEXSLT_PUBLIC extern const int exsltLibxsltVersion; -LIBEXSLT_PUBLIC extern const int exsltLibxmlVersion; +EXSLTPUBVAR const char *exsltLibraryVersion; +EXSLTPUBVAR const int exsltLibexsltVersion; +EXSLTPUBVAR const int exsltLibxsltVersion; +EXSLTPUBVAR const int exsltLibxmlVersion; /** * EXSLT_COMMON_NAMESPACE: @@ -64,16 +65,16 @@ LIBEXSLT_PUBLIC extern const int exsltLibxmlVersion; */ #define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon") -void LIBEXSLT_PUBLIC exsltCommonRegister (void); -void LIBEXSLT_PUBLIC exsltMathRegister (void); -void LIBEXSLT_PUBLIC exsltSetsRegister (void); -void LIBEXSLT_PUBLIC exsltFuncRegister (void); -void LIBEXSLT_PUBLIC exsltStrRegister (void); -void LIBEXSLT_PUBLIC exsltDateRegister (void); -void LIBEXSLT_PUBLIC exsltSaxonRegister (void); -void LIBEXSLT_PUBLIC exsltDynRegister(void); +EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltStrRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltDateRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltSaxonRegister (void); +EXSLTPUBFUN void EXSLTCALL exsltDynRegister(void); -void LIBEXSLT_PUBLIC exsltRegisterAll (void); +EXSLTPUBFUN void EXSLTCALL exsltRegisterAll (void); #ifdef __cplusplus } diff --git a/libexslt/exsltconfig.h.in b/libexslt/exsltconfig.h.in index 188e97e9..462487d6 100644 --- a/libexslt/exsltconfig.h.in +++ b/libexslt/exsltconfig.h.in @@ -50,23 +50,6 @@ extern "C" { #define ATTRIBUTE_UNUSED #endif -/** - * LIBEXSLT_PUBLIC: - * - * This macro is needed on Win32 when using MSVC. It enables the client code - * to access exported variables. It should expand to nothing when compiling - * this library itself, but must expand to __declspec(dllimport) when a - * client includes the library header and that only if it links dynamically - * against this library. - */ -#if !defined LIBEXSLT_PUBLIC -#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBEXSLT && !defined LIBEXSLT_STATIC -#define LIBEXSLT_PUBLIC __declspec(dllimport) -#else -#define LIBEXSLT_PUBLIC -#endif -#endif - #ifdef __cplusplus } #endif diff --git a/libexslt/exsltexports.h b/libexslt/exsltexports.h new file mode 100644 index 00000000..fa7b46d7 --- /dev/null +++ b/libexslt/exsltexports.h @@ -0,0 +1,92 @@ +/* + * exsltexports.h : macros for marking symbols as exportable/importable. + * + * See Copyright for the status of this software. + * + * igor@zlatkovic.com + */ + +#ifndef __EXSLT_EXPORTS_H__ +#define __EXSLT_EXPORTS_H__ + +/** + * EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +#define EXSLTPUBFUN +#define EXSLTPUBVAR +#define EXSLTCALL + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR + #endif + #endif + #define EXSLTCALL __cdecl +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR + #endif + #endif + #define EXSLTCALL __cdecl +#endif + +/* Cygwin platform, GNU compiler */ +#if defined(_WIN32) && defined(__CYGWIN__) + #undef EXSLTPUBFUN + #undef EXSLTPUBVAR + #undef EXSLTCALL + #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC) + #define EXSLTPUBFUN __declspec(dllexport) + #define EXSLTPUBVAR __declspec(dllexport) + #else + #define EXSLTPUBFUN + #if !defined(LIBEXSLT_STATIC) + #define EXSLTPUBVAR __declspec(dllimport) extern + #else + #define EXSLTPUBVAR + #endif + #endif + #define EXSLTCALL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBEXSLT_PUBLIC) +#define LIBEXSLT_PUBLIC EXSLTPUBVAR +#endif + +#endif /* __EXSLT_EXPORTS_H__ */ + + diff --git a/libxslt/attributes.h b/libxslt/attributes.h index f4d3133a..eaced88a 100644 --- a/libxslt/attributes.h +++ b/libxslt/attributes.h @@ -10,19 +10,24 @@ #define __XML_XSLT_ATTRIBUTES_H__ #include +#include "xsltexports.h" #ifdef __cplusplus extern "C" { #endif -void xsltParseStylesheetAttributeSet (xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL + xsltParseStylesheetAttributeSet (xsltStylesheetPtr style, xmlNodePtr cur); -void xsltFreeAttributeSetsHashes (xsltStylesheetPtr style); -void xsltApplyAttributeSet (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL + xsltFreeAttributeSetsHashes (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltApplyAttributeSet (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xmlChar *attributes); -void xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL + xsltResolveStylesheetAttributeSet(xsltStylesheetPtr style); #ifdef __cplusplus } #endif diff --git a/libxslt/documents.h b/libxslt/documents.h index 7c4f1a72..6f35acc6 100644 --- a/libxslt/documents.h +++ b/libxslt/documents.h @@ -10,25 +10,27 @@ #define __XML_XSLT_DOCUMENTS_H__ #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus extern "C" { #endif -xsltDocumentPtr xsltNewDocument (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltDocumentPtr XSLTCALL + xsltNewDocument (xsltTransformContextPtr ctxt, xmlDocPtr doc); -xsltDocumentPtr xsltLoadDocument (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltDocumentPtr XSLTCALL xsltLoadDocument (xsltTransformContextPtr ctxt, const xmlChar *URI); -xsltDocumentPtr xsltFindDocument (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltDocumentPtr XSLTCALL xsltFindDocument (xsltTransformContextPtr ctxt, xmlDocPtr doc); -void xsltFreeDocuments (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltFreeDocuments (xsltTransformContextPtr ctxt); -xsltDocumentPtr xsltLoadStyleDocument (xsltStylesheetPtr style, +XSLTPUBFUN xsltDocumentPtr XSLTCALL xsltLoadStyleDocument (xsltStylesheetPtr style, const xmlChar *URI); -xsltDocumentPtr xsltNewStyleDocument (xsltStylesheetPtr style, +XSLTPUBFUN xsltDocumentPtr XSLTCALL xsltNewStyleDocument (xsltStylesheetPtr style, xmlDocPtr doc); -void xsltFreeStyleDocuments (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltFreeStyleDocuments (xsltStylesheetPtr style); #ifdef __cplusplus } diff --git a/libxslt/extensions.h b/libxslt/extensions.h index 0a540449..0d40e074 100644 --- a/libxslt/extensions.h +++ b/libxslt/extensions.h @@ -10,6 +10,7 @@ #define __XML_XSLT_EXTENSION_H__ #include "libxml/xpath.h" +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -68,45 +69,46 @@ typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt, const xmlChar *URI, void *data); -int xsltRegisterExtModule (const xmlChar *URI, +XSLTPUBFUN int XSLTCALL + xsltRegisterExtModule (const xmlChar *URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc); -int xsltRegisterExtModuleFull +XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFull (const xmlChar * URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc); -int xsltUnregisterExtModule (const xmlChar * URI); +XSLTPUBFUN int XSLTCALL xsltUnregisterExtModule (const xmlChar * URI); -void * xsltGetExtData (xsltTransformContextPtr ctxt, +XSLTPUBFUN void * XSLTCALL xsltGetExtData (xsltTransformContextPtr ctxt, const xmlChar *URI); -void * xsltStyleGetExtData (xsltStylesheetPtr style, +XSLTPUBFUN void * XSLTCALL xsltStyleGetExtData (xsltStylesheetPtr style, const xmlChar *URI); -void xsltShutdownCtxtExts (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltShutdownCtxtExts (xsltTransformContextPtr ctxt); -void xsltShutdownExts (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltShutdownExts (xsltStylesheetPtr style); -xsltTransformContextPtr xsltXPathGetTransformContext +XSLTPUBFUN xsltTransformContextPtr XSLTCALL xsltXPathGetTransformContext (xmlXPathParserContextPtr ctxt); /* * extension functions */ -int xsltRegisterExtModuleFunction (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFunction (const xmlChar *name, const xmlChar *URI, xmlXPathFunction function); -xmlXPathFunction +XSLTPUBFUN xmlXPathFunction XSLTCALL xsltExtFunctionLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI); -xmlXPathFunction +XSLTPUBFUN xmlXPathFunction XSLTCALL xsltExtModuleFunctionLookup (const xmlChar *name, const xmlChar *URI); -int xsltUnregisterExtModuleFunction (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleFunction (const xmlChar *name, const xmlChar *URI); /* @@ -117,27 +119,27 @@ typedef xsltElemPreCompPtr (*xsltPreComputeFunction) xmlNodePtr inst, xsltTransformFunction function); -xsltElemPreCompPtr xsltNewElemPreComp (xsltStylesheetPtr style, +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltNewElemPreComp (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function); -void xsltInitElemPreComp (xsltElemPreCompPtr comp, +XSLTPUBFUN void XSLTCALL xsltInitElemPreComp (xsltElemPreCompPtr comp, xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function, xsltElemPreCompDeallocator freeFunc); -int xsltRegisterExtModuleElement (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleElement (const xmlChar *name, const xmlChar *URI, xsltPreComputeFunction precomp, xsltTransformFunction transform); -xsltTransformFunction xsltExtElementLookup(xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtElementLookup(xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI); -xsltTransformFunction xsltExtModuleElementLookup(const xmlChar *name, +XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtModuleElementLookup(const xmlChar *name, const xmlChar *URI); -xsltPreComputeFunction xsltExtModuleElementPreComputeLookup (const xmlChar *name, +XSLTPUBFUN xsltPreComputeFunction XSLTCALL xsltExtModuleElementPreComputeLookup (const xmlChar *name, const xmlChar *URI); -int xsltUnregisterExtModuleElement (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleElement (const xmlChar *name, const xmlChar *URI); /* @@ -146,21 +148,21 @@ int xsltUnregisterExtModuleElement (const xmlChar *name, typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style, xmlNodePtr inst); -int xsltRegisterExtModuleTopLevel (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleTopLevel (const xmlChar *name, const xmlChar *URI, xsltTopLevelFunction function); -xsltTopLevelFunction xsltExtModuleTopLevelLookup (const xmlChar *name, +XSLTPUBFUN xsltTopLevelFunction XSLTCALL xsltExtModuleTopLevelLookup (const xmlChar *name, const xmlChar *URI); -int xsltUnregisterExtModuleTopLevel (const xmlChar *name, +XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleTopLevel (const xmlChar *name, const xmlChar *URI); /* These 2 functions are deprecated for use within modules. */ -int xsltRegisterExtFunction (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltRegisterExtFunction (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI, xmlXPathFunction function); -int xsltRegisterExtElement (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltRegisterExtElement (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI, xsltTransformFunction function); @@ -170,29 +172,29 @@ int xsltRegisterExtElement (xsltTransformContextPtr ctxt, * Those are used by the XSLT (pre)processor. */ -int xsltRegisterExtPrefix (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltRegisterExtPrefix (xsltStylesheetPtr style, const xmlChar *prefix, const xmlChar *URI); -int xsltCheckExtPrefix (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltCheckExtPrefix (xsltStylesheetPtr style, const xmlChar *prefix); -int xsltInitCtxtExts (xsltTransformContextPtr ctxt); -void xsltFreeCtxtExts (xsltTransformContextPtr ctxt); -void xsltFreeExts (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL xsltInitCtxtExts (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltFreeCtxtExts (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltFreeExts (xsltStylesheetPtr style); -xsltElemPreCompPtr xsltPreComputeExtModuleElement(xsltStylesheetPtr style, +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltPreComputeExtModuleElement(xsltStylesheetPtr style, xmlNodePtr inst); /* * Extension Infos access. * Used by exslt initialisation */ -xmlHashTablePtr xsltGetExtInfo (xsltStylesheetPtr style, const xmlChar *URI); +XSLTPUBFUN xmlHashTablePtr XSLTCALL xsltGetExtInfo (xsltStylesheetPtr style, const xmlChar *URI); /** * Test module http://xmlsoft.org/XSLT/ */ -void xsltRegisterTestModule (void); -void xsltDebugDumpExtensions(FILE * output); +XSLTPUBFUN void XSLTCALL xsltRegisterTestModule (void); +XSLTPUBFUN void XSLTCALL xsltDebugDumpExtensions(FILE * output); #ifdef __cplusplus diff --git a/libxslt/extra.h b/libxslt/extra.h index 309108f6..9c7cfcf1 100644 --- a/libxslt/extra.h +++ b/libxslt/extra.h @@ -10,6 +10,7 @@ #define __XML_XSLT_EXTRA_H__ #include "libxml/xpath.h" +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -54,16 +55,17 @@ extern "C" { "http://nwalsh.com/xslt/ext/com.nwalsh.saxon.CVS") -void xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL + xsltFunctionNodeSet (xmlXPathParserContextPtr ctxt, int nargs); -void xsltDebug (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDebug (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltRegisterExtras (xsltTransformContextPtr ctxt); -void xsltRegisterAllExtras (void); +XSLTPUBFUN void XSLTCALL xsltRegisterExtras (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltRegisterAllExtras (void); #ifdef __cplusplus } diff --git a/libxslt/functions.h b/libxslt/functions.h index bfd049ea..f3a60ace 100644 --- a/libxslt/functions.h +++ b/libxslt/functions.h @@ -12,6 +12,7 @@ #include #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -28,7 +29,7 @@ extern "C" { (xmlXPathFuncLookupFunc) xsltXPathFunctionLookup, \ (void *)(ctxt->xpathCtxt)); -xmlXPathFunction +XSLTPUBFUN xmlXPathFunction XSLTCALL xsltXPathFunctionLookup (xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); @@ -37,28 +38,28 @@ xmlXPathFunction * Interfaces for the functions implementations. */ -void xsltDocumentFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDocumentFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltKeyFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltKeyFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltUnparsedEntityURIFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltFormatNumberFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltGenerateIdFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltSystemPropertyFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltElementAvailableFunction (xmlXPathParserContextPtr ctxt, int nargs); -void xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt, int nargs); /* * And the registration */ -void xsltRegisterAllFunctions (xmlXPathContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltRegisterAllFunctions (xmlXPathContextPtr ctxt); #ifdef __cplusplus } diff --git a/libxslt/imports.h b/libxslt/imports.h index 5d05b0c4..a6229b6c 100644 --- a/libxslt/imports.h +++ b/libxslt/imports.h @@ -10,6 +10,7 @@ #define __XML_XSLT_IMPORTS_H__ #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -45,15 +46,15 @@ extern "C" { /* * Module interfaces */ -int xsltParseStylesheetImport(xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur); -int xsltParseStylesheetInclude(xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur); -xsltStylesheetPtr xsltNextImport (xsltStylesheetPtr style); -int xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt); -int xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltNextImport (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL xsltNeedElemSpaceHandling(xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xmlNodePtr node); -xsltTemplatePtr xsltFindTemplate (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltTemplatePtr XSLTCALL xsltFindTemplate (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI); diff --git a/libxslt/keys.h b/libxslt/keys.h index f9282d61..fb60015d 100644 --- a/libxslt/keys.h +++ b/libxslt/keys.h @@ -10,26 +10,28 @@ #define __XML_XSLT_KEY_H__ #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus extern "C" { #endif -int xsltAddKey (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL + xsltAddKey (xsltStylesheetPtr style, const xmlChar *name, const xmlChar *nameURI, const xmlChar *match, const xmlChar *use, xmlNodePtr inst); -xmlNodeSetPtr xsltGetKey (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNodeSetPtr XSLTCALL xsltGetKey (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *nameURI, const xmlChar *value); -void xsltInitCtxtKeys (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltInitCtxtKeys (xsltTransformContextPtr ctxt, xsltDocumentPtr doc); -void xsltFreeKeys (xsltStylesheetPtr style); -void xsltFreeDocumentKeys (xsltDocumentPtr doc); +XSLTPUBFUN void XSLTCALL xsltFreeKeys (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltFreeDocumentKeys (xsltDocumentPtr doc); #ifdef __cplusplus } diff --git a/libxslt/namespaces.h b/libxslt/namespaces.h index 8a5e25ae..54827d17 100644 --- a/libxslt/namespaces.h +++ b/libxslt/namespaces.h @@ -10,29 +10,31 @@ #define __XML_XSLT_NAMESPACES_H__ #include +#include "xsltexports.h" #ifdef __cplusplus extern "C" { #endif -void xsltNamespaceAlias (xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL + xsltNamespaceAlias (xsltStylesheetPtr style, xmlNodePtr node); -xmlNsPtr xsltGetNamespace (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNsPtr XSLTCALL xsltGetNamespace (xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, xmlNodePtr out); -xmlNsPtr xsltGetSpecialNamespace (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNsPtr XSLTCALL xsltGetSpecialNamespace (xsltTransformContextPtr ctxt, xmlNodePtr cur, const xmlChar *URI, const xmlChar *prefix, xmlNodePtr out); -xmlNsPtr xsltCopyNamespace (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNsPtr XSLTCALL xsltCopyNamespace (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNsPtr cur); -xmlNsPtr xsltCopyNamespaceList (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNsPtr XSLTCALL xsltCopyNamespaceList (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNsPtr cur); -void xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style); #ifdef __cplusplus } #endif diff --git a/libxslt/numbersInternals.h b/libxslt/numbersInternals.h index 9920ef39..e4938f33 100644 --- a/libxslt/numbersInternals.h +++ b/libxslt/numbersInternals.h @@ -11,6 +11,7 @@ #define __XML_XSLT_NUMBERSINTERNALS_H__ #include +#include "xsltexports.h" #ifdef __cplusplus extern "C" { diff --git a/libxslt/pattern.h b/libxslt/pattern.h index 52e8a17d..0779fa0e 100644 --- a/libxslt/pattern.h +++ b/libxslt/pattern.h @@ -10,6 +10,7 @@ #define __XML_XSLT_PATTERN_H__ #include "xsltInternals.h" +#include "xsltexports.h" #ifdef __cplusplus extern "C" { @@ -28,28 +29,28 @@ typedef xsltCompMatch *xsltCompMatchPtr; * Pattern related interfaces. */ -xsltCompMatchPtr xsltCompilePattern (const xmlChar *pattern, +XSLTPUBFUN xsltCompMatchPtr XSLTCALL xsltCompilePattern (const xmlChar *pattern, xmlDocPtr doc, xmlNodePtr node, xsltStylesheetPtr style, xsltTransformContextPtr runtime); -void xsltFreeCompMatchList (xsltCompMatchPtr comp); -int xsltTestCompMatchList (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltFreeCompMatchList (xsltCompMatchPtr comp); +XSLTPUBFUN int XSLTCALL xsltTestCompMatchList (xsltTransformContextPtr ctxt, xmlNodePtr node, xsltCompMatchPtr comp); /* * Template related interfaces. */ -int xsltAddTemplate (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltAddTemplate (xsltStylesheetPtr style, xsltTemplatePtr cur, const xmlChar *mode, const xmlChar *modeURI); -xsltTemplatePtr xsltGetTemplate (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltTemplatePtr XSLTCALL xsltGetTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, xsltStylesheetPtr style); -void xsltFreeTemplateHashes (xsltStylesheetPtr style); -void xsltCleanupTemplates (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltFreeTemplateHashes (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltCleanupTemplates (xsltStylesheetPtr style); #if 0 int xsltMatchPattern (xsltTransformContextPtr ctxt, diff --git a/libxslt/preproc.h b/libxslt/preproc.h index 507e4f14..6359c01f 100644 --- a/libxslt/preproc.h +++ b/libxslt/preproc.h @@ -10,6 +10,7 @@ #define __XML_XSLT_PRECOMP_H__ #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -21,13 +22,13 @@ extern "C" { */ extern const xmlChar *xsltExtMarker; -xsltElemPreCompPtr xsltDocumentComp (xsltStylesheetPtr style, +XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltDocumentComp (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function); -void xsltStylePreCompute (xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL xsltStylePreCompute (xsltStylesheetPtr style, xmlNodePtr inst); -void xsltFreeStylePreComps (xsltStylesheetPtr style); +XSLTPUBFUN void XSLTCALL xsltFreeStylePreComps (xsltStylesheetPtr style); #ifdef __cplusplus } #endif diff --git a/libxslt/security.h b/libxslt/security.h index 1f3112a2..b335e801 100644 --- a/libxslt/security.h +++ b/libxslt/security.h @@ -10,6 +10,7 @@ #define __XML_XSLT_SECURITY_H__ #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -51,33 +52,33 @@ typedef int (*xsltSecurityCheck) (xsltSecurityPrefsPtr sec, /* * Module interfaces */ -xsltSecurityPrefsPtr xsltNewSecurityPrefs (void); -void xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec); -int xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec, +XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL xsltNewSecurityPrefs (void); +XSLTPUBFUN void XSLTCALL xsltFreeSecurityPrefs (xsltSecurityPrefsPtr sec); +XSLTPUBFUN int XSLTCALL xsltSetSecurityPrefs (xsltSecurityPrefsPtr sec, xsltSecurityOption option, xsltSecurityCheck func); -xsltSecurityCheck xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec, +XSLTPUBFUN xsltSecurityCheck XSLTCALL xsltGetSecurityPrefs (xsltSecurityPrefsPtr sec, xsltSecurityOption option); -void xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec); -xsltSecurityPrefsPtr xsltGetDefaultSecurityPrefs(void); +XSLTPUBFUN void XSLTCALL xsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec); +XSLTPUBFUN xsltSecurityPrefsPtr XSLTCALL xsltGetDefaultSecurityPrefs(void); -int xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec, +XSLTPUBFUN int XSLTCALL xsltSetCtxtSecurityPrefs(xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt); -int xsltSecurityAllow (xsltSecurityPrefsPtr sec, +XSLTPUBFUN int XSLTCALL xsltSecurityAllow (xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value); -int xsltSecurityForbid (xsltSecurityPrefsPtr sec, +XSLTPUBFUN int XSLTCALL xsltSecurityForbid (xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const char *value); /* * internal interfaces */ -int xsltCheckWrite (xsltSecurityPrefsPtr sec, +XSLTPUBFUN int XSLTCALL xsltCheckWrite (xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const xmlChar *URL); -int xsltCheckRead (xsltSecurityPrefsPtr sec, +XSLTPUBFUN int XSLTCALL xsltCheckRead (xsltSecurityPrefsPtr sec, xsltTransformContextPtr ctxt, const xmlChar *URL); diff --git a/libxslt/templates.h b/libxslt/templates.h index c92d1c53..d34d186d 100644 --- a/libxslt/templates.h +++ b/libxslt/templates.h @@ -11,48 +11,49 @@ #include #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus extern "C" { #endif -int xsltEvalXPathPredicate (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltEvalXPathPredicate (xsltTransformContextPtr ctxt, xmlXPathCompExprPtr comp, xmlNsPtr *nsList, int nsNr); -xmlChar * xsltEvalTemplateString (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltEvalTemplateString (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr parent); -xmlChar * xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltEvalAttrValueTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, const xmlChar *name, const xmlChar *ns); -xmlChar * xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style, +XSLTPUBFUN xmlChar * XSLTCALL xsltEvalStaticAttrValueTemplate (xsltStylesheetPtr style, xmlNodePtr node, const xmlChar *name, const xmlChar *ns, int *found); /* TODO: this is obviously broken ... the namespaces should be passed too ! */ -xmlChar * xsltEvalXPathString (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltEvalXPathString (xsltTransformContextPtr ctxt, xmlXPathCompExprPtr comp); -xmlChar * xsltEvalXPathStringNs (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltEvalXPathStringNs (xsltTransformContextPtr ctxt, xmlXPathCompExprPtr comp, int nsNr, xmlNsPtr *nsList); -xmlNodePtr * xsltTemplateProcess (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNodePtr * XSLTCALL xsltTemplateProcess (xsltTransformContextPtr ctxt, xmlNodePtr node); -xmlAttrPtr xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlAttrPtr XSLTCALL xsltAttrListTemplateProcess (xsltTransformContextPtr ctxt, xmlNodePtr target, xmlAttrPtr cur); -xmlAttrPtr xsltAttrTemplateProcess (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlAttrPtr XSLTCALL xsltAttrTemplateProcess (xsltTransformContextPtr ctxt, xmlNodePtr target, xmlAttrPtr attr); -xmlChar * xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltAttrTemplateValueProcess (xsltTransformContextPtr ctxt, const xmlChar* attr); -xmlChar * xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlChar * XSLTCALL xsltAttrTemplateValueProcessNode(xsltTransformContextPtr ctxt, const xmlChar* str, xmlNodePtr node); #ifdef __cplusplus diff --git a/libxslt/transform.h b/libxslt/transform.h index 29a7e100..4f05fae6 100644 --- a/libxslt/transform.h +++ b/libxslt/transform.h @@ -12,6 +12,7 @@ #include #include +#include "xsltexports.h" #include #ifdef __cplusplus @@ -21,18 +22,18 @@ extern "C" { /** * XInclude default processing. */ -void xsltSetXIncludeDefault (int xinclude); -int xsltGetXIncludeDefault (void); +XSLTPUBFUN void XSLTCALL xsltSetXIncludeDefault (int xinclude); +XSLTPUBFUN int XSLTCALL xsltGetXIncludeDefault (void); /** * Export context to users. */ -xsltTransformContextPtr xsltNewTransformContext (xsltStylesheetPtr style, +XSLTPUBFUN xsltTransformContextPtr XSLTCALL xsltNewTransformContext (xsltStylesheetPtr style, xmlDocPtr doc); -void xsltFreeTransformContext(xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltFreeTransformContext(xsltTransformContextPtr ctxt); -xmlDocPtr xsltApplyStylesheetUser (xsltStylesheetPtr style, +XSLTPUBFUN xmlDocPtr XSLTCALL xsltApplyStylesheetUser (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, @@ -41,22 +42,22 @@ xmlDocPtr xsltApplyStylesheetUser (xsltStylesheetPtr style, /** * Private Interfaces. */ -void xsltApplyStripSpaces (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltApplyStripSpaces (xsltTransformContextPtr ctxt, xmlNodePtr node); -xmlDocPtr xsltApplyStylesheet (xsltStylesheetPtr style, +XSLTPUBFUN xmlDocPtr XSLTCALL xsltApplyStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params); -xmlDocPtr xsltProfileStylesheet (xsltStylesheetPtr style, +XSLTPUBFUN xmlDocPtr XSLTCALL xsltProfileStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, FILE * output); -int xsltRunStylesheet (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltRunStylesheet (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, xmlSAXHandlerPtr SAX, xmlOutputBufferPtr IObuf); -int xsltRunStylesheetUser (xsltStylesheetPtr style, +XSLTPUBFUN int XSLTCALL xsltRunStylesheetUser (xsltStylesheetPtr style, xmlDocPtr doc, const char **params, const char *output, @@ -64,89 +65,89 @@ int xsltRunStylesheetUser (xsltStylesheetPtr style, xmlOutputBufferPtr IObuf, FILE * profile, xsltTransformContextPtr userCtxt); -void xsltApplyOneTemplate (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltApplyOneTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr list, xsltTemplatePtr templ, xsltStackElemPtr params); -void xsltDocumentElem (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDocumentElem (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltSort (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltSort (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltCopy (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltCopy (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltText (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltText (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltElement (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltElement (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltComment (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltComment (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltAttribute (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltAttribute (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltProcessingInstruction(xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltProcessingInstruction(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltCopyOf (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltCopyOf (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltValueOf (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltValueOf (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltNumber (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltNumber (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltApplyImports (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltApplyImports (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltCallTemplate (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltCallTemplate (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltApplyTemplates (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltApplyTemplates (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltChoose (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltChoose (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltIf (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltIf (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltForEach (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltForEach (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltStylePreCompPtr comp); -void xsltRegisterAllElement (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltRegisterAllElement (xsltTransformContextPtr ctxt); -xmlNodePtr xsltCopyTextString (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlNodePtr XSLTCALL xsltCopyTextString (xsltTransformContextPtr ctxt, xmlNodePtr target, const xmlChar *string, int noescape); /* * Hook for the debugger if activated. */ -void xslHandleDebugger (xmlNodePtr cur, +XSLTPUBFUN void XSLTCALL xslHandleDebugger (xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt); diff --git a/libxslt/variables.h b/libxslt/variables.h index 1d809f82..9b8c443d 100644 --- a/libxslt/variables.h +++ b/libxslt/variables.h @@ -11,6 +11,7 @@ #include #include +#include "xsltexports.h" #include "xsltInternals.h" #include "functions.h" @@ -36,35 +37,35 @@ extern "C" { * Interfaces for the variable module. */ -int xsltEvalGlobalVariables (xsltTransformContextPtr ctxt); -int xsltEvalUserParams (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltEvalGlobalVariables (xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL xsltEvalUserParams (xsltTransformContextPtr ctxt, const char **params); -int xsltQuoteUserParams (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltQuoteUserParams (xsltTransformContextPtr ctxt, const char **params); -int xsltEvalOneUserParam (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltEvalOneUserParam (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * value); -int xsltQuoteOneUserParam (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltQuoteOneUserParam (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * value); -void xsltParseGlobalVariable (xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL xsltParseGlobalVariable (xsltStylesheetPtr style, xmlNodePtr cur); -void xsltParseGlobalParam (xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL xsltParseGlobalParam (xsltStylesheetPtr style, xmlNodePtr cur); -void xsltParseStylesheetVariable (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltParseStylesheetVariable (xsltTransformContextPtr ctxt, xmlNodePtr cur); -void xsltParseStylesheetParam (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltParseStylesheetParam (xsltTransformContextPtr ctxt, xmlNodePtr cur); -xsltStackElemPtr xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltStackElemPtr XSLTCALL xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt, xmlNodePtr cur); -int xsltAddStackElemList (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltAddStackElemList (xsltTransformContextPtr ctxt, xsltStackElemPtr elems); -void xsltFreeGlobalVariables (xsltTransformContextPtr ctxt); -xmlXPathObjectPtr xsltVariableLookup (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltFreeGlobalVariables (xsltTransformContextPtr ctxt); +XSLTPUBFUN xmlXPathObjectPtr XSLTCALL xsltVariableLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri); -xmlXPathObjectPtr xsltXPathVariableLookup (void *ctxt, +XSLTPUBFUN xmlXPathObjectPtr XSLTCALL xsltXPathVariableLookup (void *ctxt, const xmlChar *name, const xmlChar *ns_uri); #ifdef __cplusplus diff --git a/libxslt/xslt.h b/libxslt/xslt.h index 2d96491e..adb73d1f 100644 --- a/libxslt/xslt.h +++ b/libxslt/xslt.h @@ -10,6 +10,7 @@ #define __XML_XSLT_H__ #include +#include "xsltexports.h" #ifdef __cplusplus extern "C" { @@ -43,51 +44,38 @@ extern "C" { */ #define XSLT_NAMESPACE ((xmlChar *) "http://www.w3.org/1999/XSL/Transform") -/** - * LIBXSLT_PUBLIC: - * - * Macro used on Windows to tag public identifiers from shared libraries. - */ -#if !defined LIBXSLT_PUBLIC -#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC -#define LIBXSLT_PUBLIC __declspec(dllimport) -#else -#define LIBXSLT_PUBLIC -#endif -#endif - /** * xsltMaxDepth: * * This value is used to detect templates loops. */ -LIBXSLT_PUBLIC extern int xsltMaxDepth; +XSLTPUBVAR int xsltMaxDepth; /** * xsltEngineVersion: * * The version string for libxslt. */ -LIBXSLT_PUBLIC extern const char *xsltEngineVersion; +XSLTPUBVAR const char *xsltEngineVersion; /** * xsltLibxsltVersion: * * The version of libxslt compiled. */ -LIBXSLT_PUBLIC extern const int xsltLibxsltVersion; +XSLTPUBVAR const int xsltLibxsltVersion; /** * xsltLibxmlVersion: * * The version of libxml libxslt was compiled against. */ -LIBXSLT_PUBLIC extern const int xsltLibxmlVersion; +XSLTPUBVAR const int xsltLibxmlVersion; /* * Global cleanup function. */ -void xsltCleanupGlobals (void); +XSLTPUBFUN void XSLTCALL xsltCleanupGlobals (void); #ifdef __cplusplus } diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h index 739b2100..41b897e6 100644 --- a/libxslt/xsltInternals.h +++ b/libxslt/xsltInternals.h @@ -17,6 +17,7 @@ #include #include #include +#include "xsltexports.h" #include "numbersInternals.h" #ifdef __cplusplus @@ -543,42 +544,42 @@ struct _xsltTransformContext { xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, xmlChar *name); */ -xsltStylesheetPtr xsltNewStylesheet (void); -xsltStylesheetPtr xsltParseStylesheetFile (const xmlChar* filename); -void xsltFreeStylesheet (xsltStylesheetPtr sheet); -int xsltIsBlank (xmlChar *str); -void xsltFreeStackElemList (xsltStackElemPtr elem); -xsltDecimalFormatPtr xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltNewStylesheet (void); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetFile (const xmlChar* filename); +XSLTPUBFUN void XSLTCALL xsltFreeStylesheet (xsltStylesheetPtr sheet); +XSLTPUBFUN int XSLTCALL xsltIsBlank (xmlChar *str); +XSLTPUBFUN void XSLTCALL xsltFreeStackElemList (xsltStackElemPtr elem); +XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL xsltDecimalFormatGetByName(xsltStylesheetPtr sheet, xmlChar *name); -xsltStylesheetPtr xsltParseStylesheetProcess(xsltStylesheetPtr ret, +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetProcess(xsltStylesheetPtr ret, xmlDocPtr doc); -void xsltParseStylesheetOutput(xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL xsltParseStylesheetOutput(xsltStylesheetPtr style, xmlNodePtr cur); -xsltStylesheetPtr xsltParseStylesheetDoc (xmlDocPtr doc); -xsltStylesheetPtr xsltParseStylesheetImportedDoc(xmlDocPtr doc); -xsltStylesheetPtr xsltLoadStylesheetPI (xmlDocPtr doc); -void xsltNumberFormat (xsltTransformContextPtr ctxt, +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetDoc (xmlDocPtr doc); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltParseStylesheetImportedDoc(xmlDocPtr doc); +XSLTPUBFUN xsltStylesheetPtr XSLTCALL xsltLoadStylesheetPI (xmlDocPtr doc); +XSLTPUBFUN void XSLTCALL xsltNumberFormat (xsltTransformContextPtr ctxt, xsltNumberDataPtr data, xmlNodePtr node); -xmlXPathError xsltFormatNumberConversion(xsltDecimalFormatPtr self, +XSLTPUBFUN xmlXPathError XSLTCALL xsltFormatNumberConversion(xsltDecimalFormatPtr self, xmlChar *format, double number, xmlChar **result); -void xsltParseTemplateContent(xsltStylesheetPtr style, +XSLTPUBFUN void XSLTCALL xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ); -int xsltAllocateExtra (xsltStylesheetPtr style); -int xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL xsltAllocateExtra (xsltStylesheetPtr style); +XSLTPUBFUN int XSLTCALL xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt); /* * Extra functions for Result Value Trees */ -xmlDocPtr xsltCreateRVT (xsltTransformContextPtr ctxt); -int xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlDocPtr XSLTCALL xsltCreateRVT (xsltTransformContextPtr ctxt); +XSLTPUBFUN int XSLTCALL xsltRegisterTmpRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT); -int xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, +XSLTPUBFUN int XSLTCALL xsltRegisterPersistRVT (xsltTransformContextPtr ctxt, xmlDocPtr RVT); -void xsltFreeRVTs (xsltTransformContextPtr ctxt); +XSLTPUBFUN void XSLTCALL xsltFreeRVTs (xsltTransformContextPtr ctxt); #ifdef __cplusplus } #endif diff --git a/libxslt/xsltexports.h b/libxslt/xsltexports.h new file mode 100644 index 00000000..4096a0c1 --- /dev/null +++ b/libxslt/xsltexports.h @@ -0,0 +1,92 @@ +/* + * xsltexports.h : macros for marking symbols as exportable/importable. + * + * See Copyright for the status of this software. + * + * igor@zlatkovic.com + */ + +#ifndef __XSLT_EXPORTS_H__ +#define __XSLT_EXPORTS_H__ + +/** + * XSLTPUBFUN, XSLTPUBVAR, XSLTCALL + * + * Macros which declare an exportable function, an exportable variable and + * the calling convention used for functions. + * + * Please use an extra block for every platform/compiler combination when + * modifying this, rather than overlong #ifdef lines. This helps + * readability as well as the fact that different compilers on the same + * platform might need different definitions. + */ + +#define XSLTPUBFUN +#define XSLTPUBVAR +#define XSLTCALL + +/* Windows platform with MS compiler */ +#if defined(_WIN32) && defined(_MSC_VER) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR + #endif + #endif + #define XSLTCALL __cdecl +#endif + +/* Windows platform with Borland compiler */ +#if defined(_WIN32) && defined(__BORLANDC__) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR + #endif + #endif + #define XSLTCALL __cdecl +#endif + +/* Cygwin platform, GNU compiler */ +#if defined(_WIN32) && defined(__CYGWIN__) + #undef XSLTPUBFUN + #undef XSLTPUBVAR + #undef XSLTCALL + #if defined(IN_LIBXSLT) && !defined(LIBXSLT_STATIC) + #define XSLTPUBFUN __declspec(dllexport) + #define XSLTPUBVAR __declspec(dllexport) + #else + #define XSLTPUBFUN + #if !defined(LIBXSLT_STATIC) + #define XSLTPUBVAR __declspec(dllimport) extern + #else + #define XSLTPUBVAR + #endif + #endif + #define XSLTCALL __cdecl +#endif + +/* Compatibility */ +#if !defined(LIBXSLT_PUBLIC) +#define LIBXSLT_PUBLIC XSLTPUBVAR +#endif + +#endif /* __XSLT_EXPORTS_H__ */ + + diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h index 47448f60..38f0c1d5 100644 --- a/libxslt/xsltutils.h +++ b/libxslt/xsltutils.h @@ -17,6 +17,7 @@ #include #include +#include "xsltexports.h" #include "xsltInternals.h" #ifdef __cplusplus @@ -87,34 +88,34 @@ extern "C" { /* * Our own version of namespaced atributes lookup. */ -xmlChar * xsltGetNsProp (xmlNodePtr node, +XSLTPUBFUN xmlChar * XSLTCALL xsltGetNsProp (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace); -int xsltGetUTF8Char (const unsigned char *utf, +XSLTPUBFUN int XSLTCALL xsltGetUTF8Char (const unsigned char *utf, int *len); /* * XSLT specific error and debug reporting functions. */ -LIBXSLT_PUBLIC extern xmlGenericErrorFunc xsltGenericError; -LIBXSLT_PUBLIC extern void *xsltGenericErrorContext; -LIBXSLT_PUBLIC extern xmlGenericErrorFunc xsltGenericDebug; -LIBXSLT_PUBLIC extern void *xsltGenericDebugContext; +XSLTPUBVAR xmlGenericErrorFunc xsltGenericError; +XSLTPUBVAR void *xsltGenericErrorContext; +XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug; +XSLTPUBVAR void *xsltGenericDebugContext; -void xsltPrintErrorContext (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltPrintErrorContext (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node); -void xsltMessage (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltMessage (xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst); -void xsltSetGenericErrorFunc (void *ctx, +XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler); -void xsltSetGenericDebugFunc (void *ctx, +XSLTPUBFUN void XSLTCALL xsltSetGenericDebugFunc (void *ctx, xmlGenericErrorFunc handler); -void xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt, void *ctx, xmlGenericErrorFunc handler); -void xsltTransformError (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltTransformError (xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg, @@ -124,43 +125,43 @@ void xsltTransformError (xsltTransformContextPtr ctxt, * Sorting. */ -void xsltDocumentSortFunction (xmlNodeSetPtr list); -void xsltSetSortFunc (xsltSortFunc handler); -void xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction (xmlNodeSetPtr list); +XSLTPUBFUN void XSLTCALL xsltSetSortFunc (xsltSortFunc handler); +XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt, xsltSortFunc handler); -void xsltDefaultSortFunction (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts); -void xsltDoSortFunction (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltDoSortFunction (xsltTransformContextPtr ctxt, xmlNodePtr * sorts, int nbsorts); -xmlXPathObjectPtr *xsltComputeSortResult (xsltTransformContextPtr ctxt, +XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL xsltComputeSortResult (xsltTransformContextPtr ctxt, xmlNodePtr sort); /* * QNames handling. */ -const xmlChar * xsltGetQNameURI (xmlNodePtr node, +XSLTPUBFUN const xmlChar * XSLTCALL xsltGetQNameURI (xmlNodePtr node, xmlChar **name); /* * Output, reuse libxml I/O buffers. */ -int xsltSaveResultTo (xmlOutputBufferPtr buf, +XSLTPUBFUN int XSLTCALL xsltSaveResultTo (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style); -int xsltSaveResultToFilename (const char *URI, +XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename (const char *URI, xmlDocPtr result, xsltStylesheetPtr style, int compression); -int xsltSaveResultToFile (FILE *file, +XSLTPUBFUN int XSLTCALL xsltSaveResultToFile (FILE *file, xmlDocPtr result, xsltStylesheetPtr style); -int xsltSaveResultToFd (int fd, +XSLTPUBFUN int XSLTCALL xsltSaveResultToFd (int fd, xmlDocPtr result, xsltStylesheetPtr style); -int xsltSaveResultToString (xmlChar **doc_txt_ptr, +XSLTPUBFUN int XSLTCALL xsltSaveResultToString (xmlChar **doc_txt_ptr, int * doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style); @@ -168,12 +169,12 @@ int xsltSaveResultToString (xmlChar **doc_txt_ptr, /* * Profiling. */ -void xsltSaveProfiling (xsltTransformContextPtr ctxt, +XSLTPUBFUN void XSLTCALL xsltSaveProfiling (xsltTransformContextPtr ctxt, FILE *output); -xmlDocPtr xsltGetProfileInformation (xsltTransformContextPtr ctxt); +XSLTPUBFUN xmlDocPtr XSLTCALL xsltGetProfileInformation (xsltTransformContextPtr ctxt); -long xsltTimestamp (void); -void xsltCalibrateAdjust (long delta); +XSLTPUBFUN long XSLTCALL xsltTimestamp (void); +XSLTPUBFUN void XSLTCALL xsltCalibrateAdjust (long delta); /** * XSLT_TIMESTAMP_TICS_PER_SEC: @@ -199,17 +200,17 @@ typedef enum { XSLT_DEBUG_QUIT } xsltDebugStatusCodes; -LIBXSLT_PUBLIC extern int xslDebugStatus; +XSLTPUBVAR int xslDebugStatus; typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt); typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source); typedef void (*xsltDropCallCallback) (void); -int xsltSetDebuggerCallbacks (int no, void *block); -int xslAddCall (xsltTemplatePtr templ, +XSLTPUBFUN int XSLTCALL xsltSetDebuggerCallbacks (int no, void *block); +XSLTPUBFUN int XSLTCALL xslAddCall (xsltTemplatePtr templ, xmlNodePtr source); -void xslDropCall (void); +XSLTPUBFUN void XSLTCALL xslDropCall (void); #ifdef __cplusplus } diff --git a/libxslt/xsltwin32config.h.in b/libxslt/xsltwin32config.h.in index 4c7d30fd..7d0a4c2f 100644 --- a/libxslt/xsltwin32config.h.in +++ b/libxslt/xsltwin32config.h.in @@ -77,23 +77,6 @@ extern "C" { #define ATTRIBUTE_UNUSED #endif -/** - * LIBXSLT_PUBLIC: - * - * This macro is needed on Win32 when using MSVC. It enables the client code - * to access exported variables. It should expand to nothing when compiling - * this library itself, but must expand to __declspec(dllimport) when a - * client includes the library header and that only if it links dynamically - * against this library. - */ -#if !defined LIBXSLT_PUBLIC -#if defined _MSC_VER && !defined IN_LIBXSLT && !defined LIBXSLT_STATIC -#define LIBXSLT_PUBLIC __declspec(dllimport) -#else -#define LIBXSLT_PUBLIC -#endif -#endif - #ifdef __cplusplus } #endif diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index e0de2c62..7f295429 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -244,11 +244,17 @@ $(XSLT_INTDIR)\$(XSLT_DEF) : $(XSLT_INTDIR) $(XSLT_DEF).src # Creates the libxslt shared object. $(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) - $(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \ + $(LD) $(LDFLAGS) /DLL \ /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ $(XSLT_OBJS) $(LIBS) libxml2.lib +#$(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) +# $(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \ +# /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ +# /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ +# $(XSLT_OBJS) $(LIBS) libxml2.lib + # Creates the libxslt archive. $(BINDIR)\$(XSLT_A) : $(BINDIR) $(XSLT_OBJS_A) $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XSLT_A) $(XSLT_OBJS_A) @@ -283,11 +289,17 @@ $(EXSLT_INTDIR)\$(EXSLT_DEF) : $(EXSLT_INTDIR) $(EXSLT_DEF).src # Creates the libexslt shared object. $(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt - $(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \ + $(LD) $(LDFLAGS) /DLL \ /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib +#$(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt +# $(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \ +# /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ +# /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ +# $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib + # Creates the libexslt archive. $(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS_A) -- cgit v1.2.3