== installation paths ==
[blender-staging.git] / source / blender / blenlib / intern / path_util.c
index c1e0059e954d9a5a567b27f9bf7b390bbeadcc9b..6ab7ba2a7a581da6d0141c73d45a625ae52546ce 100644 (file)
@@ -795,121 +795,6 @@ char *BLI_gethome(void) {
        #endif
 }
 
-/* this function returns the path to a blender folder, if it exists
- * utility functions for BLI_gethome_folder */
-
-// #define PATH_DEBUG /* for testing paths that are checked */
-
-static int test_data_path(char *targetpath, char *path_base, char *path_sep, char *folder_name)
-{
-       char tmppath[FILE_MAXDIR];
-       
-       if(path_sep)    BLI_join_dirfile(tmppath, path_base, path_sep);
-       else                    BLI_strncpy(tmppath, path_base, sizeof(tmppath));
-       
-       BLI_make_file_string("/", targetpath, tmppath, folder_name);
-       
-       if (BLI_is_dir(targetpath)) {
-#ifdef PATH_DEBUG
-               printf("\tpath found: %s\n", targetpath);
-#endif
-               return 1;
-       }
-       else {
-#ifdef PATH_DEBUG
-               printf("\tpath missing: %s\n", targetpath);
-#endif
-               targetpath[0] = '\0';
-               return 0;
-       }
-}
-
-static int gethome_path_local(char *targetpath, char *folder_name)
-{
-       extern char bprogname[]; /* argv[0] from creator.c */
-       char bprogdir[FILE_MAXDIR];
-       char cwd[FILE_MAXDIR];
-       char *s;
-       int i;
-       
-#ifdef PATH_DEBUG
-       printf("gethome_path_local...\n");
-#endif
-       
-       /* try release/folder_name (binary relative) */
-       /* use argv[0] (bprogname) to get the path to the executable */
-       s = BLI_last_slash(bprogname);
-       i = s - bprogname + 1;
-       BLI_strncpy(bprogdir, bprogname, i);
-
-       /* try release/folder_name (BIN relative) */
-       if(test_data_path(targetpath, bprogdir, "release", folder_name))
-               return 1;
-
-       /* try release/folder_name (CWD relative) */
-       if(test_data_path(targetpath, BLI_getwdN(cwd), "release", folder_name))
-               return 1;
-
-       /* try ./.blender/folder_name */
-       if(test_data_path(targetpath, bprogdir, ".blender", folder_name))
-               return 1;
-       
-       return 0;
-}
-
-static int gethome_path_user(char *targetpath, char *folder_name)
-{
-       char *home_path= BLI_gethome();
-
-#ifdef PATH_DEBUG
-       printf("gethome_path_user...\n");
-#endif
-       
-       /* try $HOME/folder_name */
-       return test_data_path(targetpath, home_path, ".blender", folder_name);
-}
-
-static int gethome_path_system(char *targetpath, char *folder_name)
-{
-       extern char blender_path[]; /* unix prefix eg. /usr/share/blender/2.5 creator.c */
-       
-       if(!blender_path[0])
-               return 0;
-       
-#ifdef PATH_DEBUG
-       printf("gethome_path_system...\n");
-#endif
-       
-       /* try $BLENDERPATH/folder_name */
-       return test_data_path(targetpath, blender_path, NULL, folder_name);
-}
-
-char *BLI_gethome_folder(char *folder_name, int flag)
-{
-       static char fulldir[FILE_MAXDIR] = "";
-       
-       /* first check if this is a redistributable bundle */
-       if(flag & BLI_GETHOME_LOCAL) {
-               if (gethome_path_local(fulldir, folder_name))
-                       return fulldir;
-       }
-
-       /* then check if the OS has blender data files installed in a global location */
-       if(flag & BLI_GETHOME_SYSTEM) {
-               if (gethome_path_system(fulldir, folder_name))
-                       return fulldir;
-       }
-       
-       /* now check the users home dir for data files */
-       if(flag & BLI_GETHOME_USER) {
-               if (gethome_path_user(fulldir, folder_name))
-                       return fulldir;
-       }
-       
-       return NULL;
-}
-
-
 /* NEW stuff, to be cleaned up when fully migrated */
 /* ************************************************************* */
 /* ************************************************************* */