Refactor: BLI_path_util (part 2)
authorCampbell Barton <ideasman42@gmail.com>
Sun, 23 Nov 2014 14:54:29 +0000 (15:54 +0100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 23 Nov 2014 17:55:52 +0000 (18:55 +0100)
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util

32 files changed:
source/blender/blenfont/intern/blf_lang.c
source/blender/blenfont/intern/blf_translation.c
source/blender/blenkernel/BKE_appdir.h
source/blender/blenkernel/intern/appdir.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/smoke.c
source/blender/compositor/intern/COM_Debug.cpp
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/resources.c
source/blender/editors/render/render_preview.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/freestyle/intern/application/AppConfig.cpp
source/blender/freestyle/intern/python/BPy_Freestyle.cpp
source/blender/imbuf/intern/colormanagement.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/generic/py_capi_utils.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_interface.c
source/blender/render/intern/source/render_result.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/creator/creator.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp

index 308e0819efeba98b99092fe11d428e711f3d63fb..10614e8ca59a825b4724f4d8d2868a0caa4938fa 100644 (file)
@@ -80,7 +80,7 @@ static void free_locales(void)
 
 static void fill_locales(void)
 {
-       const char * const languages_path = BLI_get_folder(BLENDER_DATAFILES, "locale");
+       const char * const languages_path = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale");
        char languages[FILE_MAX];
        LinkNode *lines = NULL, *line;
        char *str;
@@ -188,7 +188,7 @@ EnumPropertyItem *BLF_RNA_lang_enum_properties(void)
 void BLF_lang_init(void)
 {
 #ifdef WITH_INTERNATIONAL
-       const char * const messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
+       const char * const messagepath = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale");
 
        if (messagepath) {
                bl_locale_init(messagepath, TEXT_DOMAIN_NAME);
index 276c68130c213f3c90ada6829e0cfc10c9a7eb6f..e7d2c14b16f7c3d6e476be72d24f3e87ea99cf51 100644 (file)
@@ -64,7 +64,7 @@ unsigned char *BLF_get_unifont(int *r_unifont_size)
 {
 #ifdef WITH_INTERNATIONAL
        if (unifont_ttf == NULL) {
-               const char * const fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
+               const char * const fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
                if (fontpath) {
                        char unifont_path[1024];
 
@@ -99,7 +99,7 @@ unsigned char *BLF_get_unifont_mono(int *r_unifont_size)
 {
 #ifdef WITH_INTERNATIONAL
        if (unifont_mono_ttf == NULL) {
-               const char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
+               const char *fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
                if (fontpath) {
                        char unifont_path[1024];
 
index 3b2e70ba3e07f99c5dc419163ee6e1078994dd2b..5e42f17be03dfd611e2501bf6410c6d21065aaf1 100644 (file)
  *  \ingroup bli
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const char *BLI_getDefaultDocumentFolder(void);
-
-const char *BLI_get_folder(int folder_id, const char *subfolder);
-const char *BLI_get_folder_create(int folder_id, const char *subfolder);
-const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder);
-const char *BLI_get_folder_version(const int id, const int ver, const bool do_check);
-
+/* note on naming: typical _get() suffix is omitted here,
+ * since its the main purpose of the API. */
+const char *BKE_appdir_folder_default(void);
+const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder);
+const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfolder);
+const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder);
+const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check);
 
 /* Initialize path to program executable */
-void BLI_init_program_path(const char *argv0);
-/* Initialize path to temporary directory.
- * NOTE: On Window userdir will be set to the temporary directory! */
-void BLI_temp_dir_init(char *userdir);
+void        BKE_appdir_program_path_init(const char *argv0);
 
-const char *BLI_program_path(void);
-const char *BLI_program_dir(void);
-const char *BLI_temp_dir_session(void);
-const char *BLI_temp_dir_base(void);
-void BLI_system_temporary_dir(char *dir);
-void BLI_temp_dir_session_purge(void);
+const char *BKE_appdir_program_path(void);
+const char *BKE_appdir_program_dir(void);
 
+/* Initialize path to temporary directory. */
+void        BKE_tempdir_init(char *userdir);
+void        BKE_tempdir_system_init(char *dir);
 
-/* folder_id */
-
-/* general, will find based on user/local/system priority */
-#define BLENDER_DATAFILES           2
+const char *BKE_tempdir_base(void);
+const char *BKE_tempdir_session(void);
+void        BKE_tempdir_session_purge(void);
 
-/* user-specific */
-#define BLENDER_USER_CONFIG         31
-#define BLENDER_USER_DATAFILES      32
-#define BLENDER_USER_SCRIPTS        33
-#define BLENDER_USER_AUTOSAVE       34
 
-/* system */
-#define BLENDER_SYSTEM_DATAFILES    52
-#define BLENDER_SYSTEM_SCRIPTS      53
-#define BLENDER_SYSTEM_PYTHON       54
-
-/* for BLI_get_folder_version only */
-#define BLENDER_RESOURCE_PATH_USER      0
-#define BLENDER_RESOURCE_PATH_LOCAL     1
-#define BLENDER_RESOURCE_PATH_SYSTEM    2
+/* folder_id */
+enum {
+       /* general, will find based on user/local/system priority */
+       BLENDER_DATAFILES           = 2,
+
+       /* user-specific */
+       BLENDER_USER_CONFIG         = 31,
+       BLENDER_USER_DATAFILES      = 32,
+       BLENDER_USER_SCRIPTS        = 33,
+       BLENDER_USER_AUTOSAVE       = 34,
+
+       /* system */
+       BLENDER_SYSTEM_DATAFILES    = 52,
+       BLENDER_SYSTEM_SCRIPTS      = 53,
+       BLENDER_SYSTEM_PYTHON       = 54,
+};
+
+/* for BKE_appdir_folder_id_version only */
+enum {
+       BLENDER_RESOURCE_PATH_USER      = 0,
+       BLENDER_RESOURCE_PATH_LOCAL     = 1,
+       BLENDER_RESOURCE_PATH_SYSTEM    = 2,
+};
 
 #define BLENDER_STARTUP_FILE    "startup.blend"
 #define BLENDER_USERPREF_FILE   "userpref.blend"
@@ -77,9 +77,4 @@ void BLI_temp_dir_session_purge(void);
 #define BLENDER_BOOKMARK_FILE   "bookmarks.txt"
 #define BLENDER_HISTORY_FILE    "recent-files.txt"
 
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif  /* __BKE_APPDIR_H__ */
index 66dc4c113a25947580ad2626bab1a7aa601e6ad2..e37b9a7ef252486e1f5b0fb8e9bf33486ce402ed 100644 (file)
@@ -19,6 +19,8 @@
 
 /** \file blender/blenlib/intern/appdir.c
  *  \ingroup bke
+ *
+ * Access to application level directories.
  */
 
 #include <stdlib.h>
@@ -65,7 +67,7 @@ static char btempdir_session[FILE_MAX] = "";  /* volatile temporary directory */
 /* This is now only used to really get the user's default document folder */
 /* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
  * as default location to save documents */
-const char *BLI_getDefaultDocumentFolder(void)
+const char *BKE_appdir_folder_default(void)
 {
 #ifndef WIN32
        const char * const xdg_documents_dir = getenv("XDG_DOCUMENTS_DIR");
@@ -354,7 +356,7 @@ static bool get_path_system(char *targetpath, const char *folder_name, const cha
 
 /* get a folder out of the 'folder_id' presets for paths */
 /* returns the path if found, NULL string if not */
-const char *BLI_get_folder(int folder_id, const char *subfolder)
+const char *BKE_appdir_folder_id(const int folder_id, const char *subfolder)
 {
        const int ver = BLENDER_VERSION;
        static char path[FILE_MAX] = "";
@@ -408,7 +410,7 @@ const char *BLI_get_folder(int folder_id, const char *subfolder)
 /**
  * Returns the path to a folder in the user area without checking that it actually exists first.
  */
-const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
+const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder)
 {
        const int ver = BLENDER_VERSION;
        static char path[FILE_MAX] = "";
@@ -440,7 +442,7 @@ const char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
 /**
  * Returns the path to a folder in the user area, creating it if it doesn't exist.
  */
-const char *BLI_get_folder_create(int folder_id, const char *subfolder)
+const char *BKE_appdir_folder_id_create(int folder_id, const char *subfolder)
 {
        const char *path;
 
@@ -448,10 +450,10 @@ const char *BLI_get_folder_create(int folder_id, const char *subfolder)
        if (!ELEM(folder_id, BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG, BLENDER_USER_SCRIPTS, BLENDER_USER_AUTOSAVE))
                return NULL;
        
-       path = BLI_get_folder(folder_id, subfolder);
+       path = BKE_appdir_folder_id(folder_id, subfolder);
        
        if (!path) {
-               path = BLI_get_user_folder_notest(folder_id, subfolder);
+               path = BKE_appdir_folder_id_user_notest(folder_id, subfolder);
                if (path) BLI_dir_create_recursive(path);
        }
        
@@ -462,11 +464,11 @@ const char *BLI_get_folder_create(int folder_id, const char *subfolder)
  * Returns the path of the top-level version-specific local, user or system directory.
  * If do_check, then the result will be NULL if the directory doesn't exist.
  */
-const char *BLI_get_folder_version(const int id, const int ver, const bool do_check)
+const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check)
 {
        static char path[FILE_MAX] = "";
        bool ok;
-       switch (id) {
+       switch (folder_id) {
                case BLENDER_RESOURCE_PATH_USER:
                        ok = get_path_user(path, NULL, NULL, NULL, ver);
                        break;
@@ -648,7 +650,7 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name
        }
 }
 
-void BLI_init_program_path(const char *argv0)
+void BKE_appdir_program_path_init(const char *argv0)
 {
        bli_where_am_i(bprogname, sizeof(bprogname), argv0);
        BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir));
@@ -657,7 +659,7 @@ void BLI_init_program_path(const char *argv0)
 /**
  * Path to executable
  */
-const char *BLI_program_path(void)
+const char *BKE_appdir_program_path(void)
 {
        return bprogname;
 }
@@ -665,7 +667,7 @@ const char *BLI_program_path(void)
 /**
  * Path to directory of executable
  */
-const char *BLI_program_dir(void)
+const char *BKE_appdir_program_dir(void)
 {
        return bprogdir;
 }
@@ -684,7 +686,7 @@ const char *BLI_program_dir(void)
 static void BLI_where_is_temp(char *fullname, char *basename, const size_t maxlen, char *userdir)
 {
        /* Clear existing temp dir, if needed. */
-       BLI_temp_dir_session_purge();
+       BKE_tempdir_session_purge();
 
        fullname[0] = '\0';
        if (basename) {
@@ -764,8 +766,10 @@ static void BLI_where_is_temp(char *fullname, char *basename, const size_t maxle
  * Sets btempdir_base to userdir if specified and is a valid directory, otherwise
  * chooses a suitable OS-specific temporary directory.
  * Sets btempdir_session to a mkdtemp-generated sub-dir of btempdir_base.
+ *
+ * \note On Window userdir will be set to the temporary directory!
  */
-void BLI_temp_dir_init(char *userdir)
+void BKE_tempdir_init(char *userdir)
 {
        BLI_where_is_temp(btempdir_session, btempdir_base, FILE_MAX, userdir);
 ;
@@ -774,15 +778,15 @@ void BLI_temp_dir_init(char *userdir)
 /**
  * Path to temporary directory (with trailing slash)
  */
-const char *BLI_temp_dir_session(void)
+const char *BKE_tempdir_session(void)
 {
-       return btempdir_session[0] ? btempdir_session : BLI_temp_dir_base();
+       return btempdir_session[0] ? btempdir_session : BKE_tempdir_base();
 }
 
 /**
  * Path to persistent temporary directory (with trailing slash)
  */
-const char *BLI_temp_dir_base(void)
+const char *BKE_tempdir_base(void)
 {
        return btempdir_base;
 }
@@ -790,7 +794,7 @@ const char *BLI_temp_dir_base(void)
 /**
  * Path to the system temporary directory (with trailing slash)
  */
-void BLI_system_temporary_dir(char *dir)
+void BKE_tempdir_system_init(char *dir)
 {
        BLI_where_is_temp(dir, NULL, FILE_MAX, NULL);
 }
@@ -798,7 +802,7 @@ void BLI_system_temporary_dir(char *dir)
 /**
  * Delete content of this instance's temp dir.
  */
-void BLI_temp_dir_session_purge(void)
+void BKE_tempdir_session_purge(void)
 {
        if (btempdir_session[0] && BLI_is_dir(btempdir_session)) {
                BLI_delete(btempdir_session, true, true);
index 17dc2574bf798f5de07a675be488740b66e30ae1..66bd31cfdb4940ccd0cc4009c8855c6bd58dcad5 100644 (file)
@@ -688,7 +688,7 @@ void BKE_write_undo(bContext *C, const char *name)
                counter = counter % U.undosteps;
        
                BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
-               BLI_make_file_string("/", filepath, BLI_temp_dir_session(), numstr);
+               BLI_make_file_string("/", filepath, BKE_tempdir_session(), numstr);
        
                /* success = */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
                
index 295243a361e5810138da35f98b9be6dd394413d1..79c7128494512f87f3d0c852527ebfc62636221f 100644 (file)
@@ -714,7 +714,7 @@ const char *modifier_path_relbase(Object *ob)
        else {
                /* last resort, better then using "" which resolves to the current
                 * working directory */
-               return BLI_temp_dir_session();
+               return BKE_tempdir_session();
        }
 }
 
@@ -724,7 +724,7 @@ void modifier_path_init(char *path, int path_maxlen, const char *name)
        /* elubie: changed this to default to the same dir as the render output
         * to prevent saving to C:\ on Windows */
        BLI_join_dirfile(path, path_maxlen,
-                        G.relbase_valid ? "//" : BLI_temp_dir_session(),
+                        G.relbase_valid ? "//" : BKE_tempdir_session(),
                         name);
 }
 
index 46b68448550728aad0999f6bda56fac44f1f736a..13eca4bebf47736d5d1d0f04dd8258eb390c2407 100644 (file)
@@ -1470,7 +1470,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
        
        /* use the temp path. this is weak but better then not using point cache at all */
        /* temporary directory is assumed to exist and ALWAYS has a trailing slash */
-       BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH, BLI_temp_dir_session());
+       BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH, BKE_tempdir_session());
        
        return BLI_add_slash(filename); /* new strlen() */
 }
index 37d0bd1798c09ff3e7a61bdfb26a120550051b5f..fb6f99b83258c286dffc6593976cadceb1f2b5ff 100644 (file)
@@ -206,7 +206,7 @@ void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[
        /* smoke_turbulence_init uses non-threadsafe functions from fftw3 lib (like fftw_plan & co). */
        BLI_lock_thread(LOCK_FFTW);
 
-       sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, BLI_temp_dir_session(), use_fire, use_colors);
+       sds->wt = smoke_turbulence_init(res, sds->amplify + 1, sds->noise, BKE_tempdir_session(), use_fire, use_colors);
 
        BLI_unlock_thread(LOCK_FFTW);
 
index 470f8fd2ef76167d45d37aceda57e293b70cbff0..af693ea914934794814ce54c6b840a41365cdeb8 100644 (file)
@@ -398,7 +398,7 @@ void DebugInfo::graphviz(const ExecutionSystem *system)
                char filename[FILE_MAX];
                
                BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index);
-               BLI_join_dirfile(filename, sizeof(filename), BLI_temp_dir_session(), basename);
+               BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename);
                ++m_file_index;
                
                FILE *fp = BLI_fopen(filename, "wb");
index 3bb037901c3dcd28ea3ad879fadeb3fabaff30ed..517b8b61ac1f08d3e7ea48147decda6d8fb82eb0 100644 (file)
@@ -588,7 +588,7 @@ static void init_internal_icons(void)
 
 #if 0 // temp disabled
        if ((btheme != NULL) && btheme->tui.iconfile[0]) {
-               char *icondir = BLI_get_folder(BLENDER_DATAFILES, "icons");
+               char *icondir = BKE_appdir_folder_id(BLENDER_DATAFILES, "icons");
                char iconfilestr[FILE_MAX];
                
                if (icondir) {
@@ -703,7 +703,7 @@ static void init_iconfile_list(struct ListBase *list)
        const char *icondir;
 
        BLI_listbase_clear(list);
-       icondir = BLI_get_folder(BLENDER_DATAFILES, "icons");
+       icondir = BKE_appdir_folder_id(BLENDER_DATAFILES, "icons");
 
        if (icondir == NULL)
                return;
index 3af978db19ad71d1793a82500882fb19cdda1222..945b2f4e925c0f3eba88597ee3bf6bb2fcd14a0b 100644 (file)
@@ -1535,7 +1535,7 @@ void init_userdef_do_versions(void)
        }
        if (U.mixbufsize == 0) U.mixbufsize = 2048;
        if (strcmp(U.tempdir, "/") == 0) {
-               BLI_system_temporary_dir(U.tempdir);
+               BKE_tempdir_system_init(U.tempdir);
        }
        if (U.autokey_mode == 0) {
                /* 'add/replace' but not on */
index 7398ed6d75947b8c594bfb5bb21328c5fa896d09..a669a1ccae9903204b8121d4bac5515a7a4971bd 100644 (file)
@@ -122,7 +122,7 @@ ImBuf *get_brush_icon(Brush *brush)
 
                                // otherwise lets try to find it in other directories
                                if (!(brush->icon_imbuf)) {
-                                       folder = BLI_get_folder(BLENDER_DATAFILES, "brushicons");
+                                       folder = BKE_appdir_folder_id(BLENDER_DATAFILES, "brushicons");
 
                                        BLI_make_file_string(G.main->name, path, folder, brush->icon_filepath);
 
index 9d6068047af32ed081a82f0864e7a6c20a26f969..df3f989c3a2749861e15dc4495c85bd559e35962 100644 (file)
@@ -473,7 +473,7 @@ static int bookmark_add_exec(bContext *C, wmOperator *UNUSED(op))
                char name[FILE_MAX];
        
                fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, FS_INSERT_SAVE);
-               BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+               BLI_make_file_string("/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
                fsmenu_write_file(fsmenu, name);
        }
 
@@ -505,7 +505,7 @@ static int bookmark_delete_exec(bContext *C, wmOperator *op)
                        char name[FILE_MAX];
                        
                        fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index);
-                       BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+                       BLI_make_file_string("/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
                        fsmenu_write_file(fsmenu, name);
                        ED_area_tag_redraw(sa);
                }
@@ -541,7 +541,7 @@ static int reset_recent_exec(bContext *C, wmOperator *UNUSED(op))
        while (fsmenu_get_entry(fsmenu, FS_CATEGORY_RECENT, 0) != NULL) {
                fsmenu_remove_entry(fsmenu, FS_CATEGORY_RECENT, 0);
        }
-       BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+       BLI_make_file_string("/", name, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
        fsmenu_write_file(fsmenu, name);
        ED_area_tag_redraw(sa);
                
@@ -822,7 +822,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
                        fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir, FS_INSERT_SAVE | FS_INSERT_FIRST);
                }
 
-               BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
+               BLI_make_file_string(G.main->name, filepath, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
                fsmenu_write_file(fsmenu_get(), filepath);
                WM_event_fileselect_event(wm, op, EVT_FILESELECT_EXEC);
 
@@ -1198,7 +1198,7 @@ static void file_expand_directory(bContext *C)
                else if (sfile->params->dir[0] == '~') {
                        char tmpstr[sizeof(sfile->params->dir) - 1];
                        BLI_strncpy(tmpstr, sfile->params->dir + 1, sizeof(tmpstr));
-                       BLI_join_dirfile(sfile->params->dir, sizeof(sfile->params->dir), BLI_getDefaultDocumentFolder(), tmpstr);
+                       BLI_join_dirfile(sfile->params->dir, sizeof(sfile->params->dir), BKE_appdir_folder_default(), tmpstr);
                }
 
                else if (sfile->params->dir[0] == '\0')
index 04d270f5ed1449f51674d5586ef31f798f6fda78..bdeb6e337d2c16199aeceb4544fa6fff7feb4075 100644 (file)
@@ -254,7 +254,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                        BLI_split_dir_part(G.main->name, sfile->params->dir, sizeof(sfile->params->dir));
                }
                else {
-                       const char *doc_path = BLI_getDefaultDocumentFolder();
+                       const char *doc_path = BKE_appdir_folder_default();
                        if (doc_path) {
                                BLI_strncpy(sfile->params->dir, doc_path, sizeof(sfile->params->dir));
                        }
index f046ac7cdb3410793a1b8bb27a4360d46b4b638e..4ab9bc6a849ec4d930280bc1d5e6ee714f074e3b 100644 (file)
@@ -367,7 +367,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
 
                /* As 10.4 doesn't provide proper API to retrieve the favorite places,
                 * assume they are the standard ones 
-                * TODO : replace hardcoded paths with proper BLI_get_folder calls */
+                * TODO : replace hardcoded paths with proper BKE_appdir_folder_id calls */
                home = getenv("HOME");
                if (read_bookmarks && home) {
                        BLI_snprintf(line, sizeof(line), "%s/", home);
index bda5aa865cdea45a75dec8487a316542e6c4d246..dc41a781170a2b677a9a6a6f575ed23596b1a4ae 100644 (file)
@@ -657,7 +657,7 @@ void ED_file_exit(void)
 
 void ED_file_read_bookmarks(void)
 {
-       const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
+       const char * const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL);
        
        fsmenu_free();
 
index 5aceeed20d76b710fd834ad8a98fd8d05b6042e5..5df348408dfee4eba1edce94b8bb82c19bccfe21 100644 (file)
@@ -78,7 +78,7 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
        
-       BLI_make_file_string("/", str, BLI_temp_dir_base(), "copybuffer.blend");
+       BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend");
        BKE_copybuffer_save(str, op->reports);
        
        BKE_report(op->reports, RPT_INFO, "Copied selected objects to buffer");
@@ -103,7 +103,7 @@ static int view3d_pastebuffer_exec(bContext *C, wmOperator *op)
 {
        char str[FILE_MAX];
 
-       BLI_make_file_string("/", str, BLI_temp_dir_base(), "copybuffer.blend");
+       BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend");
        if (BKE_copybuffer_paste(C, str, op->reports)) {
                WM_event_add_notifier(C, NC_WINDOW, NULL);
 
index 6da7dbea3e681592348ac2f4f01452702e45b46b..44f8e9b135e8f924cc51b6f5341ed8f4622c623d 100644 (file)
@@ -43,7 +43,7 @@ Path::Path()
 {
        // get the root directory
        // soc
-       setRootDir(BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL));
+       setRootDir(BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL));
 
        _pInstance = this;
 }
index c7be8b1dd17ac444fb57fa7716e48b51e3c51ae8..ee0e7dfab3e16d34b9c68c43daf95574b90b83ec 100644 (file)
@@ -493,7 +493,7 @@ PyObject *Freestyle_Init(void)
        PyDict_SetItemString(PySys_GetObject("modules"), module_definition.m_name, module);
 
        // update 'sys.path' for Freestyle Python API modules
-       const char * const path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "freestyle");
+       const char * const path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "freestyle");
        if (path) {
                char modpath[FILE_MAX];
                BLI_join_dirfile(modpath, sizeof(modpath), path, "modules");
index 69c5b24bda0a6989f4e07ada63b823cca461d01a..de092446ca93d28475ae1c332ebf2a168cf29d0c 100644 (file)
@@ -625,7 +625,7 @@ void colormanagement_init(void)
        }
 
        if (config == NULL) {
-               configdir = BLI_get_folder(BLENDER_DATAFILES, "colormanagement");
+               configdir = BKE_appdir_folder_id(BLENDER_DATAFILES, "colormanagement");
 
                if (configdir) {
                        BLI_join_dirfile(configfile, sizeof(configfile), configdir, BCM_CONFIG_FILE);
index a77f4dbe3fe4b663474c000230ac1313bc2d4933..905ca5f33956783a63599af4f2e6b8a3ea55f077 100644 (file)
@@ -415,7 +415,7 @@ static void rna_userdef_pathcompare_remove(ReportList *reports, PointerRNA *path
 
 static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
 {
-       BLI_temp_dir_init(U.tempdir);
+       BKE_tempdir_init(U.tempdir);
 }
 
 static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
index 36ae30ada228553d54d05d9cc21fd071726f4e18..26deaf8d0338e684c28c09b43f054ceac163eec3 100644 (file)
@@ -568,7 +568,7 @@ void PyC_MainModule_Restore(PyObject *main_mod)
        Py_XDECREF(main_mod);
 }
 
-/* must be called before Py_Initialize, expects output of BLI_get_folder(BLENDER_PYTHON, NULL) */
+/* must be called before Py_Initialize, expects output of BKE_appdir_folder_id(BLENDER_PYTHON, NULL) */
 void PyC_SetHomePath(const char *py_path_bundle)
 {
        if (py_path_bundle == NULL) {
index 7ffca8c06ea5720eac01f56ceb7c14c79bbaaed6..d7c07df0c99c79a8351e1b0c9c99854c34392eff 100644 (file)
@@ -82,11 +82,11 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self))
        PyObject *item;
        const char *path;
 
-       path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL);
+       path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL);
        item = PyC_UnicodeFromByte(path ? path : "");
        BLI_assert(item != NULL);
        PyTuple_SET_ITEM(ret, 0, item);
-       path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL);
+       path = BKE_appdir_folder_id(BLENDER_USER_SCRIPTS, NULL);
        item = PyC_UnicodeFromByte(path ? path : "");
        BLI_assert(item != NULL);
        PyTuple_SET_ITEM(ret, 1, item);
@@ -168,11 +168,11 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj
                return NULL;
        }
        
-       /* same logic as BLI_get_folder_create(), but best leave it up to the script author to create */
-       path = BLI_get_folder(folder_id, subdir);
+       /* same logic as BKE_appdir_folder_id_create(), but best leave it up to the script author to create */
+       path = BKE_appdir_folder_id(folder_id, subdir);
 
        if (!path)
-               path = BLI_get_user_folder_notest(folder_id, subdir);
+               path = BKE_appdir_folder_id_user_notest(folder_id, subdir);
 
        return PyC_UnicodeFromByte(path ? path : "");
 }
@@ -211,7 +211,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj
                return NULL;
        }
 
-       path = BLI_get_folder_version(folder_id, (major * 100) + minor, false);
+       path = BKE_appdir_folder_id_version(folder_id, (major * 100) + minor, false);
 
        return PyC_UnicodeFromByte(path ? path : "");
 }
@@ -296,7 +296,7 @@ void BPy_init_modules(void)
        PyObject *mod;
 
        /* Needs to be first since this dir is needed for future modules */
-       const char * const modpath = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules");
+       const char * const modpath = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "modules");
        if (modpath) {
                // printf("bpy: found module path '%s'.\n", modpath);
                PyObject *sys_path = PySys_GetObject("path"); /* borrow */
index ae1443cd949015f631ba23e28db3b41b6948567d..7e943b2f4bf93bd4b3def8e91fd5b5bd4e4d08fa 100644 (file)
@@ -136,7 +136,7 @@ static PyObject *make_app_info(void)
 
        SetStrItem(STRINGIFY(BLENDER_VERSION_CHAR));
        SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));
