2021-08-12 07:42:14 +00:00
|
|
|
#ifndef COSMOPOLITAN_THIRD_PARTY_PYTHON_INCLUDE_PYEXPAT_H_
|
|
|
|
#define COSMOPOLITAN_THIRD_PARTY_PYTHON_INCLUDE_PYEXPAT_H_
|
|
|
|
#include "third_party/python/Modules/expat/expat.h"
|
|
|
|
#include "third_party/python/Modules/expat/expat_external.h"
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
2021-08-10 17:26:13 +00:00
|
|
|
/* clang-format off */
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
|
|
|
|
#define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
|
|
|
|
|
|
|
|
struct PyExpat_CAPI
|
|
|
|
{
|
|
|
|
char* magic; /* set to PyExpat_CAPI_MAGIC */
|
|
|
|
int size; /* set to sizeof(struct PyExpat_CAPI) */
|
|
|
|
int MAJOR_VERSION;
|
|
|
|
int MINOR_VERSION;
|
|
|
|
int MICRO_VERSION;
|
|
|
|
/* pointers to selected expat functions. add new functions at
|
|
|
|
the end, if needed */
|
|
|
|
const XML_LChar * (*ErrorString)(enum XML_Error code);
|
|
|
|
enum XML_Error (*GetErrorCode)(XML_Parser parser);
|
|
|
|
XML_Size (*GetErrorColumnNumber)(XML_Parser parser);
|
|
|
|
XML_Size (*GetErrorLineNumber)(XML_Parser parser);
|
|
|
|
enum XML_Status (*Parse)(
|
|
|
|
XML_Parser parser, const char *s, int len, int isFinal);
|
|
|
|
XML_Parser (*ParserCreate_MM)(
|
|
|
|
const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite,
|
|
|
|
const XML_Char *namespaceSeparator);
|
|
|
|
void (*ParserFree)(XML_Parser parser);
|
|
|
|
void (*SetCharacterDataHandler)(
|
|
|
|
XML_Parser parser, XML_CharacterDataHandler handler);
|
|
|
|
void (*SetCommentHandler)(
|
|
|
|
XML_Parser parser, XML_CommentHandler handler);
|
|
|
|
void (*SetDefaultHandlerExpand)(
|
|
|
|
XML_Parser parser, XML_DefaultHandler handler);
|
|
|
|
void (*SetElementHandler)(
|
|
|
|
XML_Parser parser, XML_StartElementHandler start,
|
|
|
|
XML_EndElementHandler end);
|
|
|
|
void (*SetNamespaceDeclHandler)(
|
|
|
|
XML_Parser parser, XML_StartNamespaceDeclHandler start,
|
|
|
|
XML_EndNamespaceDeclHandler end);
|
|
|
|
void (*SetProcessingInstructionHandler)(
|
|
|
|
XML_Parser parser, XML_ProcessingInstructionHandler handler);
|
|
|
|
void (*SetUnknownEncodingHandler)(
|
|
|
|
XML_Parser parser, XML_UnknownEncodingHandler handler,
|
|
|
|
void *encodingHandlerData);
|
|
|
|
void (*SetUserData)(XML_Parser parser, void *userData);
|
|
|
|
void (*SetStartDoctypeDeclHandler)(XML_Parser parser,
|
|
|
|
XML_StartDoctypeDeclHandler start);
|
|
|
|
enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding);
|
|
|
|
int (*DefaultUnknownEncodingHandler)(
|
|
|
|
void *encodingHandlerData, const XML_Char *name, XML_Encoding *info);
|
|
|
|
/* might be none for expat < 2.1.0 */
|
|
|
|
int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
|
|
|
|
/* always add new stuff to the end! */
|
|
|
|
};
|
|
|
|
|
2021-08-12 07:42:14 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_THIRD_PARTY_PYTHON_INCLUDE_PYEXPAT_H_ */
|