diff options
Diffstat (limited to 'src/cd_util.c')
-rw-r--r-- | src/cd_util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cd_util.c b/src/cd_util.c index 20e9a46..e58900a 100644 --- a/src/cd_util.c +++ b/src/cd_util.c @@ -493,3 +493,17 @@ int cdGetFontFileName(const char* font, char* filename) return 1; } + +int cdStrTmpFileName(char* filename) +{ +#ifdef WIN32 + char tmpPath[10240]; + if (GetTempPath(10240, tmpPath)==0) + return 0; + if (GetTempFileName(tmpPath, "~cd", 0, filename)==0) + return 0; + return 1; +#else + return tmpnam(filename)!=NULL; +#endif +} |