]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | /* Copyright (c) 2005-2006 ActiveState Software Inc.\r |
2 | *\r | |
3 | * Namespace all expat exported symbols to avoid dynamic loading symbol\r | |
4 | * collisions when embedding Python.\r | |
5 | *\r | |
6 | * The Problem:\r | |
7 | * - you embed Python in some app\r | |
8 | * - the app dynamically loads libexpat of version X\r | |
9 | * - the embedded Python imports pyexpat (which was built against\r | |
10 | * libexpat version X+n)\r | |
11 | * --> pyexpat gets the expat symbols from the already loaded and *older*\r | |
12 | * libexpat: crash (Specifically the crash we observed was in\r | |
13 | * getting an old XML_ErrorString (from xmlparse.c) and then calling\r | |
14 | * it with newer values in the XML_Error enum:\r | |
15 | *\r | |
16 | * // pyexpat.c, line 1970\r | |
17 | * ...\r | |
18 | * // Added in Expat 1.95.7.\r | |
19 | * MYCONST(XML_ERROR_UNBOUND_PREFIX);\r | |
20 | * ...\r | |
21 | *\r | |
22 | *\r | |
23 | * The Solution:\r | |
24 | * Prefix all a exported symbols with "PyExpat_". This is similar to\r | |
25 | * what Mozilla does for some common libs:\r | |
26 | * http://lxr.mozilla.org/seamonkey/source/modules/libimg/png/mozpngconf.h#115\r | |
27 | *\r | |
28 | * The list of relevant exported symbols can be had with this command:\r | |
29 | * \r | |
30 | nm pyexpat.so \\r | |
31 | | grep -v " [a-zBUA] " \\r | |
32 | | grep -v "_fini\|_init\|initpyexpat"\r | |
33 | *\r | |
34 | * If any of those symbols are NOT prefixed with "PyExpat_" then\r | |
35 | * a #define should be added for it here.\r | |
36 | */\r | |
37 | \r | |
38 | #ifndef PYEXPATNS_H\r | |
39 | #define PYEXPATNS_H\r | |
40 | \r | |
41 | #define XML_DefaultCurrent PyExpat_XML_DefaultCurrent\r | |
42 | #define XML_ErrorString PyExpat_XML_ErrorString\r | |
43 | #define XML_ExpatVersion PyExpat_XML_ExpatVersion\r | |
44 | #define XML_ExpatVersionInfo PyExpat_XML_ExpatVersionInfo\r | |
45 | #define XML_ExternalEntityParserCreate PyExpat_XML_ExternalEntityParserCreate\r | |
46 | #define XML_FreeContentModel PyExpat_XML_FreeContentModel\r | |
47 | #define XML_GetBase PyExpat_XML_GetBase\r | |
48 | #define XML_GetBuffer PyExpat_XML_GetBuffer\r | |
49 | #define XML_GetCurrentByteCount PyExpat_XML_GetCurrentByteCount\r | |
50 | #define XML_GetCurrentByteIndex PyExpat_XML_GetCurrentByteIndex\r | |
51 | #define XML_GetCurrentColumnNumber PyExpat_XML_GetCurrentColumnNumber\r | |
52 | #define XML_GetCurrentLineNumber PyExpat_XML_GetCurrentLineNumber\r | |
53 | #define XML_GetErrorCode PyExpat_XML_GetErrorCode\r | |
54 | #define XML_GetFeatureList PyExpat_XML_GetFeatureList\r | |
55 | #define XML_GetIdAttributeIndex PyExpat_XML_GetIdAttributeIndex\r | |
56 | #define XML_GetInputContext PyExpat_XML_GetInputContext\r | |
57 | #define XML_GetParsingStatus PyExpat_XML_GetParsingStatus\r | |
58 | #define XML_GetSpecifiedAttributeCount PyExpat_XML_GetSpecifiedAttributeCount\r | |
59 | #define XmlGetUtf16InternalEncoding PyExpat_XmlGetUtf16InternalEncoding\r | |
60 | #define XmlGetUtf16InternalEncodingNS PyExpat_XmlGetUtf16InternalEncodingNS\r | |
61 | #define XmlGetUtf8InternalEncoding PyExpat_XmlGetUtf8InternalEncoding\r | |
62 | #define XmlGetUtf8InternalEncodingNS PyExpat_XmlGetUtf8InternalEncodingNS\r | |
63 | #define XmlInitEncoding PyExpat_XmlInitEncoding\r | |
64 | #define XmlInitEncodingNS PyExpat_XmlInitEncodingNS\r | |
65 | #define XmlInitUnknownEncoding PyExpat_XmlInitUnknownEncoding\r | |
66 | #define XmlInitUnknownEncodingNS PyExpat_XmlInitUnknownEncodingNS\r | |
67 | #define XML_MemFree PyExpat_XML_MemFree\r | |
68 | #define XML_MemMalloc PyExpat_XML_MemMalloc\r | |
69 | #define XML_MemRealloc PyExpat_XML_MemRealloc\r | |
70 | #define XML_Parse PyExpat_XML_Parse\r | |
71 | #define XML_ParseBuffer PyExpat_XML_ParseBuffer\r | |
72 | #define XML_ParserCreate PyExpat_XML_ParserCreate\r | |
73 | #define XML_ParserCreate_MM PyExpat_XML_ParserCreate_MM\r | |
74 | #define XML_ParserCreateNS PyExpat_XML_ParserCreateNS\r | |
75 | #define XML_ParserFree PyExpat_XML_ParserFree\r | |
76 | #define XML_ParserReset PyExpat_XML_ParserReset\r | |
77 | #define XmlParseXmlDecl PyExpat_XmlParseXmlDecl\r | |
78 | #define XmlParseXmlDeclNS PyExpat_XmlParseXmlDeclNS\r | |
79 | #define XmlPrologStateInit PyExpat_XmlPrologStateInit\r | |
80 | #define XmlPrologStateInitExternalEntity PyExpat_XmlPrologStateInitExternalEntity\r | |
81 | #define XML_ResumeParser PyExpat_XML_ResumeParser\r | |
82 | #define XML_SetAttlistDeclHandler PyExpat_XML_SetAttlistDeclHandler\r | |
83 | #define XML_SetBase PyExpat_XML_SetBase\r | |
84 | #define XML_SetCdataSectionHandler PyExpat_XML_SetCdataSectionHandler\r | |
85 | #define XML_SetCharacterDataHandler PyExpat_XML_SetCharacterDataHandler\r | |
86 | #define XML_SetCommentHandler PyExpat_XML_SetCommentHandler\r | |
87 | #define XML_SetDefaultHandler PyExpat_XML_SetDefaultHandler\r | |
88 | #define XML_SetDefaultHandlerExpand PyExpat_XML_SetDefaultHandlerExpand\r | |
89 | #define XML_SetDoctypeDeclHandler PyExpat_XML_SetDoctypeDeclHandler\r | |
90 | #define XML_SetElementDeclHandler PyExpat_XML_SetElementDeclHandler\r | |
91 | #define XML_SetElementHandler PyExpat_XML_SetElementHandler\r | |
92 | #define XML_SetEncoding PyExpat_XML_SetEncoding\r | |
93 | #define XML_SetEndCdataSectionHandler PyExpat_XML_SetEndCdataSectionHandler\r | |
94 | #define XML_SetEndDoctypeDeclHandler PyExpat_XML_SetEndDoctypeDeclHandler\r | |
95 | #define XML_SetEndElementHandler PyExpat_XML_SetEndElementHandler\r | |
96 | #define XML_SetEndNamespaceDeclHandler PyExpat_XML_SetEndNamespaceDeclHandler\r | |
97 | #define XML_SetEntityDeclHandler PyExpat_XML_SetEntityDeclHandler\r | |
98 | #define XML_SetExternalEntityRefHandler PyExpat_XML_SetExternalEntityRefHandler\r | |
99 | #define XML_SetExternalEntityRefHandlerArg PyExpat_XML_SetExternalEntityRefHandlerArg\r | |
100 | #define XML_SetNamespaceDeclHandler PyExpat_XML_SetNamespaceDeclHandler\r | |
101 | #define XML_SetNotationDeclHandler PyExpat_XML_SetNotationDeclHandler\r | |
102 | #define XML_SetNotStandaloneHandler PyExpat_XML_SetNotStandaloneHandler\r | |
103 | #define XML_SetParamEntityParsing PyExpat_XML_SetParamEntityParsing\r | |
104 | #define XML_SetProcessingInstructionHandler PyExpat_XML_SetProcessingInstructionHandler\r | |
105 | #define XML_SetReturnNSTriplet PyExpat_XML_SetReturnNSTriplet\r | |
106 | #define XML_SetSkippedEntityHandler PyExpat_XML_SetSkippedEntityHandler\r | |
107 | #define XML_SetStartCdataSectionHandler PyExpat_XML_SetStartCdataSectionHandler\r | |
108 | #define XML_SetStartDoctypeDeclHandler PyExpat_XML_SetStartDoctypeDeclHandler\r | |
109 | #define XML_SetStartElementHandler PyExpat_XML_SetStartElementHandler\r | |
110 | #define XML_SetStartNamespaceDeclHandler PyExpat_XML_SetStartNamespaceDeclHandler\r | |
111 | #define XML_SetUnknownEncodingHandler PyExpat_XML_SetUnknownEncodingHandler\r | |
112 | #define XML_SetUnparsedEntityDeclHandler PyExpat_XML_SetUnparsedEntityDeclHandler\r | |
113 | #define XML_SetUserData PyExpat_XML_SetUserData\r | |
114 | #define XML_SetXmlDeclHandler PyExpat_XML_SetXmlDeclHandler\r | |
115 | #define XmlSizeOfUnknownEncoding PyExpat_XmlSizeOfUnknownEncoding\r | |
116 | #define XML_StopParser PyExpat_XML_StopParser\r | |
117 | #define XML_UseForeignDTD PyExpat_XML_UseForeignDTD\r | |
118 | #define XML_UseParserAsHandlerArg PyExpat_XML_UseParserAsHandlerArg\r | |
119 | #define XmlUtf16Encode PyExpat_XmlUtf16Encode\r | |
120 | #define XmlUtf8Encode PyExpat_XmlUtf8Encode\r | |
121 | \r | |
122 | \r | |
123 | #endif /* !PYEXPATNS_H */\r | |
124 | \r |