-       SetStrItem(BLI_program_path());
+       SetStrItem(BKE_appdir_program_path());
        SetObjItem(PyBool_FromLong(G.background));
 
        /* build info, use bytes since we can't assume _any_ encoding:
@@ -251,7 +251,7 @@ PyDoc_STRVAR(bpy_app_tempdir_doc,
 );
 static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure))
 {
-       return PyC_UnicodeFromByte(BLI_temp_dir_session());
+       return PyC_UnicodeFromByte(BKE_tempdir_session());
 }
 
 PyDoc_STRVAR(bpy_app_driver_dict_doc,
index fed726259663d14f2e432b73fbc5a95461b4aae7..5b4db89a41a3fb2926df2ba6cfaa857f49e9d2e5 100644 (file)
@@ -244,11 +244,11 @@ void BPY_python_start(int argc, const char **argv)
 {
 #ifndef WITH_PYTHON_MODULE
        PyThreadState *py_tstate = NULL;
-       const char *py_path_bundle = BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL);
+       const char *py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, NULL);
 
        /* not essential but nice to set our name */
        static wchar_t program_path_wchar[FILE_MAX]; /* python holds a reference */
-       BLI_strncpy_wchar_from_utf8(program_path_wchar, BLI_program_path(), ARRAY_SIZE(program_path_wchar));
+       BLI_strncpy_wchar_from_utf8(program_path_wchar, BKE_appdir_program_path(), ARRAY_SIZE(program_path_wchar));
        Py_SetProgramName(program_path_wchar);
 
        /* must run before python initializes */
