diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-03 16:34:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-03 16:34:42 +0400 |
commit | 50c3da699db13a1b51311919063bb3ad92dd8b3d (patch) | |
tree | 570123d075671acb045e9ebd161d12802ed5f9e9 /source/blender/blenlib/intern/path_util.c | |
parent | 957976882d084d9951760b154f414724d6ddb8be (diff) |
minor cleanup, minimal functional change.
replace some long duplicated, ifdef'd if statements for image extension.
- new function: BLI_testextensie_array(), can take an array of extensions.
- define extension arrays: imb_ext_image, imb_ext_movie, imb_ext_sound - we could have more of these.
- removed amiga extensions iff and lbm
Diffstat (limited to 'source/blender/blenlib/intern/path_util.c')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index d3e2b8f83e5..9a56722b5d9 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1263,6 +1263,19 @@ int BLI_testextensie(const char *str, const char *ext) return (retval); } +int BLI_testextensie_array(const char *str, const char **ext_array) +{ + int i=0; + while(ext_array[i]) { + if(BLI_testextensie(str, ext_array[i])) { + return 1; + } + + i++; + } + return 0; +} + int BLI_replace_extension(char *path, int maxlen, const char *ext) { int a; |