mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-07-29 15:41:13 +03:00
applied the same kind of fixes to the Python Makefiels than to libxml2
* python/Makefile.am python/generator.py python/libxslt.c python/types.c python/tests/Makefile.am: applied the same kind of fixes to the Python Makefiels than to libxml2 ones. Updates and cleanups too. Daniel
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
Mon Mar 18 16:22:46 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* python/Makefile.am python/generator.py python/libxslt.c
|
||||
python/types.c python/tests/Makefile.am: applied the same kind of
|
||||
fixes to the Python Makefiels than to libxml2 ones. Updates
|
||||
and cleanups too.
|
||||
|
||||
Sat Mar 16 23:48:21 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* libexslt/common.c libxslt/pattern.c libxslt/transform.c
|
||||
|
@ -31,10 +31,19 @@
|
||||
<exports symbol='xslAddCall'/>
|
||||
<exports symbol='xslDropCall'/>
|
||||
</file>
|
||||
<file name='attributes'>
|
||||
<exports symbol='xsltParseStylesheetAttributeSet'/>
|
||||
<exports symbol='xsltFreeAttributeSetsHashes'/>
|
||||
<exports symbol='xsltApplyAttributeSet'/>
|
||||
<file name='xsltwin32config'>
|
||||
<exports symbol='LIBXSLT_DOTTED_VERSION'/>
|
||||
<exports symbol='LIBXSLT_VERSION'/>
|
||||
<exports symbol='LIBXSLT_VERSION_STRING'/>
|
||||
<exports symbol='WITH_XSLT_DEBUG'/>
|
||||
<exports symbol='DEBUG_MEMORY'/>
|
||||
<exports symbol='DEBUG_MEMORY_LOCATION'/>
|
||||
<exports symbol='ATTRIBUTE_UNUSED'/>
|
||||
<exports symbol='LIBXSLT_PUBLIC'/>
|
||||
</file>
|
||||
<file name='libxslt'>
|
||||
<exports symbol='IN_LIBXSLT'/>
|
||||
<exports symbol='LIBXSLT_PUBLIC'/>
|
||||
</file>
|
||||
<file name='numbersInternals'>
|
||||
</file>
|
||||
@ -84,15 +93,10 @@
|
||||
<exports symbol='xsltPreComputeExtModuleElement'/>
|
||||
<exports symbol='xsltRegisterTestModule'/>
|
||||
</file>
|
||||
<file name='imports'>
|
||||
<exports symbol='XSLT_GET_IMPORT_PTR'/>
|
||||
<exports symbol='XSLT_GET_IMPORT_INT'/>
|
||||
<exports symbol='xsltParseStylesheetImport'/>
|
||||
<exports symbol='xsltParseStylesheetInclude'/>
|
||||
<exports symbol='xsltNextImport'/>
|
||||
<exports symbol='xsltNeedElemSpaceHandling'/>
|
||||
<exports symbol='xsltFindElemSpaceHandling'/>
|
||||
<exports symbol='xsltFindTemplate'/>
|
||||
<file name='attributes'>
|
||||
<exports symbol='xsltParseStylesheetAttributeSet'/>
|
||||
<exports symbol='xsltFreeAttributeSetsHashes'/>
|
||||
<exports symbol='xsltApplyAttributeSet'/>
|
||||
</file>
|
||||
<file name='xsltInternals'>
|
||||
<exports symbol='XSLT_MAX_SORT'/>
|
||||
@ -141,9 +145,77 @@
|
||||
<exports symbol='xsltAllocateExtra'/>
|
||||
<exports symbol='xsltAllocateExtraCtxt'/>
|
||||
</file>
|
||||
<file name='libxslt'>
|
||||
<exports symbol='IN_LIBXSLT'/>
|
||||
<exports symbol='LIBXSLT_PUBLIC'/>
|
||||
<file name='pattern'>
|
||||
<exports symbol='xsltCompMatch'/>
|
||||
<exports symbol='xsltCompMatchPtr'/>
|
||||
<exports symbol='xsltCompilePattern'/>
|
||||
<exports symbol='xsltFreeCompMatchList'/>
|
||||
<exports symbol='xsltTestCompMatchList'/>
|
||||
<exports symbol='xsltAddTemplate'/>
|
||||
<exports symbol='xsltGetTemplate'/>
|
||||
<exports symbol='xsltFreeTemplateHashes'/>
|
||||
<exports symbol='xsltCleanupTemplates'/>
|
||||
<exports symbol='xsltMatchPattern'/>
|
||||
</file>
|
||||
<file name='documents'>
|
||||
<exports symbol='xsltNewDocument'/>
|
||||
<exports symbol='xsltLoadDocument'/>
|
||||
<exports symbol='xsltFindDocument'/>
|
||||
<exports symbol='xsltFreeDocuments'/>
|
||||
<exports symbol='xsltLoadStyleDocument'/>
|
||||
<exports symbol='xsltNewStyleDocument'/>
|
||||
<exports symbol='xsltFreeStyleDocuments'/>
|
||||
</file>
|
||||
<file name='variables'>
|
||||
<exports symbol='XSLT_REGISTER_VARIABLE_LOOKUP'/>
|
||||
<exports symbol='xsltEvalGlobalVariables'/>
|
||||
<exports symbol='xsltEvalUserParams'/>
|
||||
<exports symbol='xsltQuoteUserParams'/>
|
||||
<exports symbol='xsltEvalOneUserParam'/>
|
||||
<exports symbol='xsltQuoteOneUserParam'/>
|
||||
<exports symbol='xsltParseGlobalVariable'/>
|
||||
<exports symbol='xsltParseGlobalParam'/>
|
||||
<exports symbol='xsltParseStylesheetVariable'/>
|
||||
<exports symbol='xsltParseStylesheetParam'/>
|
||||
<exports symbol='xsltParseStylesheetCallerParam'/>
|
||||
<exports symbol='xsltAddStackElemList'/>
|
||||
<exports symbol='xsltFreeGlobalVariables'/>
|
||||
<exports symbol='xsltVariableLookup'/>
|
||||
<exports symbol='xsltXPathVariableLookup'/>
|
||||
</file>
|
||||
<file name='imports'>
|
||||
<exports symbol='XSLT_GET_IMPORT_PTR'/>
|
||||
<exports symbol='XSLT_GET_IMPORT_INT'/>
|
||||
<exports symbol='xsltParseStylesheetImport'/>
|
||||
<exports symbol='xsltParseStylesheetInclude'/>
|
||||
<exports symbol='xsltNextImport'/>
|
||||
<exports symbol='xsltNeedElemSpaceHandling'/>
|
||||
<exports symbol='xsltFindElemSpaceHandling'/>
|
||||
<exports symbol='xsltFindTemplate'/>
|
||||
</file>
|
||||
<file name='keys'>
|
||||
<exports symbol='xsltAddKey'/>
|
||||
<exports symbol='xsltGetKey'/>
|
||||
<exports symbol='xsltInitCtxtKeys'/>
|
||||
<exports symbol='xsltFreeKeys'/>
|
||||
<exports symbol='xsltFreeDocumentKeys'/>
|
||||
</file>
|
||||
<file name='extra'>
|
||||
<exports symbol='XSLT_LIBXSLT_NAMESPACE'/>
|
||||
<exports symbol='XSLT_SAXON_NAMESPACE'/>
|
||||
<exports symbol='XSLT_XT_NAMESPACE'/>
|
||||
<exports symbol='XSLT_XALAN_NAMESPACE'/>
|
||||
<exports symbol='XSLT_NORM_SAXON_NAMESPACE'/>
|
||||
<exports symbol='xsltFunctionNodeSet'/>
|
||||
<exports symbol='xsltDebug'/>
|
||||
<exports symbol='xsltRegisterExtras'/>
|
||||
<exports symbol='xsltRegisterAllExtras'/>
|
||||
</file>
|
||||
<file name='preproc'>
|
||||
<exports symbol='xsltExtMarker'/>
|
||||
<exports symbol='xsltDocumentComp'/>
|
||||
<exports symbol='xsltStylePreCompute'/>
|
||||
<exports symbol='xsltFreeStylePreComps'/>
|
||||
</file>
|
||||
<file name='transform'>
|
||||
<exports symbol='xsltSetXIncludeDefault'/>
|
||||
@ -177,62 +249,6 @@
|
||||
<exports symbol='xsltRegisterAllElement'/>
|
||||
<exports symbol='xslHandleDebugger'/>
|
||||
</file>
|
||||
<file name='documents'>
|
||||
<exports symbol='xsltNewDocument'/>
|
||||
<exports symbol='xsltLoadDocument'/>
|
||||
<exports symbol='xsltFindDocument'/>
|
||||
<exports symbol='xsltFreeDocuments'/>
|
||||
<exports symbol='xsltLoadStyleDocument'/>
|
||||
<exports symbol='xsltNewStyleDocument'/>
|
||||
<exports symbol='xsltFreeStyleDocuments'/>
|
||||
</file>
|
||||
<file name='extra'>
|
||||
<exports symbol='XSLT_LIBXSLT_NAMESPACE'/>
|
||||
<exports symbol='XSLT_SAXON_NAMESPACE'/>
|
||||
<exports symbol='XSLT_XT_NAMESPACE'/>
|
||||
<exports symbol='XSLT_XALAN_NAMESPACE'/>
|
||||
<exports symbol='XSLT_NORM_SAXON_NAMESPACE'/>
|
||||
<exports symbol='xsltFunctionNodeSet'/>
|
||||
<exports symbol='xsltDebug'/>
|
||||
<exports symbol='xsltRegisterExtras'/>
|
||||
<exports symbol='xsltRegisterAllExtras'/>
|
||||
</file>
|
||||
<file name='variables'>
|
||||
<exports symbol='XSLT_REGISTER_VARIABLE_LOOKUP'/>
|
||||
<exports symbol='xsltEvalGlobalVariables'/>
|
||||
<exports symbol='xsltEvalUserParams'/>
|
||||
<exports symbol='xsltQuoteUserParams'/>
|
||||
<exports symbol='xsltEvalOneUserParam'/>
|
||||
<exports symbol='xsltQuoteOneUserParam'/>
|
||||
<exports symbol='xsltParseGlobalVariable'/>
|
||||
<exports symbol='xsltParseGlobalParam'/>
|
||||
<exports symbol='xsltParseStylesheetVariable'/>
|
||||
<exports symbol='xsltParseStylesheetParam'/>
|
||||
<exports symbol='xsltParseStylesheetCallerParam'/>
|
||||
<exports symbol='xsltAddStackElemList'/>
|
||||
<exports symbol='xsltFreeGlobalVariables'/>
|
||||
<exports symbol='xsltVariableLookup'/>
|
||||
<exports symbol='xsltXPathVariableLookup'/>
|
||||
</file>
|
||||
<file name='pattern'>
|
||||
<exports symbol='xsltCompMatch'/>
|
||||
<exports symbol='xsltCompMatchPtr'/>
|
||||
<exports symbol='xsltCompilePattern'/>
|
||||
<exports symbol='xsltFreeCompMatchList'/>
|
||||
<exports symbol='xsltTestCompMatchList'/>
|
||||
<exports symbol='xsltAddTemplate'/>
|
||||
<exports symbol='xsltGetTemplate'/>
|
||||
<exports symbol='xsltFreeTemplateHashes'/>
|
||||
<exports symbol='xsltCleanupTemplates'/>
|
||||
<exports symbol='xsltMatchPattern'/>
|
||||
</file>
|
||||
<file name='keys'>
|
||||
<exports symbol='xsltAddKey'/>
|
||||
<exports symbol='xsltGetKey'/>
|
||||
<exports symbol='xsltInitCtxtKeys'/>
|
||||
<exports symbol='xsltFreeKeys'/>
|
||||
<exports symbol='xsltFreeDocumentKeys'/>
|
||||
</file>
|
||||
<file name='xslt'>
|
||||
<exports symbol='XSLT_DEFAULT_VERSION'/>
|
||||
<exports symbol='XSLT_DEFAULT_VENDOR'/>
|
||||
@ -241,22 +257,6 @@
|
||||
<exports symbol='LIBXSLT_PUBLIC'/>
|
||||
<exports symbol='xsltCleanupGlobals'/>
|
||||
</file>
|
||||
<file name='preproc'>
|
||||
<exports symbol='xsltExtMarker'/>
|
||||
<exports symbol='xsltDocumentComp'/>
|
||||
<exports symbol='xsltStylePreCompute'/>
|
||||
<exports symbol='xsltFreeStylePreComps'/>
|
||||
</file>
|
||||
<file name='xsltwin32config'>
|
||||
<exports symbol='LIBXSLT_DOTTED_VERSION'/>
|
||||
<exports symbol='LIBXSLT_VERSION'/>
|
||||
<exports symbol='LIBXSLT_VERSION_STRING'/>
|
||||
<exports symbol='WITH_XSLT_DEBUG'/>
|
||||
<exports symbol='DEBUG_MEMORY'/>
|
||||
<exports symbol='DEBUG_MEMORY_LOCATION'/>
|
||||
<exports symbol='ATTRIBUTE_UNUSED'/>
|
||||
<exports symbol='LIBXSLT_PUBLIC'/>
|
||||
</file>
|
||||
<file name='xsltconfig'>
|
||||
<exports symbol='LIBXSLT_DOTTED_VERSION'/>
|
||||
<exports symbol='LIBXSLT_VERSION'/>
|
||||
@ -326,7 +326,7 @@
|
||||
<macro name='LIBXSLT_DOTTED_VERSION' file='xsltwin32config'>
|
||||
<info>the version string like "1.2.3"</info>
|
||||
</macro>
|
||||
<macro name='LIBXSLT_PUBLIC' file='libxslt'>
|
||||
<macro name='LIBXSLT_PUBLIC' file='xsltwin32config'>
|
||||
<info>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.</info>
|
||||
</macro>
|
||||
<macro name='LIBXSLT_VERSION' file='xsltwin32config'>
|
||||
@ -792,7 +792,7 @@
|
||||
<arg name='ctxt' type='xsltTransformContextPtr' info='the XSLT transformation context '/>
|
||||
<arg name='comp' type='xmlXPathCompExprPtr' info='the compiled XPath expression '/>
|
||||
</function>
|
||||
<function name='xsltExtElementLookup' file='extensions'>
|
||||
<function name='xsltExtElementLookup' file='transform'>
|
||||
<info>Looks up an extension element. ctxt can be NULL to search only in module elements.</info>
|
||||
<return type='xsltTransformFunction' info='the element callback or NULL if not found '/>
|
||||
<arg name='ctxt' type='xsltTransformContextPtr' info='an XSLT process context '/>
|
||||
|
1354
doc/libxslt-decl.txt
1354
doc/libxslt-decl.txt
File diff suppressed because it is too large
Load Diff
@ -518,12 +518,12 @@
|
||||
<ref name='xsltAttrTemplateProcess'/>
|
||||
</type>
|
||||
<type name='xmlChar *'>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltEvalXPathString'/>
|
||||
<ref name='xsltAttrTemplateValueProcess'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
</type>
|
||||
<type name='xmlDocPtr'>
|
||||
<ref name='xsltApplyStylesheetUser'/>
|
||||
@ -546,9 +546,9 @@
|
||||
<ref name='xsltFormatNumberConversion'/>
|
||||
</type>
|
||||
<type name='xmlXPathFunction'>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
<ref name='xsltExtFunctionLookup'/>
|
||||
<ref name='xsltExtModuleFunctionLookup'/>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
</type>
|
||||
<type name='xmlXPathObjectPtr'>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
@ -587,20 +587,20 @@
|
||||
<ref name='xsltLoadStylesheetPI'/>
|
||||
</type>
|
||||
<type name='xsltTemplatePtr'>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
<ref name='xsltFindTemplate'/>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
</type>
|
||||
<type name='xsltTopLevelFunction'>
|
||||
<ref name='xsltExtModuleTopLevelLookup'/>
|
||||
</type>
|
||||
<type name='xsltTransformContextPtr'>
|
||||
<ref name='xsltNewTransformContext'/>
|
||||
<ref name='xsltXPathGetTransformContext'/>
|
||||
<ref name='xsltNewTransformContext'/>
|
||||
</type>
|
||||
<type name='xsltTransformFunction'>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltExtModuleElementLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
</type>
|
||||
</constructors>
|
||||
<functions>
|
||||
@ -619,35 +619,8 @@
|
||||
<ref name='xsltQuoteUserParams'/>
|
||||
</type>
|
||||
<type name='const xmlChar *'>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltEvalOneUserParam'/>
|
||||
<ref name='xsltEvalOneUserParam'/>
|
||||
<ref name='xsltQuoteOneUserParam'/>
|
||||
<ref name='xsltQuoteOneUserParam'/>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
<ref name='xsltLoadDocument'/>
|
||||
<ref name='xsltLoadStyleDocument'/>
|
||||
<ref name='xsltStyleExtInitFunction'/>
|
||||
<ref name='xsltStyleExtShutdownFunction'/>
|
||||
<ref name='xsltExtInitFunction'/>
|
||||
@ -688,12 +661,39 @@
|
||||
<ref name='xsltRegisterExtPrefix'/>
|
||||
<ref name='xsltRegisterExtPrefix'/>
|
||||
<ref name='xsltCheckExtPrefix'/>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
<ref name='xsltXPathFunctionLookup'/>
|
||||
<ref name='xsltFindTemplate'/>
|
||||
<ref name='xsltFindTemplate'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltLoadDocument'/>
|
||||
<ref name='xsltLoadStyleDocument'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltEvalOneUserParam'/>
|
||||
<ref name='xsltEvalOneUserParam'/>
|
||||
<ref name='xsltQuoteOneUserParam'/>
|
||||
<ref name='xsltQuoteOneUserParam'/>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
</type>
|
||||
<type name='const xmlChar*'>
|
||||
<ref name='xsltAttrTemplateValueProcess'/>
|
||||
@ -709,12 +709,12 @@
|
||||
<ref name='xsltCalibrateAdjust'/>
|
||||
</type>
|
||||
<type name='void *'>
|
||||
<ref name='xsltStyleExtShutdownFunction'/>
|
||||
<ref name='xsltExtShutdownFunction'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltSetGenericErrorFunc'/>
|
||||
<ref name='xsltSetGenericDebugFunc'/>
|
||||
<ref name='xsltSetDebuggerCallbacks'/>
|
||||
<ref name='xsltXPathVariableLookup'/>
|
||||
<ref name='xsltStyleExtShutdownFunction'/>
|
||||
<ref name='xsltExtShutdownFunction'/>
|
||||
</type>
|
||||
<type name='xmlAttrPtr'>
|
||||
<ref name='xsltAttrListTemplateProcess'/>
|
||||
@ -727,10 +727,13 @@
|
||||
<ref name='xsltFormatNumberConversion'/>
|
||||
</type>
|
||||
<type name='xmlChar **'>
|
||||
<ref name='xsltGetQNameURI'/>
|
||||
<ref name='xsltFormatNumberConversion'/>
|
||||
<ref name='xsltGetQNameURI'/>
|
||||
</type>
|
||||
<type name='xmlDocPtr'>
|
||||
<ref name='xsltNewDocument'/>
|
||||
<ref name='xsltFindDocument'/>
|
||||
<ref name='xsltNewStyleDocument'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltNewTransformContext'/>
|
||||
@ -738,28 +741,53 @@
|
||||
<ref name='xsltApplyStylesheet'/>
|
||||
<ref name='xsltProfileStylesheet'/>
|
||||
<ref name='xsltRunStylesheet'/>
|
||||
<ref name='xsltParseStylesheetProcess'/>
|
||||
<ref name='xsltParseStylesheetDoc'/>
|
||||
<ref name='xsltLoadStylesheetPI'/>
|
||||
<ref name='xsltSaveResultTo'/>
|
||||
<ref name='xsltSaveResultToFilename'/>
|
||||
<ref name='xsltSaveResultToFile'/>
|
||||
<ref name='xsltSaveResultToFd'/>
|
||||
<ref name='xsltNewDocument'/>
|
||||
<ref name='xsltFindDocument'/>
|
||||
<ref name='xsltNewStyleDocument'/>
|
||||
<ref name='xsltParseStylesheetProcess'/>
|
||||
<ref name='xsltParseStylesheetDoc'/>
|
||||
<ref name='xsltLoadStylesheetPI'/>
|
||||
</type>
|
||||
<type name='xmlGenericErrorFunc'>
|
||||
<ref name='xsltSetGenericErrorFunc'/>
|
||||
<ref name='xsltSetGenericDebugFunc'/>
|
||||
</type>
|
||||
<type name='xmlNodePtr'>
|
||||
<ref name='xsltParseStylesheetAttributeSet'/>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltNewElemPreComp'/>
|
||||
<ref name='xsltInitElemPreComp'/>
|
||||
<ref name='xsltTopLevelFunction'/>
|
||||
<ref name='xsltPreComputeExtModuleElement'/>
|
||||
<ref name='xsltParseStylesheetImport'/>
|
||||
<ref name='xsltParseStylesheetInclude'/>
|
||||
<ref name='xsltFindElemSpaceHandling'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltNamespaceAlias'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltCopyNamespace'/>
|
||||
<ref name='xsltCopyNamespaceList'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltTestCompMatchList'/>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltDocumentComp'/>
|
||||
<ref name='xsltStylePreCompute'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltTemplateProcess'/>
|
||||
<ref name='xsltAttrListTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateProcess'/>
|
||||
<ref name='xsltApplyStripSpaces'/>
|
||||
<ref name='xsltApplyOneTemplate'/>
|
||||
<ref name='xsltApplyOneTemplate'/>
|
||||
@ -799,6 +827,16 @@
|
||||
<ref name='xsltForEach'/>
|
||||
<ref name='xslHandleDebugger'/>
|
||||
<ref name='xslHandleDebugger'/>
|
||||
<ref name='xsltParseGlobalVariable'/>
|
||||
<ref name='xsltParseGlobalParam'/>
|
||||
<ref name='xsltParseStylesheetVariable'/>
|
||||
<ref name='xsltParseStylesheetParam'/>
|
||||
<ref name='xsltParseStylesheetCallerParam'/>
|
||||
<ref name='xsltTransformFunction'/>
|
||||
<ref name='xsltTransformFunction'/>
|
||||
<ref name='xsltParseStylesheetOutput'/>
|
||||
<ref name='xsltNumberFormat'/>
|
||||
<ref name='xsltParseTemplateContent'/>
|
||||
<ref name='xsltGetNsProp'/>
|
||||
<ref name='xsltPrintErrorContext'/>
|
||||
<ref name='xsltMessage'/>
|
||||
@ -808,44 +846,6 @@
|
||||
<ref name='xsltHandleDebuggerCallback'/>
|
||||
<ref name='xsltAddCallCallback'/>
|
||||
<ref name='xslAddCall'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltTemplateProcess'/>
|
||||
<ref name='xsltAttrListTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateProcess'/>
|
||||
<ref name='xsltParseGlobalVariable'/>
|
||||
<ref name='xsltParseGlobalParam'/>
|
||||
<ref name='xsltParseStylesheetVariable'/>
|
||||
<ref name='xsltParseStylesheetParam'/>
|
||||
<ref name='xsltParseStylesheetCallerParam'/>
|
||||
<ref name='xsltNewElemPreComp'/>
|
||||
<ref name='xsltInitElemPreComp'/>
|
||||
<ref name='xsltTopLevelFunction'/>
|
||||
<ref name='xsltPreComputeExtModuleElement'/>
|
||||
<ref name='xsltParseStylesheetImport'/>
|
||||
<ref name='xsltParseStylesheetInclude'/>
|
||||
<ref name='xsltFindElemSpaceHandling'/>
|
||||
<ref name='xsltParseStylesheetAttributeSet'/>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltNamespaceAlias'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltCopyNamespace'/>
|
||||
<ref name='xsltCopyNamespaceList'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltDocumentComp'/>
|
||||
<ref name='xsltStylePreCompute'/>
|
||||
<ref name='xsltTransformFunction'/>
|
||||
<ref name='xsltTransformFunction'/>
|
||||
<ref name='xsltParseStylesheetOutput'/>
|
||||
<ref name='xsltNumberFormat'/>
|
||||
<ref name='xsltParseTemplateContent'/>
|
||||
</type>
|
||||
<type name='xmlNodePtr *'>
|
||||
<ref name='xsltDoSortFunction'/>
|
||||
@ -881,6 +881,8 @@
|
||||
<ref name='xsltRegisterExtFunction'/>
|
||||
</type>
|
||||
<type name='xmlXPathParserContextPtr'>
|
||||
<ref name='xsltFunctionNodeSet'/>
|
||||
<ref name='xsltXPathGetTransformContext'/>
|
||||
<ref name='xsltDocumentFunction'/>
|
||||
<ref name='xsltKeyFunction'/>
|
||||
<ref name='xsltUnparsedEntityURIFunction'/>
|
||||
@ -889,8 +891,6 @@
|
||||
<ref name='xsltSystemPropertyFunction'/>
|
||||
<ref name='xsltElementAvailableFunction'/>
|
||||
<ref name='xsltFunctionAvailableFunction'/>
|
||||
<ref name='xsltXPathGetTransformContext'/>
|
||||
<ref name='xsltFunctionNodeSet'/>
|
||||
</type>
|
||||
<type name='xsltCompMatchPtr'>
|
||||
<ref name='xsltFreeCompMatchList'/>
|
||||
@ -937,6 +937,7 @@
|
||||
<ref name='xsltRegisterExtModuleFull'/>
|
||||
</type>
|
||||
<type name='xsltStylePreCompPtr'>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltDocumentElem'/>
|
||||
<ref name='xsltSort'/>
|
||||
<ref name='xsltCopy'/>
|
||||
@ -954,29 +955,13 @@
|
||||
<ref name='xsltChoose'/>
|
||||
<ref name='xsltIf'/>
|
||||
<ref name='xsltForEach'/>
|
||||
<ref name='xsltDebug'/>
|
||||
</type>
|
||||
<type name='xsltStylesheetPtr'>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltFreeKeys'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
<ref name='xsltFreeTemplateHashes'/>
|
||||
<ref name='xsltCleanupTemplates'/>
|
||||
<ref name='xsltNewTransformContext'/>
|
||||
<ref name='xsltApplyStylesheetUser'/>
|
||||
<ref name='xsltApplyStylesheet'/>
|
||||
<ref name='xsltProfileStylesheet'/>
|
||||
<ref name='xsltRunStylesheet'/>
|
||||
<ref name='xsltPrintErrorContext'/>
|
||||
<ref name='xsltSaveResultTo'/>
|
||||
<ref name='xsltSaveResultToFilename'/>
|
||||
<ref name='xsltSaveResultToFile'/>
|
||||
<ref name='xsltSaveResultToFd'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltParseGlobalVariable'/>
|
||||
<ref name='xsltParseGlobalParam'/>
|
||||
<ref name='xsltParseStylesheetAttributeSet'/>
|
||||
<ref name='xsltFreeAttributeSetsHashes'/>
|
||||
<ref name='xsltLoadStyleDocument'/>
|
||||
<ref name='xsltNewStyleDocument'/>
|
||||
<ref name='xsltFreeStyleDocuments'/>
|
||||
<ref name='xsltStyleExtInitFunction'/>
|
||||
<ref name='xsltStyleExtShutdownFunction'/>
|
||||
<ref name='xsltStyleGetExtData'/>
|
||||
@ -991,22 +976,37 @@
|
||||
<ref name='xsltParseStylesheetImport'/>
|
||||
<ref name='xsltParseStylesheetInclude'/>
|
||||
<ref name='xsltNextImport'/>
|
||||
<ref name='xsltParseStylesheetAttributeSet'/>
|
||||
<ref name='xsltFreeAttributeSetsHashes'/>
|
||||
<ref name='xsltAddKey'/>
|
||||
<ref name='xsltFreeKeys'/>
|
||||
<ref name='xsltNamespaceAlias'/>
|
||||
<ref name='xsltFreeNamespaceAliasHashes'/>
|
||||
<ref name='xsltLoadStyleDocument'/>
|
||||
<ref name='xsltNewStyleDocument'/>
|
||||
<ref name='xsltFreeStyleDocuments'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
<ref name='xsltFreeTemplateHashes'/>
|
||||
<ref name='xsltCleanupTemplates'/>
|
||||
<ref name='xsltDocumentComp'/>
|
||||
<ref name='xsltStylePreCompute'/>
|
||||
<ref name='xsltFreeStylePreComps'/>
|
||||
<ref name='xsltEvalStaticAttrValueTemplate'/>
|
||||
<ref name='xsltNewTransformContext'/>
|
||||
<ref name='xsltApplyStylesheetUser'/>
|
||||
<ref name='xsltApplyStylesheet'/>
|
||||
<ref name='xsltProfileStylesheet'/>
|
||||
<ref name='xsltRunStylesheet'/>
|
||||
<ref name='xsltParseGlobalVariable'/>
|
||||
<ref name='xsltParseGlobalParam'/>
|
||||
<ref name='xsltFreeStylesheet'/>
|
||||
<ref name='xsltDecimalFormatGetByName'/>
|
||||
<ref name='xsltParseStylesheetProcess'/>
|
||||
<ref name='xsltParseStylesheetOutput'/>
|
||||
<ref name='xsltParseTemplateContent'/>
|
||||
<ref name='xsltAllocateExtra'/>
|
||||
<ref name='xsltPrintErrorContext'/>
|
||||
<ref name='xsltSaveResultTo'/>
|
||||
<ref name='xsltSaveResultToFilename'/>
|
||||
<ref name='xsltSaveResultToFile'/>
|
||||
<ref name='xsltSaveResultToFd'/>
|
||||
</type>
|
||||
<type name='xsltTemplatePtr'>
|
||||
<ref name='xsltAddTemplate'/>
|
||||
@ -1020,12 +1020,44 @@
|
||||
<ref name='xsltRegisterExtModuleTopLevel'/>
|
||||
</type>
|
||||
<type name='xsltTransformContextPtr'>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltRegisterExtras'/>
|
||||
<ref name='xsltNewDocument'/>
|
||||
<ref name='xsltLoadDocument'/>
|
||||
<ref name='xsltFindDocument'/>
|
||||
<ref name='xsltFreeDocuments'/>
|
||||
<ref name='xsltExtInitFunction'/>
|
||||
<ref name='xsltExtShutdownFunction'/>
|
||||
<ref name='xsltGetExtData'/>
|
||||
<ref name='xsltShutdownCtxtExts'/>
|
||||
<ref name='xsltExtFunctionLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltRegisterExtFunction'/>
|
||||
<ref name='xsltRegisterExtElement'/>
|
||||
<ref name='xsltInitCtxtExts'/>
|
||||
<ref name='xsltFreeCtxtExts'/>
|
||||
<ref name='xsltNeedElemSpaceHandling'/>
|
||||
<ref name='xsltFindElemSpaceHandling'/>
|
||||
<ref name='xsltFindTemplate'/>
|
||||
<ref name='xsltGetKey'/>
|
||||
<ref name='xsltInitCtxtKeys'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltCopyNamespace'/>
|
||||
<ref name='xsltCopyNamespaceList'/>
|
||||
<ref name='xsltCompilePattern'/>
|
||||
<ref name='xsltTestCompMatchList'/>
|
||||
<ref name='xsltGetTemplate'/>
|
||||
<ref name='xsltMatchPattern'/>
|
||||
<ref name='xsltEvalXPathPredicate'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalXPathString'/>
|
||||
<ref name='xsltTemplateProcess'/>
|
||||
<ref name='xsltAttrListTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateValueProcess'/>
|
||||
<ref name='xsltFreeTransformContext'/>
|
||||
<ref name='xsltApplyStylesheetUser'/>
|
||||
<ref name='xsltApplyStripSpaces'/>
|
||||
@ -1050,19 +1082,6 @@
|
||||
<ref name='xsltForEach'/>
|
||||
<ref name='xsltRegisterAllElement'/>
|
||||
<ref name='xslHandleDebugger'/>
|
||||
<ref name='xsltPrintErrorContext'/>
|
||||
<ref name='xsltMessage'/>
|
||||
<ref name='xsltDoSortFunction'/>
|
||||
<ref name='xsltSaveProfiling'/>
|
||||
<ref name='xsltHandleDebuggerCallback'/>
|
||||
<ref name='xsltEvalXPathPredicate'/>
|
||||
<ref name='xsltEvalTemplateString'/>
|
||||
<ref name='xsltEvalAttrValueTemplate'/>
|
||||
<ref name='xsltEvalXPathString'/>
|
||||
<ref name='xsltTemplateProcess'/>
|
||||
<ref name='xsltAttrListTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateProcess'/>
|
||||
<ref name='xsltAttrTemplateValueProcess'/>
|
||||
<ref name='xsltEvalGlobalVariables'/>
|
||||
<ref name='xsltEvalUserParams'/>
|
||||
<ref name='xsltQuoteUserParams'/>
|
||||
@ -1074,33 +1093,14 @@
|
||||
<ref name='xsltAddStackElemList'/>
|
||||
<ref name='xsltFreeGlobalVariables'/>
|
||||
<ref name='xsltVariableLookup'/>
|
||||
<ref name='xsltExtInitFunction'/>
|
||||
<ref name='xsltExtShutdownFunction'/>
|
||||
<ref name='xsltGetExtData'/>
|
||||
<ref name='xsltShutdownCtxtExts'/>
|
||||
<ref name='xsltExtFunctionLookup'/>
|
||||
<ref name='xsltExtElementLookup'/>
|
||||
<ref name='xsltRegisterExtFunction'/>
|
||||
<ref name='xsltRegisterExtElement'/>
|
||||
<ref name='xsltInitCtxtExts'/>
|
||||
<ref name='xsltFreeCtxtExts'/>
|
||||
<ref name='xsltNeedElemSpaceHandling'/>
|
||||
<ref name='xsltFindElemSpaceHandling'/>
|
||||
<ref name='xsltFindTemplate'/>
|
||||
<ref name='xsltApplyAttributeSet'/>
|
||||
<ref name='xsltGetNamespace'/>
|
||||
<ref name='xsltGetSpecialNamespace'/>
|
||||
<ref name='xsltCopyNamespace'/>
|
||||
<ref name='xsltCopyNamespaceList'/>
|
||||
<ref name='xsltNewDocument'/>
|
||||
<ref name='xsltLoadDocument'/>
|
||||
<ref name='xsltFindDocument'/>
|
||||
<ref name='xsltFreeDocuments'/>
|
||||
<ref name='xsltDebug'/>
|
||||
<ref name='xsltRegisterExtras'/>
|
||||
<ref name='xsltTransformFunction'/>
|
||||
<ref name='xsltNumberFormat'/>
|
||||
<ref name='xsltAllocateExtraCtxt'/>
|
||||
<ref name='xsltPrintErrorContext'/>
|
||||
<ref name='xsltMessage'/>
|
||||
<ref name='xsltDoSortFunction'/>
|
||||
<ref name='xsltSaveProfiling'/>
|
||||
<ref name='xsltHandleDebuggerCallback'/>
|
||||
</type>
|
||||
<type name='xsltTransformFunction'>
|
||||
<ref name='xsltNewElemPreComp'/>
|
||||
|
@ -4,13 +4,13 @@ AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
SUBDIRS= . tests
|
||||
|
||||
INCLUDES = \
|
||||
-I/usr/include/python$(PYTHON_VERSION) \
|
||||
-I$(PYTHON_INCLUDES) \
|
||||
$(LIBXML_CFLAGS) \
|
||||
-I$(top_srcdir)
|
||||
|
||||
DOCS_DIR = $(prefix)/share/doc/libxslt-python-$(LIBXML_VERSION)
|
||||
DOCS = TODO libxsltclass.txt
|
||||
# libxsltclass.txt is generated
|
||||
DOCS = TODO
|
||||
|
||||
EXTRA_DIST = \
|
||||
libxslt.c \
|
||||
@ -22,37 +22,20 @@ EXTRA_DIST = \
|
||||
libxslt-python-api.xml \
|
||||
$(DOCS)
|
||||
|
||||
libxsltmod_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
if WITH_PYTHON
|
||||
mylibs = \
|
||||
$(top_builddir)/libxslt/libxslt.la \
|
||||
$(top_builddir)/libexslt/libexslt.la
|
||||
|
||||
LDADD = -lxslt -lexslt
|
||||
CFLAGS = -Wall -g
|
||||
all: libxslt.py
|
||||
|
||||
pythondir = $(prefix)/lib/python${PYTHON_VERSION}/site-packages
|
||||
python_PROGRAMS = libxsltmod.so
|
||||
|
||||
libxsltmod_so_SOURCES =
|
||||
libxsltmod_so_LDFLAGS = $(mylibs) $(LIBS) -shared -Wl,-soname,libxsltmod.so
|
||||
|
||||
noinst_LTLIBRARIES = libxsltmodule.la
|
||||
libxsltmodule_la_SOURCES = libxslt.c types.c libxslt-py.c
|
||||
|
||||
GENERATE = generator.py
|
||||
API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
|
||||
GENERATED= $(srcdir)/libxsltclass.py \
|
||||
$(srcdir)/libxslt-export.c \
|
||||
$(srcdir)/libxslt-py.c \
|
||||
$(srcdir)/libxslt-py.h
|
||||
|
||||
all: $(GENERATED) libxsltmod.so libxslt.py $(PYTHONSODV)
|
||||
|
||||
libxsltmod.so: $(libxsltmodule_la_OBJECTS) libxsltmodule.la
|
||||
-(rm -f .libs/libxsltmod.so; \
|
||||
$(LINK) -o $@ $(libxsltmodule_la_OBJECTS) $(libxsltmod_so_LDFLAGS);\
|
||||
if [ -r .libs/libxsltmod.so ] ; then cp .libs/libxsltmod.so . ; fi)
|
||||
python_LTLIBRARIES = libxsltmod.la
|
||||
|
||||
libxsltmod_la_SOURCES = libxslt.c types.c libxslt-py.c
|
||||
libxsltmod_la_LIBADD = $(mylibs)
|
||||
|
||||
libxslt.py: $(srcdir)/libxsl.py libxsltclass.py
|
||||
cat $(srcdir)/libxsl.py libxsltclass.py > libxslt.py
|
||||
@ -64,6 +47,13 @@ install-data-local:
|
||||
-@(for doc in $(DOCS) ; \
|
||||
do @INSTALL@ -m 0644 $$doc $(DESTDIR)$(DOCS_DIR) ; done)
|
||||
|
||||
GENERATE = generator.py
|
||||
API_DESC = $(top_srcdir)/doc/libxslt-api.xml $(srcdir)/libxslt-python-api.xml
|
||||
GENERATED= $(srcdir)/libxsltclass.py \
|
||||
$(srcdir)/libxslt-export.c \
|
||||
$(srcdir)/libxslt-py.c \
|
||||
$(srcdir)/libxslt-py.h
|
||||
|
||||
$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
|
||||
cd $(srcdir) && $(PYTHON) $(GENERATE)
|
||||
|
||||
@ -78,4 +68,3 @@ tests test: all
|
||||
clean:
|
||||
rm -f $(GENERATED) *.o libxslt.so *.pyc libxslt.py
|
||||
|
||||
|
||||
|
@ -351,6 +351,12 @@ def print_function_wrapper(name, output, export, include):
|
||||
|
||||
if ret[0] == 'void':
|
||||
if file == "python_accessor":
|
||||
if args[1][1] == "char *" or args[1][1] == "xmlChar *":
|
||||
c_call = "\n if (%s->%s != NULL) xmlFree(%s->%s);\n" % (
|
||||
args[0][0], args[1][0], args[0][0], args[1][0])
|
||||
c_call = c_call + " %s->%s = xmlStrdup((const xmlChar *)%s);\n" % (args[0][0],
|
||||
args[1][0], args[1][0])
|
||||
else:
|
||||
c_call = "\n %s->%s = %s;\n" % (args[0][0], args[1][0],
|
||||
args[1][0])
|
||||
else:
|
||||
@ -368,6 +374,9 @@ def print_function_wrapper(name, output, export, include):
|
||||
elif py_return_types.has_key(ret[0]):
|
||||
(f, t, n, c, p) = py_return_types[ret[0]]
|
||||
c_return = " %s c_retval;\n" % (ret[0])
|
||||
if file == "python_accessor" and ret[2] != None:
|
||||
c_call = "\n c_retval = %s->%s;\n" % (args[0][0], ret[2])
|
||||
else:
|
||||
c_call = "\n c_retval = %s(%s);\n" % (name, c_call);
|
||||
ret_convert = " py_retval = %s%sWrap((%s) c_retval);\n" % (p,n,c)
|
||||
ret_convert = ret_convert + " return(py_retval);\n"
|
||||
@ -384,7 +393,7 @@ def print_function_wrapper(name, output, export, include):
|
||||
include.write("PyObject * ")
|
||||
include.write("libxslt_%s(PyObject *self, PyObject *args);\n" % (name))
|
||||
|
||||
export.write(" { \"%s\", libxslt_%s, METH_VARARGS, NULL },\n" % (name, name))
|
||||
export.write(" { (char *)\"%s\", libxslt_%s, METH_VARARGS, NULL },\n" % (name, name))
|
||||
|
||||
if file == "python":
|
||||
# Those have been manually generated
|
||||
@ -394,7 +403,10 @@ def print_function_wrapper(name, output, export, include):
|
||||
return 1
|
||||
|
||||
output.write("PyObject *\n")
|
||||
output.write("libxslt_%s(PyObject *self, PyObject *args) {\n" % (name))
|
||||
output.write("libxslt_%s(ATTRIBUTE_UNUSED PyObject *self," % (name))
|
||||
if format == "":
|
||||
output.write("ATTRIBUTE_UNUSED ")
|
||||
output.write(" PyObject *args) {\n")
|
||||
if ret[0] != 'void':
|
||||
output.write(" PyObject *py_retval;\n")
|
||||
if c_return != "":
|
||||
@ -402,7 +414,7 @@ def print_function_wrapper(name, output, export, include):
|
||||
if c_args != "":
|
||||
output.write(c_args)
|
||||
if format != "":
|
||||
output.write("\n if (!PyArg_ParseTuple(args, \"%s\"%s))\n" %
|
||||
output.write("\n if (!PyArg_ParseTuple(args, (char *)\"%s\"%s))\n" %
|
||||
(format, format_args))
|
||||
output.write(" return(NULL);\n")
|
||||
if c_convert != "":
|
||||
@ -461,6 +473,8 @@ def buildStubs():
|
||||
export.write("/* Generated */\n\n")
|
||||
wrapper = open("libxslt-py.c", "w")
|
||||
wrapper.write("/* Generated */\n\n")
|
||||
wrapper.write("#include \"config.h\"\n")
|
||||
wrapper.write("#include <libxslt/xsltconfig.h>\n")
|
||||
wrapper.write("#include \"libxslt_wrap.h\"\n")
|
||||
wrapper.write("#include \"libxslt-py.h\"\n\n")
|
||||
for function in functions.keys():
|
||||
|
121
python/libxslt.c
121
python/libxslt.c
@ -12,17 +12,21 @@
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
#include <Python.h>
|
||||
#include "config.h"
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xpath.h>
|
||||
#include "libxslt_wrap.h"
|
||||
#include "libxslt-py.h"
|
||||
|
||||
|
||||
/* #define DEBUG */
|
||||
/* #define DEBUG_XPATH */
|
||||
/* #define DEBUG_ERROR */
|
||||
/* #define DEBUG_MEMORY */
|
||||
|
||||
void initlibxsltmod(void);
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Per type specific glue *
|
||||
@ -40,7 +44,8 @@ libxslt_xsltStylesheetPtrWrap(xsltStylesheetPtr style) {
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) style, "xsltStylesheetPtr", NULL);
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) style,
|
||||
(char *)"xsltStylesheetPtr", NULL);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -55,95 +60,11 @@ libxslt_xsltTransformContextPtrWrap(xsltTransformContextPtr ctxt) {
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt, "xsltTransformContextPtr", NULL);
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt,
|
||||
(char *)"xsltTransformContextPtr", NULL);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Memory debug interface *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
extern void xmlMemFree(void *ptr);
|
||||
extern void *xmlMemMalloc(size_t size);
|
||||
extern void *xmlMemRealloc(void *ptr,size_t size);
|
||||
extern char *xmlMemoryStrdup(const char *str);
|
||||
|
||||
static int libxsltMemoryDebugActivated = 0;
|
||||
static long libxsltMemoryAllocatedBase = 0;
|
||||
|
||||
static int libxsltMemoryDebug = 0;
|
||||
static xmlFreeFunc freeFunc = NULL;
|
||||
static xmlMallocFunc mallocFunc = NULL;
|
||||
static xmlReallocFunc reallocFunc = NULL;
|
||||
static xmlStrdupFunc strdupFunc = NULL;
|
||||
|
||||
PyObject *
|
||||
libxslt_xmlDebugMemory(PyObject *self, PyObject *args) {
|
||||
int activate;
|
||||
PyObject *py_retval;
|
||||
long ret;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:xmlDebugMemory", &activate))
|
||||
return(NULL);
|
||||
|
||||
#ifdef DEBUG_MEMORY
|
||||
printf("libxslt_xmlDebugMemory(%d) called\n", activate);
|
||||
#endif
|
||||
|
||||
if (activate != 0) {
|
||||
if (libxsltMemoryDebug == 0) {
|
||||
/*
|
||||
* First initialize the library and grab the old memory handlers
|
||||
* and switch the library to memory debugging
|
||||
*/
|
||||
xmlMemGet((xmlFreeFunc *) &freeFunc,
|
||||
(xmlMallocFunc *)&mallocFunc,
|
||||
(xmlReallocFunc *)&reallocFunc,
|
||||
(xmlStrdupFunc *) &strdupFunc);
|
||||
if ((freeFunc == xmlMemFree) && (mallocFunc == xmlMemMalloc) &&
|
||||
(reallocFunc == xmlMemRealloc) &&
|
||||
(strdupFunc == xmlMemoryStrdup)) {
|
||||
libxsltMemoryAllocatedBase = xmlMemUsed();
|
||||
} else {
|
||||
ret = (long) xmlMemSetup(xmlMemFree, xmlMemMalloc,
|
||||
xmlMemRealloc, xmlMemoryStrdup);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
libxsltMemoryAllocatedBase = xmlMemUsed();
|
||||
}
|
||||
xmlInitParser();
|
||||
ret = 0;
|
||||
} else if (libxsltMemoryDebugActivated == 0) {
|
||||
libxsltMemoryAllocatedBase = xmlMemUsed();
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = xmlMemUsed() - libxsltMemoryAllocatedBase;
|
||||
}
|
||||
libxsltMemoryDebug = 1;
|
||||
libxsltMemoryDebugActivated = 1;
|
||||
} else {
|
||||
if (libxsltMemoryDebugActivated == 1)
|
||||
ret = xmlMemUsed() - libxsltMemoryAllocatedBase;
|
||||
else
|
||||
ret = 0;
|
||||
libxsltMemoryDebugActivated = 0;
|
||||
}
|
||||
error:
|
||||
py_retval = libxml_longWrap(ret);
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxslt_xmlDumpMemory(PyObject *self, PyObject *args) {
|
||||
|
||||
if (libxsltMemoryDebug != 0)
|
||||
xmlMemoryDump();
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Extending the API *
|
||||
@ -199,14 +120,15 @@ libxslt_xmlXPathFuncCallback(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltRegisterExtModuleFunction(PyObject *self, PyObject *args) {
|
||||
libxslt_xsltRegisterExtModuleFunction(PyObject *self ATTRIBUTE_UNUSED,
|
||||
PyObject *args) {
|
||||
PyObject *py_retval;
|
||||
int ret = 0;
|
||||
xmlChar *name;
|
||||
xmlChar *ns_uri;
|
||||
PyObject *pyobj_f;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "szO:registerXPathFunction",
|
||||
if (!PyArg_ParseTuple(args, (char *)"szO:registerXPathFunction",
|
||||
&name, &ns_uri, &pyobj_f))
|
||||
return(NULL);
|
||||
|
||||
@ -239,8 +161,8 @@ libxslt_xsltRegisterExtModuleFunction(PyObject *self, PyObject *args) {
|
||||
return(py_retval);
|
||||
}
|
||||
|
||||
void
|
||||
deallocateCallback(void *payload, xmlChar *name) {
|
||||
static void
|
||||
deallocateCallback(void *payload, xmlChar *name ATTRIBUTE_UNUSED) {
|
||||
PyObject *function = (PyObject *) payload;
|
||||
|
||||
#ifdef DEBUG_XPATH
|
||||
@ -257,7 +179,7 @@ deallocateCallback(void *payload, xmlChar *name) {
|
||||
************************************************************************/
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltApplyStylesheet(PyObject *self, PyObject *args) {
|
||||
libxslt_xsltApplyStylesheet(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
PyObject *py_retval;
|
||||
xmlDocPtr c_retval;
|
||||
xsltStylesheetPtr style;
|
||||
@ -270,7 +192,8 @@ libxslt_xsltApplyStylesheet(PyObject *self, PyObject *args) {
|
||||
PyObject *name;
|
||||
PyObject *value;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OOO:xsltApplyStylesheet", &pyobj_style, &pyobj_doc, &pyobj_params))
|
||||
if (!PyArg_ParseTuple(args, (char *) "OOO:xsltApplyStylesheet",
|
||||
&pyobj_style, &pyobj_doc, &pyobj_params))
|
||||
return(NULL);
|
||||
|
||||
if (pyobj_params != Py_None) {
|
||||
@ -291,11 +214,12 @@ libxslt_xsltApplyStylesheet(PyObject *self, PyObject *args) {
|
||||
|
||||
tmp = PyString_AS_STRING(name);
|
||||
size = PyString_GET_SIZE(name);
|
||||
params[j * 2] = xmlCharStrndup(tmp, size);
|
||||
params[j * 2] = (char *) xmlCharStrndup(tmp, size);
|
||||
if (PyString_Check(value)) {
|
||||
tmp = PyString_AS_STRING(value);
|
||||
size = PyString_GET_SIZE(value);
|
||||
params[(j * 2) + 1] = xmlCharStrndup(tmp, size);
|
||||
params[(j * 2) + 1] = (char *)
|
||||
xmlCharStrndup(tmp, size);
|
||||
} else {
|
||||
params[(j * 2) + 1] = NULL;
|
||||
}
|
||||
@ -334,7 +258,8 @@ libxslt_xsltApplyStylesheet(PyObject *self, PyObject *args) {
|
||||
************************************************************************/
|
||||
|
||||
PyObject *
|
||||
libxslt_xsltCleanup(PyObject *self, PyObject *args) {
|
||||
libxslt_xsltCleanup(PyObject *self ATTRIBUTE_UNUSED,
|
||||
PyObject *args ATTRIBUTE_UNUSED) {
|
||||
|
||||
if (libxslt_extModuleFunctions != NULL) {
|
||||
xmlHashFree(libxslt_extModuleFunctions, deallocateCallback);
|
||||
@ -352,7 +277,7 @@ libxslt_xsltCleanup(PyObject *self, PyObject *args) {
|
||||
************************************************************************/
|
||||
static PyMethodDef libxsltMethods[] = {
|
||||
#include "libxslt-export.c"
|
||||
{ NULL }
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
#ifdef MERGED_MODULES
|
||||
@ -369,7 +294,7 @@ void initlibxsltmod(void) {
|
||||
|
||||
if (initialized != 0)
|
||||
return;
|
||||
m = Py_InitModule("libxsltmod", libxsltMethods);
|
||||
m = Py_InitModule((char *)"libxsltmod", libxsltMethods);
|
||||
initialized = 1;
|
||||
/* libxslt_xmlErrorInitialize(); */
|
||||
/*
|
||||
|
@ -15,7 +15,7 @@ EXTRA_DIST = $(TESTSPY) $(XMLS) $(EXTRAS)
|
||||
|
||||
if WITH_PYTHON
|
||||
tests: $(TESTSPY)
|
||||
-@(PYTHONPATH=".." ; export PYTHONPATH; \
|
||||
-@(PYTHONPATH="..:../.libs" ; export PYTHONPATH; \
|
||||
for test in $(TESTSPY) ; do echo "-- $$test" ; $(PYTHON) $$test ; done)
|
||||
else
|
||||
tests:
|
||||
|
259
python/types.c
259
python/types.c
@ -6,10 +6,11 @@
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
#include "libxslt_wrap.h"
|
||||
#include "libxml_wrap.h"
|
||||
|
||||
PyObject *
|
||||
libxml_intWrap(int val) {
|
||||
libxml_intWrap(int val)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -20,7 +21,8 @@ libxml_intWrap(int val) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_longWrap(long val) {
|
||||
libxml_longWrap(long val)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -31,7 +33,8 @@ libxml_longWrap(long val) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_doubleWrap(double val) {
|
||||
libxml_doubleWrap(double val)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -42,7 +45,8 @@ libxml_doubleWrap(double val) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_charPtrWrap(char *str) {
|
||||
libxml_charPtrWrap(char *str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -59,24 +63,8 @@ libxml_charPtrWrap(char *str) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlCharPtrWrap(xmlChar *str) {
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlCharPtrWrap: str = %s\n", str);
|
||||
#endif
|
||||
if (str == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return(Py_None);
|
||||
}
|
||||
/* TODO: look at deallocation */
|
||||
ret = PyString_FromString(str);
|
||||
xmlFree(str);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_constcharPtrWrap(const char *str) {
|
||||
libxml_charPtrConstWrap(const char *str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -92,11 +80,47 @@ libxml_constcharPtrWrap(const char *str) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_constxmlCharPtrWrap(const xmlChar *str) {
|
||||
libxml_xmlCharPtrWrap(xmlChar * str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlCharPtrWrap: str = %s\n", str);
|
||||
#endif
|
||||
if (str == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
/* TODO: look at deallocation */
|
||||
ret = PyString_FromString((char *) str);
|
||||
xmlFree(str);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlCharPtrConstWrap(const xmlChar * str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlCharPtrWrap: str = %s\n", str);
|
||||
#endif
|
||||
if (str == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
/* TODO: look at deallocation */
|
||||
ret = PyString_FromString((char *) str);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_constcharPtrWrap(const char *str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlcharPtrWrap: str = %s\n", str);
|
||||
#endif
|
||||
if (str == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
@ -108,7 +132,25 @@ libxml_constxmlCharPtrWrap(const xmlChar *str) {
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlDocPtrWrap(xmlDocPtr doc) {
|
||||
libxml_constxmlCharPtrWrap(const xmlChar * str)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlCharPtrWrap: str = %s\n", str);
|
||||
#endif
|
||||
if (str == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
/* TODO: look at deallocation */
|
||||
ret = PyString_FromString((char *) str);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlDocPtrWrap(xmlDocPtr doc)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -119,12 +161,15 @@ libxml_xmlDocPtrWrap(xmlDocPtr doc) {
|
||||
return (Py_None);
|
||||
}
|
||||
/* TODO: look at deallocation */
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) doc, "xmlDocPtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) doc, (char *) "xmlDocPtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlNodePtrWrap(xmlNodePtr node) {
|
||||
libxml_xmlNodePtrWrap(xmlNodePtr node)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -134,12 +179,33 @@ libxml_xmlNodePtrWrap(xmlNodePtr node) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) node, "xmlNodePtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "xmlNodePtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlNsPtrWrap(xmlNsPtr ns) {
|
||||
libxml_xmlURIPtrWrap(xmlURIPtr uri)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlURIPtrWrap: uri = %p\n", uri);
|
||||
#endif
|
||||
if (uri == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) uri, (char *) "xmlURIPtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlNsPtrWrap(xmlNsPtr ns)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -149,12 +215,15 @@ libxml_xmlNsPtrWrap(xmlNsPtr ns) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ns, "xmlNsPtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) ns, (char *) "xmlNsPtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlAttrPtrWrap(xmlAttrPtr attr) {
|
||||
libxml_xmlAttrPtrWrap(xmlAttrPtr attr)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -164,12 +233,15 @@ libxml_xmlAttrPtrWrap(xmlAttrPtr attr) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) attr, "xmlAttrPtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) attr, (char *) "xmlAttrPtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlAttributePtrWrap(xmlAttributePtr attr) {
|
||||
libxml_xmlAttributePtrWrap(xmlAttributePtr attr)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -179,12 +251,15 @@ libxml_xmlAttributePtrWrap(xmlAttributePtr attr) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) attr, "xmlAttributePtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) attr,
|
||||
(char *) "xmlAttributePtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlElementPtrWrap(xmlElementPtr elem) {
|
||||
libxml_xmlElementPtrWrap(xmlElementPtr elem)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -194,12 +269,15 @@ libxml_xmlElementPtrWrap(xmlElementPtr elem) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) elem, "xmlElementPtr", NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) elem,
|
||||
(char *) "xmlElementPtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt) {
|
||||
libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -209,13 +287,33 @@ libxml_xmlXPathContextPtrWrap(xmlXPathContextPtr ctxt) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt, "xmlXPathContextPtr",
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) ctxt,
|
||||
(char *) "xmlXPathContextPtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlXPathParserContextPtrWrap(xmlXPathParserContextPtr ctxt)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlXPathParserContextPtrWrap: ctxt = %p\n", ctxt);
|
||||
#endif
|
||||
if (ctxt == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt,
|
||||
(char *) "xmlXPathParserContextPtr",
|
||||
NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt) {
|
||||
libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -225,13 +323,15 @@ libxml_xmlParserCtxtPtrWrap(xmlParserCtxtPtr ctxt) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret = PyCObject_FromVoidPtrAndDesc((void *) ctxt, "xmlParserCtxtPtr",
|
||||
NULL);
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) ctxt,
|
||||
(char *) "xmlParserCtxtPtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) {
|
||||
libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -245,7 +345,8 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) {
|
||||
case XPATH_XSLT_TREE:
|
||||
/* TODO !!!! Allocation problems */
|
||||
case XPATH_NODESET:
|
||||
if ((obj->nodesetval == NULL) || (obj->nodesetval->nodeNr == 0))
|
||||
if ((obj->nodesetval == NULL)
|
||||
|| (obj->nodesetval->nodeNr == 0))
|
||||
ret = PyList_New(0);
|
||||
else {
|
||||
int i;
|
||||
@ -266,7 +367,7 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) {
|
||||
ret = PyFloat_FromDouble(obj->floatval);
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
ret = PyString_FromString(obj->stringval);
|
||||
ret = PyString_FromString((char *) obj->stringval);
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
case XPATH_RANGE:
|
||||
@ -281,8 +382,9 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj) {
|
||||
}
|
||||
|
||||
xmlXPathObjectPtr
|
||||
libxml_xmlXPathObjectPtrConvert(PyObject * obj) {
|
||||
xmlXPathObjectPtr ret;
|
||||
libxml_xmlXPathObjectPtrConvert(PyObject * obj)
|
||||
{
|
||||
xmlXPathObjectPtr ret = NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlXPathObjectPtrConvert: obj = %p\n", obj);
|
||||
@ -290,14 +392,59 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj) {
|
||||
if (obj == NULL) {
|
||||
return (NULL);
|
||||
}
|
||||
if PyFloat_Check(obj) {
|
||||
if PyFloat_Check
|
||||
(obj) {
|
||||
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
|
||||
} else if PyString_Check(obj) {
|
||||
} else if PyString_Check
|
||||
(obj) {
|
||||
xmlChar *str;
|
||||
|
||||
str = xmlStrndup((const xmlChar *) PyString_AS_STRING(obj),
|
||||
PyString_GET_SIZE(obj));
|
||||
ret = xmlXPathWrapString(str);
|
||||
} else if PyList_Check
|
||||
(obj) {
|
||||
int i;
|
||||
PyObject *node;
|
||||
xmlNodePtr cur;
|
||||
xmlNodeSetPtr set;
|
||||
|
||||
set = xmlXPathNodeSetCreate(NULL);
|
||||
|
||||
for (i = 0; i < PyList_Size(obj); i++) {
|
||||
node = PyList_GetItem(obj, i);
|
||||
if ((node == NULL) || (node->ob_type == NULL))
|
||||
continue;
|
||||
|
||||
cur = NULL;
|
||||
if (PyCObject_Check(node)) {
|
||||
printf("Got a CObject\n");
|
||||
cur = PyxmlNode_Get(node);
|
||||
} else if (PyInstance_Check(node)) {
|
||||
PyInstanceObject *inst = (PyInstanceObject *) node;
|
||||
PyObject *name = inst->in_class->cl_name;
|
||||
|
||||
if PyString_Check
|
||||
(name) {
|
||||
char *type = PyString_AS_STRING(name);
|
||||
PyObject *wrapper;
|
||||
|
||||
if (!strcmp(type, "xmlNode")) {
|
||||
wrapper =
|
||||
PyObject_GetAttrString(node, (char *) "_o");
|
||||
if (wrapper != NULL) {
|
||||
cur = PyxmlNode_Get(wrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printf("Unknown object in Python return list\n");
|
||||
}
|
||||
if (cur != NULL) {
|
||||
xmlXPathNodeSetAdd(set, cur);
|
||||
}
|
||||
}
|
||||
ret = xmlXPathWrapNodeSet(set);
|
||||
} else {
|
||||
printf("Unable to convert Python Object to XPath");
|
||||
}
|
||||
@ -305,4 +452,20 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj) {
|
||||
return (ret);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
libxml_xmlCatalogPtrWrap(xmlCatalogPtr catal)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("libxml_xmlNodePtrWrap: catal = %p\n", catal);
|
||||
#endif
|
||||
if (catal == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
}
|
||||
ret =
|
||||
PyCObject_FromVoidPtrAndDesc((void *) catal,
|
||||
(char *) "xmlCatalogPtr", NULL);
|
||||
return (ret);
|
||||
}
|
||||
|
Reference in New Issue
Block a user