#ifndef XMLPARSEAPI
# if defined(__declspec) && !defined(__BEOS__)
-# define XMLPARSEAPI __declspec(dllimport)
+# define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl
+# define XMLCALLBACK(type) type __cdecl
# else
-# define XMLPARSEAPI /* nothing */
+# define XMLPARSEAPI(type) type
+# define XMLCALLBACK(type) type
# endif
#endif /* not defined XMLPARSEAPI */
to free model when finished with it.
*/
-typedef void (*XML_ElementDeclHandler) (void *userData,
- const XML_Char *name,
- XML_Content *model);
+typedef XMLCALLBACK(void) (*XML_ElementDeclHandler) (void *userData,
+ const XML_Char *name,
+ XML_Content *model);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetElementDeclHandler(XML_Parser parser,
XML_ElementDeclHandler eldecl);
default is non-NULL, then this is a "#FIXED" default.
*/
-typedef void (*XML_AttlistDeclHandler) (void *userData,
- const XML_Char *elname,
- const XML_Char *attname,
- const XML_Char *att_type,
- const XML_Char *dflt,
- int isrequired);
+typedef XMLCALLBACK(void) (*XML_AttlistDeclHandler) (void *userData,
+ const XML_Char *elname,
+ const XML_Char *attname,
+ const XML_Char *att_type,
+ const XML_Char *dflt,
+ int isrequired);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetAttlistDeclHandler(XML_Parser parser,
XML_AttlistDeclHandler attdecl);
the declaration, that it was given as no, or that it was given as yes.
*/
-typedef void (*XML_XmlDeclHandler) (void *userData,
- const XML_Char *version,
- const XML_Char *encoding,
- int standalone);
+typedef XMLCALLBACK(void) (*XML_XmlDeclHandler) (void *userData,
+ const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetXmlDeclHandler(XML_Parser parser,
XML_XmlDeclHandler xmldecl);
/* Constructs a new parser; encoding is the encoding specified by the
external protocol or null if there is none specified. */
-XMLPARSEAPI XML_Parser
+XMLPARSEAPI(XML_Parser)
XML_ParserCreate(const XML_Char *encoding);
/* Constructs a new parser and namespace processor. Element type
concatenated without any separator. When a namespace is not declared,
the name and prefix will be passed through without expansion. */
-XMLPARSEAPI XML_Parser
+XMLPARSEAPI(XML_Parser)
XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
the given suite.
*/
-XMLPARSEAPI XML_Parser
+XMLPARSEAPI(XML_Parser)
XML_ParserCreate_MM(const XML_Char *encoding,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *namespaceSeparator);
/* atts is array of name/value pairs, terminated by 0;
names and values are 0 terminated. */
-typedef void (*XML_StartElementHandler)(void *userData,
- const XML_Char *name,
- const XML_Char **atts);
+typedef XMLCALLBACK(void) (*XML_StartElementHandler)(void *userData,
+ const XML_Char *name,
+ const XML_Char **atts);
-typedef void (*XML_EndElementHandler)(void *userData,
- const XML_Char *name);
+typedef XMLCALLBACK(void) (*XML_EndElementHandler)(void *userData,
+ const XML_Char *name);
/* s is not 0 terminated. */
-typedef void (*XML_CharacterDataHandler)(void *userData,
- const XML_Char *s,
- int len);
+typedef XMLCALLBACK(void) (*XML_CharacterDataHandler)(void *userData,
+ const XML_Char *s,
+ int len);
/* target and data are 0 terminated */
-typedef void (*XML_ProcessingInstructionHandler)(void *userData,
- const XML_Char *target,
- const XML_Char *data);
+typedef XMLCALLBACK(void) (*XML_ProcessingInstructionHandler)(void *userData,
+ const XML_Char *target,
+ const XML_Char *data);
/* data is 0 terminated */
-typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
+typedef XMLCALLBACK(void) (*XML_CommentHandler)(void *userData, const XML_Char *data);
-typedef void (*XML_StartCdataSectionHandler)(void *userData);
-typedef void (*XML_EndCdataSectionHandler)(void *userData);
+typedef XMLCALLBACK(void) (*XML_StartCdataSectionHandler)(void *userData);
+typedef XMLCALLBACK(void) (*XML_EndCdataSectionHandler)(void *userData);
/* This is called for any characters in the XML document for
which there is no applicable handler. This includes both
to the default handler: for example, a comment might be split between
multiple calls. */
-typedef void (*XML_DefaultHandler)(void *userData,
- const XML_Char *s,
- int len);
+typedef XMLCALLBACK(void) (*XML_DefaultHandler)(void *userData,
+ const XML_Char *s,
+ int len);
/* This is called for the start of the DOCTYPE declaration, before
any DTD or internal subset is parsed. */
-typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
- const XML_Char *doctypeName,
- const XML_Char *sysid,
- const XML_Char *pubid,
- int has_internal_subset
- );
+typedef XMLCALLBACK(void) (*XML_StartDoctypeDeclHandler)(void *userData,
+ const XML_Char *doctypeName,
+ const XML_Char *sysid,
+ const XML_Char *pubid,
+ int has_internal_subset);
/* This is called for the start of the DOCTYPE declaration when the
closing > is encountered, but after processing any external subset. */
-typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
+typedef XMLCALLBACK(void) (*XML_EndDoctypeDeclHandler)(void *userData);
/* This is called for entity declarations. The is_parameter_entity
argument will be non-zero if the entity is a parameter entity, zero
for unparsed entity declarations.
*/
-typedef void (*XML_EntityDeclHandler) (void *userData,
- const XML_Char *entityName,
- int is_parameter_entity,
- const XML_Char *value,
- int value_length,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId,
- const XML_Char *notationName);
+typedef XMLCALLBACK(void) (*XML_EntityDeclHandler) (void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity,
+ const XML_Char *value,
+ int value_length,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetEntityDeclHandler(XML_Parser parser,
XML_EntityDeclHandler handler);
The entityName, systemId and notationName arguments will never be null.
The other arguments may be. */
-typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
- const XML_Char *entityName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId,
- const XML_Char *notationName);
+typedef XMLCALLBACK(void) (*XML_UnparsedEntityDeclHandler)(void *userData,
+ const XML_Char *entityName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName);
/* This is called for a declaration of notation.
The base argument is whatever was set by XML_SetBase.
The notationName will never be null. The other arguments can be. */
-typedef void (*XML_NotationDeclHandler)(void *userData,
- const XML_Char *notationName,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId);
+typedef XMLCALLBACK(void) (*XML_NotationDeclHandler)(void *userData,
+ const XML_Char *notationName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
/* When namespace processing is enabled, these are called once for
each namespace declaration. The call to the start and end element
declaration handlers. For an xmlns attribute, prefix will be null.
For an xmlns="" attribute, uri will be null. */
-typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
- const XML_Char *prefix,
- const XML_Char *uri);
+typedef XMLCALLBACK(void) (*XML_StartNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri);
-typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
- const XML_Char *prefix);
+typedef XMLCALLBACK(void) (*XML_EndNamespaceDeclHandler)(void *userData,
+ const XML_Char *prefix);
/* This is called if the document is not standalone (it has an
external subset or a reference to a parameter entity, but does not
will not continue, and the parser will return a
XML_ERROR_NOT_STANDALONE error. */
-typedef int (*XML_NotStandaloneHandler)(void *userData);
+typedef XMLCALLBACK(int) (*XML_NotStandaloneHandler)(void *userData);
/* This is called for a reference to an external parsed general entity.
The referenced entity is not automatically parsed.
Note that unlike other handlers the first argument is the parser, not
userData. */
-typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
- const XML_Char *context,
- const XML_Char *base,
- const XML_Char *systemId,
- const XML_Char *publicId);
+typedef XMLCALLBACK(int) (*XML_ExternalEntityRefHandler)(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId);
/* This structure is filled in by the XML_UnknownEncodingHandler
to provide information to the parser about encodings that are unknown
2. No character may require more than 4 bytes to encode.
-3. All characters encoded must have Unicode scalar values <= 0xFFFF,
-(ie characters that would be encoded by surrogates in UTF-16
-are not allowed). Note that this restriction doesn't apply to
-the built-in support for UTF-8 and UTF-16.
+3. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e.,
+characters that would be encoded by surrogates in UTF-16 are not
+allowed). Note that this restriction doesn't apply to the built-in
+support for UTF-8 and UTF-16.
4. No Unicode character may be encoded by more than one distinct sequence
of bytes. */
If info does not describe a suitable encoding,
then the parser will return an XML_UNKNOWN_ENCODING error. */
-typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
- const XML_Char *name,
- XML_Encoding *info);
+typedef XMLCALLBACK(int) (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
+ const XML_Char *name,
+ XML_Encoding *info);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetElementHandler(XML_Parser parser,
XML_StartElementHandler start,
XML_EndElementHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetCharacterDataHandler(XML_Parser parser,
XML_CharacterDataHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetProcessingInstructionHandler(XML_Parser parser,
XML_ProcessingInstructionHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetCommentHandler(XML_Parser parser,
XML_CommentHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetCdataSectionHandler(XML_Parser parser,
XML_StartCdataSectionHandler start,
XML_EndCdataSectionHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetStartCdataSectionHandler(XML_Parser parser,
XML_StartCdataSectionHandler start);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetEndCdataSectionHandler(XML_Parser parser,
XML_EndCdataSectionHandler end);
internal entities. The entity reference will be passed to the default
handler. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetDefaultHandler(XML_Parser parser,
XML_DefaultHandler handler);
internal entities. The entity reference will not be passed to the
default handler. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetDefaultHandlerExpand(XML_Parser parser,
XML_DefaultHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetDoctypeDeclHandler(XML_Parser parser,
XML_StartDoctypeDeclHandler start,
XML_EndDoctypeDeclHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetStartDoctypeDeclHandler(XML_Parser parser,
XML_StartDoctypeDeclHandler start);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetEndDoctypeDeclHandler(XML_Parser parser,
XML_EndDoctypeDeclHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
XML_UnparsedEntityDeclHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetNotationDeclHandler(XML_Parser parser,
XML_NotationDeclHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetNamespaceDeclHandler(XML_Parser parser,
XML_StartNamespaceDeclHandler start,
XML_EndNamespaceDeclHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetStartNamespaceDeclHandler(XML_Parser parser,
XML_StartNamespaceDeclHandler start);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetEndNamespaceDeclHandler(XML_Parser parser,
XML_EndNamespaceDeclHandler end);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetNotStandaloneHandler(XML_Parser parser,
XML_NotStandaloneHandler handler);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetExternalEntityRefHandler(XML_Parser parser,
XML_ExternalEntityRefHandler handler);
/* If a non-null value for arg is specified here, then it will be passed
as the first argument to the external entity ref handler instead
of the parser object. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetUnknownEncodingHandler(XML_Parser parser,
XML_UnknownEncodingHandler handler,
void *encodingHandlerData);
/* This can be called within a handler for a start element, end element,
processing instruction or character data. It causes the corresponding
markup to be passed to the default handler. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_DefaultCurrent(XML_Parser parser);
/* If do_nst is non-zero, and namespace processing is in effect, and
has a prefix.
*/
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
/* This value is passed as the userData argument to callbacks. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_SetUserData(XML_Parser parser, void *userData);
/* Returns the last value set by XML_SetUserData or null. */
to XML_ParserCreate. It must not be called after XML_Parse
or XML_ParseBuffer. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
/* If this function is called, then the parser will be passed
as the first argument to callbacks instead of userData.
The userData will still be accessible using XML_GetUserData. */
-void XMLPARSEAPI
+XMLPARSEAPI(void)
XML_UseParserAsHandlerArg(XML_Parser parser);
/* Sets the base to be used for resolving relative URIs in system
and XML_UnparsedEntityDeclHandler. The base argument will be copied.
Returns zero if out of memory, non-zero otherwise. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_SetBase(XML_Parser parser, const XML_Char *base);
-XMLPARSEAPI const XML_Char *
+XMLPARSEAPI(const XML_Char *)
XML_GetBase(XML_Parser parser);
/* Returns the number of the attribute/value pairs passed in last call
this correspondds to an index into the atts array passed to the
XML_StartElementHandler. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_GetSpecifiedAttributeCount(XML_Parser parser);
/* Returns the index of the ID attribute passed in the last call to
attribute/value pair counts as 2; thus this correspondds to an index
into the atts array passed to the XML_StartElementHandler. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_GetIdAttributeIndex(XML_Parser parser);
/* Parses some input. Returns 0 if a fatal error is detected.
The last call to XML_Parse must have isFinal true;
len may be zero for this call (or any other). */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
-XMLPARSEAPI void *
+XMLPARSEAPI(void *)
XML_GetBuffer(XML_Parser parser, int len);
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
/* Creates an XML_Parser object that can parse an external general
used in a separate thread. The handlers and userData are initialized
from the parser argument. Returns 0 if out of memory. Otherwise
returns a new XML_Parser object. */
-XMLPARSEAPI XML_Parser
+XMLPARSEAPI(XML_Parser)
XML_ExternalEntityParserCreate(XML_Parser parser,
const XML_Char *context,
const XML_Char *encoding);
XML_SetParamEntityParsing will return 0 if parsing of parameter
entities is requested; otherwise it will return non-zero. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_SetParamEntityParsing(XML_Parser parser,
enum XML_ParamEntityParsing parsing);
/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode
returns information about the error. */
-XMLPARSEAPI enum XML_Error
+XMLPARSEAPI(enum XML_Error)
XML_GetErrorCode(XML_Parser parser);
/* These functions return information about the current parse location.
some parse event; in this the location is the location of the first
of the sequence of characters that generated the event. */
-int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser);
-int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser);
-long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser);
+XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
+XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);
+XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser);
/* Return the number of bytes in the current event.
Returns 0 if the event is in an internal entity. */
-XMLPARSEAPI int
+XMLPARSEAPI(int)
XML_GetCurrentByteCount(XML_Parser parser);
/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
NOTE: The character pointer returned should not be used outside
the handler that makes the call. */
-XMLPARSEAPI const char *
+XMLPARSEAPI(const char *)
XML_GetInputContext(XML_Parser parser,
int *offset,
int *size);
#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
/* Frees memory used by the parser. */
-XMLPARSEAPI void
+XMLPARSEAPI(void)
XML_ParserFree(XML_Parser parser);
/* Returns a string describing the error. */
-XMLPARSEAPI const XML_LChar *
+XMLPARSEAPI(const XML_LChar *)
XML_ErrorString(int code);
/* Return a string containing the version number of this expat */
-XMLPARSEAPI const XML_LChar *
+XMLPARSEAPI(const XML_LChar *)
XML_ExpatVersion(void);
typedef struct {
/* Return an XML_Expat_Version structure containing numeric version
number information for this version of expat */
-XMLPARSEAPI XML_Expat_Version
+XMLPARSEAPI(XML_Expat_Version)
XML_ExpatVersionInfo(void);
#define XML_MAJOR_VERSION @EXPAT_MAJOR_VERSION@