From bc9848f7e67c3e695403179f8bcdb78b0e5764a3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Feb 2008 13:55:22 +0000 Subject: Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback. 'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/ --- source/blender/blenlib/BLI_blenlib.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_blenlib.h') diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 4fc4241e6dc..39b679144d5 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -70,7 +70,6 @@ #include "DNA_listBase.h" #include - extern ListBase fillfacebase; extern ListBase fillvertbase; /** @@ -79,6 +78,8 @@ extern ListBase fillvertbase; extern ListBase filledgebase; extern int totblock; +extern char btempdir[]; /* creator.c temp dir used instead of U.tempdir, set with BLI_where_is_temp( btempdir, 1 ); */ + struct chardesc; struct direntry; struct rctf; @@ -257,6 +258,17 @@ void BLI_free_file_lines(struct LinkNode *lines); */ void BLI_where_am_i(char *fullname, const char *name); + /** + * Gets the temp directory when blender first runs. + * If the default path is not found, use try $TEMP + * + * Also make sure the temp dir has a trailing slash + * + * @param fullname The full path to the temp directory + */ +void BLI_where_is_temp(char *fullname, int usertemp); + + /** * determines the full path to the application bundle on OS X * @@ -300,6 +312,7 @@ int BLI_delete(char *file, int dir, int recursive); int BLI_move(char *file, char *to); int BLI_touch(const char *file); char *BLI_last_slash(const char *string); +void BLI_add_slash(char *string); /* BLI_rct.c */ /** -- cgit v1.2.3