Commit c3474d42 authored by Ken Martin's avatar Ken Martin
Browse files

added a Free method

parent 3bcbca96
...@@ -380,6 +380,12 @@ void * cmCreateSourceFile() ...@@ -380,6 +380,12 @@ void * cmCreateSourceFile()
return (void *)(new cmSourceFile); return (void *)(new cmSourceFile);
} }
void cmDestroySourceFile(void *arg)
{
cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
delete sf;
}
const char *cmSourceFileGetSourceName(void *arg) const char *cmSourceFileGetSourceName(void *arg)
{ {
cmSourceFile *sf = static_cast<cmSourceFile *>(arg); cmSourceFile *sf = static_cast<cmSourceFile *>(arg);
...@@ -479,6 +485,11 @@ void cmRemoveFile(const char *name) ...@@ -479,6 +485,11 @@ void cmRemoveFile(const char *name)
cmSystemTools::RemoveFile(name); cmSystemTools::RemoveFile(name);
} }
void cmFree(void *data)
{
free(data);
}
} // close the extern "C" scope } // close the extern "C" scope
cmCAPI cmStaticCAPI = cmCAPI cmStaticCAPI =
...@@ -517,6 +528,7 @@ cmCAPI cmStaticCAPI = ...@@ -517,6 +528,7 @@ cmCAPI cmStaticCAPI =
cmAddSource, cmAddSource,
cmCreateSourceFile, cmCreateSourceFile,
cmDestroySourceFile,
cmGetSource, cmGetSource,
cmSourceFileAddDepend, cmSourceFileAddDepend,
cmSourceFileGetProperty, cmSourceFileGetProperty,
...@@ -532,5 +544,6 @@ cmCAPI cmStaticCAPI = ...@@ -532,5 +544,6 @@ cmCAPI cmStaticCAPI =
cmGetFilenameWithoutExtension, cmGetFilenameWithoutExtension,
cmGetFilenamePath, cmGetFilenamePath,
cmRemoveFile, cmRemoveFile,
cmFree,
}; };
...@@ -113,6 +113,7 @@ typedef struct ...@@ -113,6 +113,7 @@ typedef struct
=========================================================================*/ =========================================================================*/
void *(*AddSource) (void *mf, void *sf); void *(*AddSource) (void *mf, void *sf);
void *(*CreateSourceFile) (); void *(*CreateSourceFile) ();
void (*DestroySourceFile) (void *sf);
void *(*GetSource) (void *mf, const char* sourceName); void *(*GetSource) (void *mf, const char* sourceName);
void (*SourceFileAddDepend) (void *sf, const char *depend); void (*SourceFileAddDepend) (void *sf, const char *depend);
const char *(*SourceFileGetProperty) (void *sf, const char *prop); const char *(*SourceFileGetProperty) (void *sf, const char *prop);
...@@ -132,13 +133,14 @@ typedef struct ...@@ -132,13 +133,14 @@ typedef struct
/*========================================================================= /*=========================================================================
The following methods are from cmSystemTools.h see that file for specific The following methods are from cmSystemTools.h see that file for specific
documentaiton on each method. documentation on each method.
=========================================================================*/ =========================================================================*/
char *(*Capitalized)(const char *); char *(*Capitalized)(const char *);
void (*CopyFileIfDifferent)(const char *f1, const char *f2); void (*CopyFileIfDifferent)(const char *f1, const char *f2);
char *(*GetFilenameWithoutExtension)(const char *); char *(*GetFilenameWithoutExtension)(const char *);
char *(*GetFilenamePath)(const char *); char *(*GetFilenamePath)(const char *);
void (*RemoveFile)(const char *f1); void (*RemoveFile)(const char *f1);
void (*Free)(void *);
/* this is the end of the C function stub API structure */ /* this is the end of the C function stub API structure */
} cmCAPI; } cmCAPI;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment