Make C-wrapper compile times less ridiculous.

develop
Petr Mrázek 2011-04-10 10:50:32 +02:00
parent bb04aa1a32
commit d4e2850768
9 changed files with 25 additions and 74 deletions

@ -26,7 +26,6 @@ include/dfhack/DFContext.h
include/dfhack/DFContextManager.h include/dfhack/DFContextManager.h
include/dfhack/DFError.h include/dfhack/DFError.h
include/dfhack/DFExport.h include/dfhack/DFExport.h
include/dfhack/DFGlobal.h
include/dfhack/DFIntegers.h include/dfhack/DFIntegers.h
include/dfhack/DFMiscUtils.h include/dfhack/DFMiscUtils.h
include/dfhack/DFModule.h include/dfhack/DFModule.h
@ -57,6 +56,7 @@ SET(PROJECT_C_HDRS
include/DFHack_C.h include/DFHack_C.h
include/dfhack-c/DFProcess_C.h include/dfhack-c/DFProcess_C.h
include/dfhack-c/DFTypes_C.h include/dfhack-c/DFTypes_C.h
include/dfhack-c/DFTileTypes_C.h
include/dfhack-c/DFContext_C.h include/dfhack-c/DFContext_C.h
include/dfhack-c/modules/Buildings_C.h include/dfhack-c/modules/Buildings_C.h
include/dfhack-c/modules/Constructions_C.h include/dfhack-c/modules/Constructions_C.h
@ -107,6 +107,7 @@ SET(PROJECT_C_SRCS
DFContext_C.cpp DFContext_C.cpp
DFProcess_C.cpp DFProcess_C.cpp
DFTypes_C.cpp DFTypes_C.cpp
DFTileTypes_C.cpp
modules/Buildings_C.cpp modules/Buildings_C.cpp
modules/Constructions_C.cpp modules/Constructions_C.cpp

@ -27,14 +27,13 @@ distribution.
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
using namespace std;
#include "dfhack/DFIntegers.h" #include "dfhack/DFIntegers.h"
#include "dfhack/DFTileTypes.h"
#include "dfhack/DFTypes.h"
//#include "dfhack/modules/WindowIO.h"
#include "dfhack/DFContextManager.h" #include "dfhack/DFContextManager.h"
#include "dfhack/DFContext.h" #include "dfhack/DFContext.h"
using namespace std;
using namespace DFHack; using namespace DFHack;
#include "dfhack-c/DFContext_C.h" #include "dfhack-c/DFContext_C.h"

@ -133,7 +133,7 @@ void Process_write(DFHackObject* p_Ptr, uint32_t address, uint32_t length, uint8
((DFHack::Process*)p_Ptr)->write(address, length, buffer); ((DFHack::Process*)p_Ptr)->write(address, length, buffer);
} }
char* Process_readString(DFHackObject* p_Ptr, uint32_t offset) const char* Process_readString(DFHackObject* p_Ptr, uint32_t offset)
{ {
if(p_Ptr == NULL || alloc_char_buffer_callback == NULL) if(p_Ptr == NULL || alloc_char_buffer_callback == NULL)
return NULL; return NULL;
@ -162,7 +162,7 @@ char* Process_readString(DFHackObject* p_Ptr, uint32_t offset)
return ""; return "";
} }
char* Process_getPath(DFHackObject* p_Ptr) const char* Process_getPath(DFHackObject* p_Ptr)
{ {
if(p_Ptr == NULL || alloc_char_buffer_callback == NULL) if(p_Ptr == NULL || alloc_char_buffer_callback == NULL)
return NULL; return NULL;
@ -191,7 +191,7 @@ char* Process_getPath(DFHackObject* p_Ptr)
return ""; return "";
} }
char* Process_readClassName(DFHackObject* p_Ptr, uint32_t vptr) const char* Process_readClassName(DFHackObject* p_Ptr, uint32_t vptr)
{ {
if(p_Ptr == NULL || alloc_char_buffer_callback == NULL) if(p_Ptr == NULL || alloc_char_buffer_callback == NULL)
return NULL; return NULL;

@ -22,21 +22,18 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "dfhack/DFIntegers.h" #include "Internal.h"
#include "dfhack/DFTileTypes.h"
#include <stdlib.h> #include <cstdlib>
#include "string.h" #include <cstring>
#include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
#include "Internal.h"
#include "dfhack/DFTypes.h" #include "dfhack/DFTypes.h"
#include "dfhack/DFTileTypes.h"
#include "dfhack-c/DFTypes_C.h" #include "dfhack-c/DFTypes_C.h"
#include "dfhack/modules/Materials.h" #include "dfhack/modules/Materials.h"
using namespace DFHack; using namespace DFHack;
/* /*
@ -170,46 +167,6 @@ void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32
UNREG_MACRO(FeatureMap, alloc_featuremap_buffer_callback) UNREG_MACRO(FeatureMap, alloc_featuremap_buffer_callback)
int DFHack_isWallTerrain(int in)
{
return DFHack::isWallTerrain(in);
}
int DFHack_isFloorTerrain(int in)
{
return DFHack::isFloorTerrain(in);
}
int DFHack_isRampTerrain(int in)
{
return DFHack::isRampTerrain(in);
}
int DFHack_isStairTerrain(int in)
{
return DFHack::isStairTerrain(in);
}
int DFHack_isOpenTerrain(int in)
{
return DFHack::isOpenTerrain(in);
}
int DFHack_getVegetationType(int in)
{
return DFHack::getVegetationType(in);
}
int DFHack_getTileType(int index, TileRow* tPtr)
{
if(index >= TILE_TYPE_ARRAY_LENGTH)
return 0;
*tPtr = tileTypeTable[index];
return 1;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -19,7 +19,6 @@
// DFHack core classes and types // DFHack core classes and types
#include "dfhack/DFIntegers.h" #include "dfhack/DFIntegers.h"
#include "dfhack/DFGlobal.h"
#include "dfhack/DFError.h" #include "dfhack/DFError.h"
#include "dfhack/DFContextManager.h" #include "dfhack/DFContextManager.h"
#include "dfhack/DFContext.h" #include "dfhack/DFContext.h"

@ -72,9 +72,9 @@ DFHACK_EXPORT void Process_write(DFHackObject* p_Ptr, uint32_t address, uint32_t
DFHACK_EXPORT int Process_readSTLVector(DFHackObject* p_Ptr, uint32_t address, t_vecTriplet* vector); DFHACK_EXPORT int Process_readSTLVector(DFHackObject* p_Ptr, uint32_t address, t_vecTriplet* vector);
DFHACK_EXPORT char* Process_readString(DFHackObject* p_Ptr, uint32_t offset); DFHACK_EXPORT const char* Process_readString(DFHackObject* p_Ptr, uint32_t offset);
DFHACK_EXPORT char* Process_getPath(DFHackObject* p_Ptr); DFHACK_EXPORT const char* Process_getPath(DFHackObject* p_Ptr);
DFHACK_EXPORT char* Process_readClassName(DFHackObject* p_Ptr, uint32_t vptr); DFHACK_EXPORT const char* Process_readClassName(DFHackObject* p_Ptr, uint32_t vptr);
DFHACK_EXPORT int Process_isSuspended(DFHackObject* p_Ptr); DFHACK_EXPORT int Process_isSuspended(DFHackObject* p_Ptr);
DFHACK_EXPORT int Process_isAttached(DFHackObject* p_Ptr); DFHACK_EXPORT int Process_isAttached(DFHackObject* p_Ptr);

@ -31,7 +31,7 @@ distribution.
#include "dfhack/modules/Maps.h" #include "dfhack/modules/Maps.h"
#include "dfhack/modules/Materials.h" #include "dfhack/modules/Materials.h"
#include "dfhack/modules/Gui.h" #include "dfhack/modules/Gui.h"
#include "dfhack/DFTileTypes.h" //#include "dfhack/DFTileTypes.h"
#define HBUILD(a) a ## BufferCallback #define HBUILD(a) a ## BufferCallback
#define HREG_MACRO(type_name, type) DFHACK_EXPORT void HBUILD(Register ## type_name) (int (*funcptr)(type, uint32_t)); #define HREG_MACRO(type_name, type) DFHACK_EXPORT void HBUILD(Register ## type_name) (int (*funcptr)(type, uint32_t));
@ -256,15 +256,6 @@ DFHACK_EXPORT extern int (*alloc_featuremap_buffer_callback)(c_featuremap_node**
DFHACK_EXPORT void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t)); DFHACK_EXPORT void RegisterFeatureMapBufferCallback(int (*funcptr)(c_featuremap_node**, uint32_t*, uint32_t));
DFHACK_EXPORT int DFHack_isWallTerrain(int in);
DFHACK_EXPORT int DFHack_isFloorTerrain(int in);
DFHACK_EXPORT int DFHack_isRampTerrain(int in);
DFHACK_EXPORT int DFHack_isStairTerrain(int in);
DFHACK_EXPORT int DFHack_isOpenTerrain(int in);
DFHACK_EXPORT int DFHack_getVegetationType(int in);
DFHACK_EXPORT int DFHack_getTileType(int index, TileRow* tPtr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -22,12 +22,13 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "dfhack/DFIntegers.h" #include "Internal.h"
#include <string>
#include <string>
#include <vector>
using namespace std; using namespace std;
#include "Internal.h"
#include "dfhack/DFTypes.h" #include "dfhack/DFTypes.h"
#include "dfhack/modules/Translation.h" #include "dfhack/modules/Translation.h"
#include "dfhack-c/modules/Translation_C.h" #include "dfhack-c/modules/Translation_C.h"

@ -22,8 +22,11 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "dfhack/DFIntegers.h"
#include "Internal.h" #include "Internal.h"
#include <vector>
#include <string>
using namespace std;
#include "dfhack/DFTypes.h" #include "dfhack/DFTypes.h"
#include "dfhack/modules/Vegetation.h" #include "dfhack/modules/Vegetation.h"
#include "dfhack-c/modules/Vegetation_C.h" #include "dfhack-c/modules/Vegetation_C.h"