2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
23 #include "imagewal.h"
\r
25 // =============================================================================
\r
28 _QERFuncTable_1 g_FuncTable; // Radiant function table
\r
29 _QERFileSystemTable g_FileSystemTable;
\r
31 // =============================================================================
\r
34 CSynapseServer* g_pSynapseServer = NULL;
\r
35 CSynapseClientImage g_SynapseClient;
\r
37 static const XMLConfigEntry_t entries[] =
\r
39 { VFS_MAJOR, SYN_REQUIRE, sizeof(_QERFileSystemTable), &g_FileSystemTable },
\r
40 { NULL, SYN_UNKNOWN, 0, NULL } };
\r
43 #pragma GCC visibility push(default)
\r
45 extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
\r
47 #pragma GCC visibility pop
\r
49 if (strcmp(version, SYNAPSE_VERSION))
\r
51 Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
\r
54 g_pSynapseServer = pServer;
\r
55 g_pSynapseServer->IncRef();
\r
56 Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
\r
58 g_SynapseClient.AddAPI(IMAGE_MAJOR, "wal", sizeof(_QERPlugImageTable));
\r
59 g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1), SYN_REQUIRE, &g_FuncTable);
\r
61 if ( !g_SynapseClient.ConfigXML( pServer, NULL, entries ) ) {
\r
65 return &g_SynapseClient;
\r
68 bool CSynapseClientImage::RequestAPI(APIDescriptor_t *pAPI)
\r
70 if (!strcmp(pAPI->major_name, IMAGE_MAJOR ))
\r
72 _QERPlugImageTable* pTable= static_cast<_QERPlugImageTable*>(pAPI->mpTable);
\r
73 if (!strcmp(pAPI->minor_name, "wal"))
\r
75 pTable->m_pfnLoadImage = &LoadWAL;
\r
80 Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
\r
84 bool CSynapseClientImage::OnActivate() {
\r
85 if (!g_FileSystemTable.m_nSize) {
\r
86 Syn_Printf("ERROR: VFS_MAJOR table was not initialized before OnActivate in '%s' - incomplete synapse.config?\n", GetInfo());
\r
92 #include "version.h"
\r
94 const char* CSynapseClientImage::GetInfo()
\r
96 return "WAL formats module built " __DATE__ " " RADIANT_VERSION;
\r