index 7b25cbae6adf0f1297b2620c9e13eda85769cc55..55f3007e7f71c570b8418cf21c22f0f6118faa3f 100644 (file)
@@ -1073,7 +1073,7 @@ void render_result_exr_file_path(Scene *scene, const char *layname, int sample,
                BLI_snprintf(name, sizeof(name), "%s_%s_%s%d.exr", fi, scene->id.name + 2, layname, sample);
        }
 
-       BLI_make_file_string("/", filepath, BLI_temp_dir_session(), name);
+       BLI_make_file_string("/", filepath, BKE_tempdir_session(), name);
 }
 
 /* only for temp buffer, makes exact copy of render result */
@@ -1164,14 +1164,14 @@ static void render_result_exr_file_cache_path(Scene *sce, const char *root, char
                BLI_hash_md5_buffer(G.main->name, strlen(G.main->name), path_digest);
        }
        else {
-               BLI_strncpy(dirname, BLI_temp_dir_base(), sizeof(dirname));
+               BLI_strncpy(dirname, BKE_tempdir_base(), sizeof(dirname));
                BLI_strncpy(filename, "UNSAVED", sizeof(filename));
        }
        BLI_hash_md5_to_hexdigest(path_digest, path_hexdigest);
 
        /* Default to *non-volatile* tmp dir. */
        if (*root == '\0') {
-               root = BLI_temp_dir_base();
+               root = BKE_tempdir_base();
        }
 
        BLI_snprintf(filename_full, sizeof(filename_full), "cached_RR_%s_%s_%s.exr",
index baf2d322db0a80d16ddb26c6e8d4188529101ef5..d7e0a2f228a33bc0aa88e8738e1565d50e82531a 100644 (file)
@@ -320,7 +320,7 @@ static void wm_init_userdef(bContext *C, const bool from_memory)
        }
 
        /* update tempdir from user preferences */
