|
| 1 | +package libxslt |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/goplus/llgo/c" |
| 5 | + "github.com/goplus/llpkg/libxml2" |
| 6 | + "unsafe" |
| 7 | +) |
| 8 | + |
| 9 | +/** |
| 10 | + * xsltInitGlobals: |
| 11 | + * |
| 12 | + * Initialize the global variables for extensions |
| 13 | + * |
| 14 | + */ |
| 15 | +//go:linkname InitGlobals C.xsltInitGlobals |
| 16 | +func InitGlobals() |
| 17 | + |
| 18 | +// llgo:type C |
| 19 | +type StyleExtInitFunction func(StylesheetPtr, *libxml2.Char) unsafe.Pointer |
| 20 | + |
| 21 | +// llgo:type C |
| 22 | +type StyleExtShutdownFunction func(StylesheetPtr, *libxml2.Char, unsafe.Pointer) |
| 23 | + |
| 24 | +// llgo:type C |
| 25 | +type ExtInitFunction func(TransformContextPtr, *libxml2.Char) unsafe.Pointer |
| 26 | + |
| 27 | +// llgo:type C |
| 28 | +type ExtShutdownFunction func(TransformContextPtr, *libxml2.Char, unsafe.Pointer) |
| 29 | + |
| 30 | +//go:linkname RegisterExtModule C.xsltRegisterExtModule |
| 31 | +func RegisterExtModule(URI *libxml2.Char, initFunc ExtInitFunction, shutdownFunc ExtShutdownFunction) c.Int |
| 32 | + |
| 33 | +//go:linkname RegisterExtModuleFull C.xsltRegisterExtModuleFull |
| 34 | +func RegisterExtModuleFull(URI *libxml2.Char, initFunc ExtInitFunction, shutdownFunc ExtShutdownFunction, styleInitFunc StyleExtInitFunction, styleShutdownFunc StyleExtShutdownFunction) c.Int |
| 35 | + |
| 36 | +//go:linkname UnregisterExtModule C.xsltUnregisterExtModule |
| 37 | +func UnregisterExtModule(URI *libxml2.Char) c.Int |
| 38 | + |
| 39 | +//go:linkname GetExtData C.xsltGetExtData |
| 40 | +func GetExtData(ctxt TransformContextPtr, URI *libxml2.Char) unsafe.Pointer |
| 41 | + |
| 42 | +//go:linkname StyleGetExtData C.xsltStyleGetExtData |
| 43 | +func StyleGetExtData(style StylesheetPtr, URI *libxml2.Char) unsafe.Pointer |
| 44 | + |
| 45 | +//go:linkname ShutdownCtxtExts C.xsltShutdownCtxtExts |
| 46 | +func ShutdownCtxtExts(ctxt TransformContextPtr) |
| 47 | + |
| 48 | +//go:linkname ShutdownExts C.xsltShutdownExts |
| 49 | +func ShutdownExts(style StylesheetPtr) |
| 50 | + |
| 51 | +//go:linkname XPathGetTransformContext C.xsltXPathGetTransformContext |
| 52 | +func XPathGetTransformContext(ctxt libxml2.XPathParserContextPtr) TransformContextPtr |
| 53 | + |
| 54 | +/* |
| 55 | + * extension functions |
| 56 | + */ |
| 57 | +//go:linkname RegisterExtModuleFunction C.xsltRegisterExtModuleFunction |
| 58 | +func RegisterExtModuleFunction(name *libxml2.Char, URI *libxml2.Char, function libxml2.XPathFunction) c.Int |
| 59 | + |
| 60 | +//go:linkname ExtModuleFunctionLookup C.xsltExtModuleFunctionLookup |
| 61 | +func ExtModuleFunctionLookup(name *libxml2.Char, URI *libxml2.Char) libxml2.XPathFunction |
| 62 | + |
| 63 | +//go:linkname UnregisterExtModuleFunction C.xsltUnregisterExtModuleFunction |
| 64 | +func UnregisterExtModuleFunction(name *libxml2.Char, URI *libxml2.Char) c.Int |
| 65 | + |
| 66 | +// llgo:type C |
| 67 | +type PreComputeFunction func(StylesheetPtr, libxml2.NodePtr, TransformFunction) ElemPreCompPtr |
| 68 | + |
| 69 | +//go:linkname NewElemPreComp C.xsltNewElemPreComp |
| 70 | +func NewElemPreComp(style StylesheetPtr, inst libxml2.NodePtr, function TransformFunction) ElemPreCompPtr |
| 71 | + |
| 72 | +//go:linkname InitElemPreComp C.xsltInitElemPreComp |
| 73 | +func InitElemPreComp(comp ElemPreCompPtr, style StylesheetPtr, inst libxml2.NodePtr, function TransformFunction, freeFunc ElemPreCompDeallocator) |
| 74 | + |
| 75 | +//go:linkname RegisterExtModuleElement C.xsltRegisterExtModuleElement |
| 76 | +func RegisterExtModuleElement(name *libxml2.Char, URI *libxml2.Char, precomp PreComputeFunction, transform TransformFunction) c.Int |
| 77 | + |
| 78 | +//go:linkname ExtElementLookup C.xsltExtElementLookup |
| 79 | +func ExtElementLookup(ctxt TransformContextPtr, name *libxml2.Char, URI *libxml2.Char) TransformFunction |
| 80 | + |
| 81 | +//go:linkname ExtModuleElementLookup C.xsltExtModuleElementLookup |
| 82 | +func ExtModuleElementLookup(name *libxml2.Char, URI *libxml2.Char) TransformFunction |
| 83 | + |
| 84 | +//go:linkname ExtModuleElementPreComputeLookup C.xsltExtModuleElementPreComputeLookup |
| 85 | +func ExtModuleElementPreComputeLookup(name *libxml2.Char, URI *libxml2.Char) PreComputeFunction |
| 86 | + |
| 87 | +//go:linkname UnregisterExtModuleElement C.xsltUnregisterExtModuleElement |
| 88 | +func UnregisterExtModuleElement(name *libxml2.Char, URI *libxml2.Char) c.Int |
| 89 | + |
| 90 | +// llgo:type C |
| 91 | +type TopLevelFunction func(StylesheetPtr, libxml2.NodePtr) |
| 92 | + |
| 93 | +//go:linkname RegisterExtModuleTopLevel C.xsltRegisterExtModuleTopLevel |
| 94 | +func RegisterExtModuleTopLevel(name *libxml2.Char, URI *libxml2.Char, function TopLevelFunction) c.Int |
| 95 | + |
| 96 | +//go:linkname ExtModuleTopLevelLookup C.xsltExtModuleTopLevelLookup |
| 97 | +func ExtModuleTopLevelLookup(name *libxml2.Char, URI *libxml2.Char) TopLevelFunction |
| 98 | + |
| 99 | +//go:linkname UnregisterExtModuleTopLevel C.xsltUnregisterExtModuleTopLevel |
| 100 | +func UnregisterExtModuleTopLevel(name *libxml2.Char, URI *libxml2.Char) c.Int |
| 101 | + |
| 102 | +/* These 2 functions are deprecated for use within modules. */ |
| 103 | +//go:linkname RegisterExtFunction C.xsltRegisterExtFunction |
| 104 | +func RegisterExtFunction(ctxt TransformContextPtr, name *libxml2.Char, URI *libxml2.Char, function libxml2.XPathFunction) c.Int |
| 105 | + |
| 106 | +//go:linkname RegisterExtElement C.xsltRegisterExtElement |
| 107 | +func RegisterExtElement(ctxt TransformContextPtr, name *libxml2.Char, URI *libxml2.Char, function TransformFunction) c.Int |
| 108 | + |
| 109 | +/* |
| 110 | + * Extension Prefix handling API. |
| 111 | + * Those are used by the XSLT (pre)processor. |
| 112 | + */ |
| 113 | +//go:linkname RegisterExtPrefix C.xsltRegisterExtPrefix |
| 114 | +func RegisterExtPrefix(style StylesheetPtr, prefix *libxml2.Char, URI *libxml2.Char) c.Int |
| 115 | + |
| 116 | +//go:linkname CheckExtPrefix C.xsltCheckExtPrefix |
| 117 | +func CheckExtPrefix(style StylesheetPtr, URI *libxml2.Char) c.Int |
| 118 | + |
| 119 | +//go:linkname CheckExtURI C.xsltCheckExtURI |
| 120 | +func CheckExtURI(style StylesheetPtr, URI *libxml2.Char) c.Int |
| 121 | + |
| 122 | +//go:linkname InitCtxtExts C.xsltInitCtxtExts |
| 123 | +func InitCtxtExts(ctxt TransformContextPtr) c.Int |
| 124 | + |
| 125 | +//go:linkname FreeCtxtExts C.xsltFreeCtxtExts |
| 126 | +func FreeCtxtExts(ctxt TransformContextPtr) |
| 127 | + |
| 128 | +//go:linkname FreeExts C.xsltFreeExts |
| 129 | +func FreeExts(style StylesheetPtr) |
| 130 | + |
| 131 | +//go:linkname PreComputeExtModuleElement C.xsltPreComputeExtModuleElement |
| 132 | +func PreComputeExtModuleElement(style StylesheetPtr, inst libxml2.NodePtr) ElemPreCompPtr |
| 133 | + |
| 134 | +/* |
| 135 | + * Extension Infos access. |
| 136 | + * Used by exslt initialisation |
| 137 | + */ |
| 138 | +//go:linkname GetExtInfo C.xsltGetExtInfo |
| 139 | +func GetExtInfo(style StylesheetPtr, URI *libxml2.Char) libxml2.HashTablePtr |
| 140 | + |
| 141 | +/** |
| 142 | + * Test of the extension module API |
| 143 | + */ |
| 144 | +//go:linkname RegisterTestModule C.xsltRegisterTestModule |
| 145 | +func RegisterTestModule() |
| 146 | + |
| 147 | +//go:linkname DebugDumpExtensions C.xsltDebugDumpExtensions |
| 148 | +func DebugDumpExtensions(output *c.FILE) |
0 commit comments