diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 10 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedxml2types.h | 5 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedxslttypes.h | 7 | ||||
| -rwxr-xr-x | src/wrapped/wrappedfreetype_private.h | 4 | ||||
| -rwxr-xr-x | src/wrapped/wrappedxml2.c | 165 | ||||
| -rwxr-xr-x | src/wrapped/wrappedxml2_private.h | 46 | ||||
| -rwxr-xr-x | src/wrapped/wrappedxslt.c | 60 | ||||
| -rwxr-xr-x | src/wrapped/wrappedxslt_private.h | 8 |
8 files changed, 252 insertions, 53 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index d6eb1d7a..f5806243 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -4559,9 +4559,13 @@ wrappedxml2: - iFp: - xmlParseDocument - pFv: + - __xmlGenericError + - __xmlStructuredError - xmlGetExternalEntityLoader - vFpp: - xmlHashFree + - xmlSetGenericErrorFunc + - xmlSetStructuredErrorFunc - pFpp: - xmlHashCopy - vFppp: @@ -4581,6 +4585,7 @@ wrappedxml2: - xmlHashRemoveEntry2 - xmlHashUpdateEntry - xmlRegisterInputCallbacks + - xmlRegisterOutputCallbacks - pFpppi: - xmlParserInputBufferCreateIO - pFpppp: @@ -4601,5 +4606,10 @@ wrappedxshmfence: wrappedxslt: - vFp: - xsltSetLoaderFunc +- vFpp: + - xsltSetCtxtSortFunc - iFppp: - xsltRegisterExtModuleFunction + - xsltSetSecurityPrefs +- iFpppp: + - xsltRegisterExtFunction diff --git a/src/wrapped/generated/wrappedxml2types.h b/src/wrapped/generated/wrappedxml2types.h index 13627375..fb721595 100644 --- a/src/wrapped/generated/wrappedxml2types.h +++ b/src/wrapped/generated/wrappedxml2types.h @@ -32,8 +32,12 @@ typedef void* (*pFpppppi_t)(void*, void*, void*, void*, void*, int32_t); #define SUPER() ADDED_FUNCTIONS() \ GO(xmlSetExternalEntityLoader, vFp_t) \ GO(xmlParseDocument, iFp_t) \ + GO(__xmlGenericError, pFv_t) \ + GO(__xmlStructuredError, pFv_t) \ GO(xmlGetExternalEntityLoader, pFv_t) \ GO(xmlHashFree, vFpp_t) \ + GO(xmlSetGenericErrorFunc, vFpp_t) \ + GO(xmlSetStructuredErrorFunc, vFpp_t) \ GO(xmlHashCopy, pFpp_t) \ GO(xmlHashScan, vFppp_t) \ GO(xmlHashScanFull, vFppp_t) \ @@ -47,6 +51,7 @@ typedef void* (*pFpppppi_t)(void*, void*, void*, void*, void*, int32_t); GO(xmlHashRemoveEntry2, iFpppp_t) \ GO(xmlHashUpdateEntry, iFpppp_t) \ GO(xmlRegisterInputCallbacks, iFpppp_t) \ + GO(xmlRegisterOutputCallbacks, iFpppp_t) \ GO(xmlParserInputBufferCreateIO, pFpppi_t) \ GO(xmlOutputBufferCreateIO, pFpppp_t) \ GO(xmlHashRemoveEntry3, iFppppp_t) \ diff --git a/src/wrapped/generated/wrappedxslttypes.h b/src/wrapped/generated/wrappedxslttypes.h index 8ff09ddf..83337e16 100644 --- a/src/wrapped/generated/wrappedxslttypes.h +++ b/src/wrapped/generated/wrappedxslttypes.h @@ -12,10 +12,15 @@ #endif typedef void (*vFp_t)(void*); +typedef void (*vFpp_t)(void*, void*); typedef int32_t (*iFppp_t)(void*, void*, void*); +typedef int32_t (*iFpppp_t)(void*, void*, void*, void*); #define SUPER() ADDED_FUNCTIONS() \ GO(xsltSetLoaderFunc, vFp_t) \ - GO(xsltRegisterExtModuleFunction, iFppp_t) + GO(xsltSetCtxtSortFunc, vFpp_t) \ + GO(xsltRegisterExtModuleFunction, iFppp_t) \ + GO(xsltSetSecurityPrefs, iFppp_t) \ + GO(xsltRegisterExtFunction, iFpppp_t) #endif // __wrappedxsltTYPES_H_ diff --git a/src/wrapped/wrappedfreetype_private.h b/src/wrapped/wrappedfreetype_private.h index 5beaad93..9c4318fd 100755 --- a/src/wrapped/wrappedfreetype_private.h +++ b/src/wrapped/wrappedfreetype_private.h @@ -156,13 +156,13 @@ GO(FT_Set_Char_Size, iFplluu) //GO(FT_Set_Debug_Hook, //GO(FT_Set_Default_Properties, //GO(FT_Set_MM_Blend_Coordinates, -//GO(FT_Set_MM_Design_Coordinates, +GO(FT_Set_MM_Design_Coordinates, iFpup) GO(FT_Set_Pixel_Sizes, iFpuu) //GO(FT_Set_Renderer, GO(FT_Set_Transform, vFppp) //GO(FT_Set_Var_Blend_Coordinates, GO(FT_Set_Var_Design_Coordinates, iFpup) -//GO(FT_Sfnt_Table_Info, +GO(FT_Sfnt_Table_Info, iFpupp) GO(FT_Sin, lFl) //GO(FT_Stream_OpenBzip2, //GO(FT_Stream_OpenGzip, diff --git a/src/wrapped/wrappedxml2.c b/src/wrapped/wrappedxml2.c index 271edfdd..bcf0391a 100755 --- a/src/wrapped/wrappedxml2.c +++ b/src/wrapped/wrappedxml2.c @@ -3,6 +3,7 @@ #include <string.h> #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <dlfcn.h> +#include <stdarg.h> #include "wrappedlibs.h" @@ -402,28 +403,6 @@ static void* find_xmlSchemaValidityWarningFunc_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlSchemaValidityWarningFunc callback\n"); return NULL; } -// xmlStructuredErrorFunc ... -#define GO(A) \ -static uintptr_t my_xmlStructuredErrorFunc_fct_##A = 0; \ -static void my_xmlStructuredErrorFunc_##A(void* a, void* b) \ -{ \ - RunFunction(my_context, my_xmlStructuredErrorFunc_fct_##A, 2, a, b); \ -} -SUPER() -#undef GO -static void* find_xmlStructuredErrorFunc_Fct(void* fct) -{ - if(!fct) return fct; - if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); - #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlStructuredErrorFunc_##A; - SUPER() - #undef GO - #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == 0) {my_xmlStructuredErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlStructuredErrorFunc_##A; } - SUPER() - #undef GO - printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlStructuredErrorFunc callback\n"); - return NULL; -} // xmlXPathFunction ... #define GO(A) \ static uintptr_t my_xmlXPathFunction_fct_##A = 0; \ @@ -1119,6 +1098,123 @@ static void* reverse_xmlExternalEntityLoaderFct(void* fct) } +// xmlGenericErrorFunc +#define GO(A) \ +static uintptr_t my_xmlGenericErrorFunc_fct_##A = 0; \ +static void my_xmlGenericErrorFunc_##A(void* a, const char* fmt, ...) \ +{ \ + char buf[4096]; \ + va_list args; \ + va_start(args, fmt); \ + vsnprintf(buf, 4096, fmt, args); \ + va_end(args); \ + RunFunction(my_context, my_xmlGenericErrorFunc_fct_##A, 2, a, buf); \ +} +SUPER() +#undef GO +static void* find_xmlGenericErrorFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlGenericErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlGenericErrorFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlGenericErrorFunc_fct_##A == 0) {my_xmlGenericErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlGenericErrorFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlGenericErrorFunc callback\n"); + return NULL; +} +static void* reverse_xmlGenericErrorFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_xmlGenericErrorFunc_##A == fct) return (void*)my_xmlGenericErrorFunc_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, "xmlGenericErrorFunc_callback"); +} + +// xmlStructuredErrorFunc +#define GO(A) \ +static uintptr_t my_xmlStructuredErrorFunc_fct_##A = 0; \ +static void my_xmlStructuredErrorFunc_##A(void* a, const char* b) \ +{ \ + RunFunction(my_context, my_xmlStructuredErrorFunc_fct_##A, 2, a, b); \ +} +SUPER() +#undef GO +static void* find_xmlStructuredErrorFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == (uintptr_t)fct) return my_xmlStructuredErrorFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlStructuredErrorFunc_fct_##A == 0) {my_xmlStructuredErrorFunc_fct_##A = (uintptr_t)fct; return my_xmlStructuredErrorFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlStructuredErrorFunc callback\n"); + return NULL; +} +static void* reverse_xmlStructuredErrorFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(CheckBridged(my_lib->w.bridge, fct)) + return (void*)CheckBridged(my_lib->w.bridge, fct); + #define GO(A) if(my_xmlStructuredErrorFunc_##A == fct) return (void*)my_xmlStructuredErrorFunc_fct_##A; + SUPER() + #undef GO + return (void*)AddBridge(my_lib->w.bridge, vFpp, fct, 0, "xmlStructuredErrorFunc_callback"); +} + +// xmlOutputMatchCallback ... +#define GO(A) \ +static uintptr_t my_xmlOutputMatchCallback_fct_##A = 0; \ +static int my_xmlOutputMatchCallback_##A(void* a) \ +{ \ + return (int)RunFunction(my_context, my_xmlOutputMatchCallback_fct_##A, 1, a); \ +} +SUPER() +#undef GO +static void* find_xmlOutputMatchCallback_Fct(void* fct) // this one have a VAArg +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlOutputMatchCallback_fct_##A == (uintptr_t)fct) return my_xmlOutputMatchCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlOutputMatchCallback_fct_##A == 0) {my_xmlOutputMatchCallback_fct_##A = (uintptr_t)fct; return my_xmlOutputMatchCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlOutputMatchCallback callback\n"); + return NULL; +} + +// xmlOutputOpenCallback ... +#define GO(A) \ +static uintptr_t my_xmlOutputOpenCallback_fct_##A = 0; \ +static void* my_xmlOutputOpenCallback_##A(void* a) \ +{ \ + return (void*)RunFunction(my_context, my_xmlOutputOpenCallback_fct_##A, 1, a); \ +} +SUPER() +#undef GO +static void* find_xmlOutputOpenCallback_Fct(void* fct) // this one have a VAArg +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xmlOutputOpenCallback_fct_##A == (uintptr_t)fct) return my_xmlOutputOpenCallback_##A; + SUPER() + #undef GO + #define GO(A) if(my_xmlOutputOpenCallback_fct_##A == 0) {my_xmlOutputOpenCallback_fct_##A = (uintptr_t)fct; return my_xmlOutputOpenCallback_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxml2 xmlOutputOpenCallback callback\n"); + return NULL; +} + #undef SUPER EXPORT void* my_xmlHashCopy(x64emu_t* emu, void* table, void* f) @@ -1317,6 +1413,31 @@ EXPORT void* my_xmlCreateIOParserCtxt(x64emu_t* emu, my_xmlSAXHandler_t** p, voi return ret; } +EXPORT void* my___xmlGenericError(x64emu_t* emu) +{ + return reverse_xmlGenericErrorFunc_Fct(my->__xmlGenericError()); +} + +EXPORT void* my___xmlStructuredError(x64emu_t* emu) +{ + return reverse_xmlStructuredErrorFunc_Fct(my->__xmlStructuredError()); +} + +EXPORT void my_xmlSetGenericErrorFunc(x64emu_t* emu, void* ctx, void* f) +{ + my->xmlSetGenericErrorFunc(ctx, find_xmlGenericErrorFunc_Fct(f)); +} + +EXPORT void my_xmlSetStructuredErrorFunc(x64emu_t* emu, void* ctx, void* f) +{ + my->xmlSetStructuredErrorFunc(ctx, find_xmlStructuredErrorFunc_Fct(f)); +} + +EXPORT int my_xmlRegisterOutputCallbacks(x64emu_t* emu, void* match, void* open, void* write, void* close) +{ + return my->xmlRegisterOutputCallbacks(find_xmlOutputMatchCallback_Fct(match), find_xmlOutputOpenCallback_Fct(open), find_xmlOutputWriteCallback_Fct(write), find_xmlOutputCloseCallback_Fct(close)); +} + #define CUSTOM_INIT \ getMy(lib); diff --git a/src/wrapped/wrappedxml2_private.h b/src/wrapped/wrappedxml2_private.h index de63b740..dd699a9b 100755 --- a/src/wrapped/wrappedxml2_private.h +++ b/src/wrapped/wrappedxml2_private.h @@ -164,7 +164,7 @@ GO(xmlBufferWriteCHAR, vFpp) GO(xmlBufferWriteQuotedString, vFpp) GO(xmlBuildQName, pFpppi) GO(xmlBuildRelativeURI, pFpp) -//GO(xmlBuildURI, +GO(xmlBuildURI, pFpp) GO(xmlByteConsumed, lFp) //GO(xmlC14NDocDumpMemory, //GO(xmlC14NDocSave, @@ -190,7 +190,7 @@ GO(xmlByteConsumed, lFp) //GO(xmlCatalogResolveURI, //GO(xmlCatalogSetDebug, //GO(xmlCatalogSetDefaultPrefer, -//GO(xmlCatalogSetDefaults, +GO(xmlCatalogSetDefaults, vFi) GO(xmlCharEncCloseFunc, iFp) GO(xmlCharEncFirstLine, iFppp) //GO(xmlCharEncFirstLineInt, @@ -361,14 +361,14 @@ GO(xmlFreePropList, vFp) GO(xmlFreeRefTable, vFp) //GO(xmlFreeRMutex, //GO(xmlFreeStreamCtxt, -//GO(xmlFreeTextReader, +GO(xmlFreeTextReader, vFp) //GO(xmlFreeTextWriter, //GO(xmlFreeURI, GO(xmlFreeValidCtxt, vFp) //GO(xmlGcMemGet, //GO(xmlGcMemSetup, -//GO(__xmlGenericError, -//GO(__xmlGenericErrorContext, +GOM(__xmlGenericError, pFEv) +GO(__xmlGenericErrorContext, pFv) //GO(xmlGenericErrorDefaultFunc, GO(xmlGetBufferAllocationScheme, iFv) GO(xmlGetCharEncodingHandler, pFp) @@ -777,7 +777,7 @@ GO(xmlReadDoc, pFpppi) //GO(xmlReaderForFd, //GO(xmlReaderForFile, //GO(xmlReaderForIO, -//GO(xmlReaderForMemory, +GO(xmlReaderForMemory, pFpippi) //GO(xmlReaderNewDoc, //GO(xmlReaderNewFd, //GO(xmlReaderNewFile, @@ -811,7 +811,7 @@ GO(xmlRegisterHTTPPostCallbacks, vFv) GOM(xmlRegisterInputCallbacks, iFEpppp) //GOM(xmlRegisterNodeDefault, BFEB) //GO(__xmlRegisterNodeDefaultValue, -//GOM(xmlRegisterOutputCallbacks, iFEBBBB) +GOM(xmlRegisterOutputCallbacks, iFEpppp) //GO(xmlRegNewExecCtxt, //GO(xmlRelaxNGCleanupTypes, //GO(xmlRelaxNGDump, @@ -988,12 +988,12 @@ GO(xmlSetCompressMode, vFi) GO(xmlSetDocCompressMode, vFpi) GOM(xmlSetExternalEntityLoader, vFEp) GO(xmlSetFeature, iFppp) -//GO(xmlSetGenericErrorFunc, +GOM(xmlSetGenericErrorFunc, vFEpp) GO(xmlSetListDoc, vFpp) GO(xmlSetNs, vFpp) GO(xmlSetNsProp, pFpppp) GO(xmlSetProp, pFppp) -//GO(xmlSetStructuredErrorFunc, +GOM(xmlSetStructuredErrorFunc, vFEpp) GO(xmlSetTreeDoc, vFpp) GO(xmlSetupParserForBuffer, vFppp) //GO(__xmlSimpleError, @@ -1031,7 +1031,7 @@ GO2(xmlStrPrintf, iFpipV, xmlStrVPrintf) GO(xmlStrQEqual, iFppp) GO(xmlStrstr, pFpp) GO(xmlStrsub, pFpii) -//GO(__xmlStructuredError, +GOM(__xmlStructuredError, pFEv) //GO(__xmlStructuredErrorContext, GO(xmlStrVPrintf, iFpipp) GO(xmlSubstituteEntitiesDefault, iFi) @@ -1047,19 +1047,19 @@ GO(xmlTextMerge, pFpp) //GO(xmlTextReaderClose, //GO(xmlTextReaderConstBaseUri, //GO(xmlTextReaderConstEncoding, -//GO(xmlTextReaderConstLocalName, -//GO(xmlTextReaderConstName, +GO(xmlTextReaderConstLocalName, pFp) +GO(xmlTextReaderConstName, pFp) //GO(xmlTextReaderConstNamespaceUri, //GO(xmlTextReaderConstPrefix, //GO(xmlTextReaderConstString, -//GO(xmlTextReaderConstValue, +GO(xmlTextReaderConstValue, pFp) //GO(xmlTextReaderConstXmlLang, //GO(xmlTextReaderConstXmlVersion, //GO(xmlTextReaderCurrentDoc, //GO(xmlTextReaderCurrentNode, //GO(xmlTextReaderDepth, //GO(xmlTextReaderExpand, -//GO(xmlTextReaderGetAttribute, +GO(xmlTextReaderGetAttribute, pFpp) //GO(xmlTextReaderGetAttributeNo, //GO(xmlTextReaderGetAttributeNs, //GO(xmlTextReaderGetErrorHandler, @@ -1067,33 +1067,33 @@ GO(xmlTextMerge, pFpp) //GO(xmlTextReaderGetParserLineNumber, //GO(xmlTextReaderGetParserProp, //GO(xmlTextReaderGetRemainder, -//GO(xmlTextReaderHasAttributes, +GO(xmlTextReaderHasAttributes, iFp) //GO(xmlTextReaderHasValue, //GO(xmlTextReaderIsDefault, -//GO(xmlTextReaderIsEmptyElement, -//GO(xmlTextReaderIsNamespaceDecl, +GO(xmlTextReaderIsEmptyElement, iFp) +GO(xmlTextReaderIsNamespaceDecl, iFp) //GO(xmlTextReaderIsValid, //GO(xmlTextReaderLocalName, //GO(xmlTextReaderLocatorBaseURI, //GO(xmlTextReaderLocatorLineNumber, -//GO(xmlTextReaderLookupNamespace, +GO(xmlTextReaderLookupNamespace, pFpp) //GO(xmlTextReaderMoveToAttribute, //GO(xmlTextReaderMoveToAttributeNo, //GO(xmlTextReaderMoveToAttributeNs, -//GO(xmlTextReaderMoveToElement, -//GO(xmlTextReaderMoveToFirstAttribute, -//GO(xmlTextReaderMoveToNextAttribute, +GO(xmlTextReaderMoveToElement, iFp) +GO(xmlTextReaderMoveToFirstAttribute, iFp) +GO(xmlTextReaderMoveToNextAttribute, iFp) //GO(xmlTextReaderName, //GO(xmlTextReaderNamespaceUri, //GO(xmlTextReaderNext, //GO(xmlTextReaderNextSibling, -//GO(xmlTextReaderNodeType, +GO(xmlTextReaderNodeType, iFp) //GO(xmlTextReaderNormalization, //GO(xmlTextReaderPrefix, //GO(xmlTextReaderPreserve, //GO(xmlTextReaderPreservePattern, //GO(xmlTextReaderQuoteChar, -//GO(xmlTextReaderRead, +GO(xmlTextReaderRead, iFp) //GO(xmlTextReaderReadAttributeValue, //GO(xmlTextReaderReadInnerXml, //GO(xmlTextReaderReadOuterXml, diff --git a/src/wrapped/wrappedxslt.c b/src/wrapped/wrappedxslt.c index 41e68636..118dc5b7 100755 --- a/src/wrapped/wrappedxslt.c +++ b/src/wrapped/wrappedxslt.c @@ -82,7 +82,50 @@ static void* find_xsltDocLoaderFunc_Fct(void* fct) printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltDocLoaderFunc callback\n"); return NULL; } - +// xsltSecurityCheck ... +#define GO(A) \ +static uintptr_t my_xsltSecurityCheck_fct_##A = 0; \ +static int my_xsltSecurityCheck_##A(void* a, void* b, void* c) \ +{ \ + return (int)RunFunction(my_context, my_xsltSecurityCheck_fct_##A, 3, a, b, c); \ +} +SUPER() +#undef GO +static void* find_xsltSecurityCheck_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xsltSecurityCheck_fct_##A == (uintptr_t)fct) return my_xsltSecurityCheck_##A; + SUPER() + #undef GO + #define GO(A) if(my_xsltSecurityCheck_fct_##A == 0) {my_xsltSecurityCheck_fct_##A = (uintptr_t)fct; return my_xsltSecurityCheck_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltSecurityCheck callback\n"); + return NULL; +} +// xsltSortFunc ... +#define GO(A) \ +static uintptr_t my_xsltSortFunc_fct_##A = 0; \ +static void my_xsltSortFunc_##A(void* a, void* b, int c) \ +{ \ + RunFunction(my_context, my_xsltSortFunc_fct_##A, 3, a, b, c); \ +} +SUPER() +#undef GO +static void* find_xsltSortFunc_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_xsltSortFunc_fct_##A == (uintptr_t)fct) return my_xsltSortFunc_##A; + SUPER() + #undef GO + #define GO(A) if(my_xsltSortFunc_fct_##A == 0) {my_xsltSortFunc_fct_##A = (uintptr_t)fct; return my_xsltSortFunc_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for libxslt xsltSortFunc callback\n"); + return NULL; +} #undef SUPER EXPORT int my_xsltRegisterExtModuleFunction(x64emu_t* emu, void* name, void* URI, void* f) @@ -95,6 +138,21 @@ EXPORT void my_xsltSetLoaderFunc(x64emu_t* emu, void* f) my->xsltSetLoaderFunc(find_xsltDocLoaderFunc_Fct(f)); } +EXPORT int my_xsltRegisterExtFunction(x64emu_t* emu, void* ctx, void* name, void* uri, void* f) +{ + return my->xsltRegisterExtFunction(ctx, name, uri, find_xmlXPathFunction_Fct(f)); +} + +EXPORT int my_xsltSetSecurityPrefs(x64emu_t* emu, void* sec, void* option, void* f) +{ + return my->xsltSetSecurityPrefs(sec, option, find_xsltSecurityCheck_Fct(f)); +} + +EXPORT void my_xsltSetCtxtSortFunc(x64emu_t* emu, void* ctx, void* handler) +{ + return my->xsltSetCtxtSortFunc(ctx, find_xsltSortFunc_Fct(handler)); +} + #define CUSTOM_INIT \ getMy(lib); diff --git a/src/wrapped/wrappedxslt_private.h b/src/wrapped/wrappedxslt_private.h index f769d942..24c3db72 100755 --- a/src/wrapped/wrappedxslt_private.h +++ b/src/wrapped/wrappedxslt_private.h @@ -56,7 +56,7 @@ GO(xsltDocumentSortFunction, vFp) GO(xsltDoSortFunction, vFppi) GO(xsltElement, vFpppp) //GO(xsltElementAvailableFunction, -//GO(xsltEvalAttrValueTemplate, +GO(xsltEvalAttrValueTemplate, pFpppp) GO(xsltEvalAVT, pFppp) GO(xsltEvalGlobalVariables, iFp) GO(xsltEvalOneUserParam, iFppp) @@ -180,7 +180,7 @@ GO(xsltRegisterAllElement, vFp) GO(xsltRegisterAllExtras, vFv) //GO(xsltRegisterAllFunctions, //GOM(xsltRegisterExtElement, iFEpppB) -//GOM(xsltRegisterExtFunction, iFEpppB) +GOM(xsltRegisterExtFunction, iFEpppp) //GOM(xsltRegisterExtModule, iFEpBB) //GOM(xsltRegisterExtModuleElement, iFEppBB) //GOM(xsltRegisterExtModuleFull, iFEpBBBB) @@ -207,14 +207,14 @@ GO(xsltSecurityAllow, iFppp) GO(xsltSecurityForbid, iFppp) GO(xsltSetCtxtParseOptions, iFpi) GO(xsltSetCtxtSecurityPrefs, iFpp) -//GOM(xsltSetCtxtSortFunc, vFEpB) +GOM(xsltSetCtxtSortFunc, vFEpp) //GOM(xsltSetDebuggerCallbacks, iFip) GO(xsltSetDebuggerStatus, vFi) GO(xsltSetDefaultSecurityPrefs, vFp) //GOM(xsltSetGenericDebugFunc, vFEpB) //GOM(xsltSetGenericErrorFunc, vFEpB) GOM(xsltSetLoaderFunc, vFEp) -//GOM(xsltSetSecurityPrefs, iFEppB) +GOM(xsltSetSecurityPrefs, iFEppp) //GOM(xsltSetSortFunc, vFEp) //GO(MxsltSetTransformErrorFunc, vFEppB) GO(xsltSetXIncludeDefault, vFi) |