-       BLI_temp_dir_init(U.tempdir);
+       BKE_tempdir_init(U.tempdir);
 
        BKE_userdef_state();
 }
@@ -569,7 +569,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
 
        G.relbase_valid = 0;
        if (!from_memory) {
-               const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
+               const char * const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL);
                if (custom_file) {
                        BLI_strncpy(startstr, custom_file, FILE_MAX);
 
@@ -615,7 +615,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
                if (BLI_listbase_is_empty(&wmbase)) {
                        wm_clear_default_size(C);
                }
-               BLI_temp_dir_init(U.tempdir);
+               BKE_tempdir_init(U.tempdir);
 
 #ifdef WITH_PYTHON_SECURITY
                /* use alternative setting for security nuts
@@ -728,7 +728,7 @@ void wm_read_history(void)
        struct RecentFile *recent;
        const char *line;
        int num;
-       const char * const cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
+       const char * const cfgdir = BKE_appdir_folder_id(BLENDER_USER_CONFIG, NULL);
 
        if (!cfgdir) return;
 
@@ -765,7 +765,7 @@ static void write_history(void)
                return;
        
        /* will be NULL in background mode */
-       user_config_dir = BLI_get_folder_create(BLENDER_USER_CONFIG, NULL);
+       user_config_dir = BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL);
        if (!user_config_dir)
                return;
 
