Blender V2.61 - r43446
|
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "MEM_guardedalloc.h"
#include "DNA_listBase.h"
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_utildefines.h"
#include "BKE_blender.h"
#include "GHOST_Path-api.h"
#include <fnmatch.h>
Go to the source code of this file.
Defines | |
#define | _GNU_SOURCE |
#define | BLENDER_USER_FORMAT "%s/.blender/%s" |
#define | BLENDER_SYSTEM_FORMAT "%s/blender/%s" |
#define | UNIQUE_NAME_MAX 128 |
#define | GIVE_STRADDR(data, offset) ( ((char *)data) + offset ) |
Functions | |
static int | add_win32_extension (char *name) |
static char * | blender_version_decimal (const int ver) |
int | BLI_stringdec (const char *string, char *head, char *tail, unsigned short *numlen) |
void | BLI_stringenc (char *string, const char *head, const char *tail, unsigned short numlen, int pic) |
int | BLI_split_name_num (char *left, int *nr, const char *name, const char delim) |
void | BLI_newname (char *name, int add) |
int | BLI_uniquename_cb (int(*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len) |
static int | uniquename_find_dupe (ListBase *list, void *vlink, const char *name, short name_offs) |
static int | uniquename_unique_check (void *arg, const char *name) |
void | BLI_uniquename (ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short name_len) |
void | BLI_cleanup_path (const char *relabase, char *dir) |
void | BLI_cleanup_dir (const char *relabase, char *dir) |
void | BLI_cleanup_file (const char *relabase, char *dir) |
void | BLI_path_rel (char *file, const char *relfile) |
int | BLI_has_parent (char *path) |
int | BLI_parent_dir (char *path) |
static int | stringframe_chars (char *path, int *char_start, int *char_end) |
static void | ensure_digits (char *path, int digits) |
int | BLI_path_frame (char *path, int frame, int digits) |
int | BLI_path_frame_range (char *path, int sta, int end, int digits) |
int | BLI_path_abs (char *path, const char *basepath) |
int | BLI_path_cwd (char *path) |
void | BLI_splitdirstring (char *di, char *fi) |
void | BLI_getlastdir (const char *dir, char *last, const size_t maxlen) |
const char * | BLI_getDefaultDocumentFolder (void) |
static int | test_path (char *targetpath, const char *path_base, const char *path_sep, const char *folder_name) |
static int | test_env_path (char *path, const char *envvar) |
static int | get_path_local (char *targetpath, const char *folder_name, const char *subfolder_name, const int ver) |
static int | is_portable_install (void) |
static int | get_path_user (char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar, const int ver) |
static int | get_path_system (char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar, const int ver) |
char * | BLI_get_folder (int folder_id, const char *subfolder) |
char * | BLI_get_user_folder_notest (int folder_id, const char *subfolder) |
char * | BLI_get_folder_create (int folder_id, const char *subfolder) |
char * | BLI_get_folder_version (const int id, const int ver, const int do_check) |
void | BLI_setenv (const char *env, const char *val) |
void | BLI_setenv_if_new (const char *env, const char *val) |
void | BLI_clean (char *path) |
void | BLI_char_switch (char *string, char from, char to) |
void | BLI_make_exist (char *dir) |
void | BLI_make_existing_file (const char *name) |
void | BLI_make_file_string (const char *relabase, char *string, const char *dir, const char *file) |
int | BLI_testextensie (const char *str, const char *ext) |
int | BLI_testextensie_array (const char *str, const char **ext_array) |
int | BLI_testextensie_glob (const char *str, const char *ext_fnmatch) |
int | BLI_replace_extension (char *path, size_t maxlen, const char *ext) |
int | BLI_ensure_extension (char *path, size_t maxlen, const char *ext) |
void | BLI_split_dirfile (const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen) |
void | BLI_split_dir_part (const char *string, char *dir, const size_t dirlen) |
void | BLI_split_file_part (const char *string, char *file, const size_t filelen) |
void | BLI_join_dirfile (char *dst, const size_t maxlen, const char *dir, const char *file) |
char * | BLI_path_basename (char *path) |
int | BKE_rebase_path (char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir) |
char * | BLI_first_slash (char *string) |
char * | BLI_last_slash (const char *string) |
int | BLI_add_slash (char *string) |
void | BLI_del_slash (char *string) |
static void | bli_where_am_i (char *fullname, const size_t maxlen, const char *name) |
void | BLI_init_program_path (const char *argv0) |
const char * | BLI_program_path (void) |
const char * | BLI_program_dir (void) |
static void | BLI_where_is_temp (char *fullname, const size_t maxlen, char *userdir) |
void | BLI_init_temporary_dir (char *userdir) |
const char * | BLI_temporary_dir (void) |
void | BLI_system_temporary_dir (char *dir) |
Variables | |
static char | bprogname [FILE_MAX] |
static char | bprogdir [FILE_MAX] |
static char | btempdir [FILE_MAX] |
Definition in file path_util.c.
#define _GNU_SOURCE |
Definition at line 59 of file path_util.c.
#define BLENDER_SYSTEM_FORMAT "%s/blender/%s" |
Definition at line 92 of file path_util.c.
Referenced by get_path_system().
#define BLENDER_USER_FORMAT "%s/.blender/%s" |
Definition at line 88 of file path_util.c.
Referenced by get_path_user().
Definition at line 256 of file path_util.c.
Referenced by BLI_uniquename(), and uniquename_find_dupe().
#define UNIQUE_NAME_MAX 128 |
Definition at line 96 of file path_util.c.
Referenced by BLI_newname(), BLI_uniquename(), and BLI_uniquename_cb().
static int add_win32_extension | ( | char * | name | ) | [static] |
Definition at line 1702 of file path_util.c.
References BLI_exists(), and FILE_MAX.
Referenced by bli_where_am_i().
int BKE_rebase_path | ( | char * | abs, |
size_t | abs_len, | ||
char * | rel, | ||
size_t | rel_len, | ||
const char * | base_dir, | ||
const char * | src_dir, | ||
const char * | dest_dir | ||
) |
Definition at line 1576 of file path_util.c.
References BLI_join_dirfile(), BLI_path_abs(), BLI_path_cmp, BLI_split_dir_part(), BLI_split_dirfile(), BLI_strncpy(), FILE_MAX, len(), and strlen().
Referenced by ImagesExporter::operator()().
static char * blender_version_decimal | ( | const int | ver | ) | [static] |
Definition at line 856 of file path_util.c.
Referenced by get_path_local(), get_path_system(), and get_path_user().
int BLI_add_slash | ( | char * | string | ) |
Definition at line 1677 of file path_util.c.
References len(), SEP, and strlen().
Referenced by autocomplete_directory(), BLI_cleanup_dir(), BLI_has_parent(), BLI_parent_dir(), BLI_where_is_temp(), file_browse_exec(), file_directory_exec(), file_panel_category(), file_select_do(), and ptcache_path().
void BLI_char_switch | ( | char * | string, |
char | from, | ||
char | to | ||
) |
Change every from in string into to. The result will be in string
string The string to work on from The character to replace to The character to replace with
Definition at line 1222 of file path_util.c.
References NULL.
Referenced by BLI_clean(), BLI_make_exist(), BLI_path_abs(), BLI_path_rel(), and uri_from_filename().
void BLI_clean | ( | char * | path | ) |
Definition at line 1209 of file path_util.c.
References BLI_char_switch(), BLI_strnlen(), and NULL.
Referenced by BLI_has_parent(), BLI_make_file_string(), clean_paths(), and clean_paths_visit_cb().
void BLI_cleanup_dir | ( | const char * | relabase, |
char * | dir | ||
) |
Definition at line 413 of file path_util.c.
References BLI_add_slash(), and BLI_cleanup_path().
Referenced by BLI_parent_dir(), BLO_write_file(), bookmark_select_exec(), cleanup_path(), ED_fileselect_set_params(), file_directory_exec(), file_parent_exec(), file_select_do(), filelist_read_dir(), and filelist_read_library().
void BLI_cleanup_file | ( | const char * | relabase, |
char * | dir | ||
) |
dir can be any input, like from buttons, and this function converts it to a regular full path. Also removes garbage from directory paths, like /../ or double slashes etc
Definition at line 420 of file path_util.c.
References BLI_cleanup_path(), and BLI_del_slash().
Referenced by bpath_relocate_visitor().
void BLI_cleanup_path | ( | const char * | relabase, |
char * | dir | ||
) |
Definition at line 318 of file path_util.c.
References BLI_path_abs(), and strlen().
Referenced by BLI_cleanup_dir(), BLI_cleanup_file(), BLI_path_abs(), and BLI_path_rel().
void BLI_del_slash | ( | char * | string | ) |
Definition at line 1689 of file path_util.c.
References len(), SEP, and strlen().
Referenced by BLI_cleanup_file(), and file_panel_category().
int BLI_ensure_extension | ( | char * | path, |
size_t | maxlen, | ||
const char * | ext | ||
) |
Definition at line 1441 of file path_util.c.
References strlen().
Referenced by BKE_add_image_extension(), and blend_save_check().
char* BLI_first_slash | ( | char * | string | ) |
Definition at line 1648 of file path_util.c.
char* BLI_get_folder | ( | int | folder_id, |
const char * | subfolder | ||
) |
Definition at line 1051 of file path_util.c.
References BLENDER_DATAFILES, BLENDER_SYSTEM_DATAFILES, BLENDER_SYSTEM_PYTHON, BLENDER_SYSTEM_SCRIPTS, BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLENDER_VERSION, FILE_MAX, get_path_local(), get_path_system(), get_path_user(), and NULL.
Referenced by BLI_get_folder_create(), BPy_init_modules(), BPY_python_start(), bpy_script_paths(), bpy_user_resource(), ED_file_init(), get_brush_icon(), init_iconfile_list(), init_internal_icons(), WM_read_history(), and WM_read_homefile().
char* BLI_get_folder_create | ( | int | folder_id, |
const char * | subfolder | ||
) |
Definition at line 1123 of file path_util.c.
References BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLI_dir_create_recursive(), BLI_get_folder(), BLI_get_user_folder_notest(), ELEM4, and NULL.
Referenced by BLO_write_file(), bookmark_add_exec(), bookmark_delete_exec(), file_exec(), wm_autosave_location(), WM_write_homefile(), and write_history().
char* BLI_get_folder_version | ( | const int | id, |
const int | ver, | ||
const int | do_check | ||
) |
Definition at line 1141 of file path_util.c.
References BLENDER_RESOURCE_PATH_LOCAL, BLENDER_RESOURCE_PATH_SYSTEM, BLENDER_RESOURCE_PATH_USER, BLI_assert, FALSE, FILE_MAX, get_path_local(), get_path_system(), get_path_user(), and NULL.
Referenced by bpy_resource_path(), and wm_resource_check_prev().
char* BLI_get_user_folder_notest | ( | int | folder_id, |
const char * | subfolder | ||
) |
Definition at line 1098 of file path_util.c.
References BLENDER_USER_AUTOSAVE, BLENDER_USER_CONFIG, BLENDER_USER_DATAFILES, BLENDER_USER_SCRIPTS, BLENDER_VERSION, FILE_MAX, get_path_user(), and NULL.
Referenced by BLI_get_folder_create(), and bpy_user_resource().
const char* BLI_getDefaultDocumentFolder | ( | void | ) |
Definition at line 809 of file path_util.c.
References BLI_is_dir(), HRESULT, NULL, and S_OK.
Referenced by file_expand_directory().
void BLI_getlastdir | ( | const char * | dir, |
char * | last, | ||
const size_t | maxlen | ||
) |
Definition at line 787 of file path_util.c.
References BLI_strncpy(), and NULL.
Referenced by file_panel_category().
int BLI_has_parent | ( | char * | path | ) |
Definition at line 524 of file path_util.c.
References BLI_add_slash(), BLI_clean(), and len().
Referenced by file_parent_exec().
void BLI_init_program_path | ( | const char * | argv0 | ) |
Definition at line 1835 of file path_util.c.
References BLI_split_dir_part(), bli_where_am_i(), bprogdir, and bprogname.
Referenced by main().
void BLI_init_temporary_dir | ( | char * | userdir | ) |
Definition at line 1906 of file path_util.c.
References BLI_where_is_temp(), btempdir, and FILE_MAX.
Referenced by main(), and wm_init_userdef().
void BLI_join_dirfile | ( | char * | dst, |
const size_t | maxlen, | ||
const char * | dir, | ||
const char * | file | ||
) |
Definition at line 1507 of file path_util.c.
References BLI_strncpy(), BLI_strnlen(), NULL, and SEP.
Referenced by autocomplete_directory(), BKE_ptcache_disk_cache_rename(), BKE_ptcache_id_clear(), BKE_ptcache_remove(), BKE_rebase_path(), blf_dir_search(), bli_where_am_i(), do_versions(), dynamicPaint_bakeImageSequence(), file_draw_check_exists(), file_expand_directory(), file_sfile_to_operator(), findFileRecursive(), get_index_dir(), get_path_local(), get_path_system(), get_proxy_filename(), get_tc_filename(), init_iconfile_list(), init_internal_icons(), modifier_path_init(), new_folder_path(), particles_fluid_step(), reload_sequence_new_file(), rewrite_path_fixed_dirfile(), seq_open_anim_file(), seq_proxy_get_fname(), seq_render_strip(), sequencer_add_generic_strip_exec(), test_path(), and DocumentImporter::writeImage().
char* BLI_last_slash | ( | const char * | string | ) |
Definition at line 1662 of file path_util.c.
Referenced by BLI_dir_create_recursive(), BLI_make_file_string(), BLI_path_abs(), BLI_path_basename(), BLI_path_rel(), BLI_split_dirfile(), BLI_splitdirstring(), BLI_stringdec(), bli_where_am_i(), BLO_is_a_library(), ensure_digits(), file_browse_invoke(), groupname_to_code(), image_info(), and untitled().
void BLI_make_exist | ( | char * | dir | ) |
Definition at line 1231 of file path_util.c.
References ALTSEP, BLI_char_switch(), BLI_is_dir(), SEP, and strlen().
Referenced by filelist_parent(), and filelist_read_library().
void BLI_make_existing_file | ( | const char * | name | ) |
Definition at line 1259 of file path_util.c.
References BLI_dir_create_recursive(), BLI_exists(), BLI_splitdirstring(), BLI_strncpy(), FILE_MAX, and FILE_MAXFILE.
Referenced by BKE_write_ibuf(), collada_export(), dynamicPaint_outputSurfaceImage(), filepath_avi(), IMB_index_builder_create(), index_rebuild_fallback(), movieclip_build_proxy_ibuf(), ImagesExporter::operator()(), ptcache_file_open(), RE_BlenderAnim(), RE_WriteRenderResult(), seq_proxy_build_frame(), and writePackedFile().
void BLI_make_file_string | ( | const char * | relabase, |
char * | string, | ||
const char * | dir, | ||
const char * | file | ||
) |
Definition at line 1273 of file path_util.c.
References BLI_clean(), BLI_last_slash(), BLI_strncpy(), BLI_strnlen(), ELEM, NULL, and strlen().
Referenced by BKE_undo_save_quit(), BKE_write_undo(), BLI_path_cwd(), BLO_write_file(), bookmark_add_exec(), bookmark_delete_exec(), ED_file_init(), file_delete_exec(), file_exec(), get_brush_icon(), renamebutton_cb(), render_result_exr_file_path(), test_path(), touch_seq_files(), wm_autosave_delete(), wm_autosave_location(), WM_read_history(), WM_read_homefile(), wm_recover_last_session_exec(), WM_write_homefile(), and write_history().
void BLI_newname | ( | char * | name, |
int | add | ||
) |
Definition at line 193 of file path_util.c.
References add(), BLI_stringdec(), BLI_stringenc(), KDL::exp(), i, and UNIQUE_NAME_MAX.
Referenced by file_filenum_exec(), and make_unique_prop_names().
int BLI_parent_dir | ( | char * | path | ) |
Definition at line 539 of file path_util.c.
References BLI_add_slash(), BLI_cleanup_dir(), BLI_strncpy(), BLI_testextensie(), FILE_MAX, NULL, and SEP.
Referenced by file_parent_exec(), file_select_do(), filelist_parent(), and wm_link_append_invoke().
int BLI_path_abs | ( | char * | path, |
const char * | basepath | ||
) |
Blender's path code replacement function. Bases path strings leading with "//" by the directory basepath, and replaces instances of '#' with the framenum. Results are written back into path.
path The path to convert basepath The directory to base relative paths with. framenum The framenumber to replace the frame code with.
Returns | true if the path was relative (started with "//"). |
Definition at line 639 of file path_util.c.
References BLI_char_switch(), BLI_cleanup_path(), BLI_last_slash(), BLI_strncpy(), FILE_MAX, NULL, and p.
Referenced by add_text(), BKE_add_image_file(), BKE_add_movieclip_file(), BKE_library_filepath_set(), BKE_makepicstring(), BKE_rebase_path(), BL_MakeScreenShot(), BLI_cleanup_path(), bpath_relocate_visitor(), bpy_lib_load(), cache_voxeldata(), checkPackedFile(), customdata_external_filename(), do_versions(), dynamicPaint_outputSurfaceImage(), ED_fileselect_set_params(), file_browse_exec(), file_operator_to_sfile(), filepath_avi(), get_brush_icon(), get_proxy_fname(), get_sequence_fname(), GetFontId(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), image_save_sequence_exec(), main(), makeFilesAbsolute_visit_cb(), movieclip_load_movie_file(), namebutton_cb(), newPackedFile(), ImagesExporter::operator()(), particles_fluid_step(), ptcache_path(), RE_WriteEnvmapResult(), reload_sequence_new_file(), reopen_text(), rewrite_path_alloc(), rewrite_path_fixed(), rewrite_path_fixed_dirfile(), save_image_options_from_op(), save_image_options_init(), screenshot_exec(), seq_open_anim_file(), seq_proxy_get_fname(), seq_render_strip(), sequencer_add_movie_strip(), sequencer_generic_invoke_path__internal(), sound_mixdown_exec(), sound_new_file(), space_image_file_exists_poll(), StartKetsjiShell(), text_file_modified(), text_ignore_modified(), txt_write_file(), and writePackedFile().
char* BLI_path_basename | ( | char * | path | ) |
Definition at line 1544 of file path_util.c.
References BLI_last_slash().
Referenced by add_text(), BKE_add_image_imbuf(), bpy_text_reimport(), findMissingFiles_visit_cb(), recent_files_menu_draw(), seq_load_operator_info(), and wm_block_create_splash().
int BLI_path_cwd | ( | char * | path | ) |
Definition at line 735 of file path_util.c.
References BLI_current_working_dir(), BLI_make_file_string(), BLI_strncpy(), FILE_MAX, NULL, and strlen().
Referenced by load_file(), main(), and run_python().
int BLI_path_frame | ( | char * | path, |
int | frame, | ||
int | digits | ||
) |
Definition at line 605 of file path_util.c.
References ensure_digits(), FILE_MAX, and stringframe_chars().
Referenced by BKE_makepicstring(), dynamicPaint_bakeImageSequence(), get_proxy_fname(), particles_fluid_step(), and seq_proxy_get_fname().
int BLI_path_frame_range | ( | char * | path, |
int | sta, | ||
int | end, | ||
int | digits | ||
) |
Definition at line 621 of file path_util.c.
References BLI_snprintf(), BLI_strncpy(), ensure_digits(), FILE_MAX, and stringframe_chars().
Referenced by filepath_avi().
void BLI_path_rel | ( | char * | file, |
const char * | relfile | ||
) |
Definition at line 426 of file path_util.c.
References BLI_char_switch(), BLI_cleanup_path(), BLI_last_slash(), BLI_strncpy(), BLI_strnlen(), FILE_MAX, NULL, and p.
Referenced by bpath_relocate_visitor(), file_sfile_to_operator(), fix_relpaths_library(), library_append_end(), makeFilesRelative_visit_cb(), multires_external_save_exec(), save_image_doit(), seq_load_operator_info(), and sequencer_change_path_exec().
const char* BLI_program_dir | ( | void | ) |
Definition at line 1846 of file path_util.c.
References bprogdir.
const char* BLI_program_path | ( | void | ) |
Definition at line 1841 of file path_util.c.
References bprogname.
Referenced by BPY_python_start(), main(), and make_app_info().
int BLI_replace_extension | ( | char * | path, |
size_t | maxlen, | ||
const char * | ext | ||
) |
Definition at line 1417 of file path_util.c.
References ELEM3, and strlen().
Referenced by BKE_add_image_extension(), imb_cache_filename(), WM_write_file(), and write_crash_blend().
void BLI_setenv | ( | const char * | env, |
const char * | val | ||
) |
Definition at line 1178 of file path_util.c.
References MEM_freeN(), MEM_mallocN(), and strlen().
Referenced by BLI_setenv_if_new(), BPY_python_start(), main(), PyC_SetHomePath(), and set_env().
void BLI_setenv_if_new | ( | const char * | env, |
const char * | val | ||
) |
Only set an env var if already not there. Like Unix setenv(env, val, 0);
Definition at line 1202 of file path_util.c.
References BLI_setenv(), and NULL.
void BLI_split_dir_part | ( | const char * | string, |
char * | dir, | ||
const size_t | dirlen | ||
) |
Definition at line 1496 of file path_util.c.
References BLI_split_dirfile(), and NULL.
Referenced by autocomplete_directory(), BKE_rebase_path(), BLI_init_program_path(), BLO_write_file(), findMissingFiles(), ImagesExporter::operator()(), sequencer_add_generic_strip_exec(), and DocumentImporter::writeImage().
void BLI_split_dirfile | ( | const char * | string, |
char * | dir, | ||
char * | file, | ||
const size_t | dirlen, | ||
const size_t | filelen | ||
) |
Definition at line 1477 of file path_util.c.
References BLI_last_slash(), BLI_strncpy(), and MIN2.
Referenced by BKE_rebase_path(), BLI_split_dir_part(), BLI_split_file_part(), ED_fileselect_set_params(), file_directory_exec(), file_operator_to_sfile(), get_proxy_fname(), rewrite_path_fixed_dirfile(), sequencer_add_movie_strip(), and sequencer_drop_copy().
void BLI_split_file_part | ( | const char * | string, |
char * | file, | ||
const size_t | filelen | ||
) |
Definition at line 1501 of file path_util.c.
References BLI_split_dirfile(), and NULL.
Referenced by ptcache_path().
int BLI_split_name_num | ( | char * | left, |
int * | nr, | ||
const char * | name, | ||
const char | delim | ||
) |
Definition at line 163 of file path_util.c.
References strlen().
Referenced by BLI_uniquename_cb(), check_for_dupid(), copy_mball_properties(), find_basis_mball(), init_meta(), and is_mball_basis_for().
void BLI_splitdirstring | ( | char * | di, |
char * | fi | ||
) |
Definition at line 774 of file path_util.c.
References BLI_last_slash(), BLI_strncpy(), and FILE_MAXFILE.
Referenced by autotexname(), BLI_make_existing_file(), cleanup_path(), file_browse_exec(), get_index_dir(), image_save_sequence_exec(), load_vfont(), render_result_exr_file_path(), unpack_menu(), unpackImage(), unpackSound(), and unpackVFont().
int BLI_stringdec | ( | const char * | string, |
char * | head, | ||
char * | tail, | ||
unsigned short * | numlen | ||
) |
Definition at line 107 of file path_util.c.
References BLI_last_slash(), i, len(), and strlen().
Referenced by BLI_newname(), get_sequence_fname(), and image_load_sequence_file().
void BLI_stringenc | ( | char * | string, |
const char * | head, | ||
const char * | tail, | ||
unsigned short | numlen, | ||
int | pic | ||
) |
Definition at line 153 of file path_util.c.
Referenced by an_stringenc(), BLI_newname(), get_sequence_fname(), and image_load_sequence_file().
void BLI_system_temporary_dir | ( | char * | dir | ) |
Definition at line 1916 of file path_util.c.
References BLI_where_is_temp(), FILE_MAX, and NULL.
Referenced by init_userdef_do_versions().
const char* BLI_temporary_dir | ( | void | ) |
Definition at line 1911 of file path_util.c.
References btempdir.
Referenced by BKE_undo_save_quit(), BKE_write_undo(), bpy_app_tempdir_get(), modifier_path_init(), modifier_path_relbase(), ptcache_path(), render_result_exr_file_path(), wm_autosave_delete(), wm_autosave_location(), and wm_recover_last_session_exec().
int BLI_testextensie | ( | const char * | str, |
const char * | ext | ||
) |
Definition at line 1355 of file path_util.c.
References BLI_strcasecmp(), and strlen().
Referenced by BKE_add_image_extension(), BLI_parent_dir(), BLI_testextensie_array(), BLO_has_bfile_extension(), BPY_modules_load_user(), do_write_image_or_movie(), file_extension_type(), filepath_avi(), IMB_isanim(), and init_iconfile_list().
int BLI_testextensie_array | ( | const char * | str, |
const char ** | ext_array | ||
) |
Definition at line 1374 of file path_util.c.
References BLI_testextensie(), and i.
Referenced by BKE_add_image_extension(), BKE_add_image_file(), BKE_add_movieclip_file(), BKE_movieclip_reload(), file_extension_type(), and IMB_ispic().
int BLI_testextensie_glob | ( | const char * | str, |
const char * | ext_fnmatch | ||
) |
Definition at line 1389 of file path_util.c.
References BLI_strncpy(), and FNM_CASEFOLD.
Referenced by filelist_setfiletypes().
void BLI_uniquename | ( | ListBase * | list, |
void * | vlink, | ||
const char | defname[], | ||
char | delim, | ||
short | name_offs, | ||
short | name_len | ||
) |
Definition at line 290 of file path_util.c.
References assert, BLI_uniquename_cb(), data, ELEM, GIVE_STRADDR, NULL, UNIQUE_NAME_MAX, and uniquename_unique_check().
Referenced by action_groups_add_new(), AnimationImporter::add_bone_fcurve(), add_keyblock(), add_nlatrack(), BKE_keyingset_add(), BKE_track_unique_name(), BKE_tracking_object_unique_name(), driver_add_new_variable(), fcurve_add_to_list(), gpencil_layer_addnew(), modifier_unique_name(), namebutton_cb(), nodeUniqueName(), pose_add_group(), poselib_add_exec(), poselib_rename_exec(), scene_add_render_layer(), tracks_map_merge(), and unique_constraint_name().
int BLI_uniquename_cb | ( | int(*)(void *, const char *) | unique_check, |
void * | arg, | ||
const char | defname[], | ||
char | delim, | ||
char * | name, | ||
short | name_len | ||
) |
Definition at line 217 of file path_util.c.
References BLI_snprintf(), BLI_split_name_num(), BLI_strncat_utf8(), BLI_strncpy(), left(), len(), and UNIQUE_NAME_MAX.
Referenced by BKE_nlastrip_validate_name(), BLI_uniquename(), CustomData_set_layer_unique_name(), defgroup_unique_name(), dynamicPaintSurface_setUniqueName(), surface_setUniqueOutputName(), unique_bone_name(), unique_editbone_name(), and uniqueOrientationName().
static void bli_where_am_i | ( | char * | fullname, |
const size_t | maxlen, | ||
const char * | name | ||
) | [static] |
Definition at line 1755 of file path_util.c.
References add_win32_extension(), BLI_current_working_dir(), BLI_exists(), BLI_join_dirfile(), BLI_last_slash(), BLI_strncpy(), FILE_MAX, addon::engine::free(), NULL, and SEP.
Referenced by BLI_init_program_path().
static void BLI_where_is_temp | ( | char * | fullname, |
const size_t | maxlen, | ||
char * | userdir | ||
) | [static] |
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
fullname | The full path to the temp directory |
userdir | Directory specified in user preferences |
Definition at line 1860 of file path_util.c.
References BLI_add_slash(), BLI_is_dir(), and BLI_strncpy().
Referenced by BLI_init_temporary_dir(), and BLI_system_temporary_dir().
static void ensure_digits | ( | char * | path, |
int | digits | ||
) | [static] |
Definition at line 588 of file path_util.c.
References BLI_last_slash(), len(), NULL, and strlen().
Referenced by BLI_path_frame(), and BLI_path_frame_range().
static int get_path_local | ( | char * | targetpath, |
const char * | folder_name, | ||
const char * | subfolder_name, | ||
const int | ver | ||
) | [static] |
Definition at line 905 of file path_util.c.
References blender_version_decimal(), BLI_join_dirfile(), BLI_strncpy(), bprogdir, FILE_MAX, and test_path().
Referenced by BLI_get_folder(), BLI_get_folder_version(), get_path_user(), and is_portable_install().
static int get_path_system | ( | char * | targetpath, |
const char * | folder_name, | ||
const char * | subfolder_name, | ||
const char * | envvar, | ||
const int | ver | ||
) | [static] |
Definition at line 981 of file path_util.c.
References BLENDER_SYSTEM_FORMAT, blender_version_decimal(), BLI_current_working_dir(), BLI_join_dirfile(), BLI_snprintf(), BLI_strncpy(), bprogdir, FILE_MAX, GHOST_getSystemDir(), NULL, test_env_path(), and test_path().
Referenced by BLI_get_folder(), and BLI_get_folder_version().
static int get_path_user | ( | char * | targetpath, |
const char * | folder_name, | ||
const char * | subfolder_name, | ||
const char * | envvar, | ||
const int | ver | ||
) | [static] |
Definition at line 940 of file path_util.c.
References BLENDER_USER_FORMAT, blender_version_decimal(), BLI_snprintf(), BLI_strncpy(), FILE_MAX, get_path_local(), GHOST_getUserDir(), is_portable_install(), NULL, test_env_path(), and test_path().
Referenced by BLI_get_folder(), BLI_get_folder_version(), and BLI_get_user_folder_notest().
static int is_portable_install | ( | void | ) | [static] |
Definition at line 931 of file path_util.c.
References BLENDER_VERSION, FILE_MAX, get_path_local(), and NULL.
Referenced by get_path_user().
static int stringframe_chars | ( | char * | path, |
int * | char_start, | ||
int * | char_end | ||
) | [static] |
Definition at line 556 of file path_util.c.
References i.
Referenced by BLI_path_frame(), and BLI_path_frame_range().
static int test_env_path | ( | char * | path, |
const char * | envvar | ||
) | [static] |
Definition at line 891 of file path_util.c.
References BLI_is_dir(), BLI_strncpy(), FILE_MAX, and NULL.
Referenced by get_path_system(), and get_path_user().
static int test_path | ( | char * | targetpath, |
const char * | path_base, | ||
const char * | path_sep, | ||
const char * | folder_name | ||
) | [static] |
Definition at line 863 of file path_util.c.
References BLI_is_dir(), BLI_join_dirfile(), BLI_make_file_string(), BLI_strncpy(), and FILE_MAX.
Referenced by get_path_local(), get_path_system(), and get_path_user().
static int uniquename_find_dupe | ( | ListBase * | list, |
void * | vlink, | ||
const char * | name, | ||
short | name_offs | ||
) | [static] |
Definition at line 269 of file path_util.c.
References ListBase::first, GIVE_STRADDR, link(), and Link::next.
Referenced by uniquename_unique_check().
static int uniquename_unique_check | ( | void * | arg, |
const char * | name | ||
) | [static] |
Definition at line 284 of file path_util.c.
References data, and uniquename_find_dupe().
Referenced by BLI_uniquename().
char bprogdir[FILE_MAX] [static] |
Definition at line 99 of file path_util.c.
Referenced by BLI_init_program_path(), BLI_program_dir(), get_path_local(), and get_path_system().
char bprogname[FILE_MAX] [static] |
Definition at line 98 of file path_util.c.
Referenced by BLI_init_program_path(), and BLI_program_path().
char btempdir[FILE_MAX] [static] |
Definition at line 100 of file path_util.c.
Referenced by BLI_init_temporary_dir(), and BLI_temporary_dir().