From c3474d4257edc0bf9c7a5b298b4441d8edb2afe0 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Wed, 11 Dec 2002 14:16:55 -0500 Subject: [PATCH] added a Free method --- Source/cmCPluginAPI.cxx | 13 +++++++++++++ Source/cmCPluginAPI.h | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index bdf0b944b..56da7d39e 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -380,6 +380,12 @@ void * cmCreateSourceFile() return (void *)(new cmSourceFile); } +void cmDestroySourceFile(void *arg) +{ + cmSourceFile *sf = static_cast(arg); + delete sf; +} + const char *cmSourceFileGetSourceName(void *arg) { cmSourceFile *sf = static_cast(arg); @@ -479,6 +485,11 @@ void cmRemoveFile(const char *name) cmSystemTools::RemoveFile(name); } +void cmFree(void *data) +{ + free(data); +} + } // close the extern "C" scope cmCAPI cmStaticCAPI = @@ -517,6 +528,7 @@ cmCAPI cmStaticCAPI = cmAddSource, cmCreateSourceFile, + cmDestroySourceFile, cmGetSource, cmSourceFileAddDepend, cmSourceFileGetProperty, @@ -532,5 +544,6 @@ cmCAPI cmStaticCAPI = cmGetFilenameWithoutExtension, cmGetFilenamePath, cmRemoveFile, + cmFree, }; diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index eaa98d9fc..cf830cdbc 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -113,6 +113,7 @@ typedef struct =========================================================================*/ void *(*AddSource) (void *mf, void *sf); void *(*CreateSourceFile) (); + void (*DestroySourceFile) (void *sf); void *(*GetSource) (void *mf, const char* sourceName); void (*SourceFileAddDepend) (void *sf, const char *depend); const char *(*SourceFileGetProperty) (void *sf, const char *prop); @@ -132,13 +133,14 @@ typedef struct /*========================================================================= The following methods are from cmSystemTools.h see that file for specific - documentaiton on each method. + documentation on each method. =========================================================================*/ char *(*Capitalized)(const char *); void (*CopyFileIfDifferent)(const char *f1, const char *f2); char *(*GetFilenameWithoutExtension)(const char *); char *(*GetFilenamePath)(const char *); void (*RemoveFile)(const char *f1); + void (*Free)(void *); /* this is the end of the C function stub API structure */ } cmCAPI;