@@ -1025,7 +1025,7 @@ int wm_homefile_write_exec(bContext *C, wmOperator *op)
        /* update keymaps in user preferences */
        WM_keyconfig_update(wm);
        
-       BLI_make_file_string("/", filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE);
+       BLI_make_file_string("/", filepath, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE);
        printf("trying to save homefile at %s ", filepath);
        
        ED_editors_flush_edits(C, false);
@@ -1056,7 +1056,7 @@ int wm_userpref_write_exec(bContext *C, wmOperator *op)
        /* update keymaps in user preferences */
        WM_keyconfig_update(wm);
        
-       BLI_make_file_string("/", filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_USERPREF_FILE);
+       BLI_make_file_string("/", filepath, BKE_appdir_folder_id_create(BLENDER_USER_CONFIG, NULL), BLENDER_USERPREF_FILE);
        printf("trying to save userpref at %s ", filepath);
        
        if (BKE_write_file_userdef(filepath, op->reports) == 0) {
@@ -1097,14 +1097,14 @@ void wm_autosave_location(char *filepath)
         * BLI_make_file_string will create string that has it most likely on C:\
         * through get_default_root().
         * If there is no C:\tmp autosave fails. */
-       if (!BLI_exists(BLI_temp_dir_base())) {
-               savedir = BLI_get_folder_create(BLENDER_USER_AUTOSAVE, NULL);
+       if (!BLI_exists(BKE_tempdir_base())) {
+               savedir = BKE_appdir_folder_id_create(BLENDER_USER_AUTOSAVE, NULL);
                BLI_make_file_string("/", filepath, savedir, path);
                return;
        }
 #endif
 
-       BLI_make_file_string("/", filepath, BLI_temp_dir_base(), path);
+       BLI_make_file_string("/", filepath, BKE_tempdir_base(), path);
 }
 
 void WM_autosave_init(wmWindowManager *wm)
@@ -1168,7 +1168,7 @@ void wm_autosave_delete(void)
 
        if (BLI_exists(filename)) {
                char str[FILE_MAX];
-               BLI_make_file_string("/", str, BLI_temp_dir_base(), BLENDER_QUIT_FILE);
+               BLI_make_file_string("/", str, BKE_tempdir_base(), BLENDER_QUIT_FILE);
 
                /* if global undo; remove tempsave, otherwise rename */
                if (U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, false, false);
index aa93f1039910ab67abe341d0d761ece379a22273..6926251634b80c88663f4b6876873b152082937c 100644 (file)
@@ -220,7 +220,7 @@ void WM_init(bContext *C, int argc, const char **argv)
        /* allow a path of "", this is what happens when making a new file */
 #if 0
        if (G.main->name[0] == 0)
-               BLI_make_file_string("/", G.main->name, BLI_getDefaultDocumentFolder(), "untitled.blend");
+               BLI_make_file_string("/", G.main->name, BKE_appdir_folder_default(), "untitled.blend");
 #endif
 
        BLI_strncpy(G.lib, G.main->name, FILE_MAX);
@@ -415,7 +415,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
                                bool has_edited;
                                int fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN | G_FILE_HISTORY);
 
-                               BLI_make_file_string("/", filename, BLI_temp_dir_base(), BLENDER_QUIT_FILE);
+                               BLI_make_file_string("/", filename, BKE_tempdir_base(), BLENDER_QUIT_FILE);
 
                                has_edited = ED_editors_flush_edits(C, false);
 
@@ -544,7 +544,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
        }
        wm_autosave_delete();
 
