From f67643112cffc73b0f8425e341952e3eda17d52d Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 14 Nov 2002 11:16:58 -0500 Subject: added another func --- Source/cmCPluginAPI.cxx | 9 +++++++++ Source/cmCPluginAPI.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index e7ffe3f..bdf0b94 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -453,6 +453,14 @@ char *cmGetFilenameWithoutExtension(const char *name) return result; } +char *cmGetFilenamePath(const char *name) +{ + std::string sres = cmSystemTools::GetFilenamePath(name); + char *result = (char *)malloc(sres.size()+1); + strcpy(result,sres.c_str()); + return result; +} + char *cmCapitalized(const char *name) { std::string sres = cmSystemTools::Capitalized(name); @@ -522,6 +530,7 @@ cmCAPI cmStaticCAPI = cmCapitalized, cmCopyFileIfDifferent, cmGetFilenameWithoutExtension, + cmGetFilenamePath, cmRemoveFile, }; diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index 1f679d7..eaa98d9 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -137,6 +137,7 @@ typedef struct 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); /* this is the end of the C function stub API structure */ -- cgit v0.12