Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 17 Jun 2018 14:18:15 +0000 (16:18 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 17 Jun 2018 14:18:15 +0000 (16:18 +0200)
26 files changed:
source/blender/blenkernel/intern/cachefile.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/studiolight.c
source/blender/blenkernel/intern/writeavi.c
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/intern/path_util.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/DocumentExporter.cpp
source/blender/editors/interface/interface_icons.c
source/blender/editors/io/io_alembic.c
source/blender/editors/io/io_cache.c
source/blender/editors/io/io_collada.c
source/blender/editors/screen/screendump.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/freestyle/intern/application/Controller.cpp
source/blender/imbuf/intern/oiio/openimageio_api.cpp
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/util.c
source/blender/python/intern/bpy_interface.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/windowmanager/intern/wm_files.c
source/creator/creator_signals.c

index 74c0dca..c7d7a3a 100644 (file)
@@ -217,7 +217,7 @@ bool BKE_cachefile_filepath_get(
                char ext[32];
                BLI_path_frame_strip(r_filepath, true, ext);
                BLI_path_frame(r_filepath, frame, frame_len);
-               BLI_ensure_extension(r_filepath, FILE_MAX, ext);
+               BLI_path_extension_ensure(r_filepath, FILE_MAX, ext);
 
                /* TODO(kevin): store sequence range? */
                return BLI_exists(r_filepath);
index d165c6d..fc6530a 100644 (file)
@@ -576,7 +576,7 @@ static void image_init_color_management(Image *ima)
 
 char BKE_image_alpha_mode_from_extension_ex(const char *filepath)
 {
-       if (BLI_testextensie_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) {
+       if (BLI_path_extension_check_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) {
                return IMA_ALPHA_PREMUL;
        }
        else {
@@ -607,7 +607,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath)
        ima = image_alloc(bmain, BLI_path_basename(filepath), IMA_SRC_FILE, IMA_TYPE_IMAGE);
        STRNCPY(ima->name, filepath);
 
-       if (BLI_testextensie_array(filepath, imb_ext_movie))
+       if (BLI_path_extension_check_array(filepath, imb_ext_movie))
                ima->source = IMA_SRC_MOVIE;
 
        image_init_color_management(ima);
@@ -1352,63 +1352,63 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
        (void)im_format;  /* may be unused, depends on build options */
 
        if (imtype == R_IMF_IMTYPE_IRIS) {
-               if (!BLI_testextensie(string, extension_test = ".rgb"))
+               if (!BLI_path_extension_check(string, extension_test = ".rgb"))
                        extension = extension_test;
        }
        else if (imtype == R_IMF_IMTYPE_IRIZ) {
-               if (!BLI_testextensie(string, extension_test = ".rgb"))
+               if (!BLI_path_extension_check(string, extension_test = ".rgb"))
                        extension = extension_test;
        }
 #ifdef WITH_HDR
        else if (imtype == R_IMF_IMTYPE_RADHDR) {
-               if (!BLI_testextensie(string, extension_test = ".hdr"))
+               if (!BLI_path_extension_check(string, extension_test = ".hdr"))
                        extension = extension_test;
        }
 #endif
        else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
-               if (!BLI_testextensie(string, extension_test = ".png"))
+               if (!BLI_path_extension_check(string, extension_test = ".png"))
                        extension = extension_test;
        }
 #ifdef WITH_DDS
        else if (imtype == R_IMF_IMTYPE_DDS) {
-               if (!BLI_testextensie(string, extension_test = ".dds"))
+               if (!BLI_path_extension_check(string, extension_test = ".dds"))
                        extension = extension_test;
        }
 #endif
        else if (ELEM(imtype, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_RAWTGA)) {
-               if (!BLI_testextensie(string, extension_test = ".tga"))
+               if (!BLI_path_extension_check(string, extension_test = ".tga"))
                        extension = extension_test;
        }
        else if (imtype == R_IMF_IMTYPE_BMP) {
-               if (!BLI_testextensie(string, extension_test = ".bmp"))
+               if (!BLI_path_extension_check(string, extension_test = ".bmp"))
                        extension = extension_test;
        }
 #ifdef WITH_TIFF
        else if (imtype == R_IMF_IMTYPE_TIFF) {
-               if (!BLI_testextensie_n(string, extension_test = ".tif", ".tiff", NULL)) {
+               if (!BLI_path_extension_check_n(string, extension_test = ".tif", ".tiff", NULL)) {
                        extension = extension_test;
                }
        }
 #endif
 #ifdef WITH_OPENIMAGEIO
        else if (imtype == R_IMF_IMTYPE_PSD) {
-               if (!BLI_testextensie(string, extension_test = ".psd"))
+               if (!BLI_path_extension_check(string, extension_test = ".psd"))
                        extension = extension_test;
        }
 #endif
 #ifdef WITH_OPENEXR
        else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER) {
-               if (!BLI_testextensie(string, extension_test = ".exr"))
+               if (!BLI_path_extension_check(string, extension_test = ".exr"))
                        extension = extension_test;
        }
 #endif
 #ifdef WITH_CINEON
        else if (imtype == R_IMF_IMTYPE_CINEON) {
-               if (!BLI_testextensie(string, extension_test = ".cin"))
+               if (!BLI_path_extension_check(string, extension_test = ".cin"))
                        extension = extension_test;
        }
        else if (imtype == R_IMF_IMTYPE_DPX) {
-               if (!BLI_testextensie(string, extension_test = ".dpx"))
+               if (!BLI_path_extension_check(string, extension_test = ".dpx"))
                        extension = extension_test;
        }
 #endif
@@ -1416,35 +1416,35 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
        else if (imtype == R_IMF_IMTYPE_JP2) {
                if (im_format) {
                        if (im_format->jp2_codec == R_IMF_JP2_CODEC_JP2) {
-                               if (!BLI_testextensie(string, extension_test = ".jp2"))
+                               if (!BLI_path_extension_check(string, extension_test = ".jp2"))
                                        extension = extension_test;
                        }
                        else if (im_format->jp2_codec == R_IMF_JP2_CODEC_J2K) {
-                               if (!BLI_testextensie(string, extension_test = ".j2c"))
+                               if (!BLI_path_extension_check(string, extension_test = ".j2c"))
                                        extension = extension_test;
                        }
                        else
                                BLI_assert(!"Unsupported jp2 codec was specified in im_format->jp2_codec");
                }
                else {
-                       if (!BLI_testextensie(string, extension_test = ".jp2"))
+                       if (!BLI_path_extension_check(string, extension_test = ".jp2"))
                                extension = extension_test;
                }
        }
 #endif
        else { //   R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc
-               if (!(BLI_testextensie_n(string, extension_test = ".jpg", ".jpeg", NULL)))
+               if (!(BLI_path_extension_check_n(string, extension_test = ".jpg", ".jpeg", NULL)))
                        extension = extension_test;
        }
 
        if (extension) {
                /* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
                /* remove any other known image extension */
-               if (BLI_testextensie_array(string, imb_ext_image)) {
-                       return BLI_replace_extension(string, FILE_MAX, extension);
+               if (BLI_path_extension_check_array(string, imb_ext_image)) {
+                       return BLI_path_extension_replace(string, FILE_MAX, extension);
                }
                else {
-                       return BLI_ensure_extension(string, FILE_MAX, extension);
+                       return BLI_path_extension_ensure(string, FILE_MAX, extension);
                }
 
        }
@@ -3028,7 +3028,7 @@ bool BKE_image_is_openexr(struct Image *ima)
 {
 #ifdef WITH_OPENEXR
        if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) {
-               return BLI_testextensie(ima->name, ".exr");
+               return BLI_path_extension_check(ima->name, ".exr");
        }
 #else
        UNUSED_VARS(ima);
index 297993a..b116e99 100644 (file)
@@ -549,7 +549,7 @@ static void studiolight_add_files_from_datafolder(const int folder_id, const cha
                        if ((dir[i].type & S_IFREG)) {
                                const char *filename = dir[i].relname;
                                const char *path = dir[i].path;
-                               if (BLI_testextensie_array(filename, imb_ext_image)) {
+                               if (BLI_path_extension_check_array(filename, imb_ext_image)) {
                                        sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | flag);
                                        BLI_strncpy(sl->name, filename, FILE_MAXFILE);
                                        BLI_strncpy(sl->path, path, FILE_MAXFILE);
index 33ac312..2c6b22f 100644 (file)
@@ -150,7 +150,7 @@ static void filepath_avi(char *string, RenderData *rd, bool preview, const char
        BLI_make_existing_file(string);
 
        if (rd->scemode & R_EXTENSION) {
-               if (!BLI_testextensie(string, ".avi")) {
+               if (!BLI_path_extension_check(string, ".avi")) {
                        BLI_path_frame_range(string, sfra, efra, 4);
                        strcat(string, ".avi");
                }
index b59e7f9..5315b77 100644 (file)
@@ -81,12 +81,12 @@ bool BLI_path_program_extensions_add_win32(char *name, const size_t maxlen);
 #endif
 bool BLI_path_program_search(char *fullname, const size_t maxlen, const char *name);
 
-bool BLI_testextensie(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-bool BLI_testextensie_n(const char *str, ...) ATTR_NONNULL(1) ATTR_SENTINEL(0);
-bool BLI_testextensie_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-bool BLI_replace_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
-bool BLI_ensure_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
+bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+bool BLI_path_extension_check_n(const char *str, ...) ATTR_NONNULL(1) ATTR_SENTINEL(0);
+bool BLI_path_extension_check_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
+bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
 bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
 int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
 void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
index 784e017..dcae121 100644 (file)
@@ -703,7 +703,7 @@ bool BLI_parent_dir(char *path)
        BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
        BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
 
-       if (!BLI_testextensie(tmp, parent_dir)) {
+       if (!BLI_path_extension_check(tmp, parent_dir)) {
                strcpy(path, tmp);  /* We assume pardir is always shorter... */
                return true;
        }
@@ -1353,7 +1353,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, c
        BLI_path_native_slash(string);
 }
 
-static bool testextensie_ex(const char *str, const size_t str_len,
+static bool path_extension_check_ex(const char *str, const size_t str_len,
                             const char *ext, const size_t ext_len)
 {
        BLI_assert(strlen(str) == str_len);
@@ -1364,12 +1364,12 @@ static bool testextensie_ex(const char *str, const size_t str_len,
 }
 
 /* does str end with ext. */
-bool BLI_testextensie(const char *str, const char *ext)
+bool BLI_path_extension_check(const char *str, const char *ext)
 {
-       return testextensie_ex(str, strlen(str), ext, strlen(ext));
+       return path_extension_check_ex(str, strlen(str), ext, strlen(ext));
 }
 
-bool BLI_testextensie_n(const char *str, ...)
+bool BLI_path_extension_check_n(const char *str, ...)
 {
        const size_t str_len = strlen(str);
 
@@ -1380,7 +1380,7 @@ bool BLI_testextensie_n(const char *str, ...)
        va_start(args, str);
 
        while ((ext = (const char *) va_arg(args, void *))) {
-               if (testextensie_ex(str, str_len, ext, strlen(ext))) {
+               if (path_extension_check_ex(str, str_len, ext, strlen(ext))) {
                        ret = true;
                        break;
                }
@@ -1392,13 +1392,13 @@ bool BLI_testextensie_n(const char *str, ...)
 }
 
 /* does str end with any of the suffixes in *ext_array. */
-bool BLI_testextensie_array(const char *str, const char **ext_array)
+bool BLI_path_extension_check_array(const char *str, const char **ext_array)
 {
        const size_t str_len = strlen(str);
        int i = 0;
 
        while (ext_array[i]) {
-               if (testextensie_ex(str, str_len, ext_array[i], strlen(ext_array[i]))) {
+               if (path_extension_check_ex(str, str_len, ext_array[i], strlen(ext_array[i]))) {
                        return true;
                }
 
@@ -1412,7 +1412,7 @@ bool BLI_testextensie_array(const char *str, const char **ext_array)
  *  '*.zip;*.py;*.exe'
  * does str match any of the semicolon-separated glob patterns in fnmatch.
  */
-bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
+bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch)
 {
        const char *ext_step = ext_fnmatch;
        char pattern[16];
@@ -1443,7 +1443,7 @@ bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
  * Removes any existing extension on the end of \a path and appends \a ext.
  * \return false if there was no room.
  */
-bool BLI_replace_extension(char *path, size_t maxlen, const char *ext)
+bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext)
 {
 #ifdef DEBUG_STRSIZE
        memset(path, 0xff, sizeof(*path) * maxlen);
@@ -1472,7 +1472,7 @@ bool BLI_replace_extension(char *path, size_t maxlen, const char *ext)
 /**
  * Strip's trailing '.'s and adds the extension only when needed
  */
-bool BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
+bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext)
 {
 #ifdef DEBUG_STRSIZE
        memset(path, 0xff, sizeof(*path) * maxlen);
index 9267e95..ebdca0c 100644 (file)
@@ -1368,7 +1368,7 @@ void blo_freefiledata(FileData *fd)
 bool BLO_has_bfile_extension(const char *str)
 {
        const char *ext_test[4] = {".blend", ".ble", ".blend.gz", NULL};
-       return BLI_testextensie_array(str, ext_test);
+       return BLI_path_extension_check_array(str, ext_test);
 }
 
 /**
index 04d39f4..541f84f 100644 (file)
@@ -168,7 +168,7 @@ static COLLADABU::NativeString make_temp_filepath(const char *name, const char *
        BLI_make_file_string(NULL, tempfile, tempdir, name);
 
        if (extension) {
-               BLI_ensure_extension(tempfile, FILE_MAX, extension);
+               BLI_path_extension_ensure(tempfile, FILE_MAX, extension);
        }
 
        COLLADABU::NativeString native_filename =
index be76af3..91ace3e 100644 (file)
@@ -602,7 +602,7 @@ static void init_iconfile_list(struct ListBase *list)
                if ((dir[i].type & S_IFREG)) {
                        const char *filename = dir[i].relname;
 
-                       if (BLI_testextensie(filename, ".png")) {
+                       if (BLI_path_extension_check(filename, ".png")) {
                                /* loading all icons on file start is overkill & slows startup
                                 * its possible they change size after blender load anyway. */
 #if 0
index 4440b99..91fc1e9 100644 (file)
@@ -86,7 +86,7 @@ static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *
                        BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
                }
 
-               BLI_replace_extension(filepath, sizeof(filepath), ".abc");
+               BLI_path_extension_replace(filepath, sizeof(filepath), ".abc");
                RNA_string_set(op->ptr, "filepath", filepath);
        }
 
@@ -284,8 +284,8 @@ static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op)
        char filepath[FILE_MAX];
        RNA_string_get(op->ptr, "filepath", filepath);
 
-       if (!BLI_testextensie(filepath, ".abc")) {
-               BLI_ensure_extension(filepath, FILE_MAX, ".abc");
+       if (!BLI_path_extension_check(filepath, ".abc")) {
+               BLI_path_extension_ensure(filepath, FILE_MAX, ".abc");
                RNA_string_set(op->ptr, "filepath", filepath);
                return true;
        }
index b13eace..221142a 100644 (file)
@@ -61,7 +61,7 @@ static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent *eve
                Main *bmain = CTX_data_main(C);
 
                BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
-               BLI_replace_extension(filepath, sizeof(filepath), ".abc");
+               BLI_path_extension_replace(filepath, sizeof(filepath), ".abc");
                RNA_string_set(op->ptr, "filepath", filepath);
        }
 
index aca380c..8f05495 100644 (file)
@@ -72,7 +72,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent *
                else
                        BLI_strncpy(filepath, blendfile_path, sizeof(filepath));
 
-               BLI_replace_extension(filepath, sizeof(filepath), ".dae");
+               BLI_path_extension_replace(filepath, sizeof(filepath), ".dae");
                RNA_string_set(op->ptr, "filepath", filepath);
        }
 
@@ -119,7 +119,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
        }
 
        RNA_string_get(op->ptr, "filepath", filepath);
-       BLI_ensure_extension(filepath, sizeof(filepath), ".dae");
+       BLI_path_extension_ensure(filepath, sizeof(filepath), ".dae");
 
 
        /* Avoid File write exceptions in Collada */
@@ -337,8 +337,8 @@ static bool wm_collada_export_check(bContext *UNUSED(C), wmOperator *op)
        char filepath[FILE_MAX];
        RNA_string_get(op->ptr, "filepath", filepath);
 
-       if (!BLI_testextensie(filepath, ".dae")) {
-               BLI_ensure_extension(filepath, FILE_MAX, ".dae");
+       if (!BLI_path_extension_check(filepath, ".dae")) {
+               BLI_path_extension_ensure(filepath, FILE_MAX, ".dae");
                RNA_string_set(op->ptr, "filepath", filepath);
                return true;
        }
index 7e50f8d..e7b075d 100644 (file)
@@ -234,7 +234,7 @@ static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
                char filepath[FILE_MAX] = "//screen";
                if (G.relbase_valid) {
                        BLI_strncpy(filepath, BKE_main_blendfile_path_from_global(), sizeof(filepath));
-                       BLI_replace_extension(filepath, sizeof(filepath), "");  /* strip '.blend' */
+                       BLI_path_extension_replace(filepath, sizeof(filepath), "");  /* strip '.blend' */
                }
                RNA_string_set(op->ptr, "filepath", filepath);
 
index b7a80a9..049feea 100644 (file)
@@ -455,10 +455,10 @@ static bool sound_mixdown_check(bContext *UNUSED(C), wmOperator *op)
                prop = RNA_struct_find_property(op->ptr, "filepath");
                RNA_property_string_get(op->ptr, prop, filepath);
 
-               if (BLI_testextensie_array(filepath, snd_ext_sound))
-                       check = BLI_replace_extension(filepath, FILE_MAX, extension);
+               if (BLI_path_extension_check_array(filepath, snd_ext_sound))
+                       check = BLI_path_extension_replace(filepath, FILE_MAX, extension);
                else
-                       check = BLI_ensure_extension(filepath, FILE_MAX, extension);
+                       check = BLI_path_extension_ensure(filepath, FILE_MAX, extension);
 
                if (!check)
                        return check;
index 8123bed..6587258 100644 (file)
@@ -1973,31 +1973,31 @@ int ED_path_extension_type(const char *path)
        else if (file_is_blend_backup(path)) {
                return FILE_TYPE_BLENDER_BACKUP;
        }
-       else if (BLI_testextensie(path, ".app")) {
+       else if (BLI_path_extension_check(path, ".app")) {
                return FILE_TYPE_APPLICATIONBUNDLE;
        }
-       else if (BLI_testextensie(path, ".py")) {
+       else if (BLI_path_extension_check(path, ".py")) {
                return FILE_TYPE_PYSCRIPT;
        }
-       else if (BLI_testextensie_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) {
+       else if (BLI_path_extension_check_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) {
                return FILE_TYPE_TEXT;
        }
-       else if (BLI_testextensie_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) {
+       else if (BLI_path_extension_check_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) {
                return FILE_TYPE_FTFONT;
        }
-       else if (BLI_testextensie(path, ".btx")) {
+       else if (BLI_path_extension_check(path, ".btx")) {
                return FILE_TYPE_BTX;
        }
-       else if (BLI_testextensie(path, ".dae")) {
+       else if (BLI_path_extension_check(path, ".dae")) {
                return FILE_TYPE_COLLADA;
        }
-       else if (BLI_testextensie(path, ".abc")) {
+       else if (BLI_path_extension_check(path, ".abc")) {
                return FILE_TYPE_ALEMBIC;
        }
-       else if (BLI_testextensie_array(path, imb_ext_image)) {
+       else if (BLI_path_extension_check_array(path, imb_ext_image)) {
                return FILE_TYPE_IMAGE;
        }
-       else if (BLI_testextensie(path, ".ogg")) {
+       else if (BLI_path_extension_check(path, ".ogg")) {
                if (IMB_isanim(path)) {
                        return FILE_TYPE_MOVIE;
                }
@@ -2005,10 +2005,10 @@ int ED_path_extension_type(const char *path)
                        return FILE_TYPE_SOUND;
                }
        }
-       else if (BLI_testextensie_array(path, imb_ext_movie)) {
+       else if (BLI_path_extension_check_array(path, imb_ext_movie)) {
                return FILE_TYPE_MOVIE;
        }
-       else if (BLI_testextensie_array(path, imb_ext_audio)) {
+       else if (BLI_path_extension_check_array(path, imb_ext_audio)) {
                return FILE_TYPE_SOUND;
        }
        return 0;
@@ -2233,7 +2233,7 @@ static int filelist_readjob_list_dir(
                        /* Otherwise, do not check extensions for directories! */
                        else if (!(entry->typeflag & FILE_TYPE_DIR)) {
                                entry->typeflag = file_extension_type(root, entry->relpath);
-                               if (filter_glob[0] && BLI_testextensie_glob(entry->relpath, filter_glob)) {
+                               if (filter_glob[0] && BLI_path_extension_check_glob(entry->relpath, filter_glob)) {
                                        entry->typeflag |= FILE_TYPE_OPERATOR;
                                }
                        }
index 44ff108..b852788 100644 (file)
@@ -1538,7 +1538,7 @@ static int image_replace_exec(bContext *C, wmOperator *op)
                BKE_image_signal(bmain, sima->image, &sima->iuser, IMA_SIGNAL_SRC_CHANGE);
        }
 
-       if (BLI_testextensie_array(str, imb_ext_movie))
+       if (BLI_path_extension_check_array(str, imb_ext_movie))
                sima->image->source = IMA_SRC_MOVIE;
        else
                sima->image->source = IMA_SRC_FILE;
index b24817f..a78b3ee 100644 (file)
@@ -3874,7 +3874,7 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const
                else
                        BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
 
-               BLI_replace_extension(filepath, sizeof(filepath), ".srt");
+               BLI_path_extension_replace(filepath, sizeof(filepath), ".srt");
                RNA_string_set(op->ptr, "filepath", filepath);
        }
 
@@ -3899,7 +3899,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op)
        }
 
        RNA_string_get(op->ptr, "filepath", filepath);
-       BLI_ensure_extension(filepath, sizeof(filepath), ".srt");
+       BLI_path_extension_ensure(filepath, sizeof(filepath), ".srt");
 
        /* Avoid File write exceptions */
        if (!BLI_exists(filepath)) {
index 759f645..200e3eb 100644 (file)
@@ -928,7 +928,7 @@ Render *Controller::RenderStrokes(Render *re, bool render)
 
 void Controller::InsertStyleModule(unsigned index, const char *iFileName)
 {
-       if (!BLI_testextensie(iFileName, ".py")) {
+       if (!BLI_path_extension_check(iFileName, ".py")) {
                cerr << "Error: Cannot load \"" << string(iFileName) << "\", unknown extension" << endl;
                return;
        }
index b123d50..ab8824f 100644 (file)
@@ -179,7 +179,7 @@ int imb_is_a_photoshop(const char *filename)
                NULL
        };
 
-       return BLI_testextensie_array(filename, photoshop_extension);
+       return BLI_path_extension_check_array(filename, photoshop_extension);
 }
 
 int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags)
index afa3ffb..0b4490a 100644 (file)
@@ -159,7 +159,7 @@ static ImBuf *IMB_ibImageFromFile(const char *filepath, int flags, char colorspa
 static bool imb_is_filepath_format(const char *filepath)
 {
        /* return true if this is one of the formats that can't be loaded from memory */
-       return BLI_testextensie_array(filepath, imb_ext_image_filepath_only);
+       return BLI_path_extension_check_array(filepath, imb_ext_image_filepath_only);
 }
 
 ImBuf *IMB_loadifffile(int file, const char *filepath, int flags, char colorspace[IM_MAX_SPACE], const char *descr)
@@ -199,7 +199,7 @@ static void imb_cache_filename(char *filename, const char *name, int flags)
        /* read .tx instead if it exists and is not older */
        if (flags & IB_tilecache) {
                BLI_strncpy(filename, name, IMB_FILENAME_SIZE);
-               if (!BLI_replace_extension(filename, IMB_FILENAME_SIZE, ".tx"))
+               if (!BLI_path_extension_replace(filename, IMB_FILENAME_SIZE, ".tx"))
                        return;
 
                if (BLI_file_older(name, filename))
index 9dfe926..db57023 100644 (file)
@@ -281,7 +281,7 @@ static int isffmpeg(const char *filename)
        AVCodec *pCodec;
        AVCodecContext *pCodecCtx;
 
-       if (BLI_testextensie_n(
+       if (BLI_path_extension_check_n(
                filename,
                ".swf", ".jpg", ".png", ".dds", ".tga", ".bmp", ".tif", ".exr", ".cin", ".wav", NULL))
        {
index 5f51f2a..0d7b0c9 100644 (file)
@@ -726,7 +726,7 @@ void BPY_modules_load_user(bContext *C)
        bpy_context_set(C, &gilstate);
 
        for (text = bmain->text.first; text; text = text->id.next) {
-               if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) {
+               if (text->flags & TXT_ISSCRIPT && BLI_path_extension_check(text->id.name + 2, ".py")) {
                        if (!(G.f & G_SCRIPT_AUTOEXEC)) {
                                if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
                                        G.f |= G_SCRIPT_AUTOEXEC_FAIL;
index 8ecfe80..55fb43b 100644 (file)
@@ -2157,7 +2157,7 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
                                        ImageFormatData imf = rd->im_format;
                                        imf.imtype = R_IMF_IMTYPE_JPEG90;
 
-                                       if (BLI_testextensie(name, ".exr"))
+                                       if (BLI_path_extension_check(name, ".exr"))
                                                name[strlen(name) - 4] = 0;
                                        BKE_image_path_ensure_ext_from_imformat(name, &imf);
 
@@ -2212,7 +2212,7 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
                                ImageFormatData imf = rd->im_format;
                                imf.imtype = R_IMF_IMTYPE_JPEG90;
 
-                               if (BLI_testextensie(name, ".exr"))
+                               if (BLI_path_extension_check(name, ".exr"))
                                        name[strlen(name) - 4] = 0;
 
                                BKE_image_path_ensure_ext_from_imformat(name, &imf);
index e0cacdf..c259a60 100644 (file)
@@ -1227,7 +1227,7 @@ static void render_result_exr_file_cache_path(Scene *sce, const char *root, char
        const char *blendfile_path = BKE_main_blendfile_path_from_global();
        if (blendfile_path[0] != '\0') {
                BLI_split_dirfile(blendfile_path, dirname, filename, sizeof(dirname), sizeof(filename));
-               BLI_replace_extension(filename, sizeof(filename), "");  /* strip '.blend' */
+               BLI_path_extension_replace(filename, sizeof(filename), "");  /* strip '.blend' */
                BLI_hash_md5_buffer(blendfile_path, strlen(blendfile_path), path_digest);
        }
        else {
index 8161846..be805fa 100644 (file)
@@ -1100,7 +1100,7 @@ bool write_crash_blend(void)
        int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on crash file */
 
        BLI_strncpy(path, BKE_main_blendfile_path_from_global(), sizeof(path));
-       BLI_replace_extension(path, sizeof(path), "_crash.blend");
+       BLI_path_extension_replace(path, sizeof(path), "_crash.blend");
        if (BLO_write_file(G_MAIN, path, fileflags, NULL, NULL)) {
                printf("written: %s\n", path);
                return 1;
@@ -2166,9 +2166,9 @@ static bool blend_save_check(bContext *UNUSED(C), wmOperator *op)
        char filepath[FILE_MAX];
        RNA_string_get(op->ptr, "filepath", filepath);
        if (!BLO_has_bfile_extension(filepath)) {
-               /* some users would prefer BLI_replace_extension(),
+               /* some users would prefer BLI_path_extension_replace(),
                 * we keep getting nitpicking bug reports about this - campbell */
-               BLI_ensure_extension(filepath, FILE_MAX, ".blend");
+               BLI_path_extension_ensure(filepath, FILE_MAX, ".blend");
                RNA_string_set(op->ptr, "filepath", filepath);
                return true;
        }
index 44c93d2..94e5874 100644 (file)
@@ -123,7 +123,7 @@ static void sig_handle_crash(int signum)
                        }
                        else {
                                BLI_strncpy(fname, G_MAIN->name, sizeof(fname));
-                               BLI_replace_extension(fname, sizeof(fname), ".crash.blend");
+                               BLI_path_extension_replace(fname, sizeof(fname), ".crash.blend");
                        }
 
                        printf("Writing: %s\n", fname);
@@ -144,7 +144,7 @@ static void sig_handle_crash(int signum)
        }
        else {
                BLI_join_dirfile(fname, sizeof(fname), BKE_tempdir_base(), BLI_path_basename(G_MAIN->name));
-               BLI_replace_extension(fname, sizeof(fname), ".crash.txt");
+               BLI_path_extension_replace(fname, sizeof(fname), ".crash.txt");
        }
 
        printf("Writing: %s\n", fname);