-       BLI_temp_dir_session_purge();
+       BKE_tempdir_session_purge();
 }
 
 void WM_exit(bContext *C)
index 3c2850ee282f1857b304b81416b889ed25d12dd4..598175a19521a9feff2eeceab38cc126b56665f8 100644 (file)
@@ -1777,14 +1777,14 @@ static void wm_block_splash_refreshmenu(bContext *UNUSED(C), void *UNUSED(arg_bl
 static int wm_resource_check_prev(void)
 {
 
-       const char *res = BLI_get_folder_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION, true);
+       const char *res = BKE_appdir_folder_id_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION, true);
 
        // if (res) printf("USER: %s\n", res);
 
 #if 0 /* ignore the local folder */
        if (res == NULL) {
                /* with a local dir, copying old files isn't useful since local dir get priority for config */
-               res = BLI_get_folder_version(BLENDER_RESOURCE_PATH_LOCAL, BLENDER_VERSION, true);
+               res = BKE_appdir_folder_id_version(BLENDER_RESOURCE_PATH_LOCAL, BLENDER_VERSION, true);
        }
 #endif
 
@@ -1793,7 +1793,7 @@ static int wm_resource_check_prev(void)
                return false;
        }
        else {
-               return (BLI_get_folder_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION - 1, true) != NULL);
+               return (BKE_appdir_folder_id_version(BLENDER_RESOURCE_PATH_USER, BLENDER_VERSION - 1, true) != NULL);
        }
 }
 
