/*refresh modules - note we don't check for deleted modules but since we've open them the OS should forbid delete*/ u32 gf_modules_refresh(GF_ModuleManager *pm) { u32 i; if (!pm) return 0; /*load all static modules*/ load_static_modules(pm); for (i =0; i < pm->num_dirs; i++){ #ifdef WIN32 gf_enum_directory(pm->dirs[i], GF_FALSE, enum_modules, pm, ".dll"); #elif defined(__APPLE__) #if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) /*we are in static build for modules by default*/ #else gf_enum_directory(pm->dirs[i], 0, enum_modules, pm, ".dylib"); #endif #else GF_LOG(GF_LOG_INFO, GF_LOG_CORE, ("Refreshing list of modules in directory %s...\n", pm->dirs[i])); gf_enum_directory(pm->dirs[i], 0, enum_modules, pm, ".so"); #endif } return gf_list_count(pm->plug_list); }
void Playlist::AddDir(Bool do_recurse) { BROWSEINFO brw; LPMALLOC pMalloc; LPITEMIDLIST ret; char dir[MAX_PATH]; Bool res = GF_FALSE; if (NOERROR == ::SHGetMalloc(&pMalloc) ) { memset(&brw, 0, sizeof(BROWSEINFO)); brw.hwndOwner = this->GetSafeHwnd(); brw.pszDisplayName = dir; brw.lpszTitle = "Select Directory..."; brw.ulFlags = 0L; brw.lpfn = LocCbck; ret = SHBrowseForFolder(&brw); if (ret != NULL) { if (::SHGetPathFromIDList(ret, dir)) res = GF_TRUE; pMalloc->Free(ret); } pMalloc->Release(); } if (!res) return; strcpy(szCacheDir, dir); gf_enum_directory(dir, GF_FALSE, pl_enum_dir_item, this, NULL); if (do_recurse) gf_enum_directory(dir, GF_FALSE, pl_enum_dir_dirs, this, NULL); m_all_dead_entries=-1; RefreshList(); }
void CPlaylist::ScanDirectory(const char *dir) { ResetView(); if (!dir || !strlen(dir)) { RFs iFs; TDriveList aList; iFs.Connect(); iFs.DriveList(aList); for (TInt i=0; i<KMaxDrives; i++) { if (aList[i]) { TChar aDrive; iFs.DriveToChar(i, aDrive); sprintf(szCurrentDir, "%c:", (TUint)aDrive); AddItem(szCurrentDir, 0); } } iFs.Close(); FlushItemList(); strcpy(szCurrentDir, ""); return; } else { strcpy(szCurrentDir, dir); AddItem("..", 1); } #ifndef GPAC_GUI_ONLY gf_enum_directory((const char *) szCurrentDir, 1, enum_dirs, this, NULL); gf_enum_directory((char *) szCurrentDir, 0, enum_files, this, view_all_files ? NULL : ext_list); #endif FlushItemList(); ((COsmo4AppUi *) CEikonEnv::Static()->AppUi())->SetTitle(szCurrentDir, 0); }
GF_Err gf_cleanup_dir(char* DirPathName) { Bool directory_clean_mode; directory_clean_mode = 1; gf_enum_directory(DirPathName, 1, delete_dir, &directory_clean_mode, NULL); directory_clean_mode = 0; gf_enum_directory(DirPathName, 0, delete_dir, &directory_clean_mode, NULL); return GF_OK; }
GF_Err gf_cleanup_dir(const char* DirPathName) { Bool directory_clean_mode; directory_clean_mode = GF_TRUE; gf_enum_directory(DirPathName, GF_TRUE, delete_dir, &directory_clean_mode, NULL); directory_clean_mode = GF_FALSE; gf_enum_directory(DirPathName, GF_FALSE, delete_dir, &directory_clean_mode, NULL); return GF_OK; }
void wxPlaylist::AddDir(Bool do_recurse) { wxDirDialog dlg(this); dlg.SetPath(wxString(szCacheDir, wxConvUTF8) ); if (dlg.ShowModal() != wxID_OK) return; strcpy(szCacheDir, dlg.GetPath().mb_str(wxConvUTF8)); gf_enum_directory(szCacheDir, 0, pl_enum_dir_item, this, NULL); if (do_recurse) gf_enum_directory(szCacheDir, 1, pl_enum_dir_dirs, this, NULL); m_all_dead_entries = -1; RefreshList(); }
void process_list_change(HWND hWnd, Bool add_to_pl) { TCHAR sTxt[GF_MAX_PATH]; if (!SendMessage(hList, LB_GETSELCOUNT, 0, 0)) return; u32 idx = SendMessage(hList, LB_GETCURSEL, 0, 0); SendMessage(hList, LB_GETTEXT, idx, (LPARAM)(LPCTSTR) sTxt); DWORD param = SendMessage(hList, LB_GETITEMDATA, idx, 0); if (param==1) { if (!wcscmp(sTxt, _T("+ ..") ) ) { if (add_to_pl) return; current_dir[strlen((const char *) current_dir)-1] = 0; char *b = strrchr((const char *) current_dir, '\\'); if (b) b[1] = 0; else b[0] = '\\'; CE_CharToWide((char *) current_dir, (u16 *) w_current_dir); set_directory(w_current_dir); } else { if (add_to_pl) { char dir[MAX_PATH]; TCHAR wdir[MAX_PATH]; wcscpy(wdir, w_current_dir); wcscat(wdir, sTxt+2); wcscat(wdir, _T("\\")); CE_WideToChar((u16 *) wdir, (char *) dir); gf_enum_directory(dir, GF_FALSE, add_files, NULL, NULL); } else { wcscat(w_current_dir, sTxt+2); wcscat(w_current_dir, _T("\\")); CE_WideToChar((u16 *) w_current_dir, (char *) current_dir); set_directory(w_current_dir); } } } else { char szTxt[1024]; CE_WideToChar((u16 *) sTxt, (char *) szTxt); strcpy((char *) out_url, (const char *) current_dir); strcat(out_url, szTxt); if (add_to_pl) { gf_cfg_set_key(cfg, "Playlist", out_url, ""); strcpy(out_url, ""); } else { if (playlist_mode) { const char *file; char szPLE[20]; sprintf(szPLE, "%d", idx); gf_cfg_set_key(cfg, "General", "PLEntry", szPLE); file = gf_cfg_get_key_name(cfg, "Playlist", idx); strcpy(out_url, file); } gf_cfg_set_key(cfg, "General", "LastWorkingDir", (const char *) current_dir); EndDialog(hWnd, 1); } } }
void set_directory(TCHAR *dir) { SendMessage(hList, LB_RESETCONTENT, 0, 0); CE_WideToChar((u16 *) dir, (char *) current_dir); wcscpy(w_current_dir, dir); SetWindowText(hDirTxt, w_current_dir); if (strcmp((const char *) current_dir, "\\")) { int iRes = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) _T("+ ..") ); SendMessage(hList, LB_SETITEMDATA, iRes, (LPARAM) 1); } /*enum directories*/ gf_enum_directory((const char *) current_dir, GF_TRUE, enum_dirs, NULL, NULL); /*enum files*/ gf_enum_directory((char *) current_dir, GF_FALSE, enum_files, NULL, NULL); SendMessage(hList, LB_SETCURSEL, 0, 0); SetFocus(hList); }
/*refresh modules - note we don't check for deleted modules but since we've open them the OS should forbid delete*/ GF_EXPORT u32 gf_modules_refresh(GF_ModuleManager *pm) { if (!pm) return 0; //!! symbian 9.1 doesn't allow for DLL browsing in /sys/bin, and can only load DLLs in /sys/bin !! #if 0 gf_enum_directory((char*)pm->dir, 0, enum_modules, pm, ".dll"); #else u32 i, mod_count; mod_count = gf_cfg_get_key_count(pm->cfg, "SymbianDLLs"); for (i=0; i<mod_count; i++) { const char *mod = gf_cfg_get_key_name(pm->cfg, "SymbianDLLs", i); if (stricmp(gf_cfg_get_key(pm->cfg, "SymbianDLLs", mod), "yes")) continue; enum_modules(pm, (char*)mod, NULL); } #endif return gf_list_count(pm->plug_list); }
static Bool check_file_exists(char *name, char *path, char *outPath) { char szPath[GF_MAX_PATH]; FILE *f; #ifdef GPAC_STATIC_MODULES if (!strcmp(name, TEST_MODULE)) { Bool found = GF_FALSE; gf_enum_directory(path, GF_FALSE, enum_mod_dir, &found, NULL); if (!found) return 0; if (outPath != path) strcpy(outPath, path); return 1; } #endif sprintf(szPath, "%s%c%s", path, GF_PATH_SEPARATOR, name); f = fopen(szPath, "rb"); if (!f) return 0; fclose(f); if (outPath != path) strcpy(outPath, path); return 1; }
static Bool ft_enum_fonts_dir(void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info) { GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[FreeType] Scanning directory %s (%s)\n", file_name, file_path)); gf_enum_directory(file_path, 0, ft_enum_fonts, cbck, "ttf;ttc"); return (gf_enum_directory(file_path, 1, ft_enum_fonts_dir, cbck, NULL)==GF_OK) ? GF_FALSE : GF_TRUE; }
void CPlaylist::PlaylistAct(Osmo4_PLActions act) { char szURL[1024]; char szName[100]; CDesCArray*array; TInt idx; TInt count; if (act==Osmo4PLClear) { while (1) { #ifndef GPAC_GUI_ONLY const char *opt = gf_cfg_get_key_name(m_user->config, "Playlist", 0); if (!opt) break; gf_cfg_set_key(m_user->config, "Playlist", opt, NULL); #endif } RefreshPlaylist(); return; } else if (act == Osmo4PLToggleMode) { playlist_mode = !playlist_mode; RefreshPlaylist(); return; } else if (act == Osmo4PLToggleAllFiles) { view_all_files = !view_all_files; RefreshPlaylist(); return; } else if (act == Osmo4PLAdd) { #ifndef GPAC_GUI_ONLY GetSelectionName(szName); if ((szName[0] == '+') && (szName[1] == ' ')) { if ((szName[2] != '.') && (szName[3] != '.')) { sprintf(szURL, "%s\\%s", szCurrentDir, szName+2); gf_enum_directory(szURL, 0, dir_add_files, this, view_all_files ? NULL : ext_list); } } else if (szName[1] == ':') { gf_enum_directory(szName, 0, dir_add_files, this, view_all_files ? NULL : ext_list); } else { sprintf(szURL, "%s\\%s", szCurrentDir, szName); gf_cfg_set_key(m_user->config, "Playlist", szURL, ""); } #endif return; } GetSelectionName(szName); if ((szName[0] == '+') && (szName[1] == ' ')) return; else if (szName[1] == ':') return; switch (act) { /*remove from playlist*/ case Osmo4PLRem: #ifndef GPAC_GUI_ONLY sprintf(szURL, "%s\\%s", szCurrentDir, szName); gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL); #endif RefreshPlaylist(); break; /*move up*/ case Osmo4PLMoveUp: array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray()); count = array->Count(); idx = iListBox->CurrentItemIndex(); sprintf(szURL, "%s\\%s", szCurrentDir, szName); #ifndef GPAC_GUI_ONLY gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL); gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx-1); #endif RefreshPlaylist(); if (idx>1) iListBox->SetCurrentItemIndexAndDraw(idx-1); break; /*move down*/ case Osmo4PLMoveDown: array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray()); count = array->Count(); idx = iListBox->CurrentItemIndex(); sprintf(szURL, "%s\\%s", szCurrentDir, szName); #ifndef GPAC_GUI_ONLY gf_cfg_set_key(m_user->config, "Playlist", szURL, NULL); gf_cfg_insert_key(m_user->config, "Playlist", szURL, "", idx+1); #endif RefreshPlaylist(); if (idx<count-1) iListBox->SetCurrentItemIndexAndDraw(idx+1); break; default: break; } }
int main(int argc, char **argv) { u32 i; char *arg; GF_LoadCompare lc; Bool single = 0; char *out = NULL; char in[256] = "."; fprintf(stdout, "LASeR and SVG Comparison tool\n"); memset(&lc, 0, sizeof(GF_LoadCompare)); lc.nbloads = 1; lc.out = stdout; for (i = 1; i < (u32) argc ; i++) { arg = argv[i]; if (!stricmp(arg, "-out")) { out = argv[i+1]; i++; } else if (!stricmp(arg, "-single")) { single = 1; strcpy(in, argv[i+1]); i++; } else if (!stricmp(arg, "-dir")) { strcpy(in, argv[i+1]); i++; } else if (!stricmp(arg, "-nloads")) { lc.nbloads = (u32)atoi(argv[i+1]); i++; } else if (!stricmp(arg, "-regenerate")) { lc.regenerate = 1; } else if (!stricmp(arg, "-xmt")) { lc.type = XMT; } else if (!stricmp(arg, "-svg")) { lc.type = SVG; } else if (!stricmp(arg, "-spread_repeat")) { lc.spread_repeat = 1; } else if (!stricmp(arg, "-verbose")) { lc.verbose = (u32)atoi(argv[i+1]); i++; } else { usage(); return -1; } } gf_sys_init(); if (out) lc.out = fopen(out, "wt"); if (!lc.out) { fprintf(stderr, "Cannot open output file %s\n", out); return -1; } if (lc.type == SVG) { fprintf(lc.out,"File Name\tSVG Size\tSVG Load Time\tLibXML Load Time\tSVGZ Size\tSVGZ Load Time\tLibXML GZ Load Time\tMP4 Size\tMP4 Load Time\tDecoded SVG Size\tDecoded SVG Load Time\n"); } else if (lc.type == XMT) { fprintf(lc.out,"File Name\tXMT Size\tXMT Load Time\tBT Size\tBT Load Time\n"); } lc.data = gf_list_new(); if (single) { LoadData *ld; char *tmp = strrchr(in, GF_PATH_SEPARATOR); loadcompare_one(&lc, tmp+1, in); ld = gf_list_get(lc.data, 0); print_load_data(&lc, ld); gf_free(ld); } else { if (lc.spread_repeat) { for (lc.repeat_index = 0; lc.repeat_index < lc.nbloads; lc.repeat_index ++) { if (lc.verbose) fprintf(stdout, "Loop %d\n", lc.repeat_index); if (lc.type == SVG) { gf_enum_directory(in, 0, loadcompare_one, &lc, "svg"); } else if (lc.type == XMT) { gf_enum_directory(in, 0, loadcompare_one, &lc, "xmt"); } } for (i=0; i<gf_list_count(lc.data); i++) { LoadData *ld = gf_list_get(lc.data, i); print_load_data(&lc, ld); gf_free(ld); } } else { if (lc.type == SVG) { gf_enum_directory(in, 0, loadcompare_one, &lc, "svg"); } else if (lc.type == XMT) { gf_enum_directory(in, 0, loadcompare_one, &lc, "xmt"); } } } gf_list_del(lc.data); if (lc.out) fclose(lc.out); gf_sys_close(); return 0; }
static void ft_rescan_fonts(GF_FontReader *dr) { char *font_dir, *font_default; u32 i, count; GF_Config *cfg = gf_modules_get_config((GF_BaseInterface *)dr); FTBuilder *ftpriv = (FTBuilder *)dr->udta; GF_LOG(GF_LOG_INFO, GF_LOG_PARSER, ("[FreeType] Rescaning font directory %s\n", ftpriv->font_dir)); count = gf_cfg_get_key_count(cfg, "FontEngine"); for (i=0; i<count; i++) { const char *key = gf_cfg_get_key_name(cfg, "FontEngine", i); if (!strcmp(key, "FontReader")) continue; if (!strcmp(key, "FontDirectory")) continue; if (!strcmp(key, "RescanFonts")) continue; /*any other persistent options should go here*/ gf_cfg_set_key(cfg, "FontEngine", key, NULL); count--; i--; } gf_modules_set_option((GF_BaseInterface *)dr, "FontEngine", "RescanFonts", "no"); ftpriv->font_serif = NULL; ftpriv->font_sans = NULL; ftpriv->font_fixed = NULL; font_dir = ftpriv->font_dir; ftpriv->font_dir = NULL; gf_enum_directory(font_dir, 0, ft_enum_fonts, dr, "ttf;ttc"); gf_enum_directory(font_dir, 1, ft_enum_fonts_dir, dr, NULL); font_default = ftpriv->font_dir; ftpriv->font_dir = font_dir; if (ftpriv->font_fixed) gf_free(ftpriv->font_fixed); ftpriv->font_fixed = NULL; if (ftpriv->font_sans) gf_free(ftpriv->font_sans); ftpriv->font_sans = NULL; if (ftpriv->font_serif) gf_free(ftpriv->font_serif); ftpriv->font_serif = NULL; /* let's check we have fonts that match our default Bol/Italic/BoldItalic conventions*/ count = gf_cfg_get_key_count(cfg, "FontEngine"); for (i=0; i<count; i++) { const char *opt; char fkey[GF_MAX_PATH]; const char *key = gf_cfg_get_key_name(cfg, "FontEngine", i); opt = gf_cfg_get_key(cfg, "FontEngine", key); if (!strchr(opt, '/') && !strchr(opt, '\\')) continue; if (!strcmp(key, "FontDirectory")) continue; if (strstr(key, "Bold")) continue; if (strstr(key, "Italic")) continue; strcpy(fkey, key); strcat(fkey, " Italic"); opt = gf_cfg_get_key(cfg, "FontEngine", fkey); if (!opt) continue; strcpy(fkey, key); strcat(fkey, " Bold"); opt = gf_cfg_get_key(cfg, "FontEngine", fkey); if (!opt) continue; strcpy(fkey, key); strcat(fkey, " Bold Italic"); opt = gf_cfg_get_key(cfg, "FontEngine", fkey); if (!opt) continue; strcpy(fkey, key); strlwr(fkey); /*this font is suited for our case*/ if (isBestFontFor(BEST_FIXED_FONTS, ftpriv->font_fixed, key) || (!ftpriv->font_fixed && (strstr(fkey, "fixed") || strstr(fkey, "mono")) ) ) { if (ftpriv->font_fixed) gf_free(ftpriv->font_fixed); ftpriv->font_fixed = gf_strdup(key); } if (isBestFontFor(BEST_SANS_FONTS, ftpriv->font_sans, key) || (!ftpriv->font_sans && strstr(fkey, "sans")) ) { if (ftpriv->font_sans) gf_free(ftpriv->font_sans); ftpriv->font_sans = gf_strdup(key); } if (isBestFontFor(BEST_SERIF_FONTS, ftpriv->font_serif, key) || (!ftpriv->font_serif && strstr(fkey, "serif")) ) { if (ftpriv->font_serif) gf_free(ftpriv->font_serif); ftpriv->font_serif = gf_strdup(key); } } if (!ftpriv->font_serif) ftpriv->font_serif = gf_strdup(font_default ? font_default : ""); if (!ftpriv->font_sans) ftpriv->font_sans = gf_strdup(font_default ? font_default : ""); if (!ftpriv->font_fixed) ftpriv->font_fixed = gf_strdup(font_default ? font_default : ""); if (font_default) gf_free(font_default); gf_modules_set_option((GF_BaseInterface *)dr, "FontEngine", "FontFixed", ftpriv->font_fixed); gf_modules_set_option((GF_BaseInterface *)dr, "FontEngine", "FontSerif", ftpriv->font_serif); gf_modules_set_option((GF_BaseInterface *)dr, "FontEngine", "FontSans", ftpriv->font_sans); GF_LOG(GF_LOG_INFO, GF_LOG_PARSER, ("[FreeType] Font directory scanned\n", ftpriv->font_dir)); }
static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path, GF_FileEnumInfo *file_info) { gf_enum_directory(item_path, GF_FALSE, pl_enum_dir_item, cbck, NULL); gf_enum_directory(item_path, GF_TRUE, pl_enum_dir_dirs, cbck, NULL); return GF_FALSE; }
static Bool ft_enum_fonts_dir(void *cbck, char *file_name, char *file_path) { GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[FreeType] Scanning directory %s (%s)\n", file_name, file_path)); gf_enum_directory(file_path, 0, ft_enum_fonts, cbck, "ttf;ttc"); return gf_enum_directory(file_path, 1, ft_enum_fonts_dir, cbck, NULL); }
/*refresh modules - note we don't check for deleted modules but since we've open them the OS should forbid delete*/ u32 gf_modules_refresh(GF_ModuleManager *pm) { if (!pm) return 0; #ifdef WIN32 gf_enum_directory(pm->dir, 0, enum_modules, pm, ".dll"); #elif defined(__APPLE__) #if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_sdl_out.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_soft_raster.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_dummy_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_ctx_load.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_svg_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_mp3_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_aac_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_img_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_bifs_dec.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_hyb_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_gpac_js.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_isom_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_laser_dec.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_odf_dec.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_rtp_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_mpegts_in.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_ft_font.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_widgetman.dylib"); gf_list_add(pm->plug_list, inst); } { ModuleInstance *inst; GF_SAFEALLOC(inst, ModuleInstance); inst->interfaces = gf_list_new(); inst->plugman = pm; inst->name = gf_strdup("gm_mpd_in.dylib"); gf_list_add(pm->plug_list, inst); } #else gf_enum_directory(pm->dir, 0, enum_modules, pm, ".dylib"); #endif #else GF_LOG(GF_LOG_INFO, GF_LOG_CORE, ("Refreshing list of modules in directory %s...\n", pm->dir)); gf_enum_directory(pm->dir, 0, enum_modules, pm, ".so"); #endif return gf_list_count(pm->plug_list); }
GF_Err gf_cache_delete_all_cached_files(const char * directory) { GF_LOG(GF_LOG_INFO, GF_LOG_NETWORK, ("Deleting cached files in %s...\n", directory)); return gf_enum_directory( directory, 0, delete_cache_files, (void*)cache_file_prefix, NULL); }
static Bool pl_enum_dir_dirs(void *cbck, char *item_name, char *item_path) { gf_enum_directory(item_path, 0, pl_enum_dir_item, cbck, NULL); gf_enum_directory(item_path, 1, pl_enum_dir_dirs, cbck, NULL); return 0; }