diff --git a/cmFileSys.c b/cmFileSys.c index 1b17a62..eaa1f24 100644 --- a/cmFileSys.c +++ b/cmFileSys.c @@ -515,7 +515,12 @@ const cmChar_t* cmFileSysMakeUserDir( cmFileSysH_t h, const cmChar_t* dir, ... return retPtr; } +const cmChar_t* cmFileSysMakeDirFn( cmFileSysH_t h, const cmChar_t* dir, const cmChar_t* fn ) +{ return cmFileSysMakeFn( h, dir, fn, NULL, NULL); } +const cmChar_t* cmFileSysMakeUserDirFn(cmFileSysH_t h, const cmChar_t* dir, const cmChar_t* fn ) +{ return cmFileSysMakeUserFn(h, dir, fn, NULL, NULL ); } + void cmFileSysFreeFn( cmFileSysH_t h, const cmChar_t* fn ) { cmFs_t* p = _cmFileSysHandleToPtr(h); @@ -1248,6 +1253,12 @@ const cmChar_t* cmFsMakeUserFn( const cmChar_t* dirPrefix, const cmChar_t* fn, return retPtr; } +const cmChar_t* cmFsMakeDirFn(const cmChar_t* dir, const cmChar_t* fn ) +{ return cmFileSysMakeDirFn(_cmFsH,dir,fn); } + +const cmChar_t* cmFsMakeUserDirFn(const cmChar_t* dir, const cmChar_t* fn ) +{ return cmFileSysMakeUserDirFn(_cmFsH,dir,fn); } + const cmChar_t* cmFsVMakeDir( const cmChar_t* dir, va_list vl ) { return cmFileSysVMakeDir(_cmFsH,dir,vl); } diff --git a/cmFileSys.h b/cmFileSys.h index ec0592a..a067ae6 100644 --- a/cmFileSys.h +++ b/cmFileSys.h @@ -104,6 +104,13 @@ extern "C" { const cmChar_t* cmFileSysMakeDir( cmFileSysH_t h, const cmChar_t* dir, ... ); const cmChar_t* cmFileSysVMakeUserDir( cmFileSysH_t h, const cmChar_t* dir, va_list vl ); const cmChar_t* cmFileSysMakeUserDir( cmFileSysH_t h, const cmChar_t* dir, ... ); + + // Equivalent to same named cmFileSysMake() functions but assumes a single directory prefix and the file name + // extension is attached to 'fn'. + const cmChar_t* cmFileSysMakeDirFn( cmFileSysH_t h, const cmChar_t* dir, const cmChar_t* fn ); + + // Same as cmFileSysMakeDirFn() but prefixes 'dir' with the users home directory. + const cmChar_t* cmFileSysMakeUserDirFn(cmFileSysH_t h, const cmChar_t* dir, const cmChar_t* fn ); // Release the file name created through an earlier call to cmFileSysMakeFn(). void cmFileSysFreeFn( cmFileSysH_t h, const cmChar_t* fn ); @@ -242,6 +249,9 @@ extern "C" { const cmChar_t* cmFsMakeDir( const cmChar_t* dirPrefix, ... ); const cmChar_t* cmFsVMakeUserDir( const cmChar_t* dirPrefix, va_list vl ); const cmChar_t* cmFsMakeUserDir( const cmChar_t* dirPrefix, ... ); + + const cmChar_t* cmFsMakeDirFn( const cmChar_t* dir, const cmChar_t* fn ); + const cmChar_t* cmFsMakeUserDirFn(const cmChar_t* dir, const cmChar_t* fn ); void cmFsFreeFn( const cmChar_t* fn ); cmFsRC_t cmFsGenFn( const cmChar_t* dir, const cmChar_t* prefixStr, const cmChar_t* extStr, const cmChar_t** fnPtr );