@@ -2688,7 +2688,7 @@ void WM_recover_last_session(bContext *C, ReportList *reports)
 {
        char filepath[FILE_MAX];
        
-       BLI_make_file_string("/", filepath, BLI_temp_dir_base(), BLENDER_QUIT_FILE);
+       BLI_make_file_string("/", filepath, BKE_tempdir_base(), BLENDER_QUIT_FILE);
        /* if reports==NULL, it's called directly without operator, we add a quick check here */
        if (reports || BLI_exists(filepath)) {
                G.fileflags |= G_FILE_RECOVER;
index 223c299d3bbd77c1f12688799be71d9548e7c436..f7ad38623d47baaa6cc3516ebd2936f9f931ebe9 100644 (file)
@@ -523,7 +523,7 @@ static void blender_crash_handler(int signum)
                char fname[FILE_MAX];
 
                if (!G.main->name[0]) {
-                       BLI_make_file_string("/", fname, BLI_temp_dir_base(), "crash.blend");
+                       BLI_make_file_string("/", fname, BKE_tempdir_base(), "crash.blend");
                }
                else {
                        BLI_strncpy(fname, G.main->name, sizeof(fname));
@@ -544,10 +544,10 @@ static void blender_crash_handler(int signum)
        char fname[FILE_MAX];
 
        if (!G.main->name[0]) {
-               BLI_join_dirfile(fname, sizeof(fname), BLI_temp_dir_base(), "blender.crash.txt");
+               BLI_join_dirfile(fname, sizeof(fname), BKE_tempdir_base(), "blender.crash.txt");
        }
        else {
-               BLI_join_dirfile(fname, sizeof(fname), BLI_temp_dir_base(), BLI_path_basename(G.main->name));
+               BLI_join_dirfile(fname, sizeof(fname), BKE_tempdir_base(), BLI_path_basename(G.main->name));
                BLI_replace_extension(fname, sizeof(fname), ".crash.txt");
        }
 
@@ -579,7 +579,7 @@ static void blender_crash_handler(int signum)
        }
 
        /* Delete content of temp dir! */
-       BLI_temp_dir_session_purge();
+       BKE_tempdir_session_purge();
 
        /* really crash */
        signal(signum, SIG_DFL);
@@ -1557,7 +1557,7 @@ int main(
 #endif
 
        /* initialize path to executable */
-       BLI_init_program_path(argv[0]);
+       BKE_appdir_program_path_init(argv[0]);
 
        BLI_threadapi_init();
 
@@ -1636,7 +1636,7 @@ int main(
 
                /* this is properly initialized with user defs, but this is default */
                /* call after loading the startup.blend so we can read U.tempdir */
-               BLI_temp_dir_init(U.tempdir);
+               BKE_tempdir_init(U.tempdir);
        }
        else {
 #ifndef WITH_PYTHON_MODULE
@@ -1646,7 +1646,7 @@ int main(
                WM_init(C, argc, (const char **)argv);
 
                /* don't use user preferences temp dir */
-               BLI_temp_dir_init(NULL);
+               BKE_tempdir_init(NULL);
        }
 #ifdef WITH_PYTHON
        /**
index 685895a73011f7c85051df8121fd7b45b3b2e383..3e87b4a06d5d454edda0e311d43d400432e31677 100644 (file)
@@ -431,8 +431,8 @@ int main(int argc, char** argv)
        sdlewInit();
 #endif
 
-       BLI_init_program_path(argv[0]);
-       BLI_temp_dir_init(NULL);
+       BKE_appdir_program_path_init(argv[0]);
+       BKE_tempdir_init(NULL);
        
        // We don't use threads directly in the BGE, but we need to call this so things like
        // freeing up GPU_Textures works correctly.
@@ -871,7 +871,7 @@ int main(int argc, char** argv)
                                                }
                                        }
                                        else {
-                                               bfd = load_game_data(BLI_program_path(), filename[0]? filename: NULL);
+                                               bfd = load_game_data(BKE_appdir_program_path(), filename[0]? filename: NULL);
                                        }
 
 #if defined(DEBUG)
@@ -1143,7 +1143,7 @@ int main(int argc, char** argv)
                MEM_printmemlist();
        }
 
-       BLI_temp_dir_session_purge();
+       BKE_tempdir_session_purge();
 
        return error ? -1 : 0;
 }
index 1479b5d584a7b964b381322d0516dc71212ef6c2..3ddd53b971f94b5092ae2cfc63a8475e36786d89 100644 (file)
@@ -130,6 +130,8 @@ extern "C" {
 #include "DNA_scene_types.h"
 
 #include "PHY_IPhysicsEnvironment.h"
+
+extern "C" {
 #include "BKE_main.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
@@ -137,6 +139,7 @@ extern "C" {
 #include "BLI_blenlib.h"
 #include "GPU_material.h"
 #include "MEM_guardedalloc.h"
+}
 
 /* for converting new scenes */
 #include "KX_BlenderSceneConverter.h"
@@ -2072,7 +2075,7 @@ PyObject *initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
         * somehow it remembers the sys.path - Campbell
         */
        static bool first_time = true;
-       const char * const py_path_bundle   = BLI_get_folder(BLENDER_SYSTEM_PYTHON, NULL);
+       const char * const py_path_bundle = BKE_appdir_folder_id(BLENDER_SYSTEM_PYTHON, NULL);
 
 #if 0 // TODO - py3
        STR_String pname = progname;