static int file_extension_type(char *relname) { if(BLO_has_bfile_extension(relname)) { return BLENDERFILE; } else if(file_is_blend_backup(relname)) { return BLENDERFILE_BACKUP; } else if(BLI_testextensie(relname, ".py")) { return PYSCRIPTFILE; } else if(BLI_testextensie(relname, ".txt") || BLI_testextensie(relname, ".glsl") || BLI_testextensie(relname, ".data")) { return TEXTFILE; } else if( BLI_testextensie(relname, ".ttf") || BLI_testextensie(relname, ".ttc") || BLI_testextensie(relname, ".pfb") || BLI_testextensie(relname, ".otf") || BLI_testextensie(relname, ".otc")) { return FTFONTFILE; } else if(BLI_testextensie(relname, ".btx")) { return BTXFILE; } else if(BLI_testextensie(relname, ".dae")) { return COLLADAFILE; } else if(BLI_testextensie_array(relname, imb_ext_image) || (G.have_quicktime && BLI_testextensie_array(relname, imb_ext_image_qt))) { return IMAGEFILE; } else if(BLI_testextensie_array(relname, imb_ext_movie)) { return MOVIEFILE; } else if(BLI_testextensie_array(relname, imb_ext_audio)) { return SOUNDFILE; } return 0; }
static int path_extension_type(const char *path) { if (BLO_has_bfile_extension(path)) { return FILE_TYPE_BLENDER; } else if (file_is_blend_backup(path)) { return FILE_TYPE_BLENDER_BACKUP; } else if (BLI_testextensie(path, ".app")) { return FILE_TYPE_APPLICATIONBUNDLE; } else if (BLI_testextensie(path, ".py")) { return FILE_TYPE_PYSCRIPT; } else if (BLI_testextensie_n(path, ".txt", ".glsl", ".osl", ".data", NULL)) { return FILE_TYPE_TEXT; } else if (BLI_testextensie_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) { return FILE_TYPE_FTFONT; } else if (BLI_testextensie(path, ".btx")) { return FILE_TYPE_BTX; } else if (BLI_testextensie(path, ".dae")) { return FILE_TYPE_COLLADA; } else if (BLI_testextensie_array(path, imb_ext_image) || (G.have_quicktime && BLI_testextensie_array(path, imb_ext_image_qt))) { return FILE_TYPE_IMAGE; } else if (BLI_testextensie(path, ".ogg")) { if (IMB_isanim(path)) { return FILE_TYPE_MOVIE; } else { return FILE_TYPE_SOUND; } } else if (BLI_testextensie_array(path, imb_ext_movie)) { return FILE_TYPE_MOVIE; } else if (BLI_testextensie_array(path, imb_ext_audio)) { return FILE_TYPE_SOUND; } return 0; }