From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/xml/main.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Src/xml/main.cpp (limited to 'Src/xml/main.cpp') diff --git a/Src/xml/main.cpp b/Src/xml/main.cpp new file mode 100644 index 00000000..d3106eeb --- /dev/null +++ b/Src/xml/main.cpp @@ -0,0 +1,49 @@ +#include "api__xml.h" +#include "wa5_xml.h" +#include "factory_xml.h" +#include + +#ifndef _DEBUG +BOOL WINAPI _DllMainCRTStartup(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + DisableThreadLibraryCalls(hInst); + return TRUE; +} +#endif + +WA5_XML wa5_xml; +XMLFactory *xmlFactory=0; + +api_service *WASABI_API_SVC = 0; + +void WA5_XML::RegisterServices(api_service *service) +{ + xmlFactory = new XMLFactory; + WASABI_API_SVC = service; + WASABI_API_SVC->service_register(xmlFactory); +} + +int WA5_XML::RegisterServicesSafeModeOk() +{ + return 1; +} + +void WA5_XML::DeregisterServices(api_service *service) +{ + service->service_deregister(xmlFactory); + delete xmlFactory; + xmlFactory=0; +} + +extern "C" DLLEXPORT ifc_wa5component *GetWinamp5SystemComponent() +{ + return &wa5_xml; +} + +#define CBCLASS WA5_XML +START_DISPATCH; +VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices) +CB(15, RegisterServicesSafeModeOk) +VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices) +END_DISPATCH; +#undef CBCLASS \ No newline at end of file -- cgit