Browse Source

added another func

Ken Martin 23 years ago
parent
commit
f67643112c
2 changed files with 10 additions and 0 deletions
  1. 9 0
      Source/cmCPluginAPI.cxx
  2. 1 0
      Source/cmCPluginAPI.h

+ 9 - 0
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,
 };
 

+ 1 - 0
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 */