Changeset 24035
- Timestamp:
- 10/03/13 09:08:09 (9 years ago)
- Location:
- titan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/catcatch/catcatch.c
r17097 r24035 23 23 char* tmpstr = NULL; 24 24 25 tmpstr = ostrcat(getconfig("pluginpath", NULL), "/catcatch/skin.xml", 0, 0);25 tmpstr = createpluginpath("/catcatch/skin.xml", 0); 26 26 readscreen(tmpstr, 241, 1); 27 27 free(tmpstr); tmpstr = NULL; -
titan/titan/global.h
r23991 r24035 1 1 #ifndef GLOBAL_H 2 2 #define GLOBAL_H 3 4 //flag 0: get pluginpath an add text 5 //flag 1: get pluginpath and change "%pluginpath%/" 6 char* createpluginpath(char* text, int flag) 7 { 8 char* tmpstr = NULL; 9 if(text == NULL) return NULL; 10 11 if(flag == 0) 12 { 13 tmpstr = ostrcat(getconfig("pluginpath", NULL), text, 0, 0); 14 if(file_exist(tmpstr) == 1) return tmpstr; 15 16 free(tmpstr); tmpstr = NULL; 17 tmpstr = ostrcat(getconfig("pluginpath1", NULL), text, 0, 0); 18 if(file_exist(tmpstr) == 1) return tmpstr; 19 20 free(tmpstr); tmpstr = NULL; 21 tmpstr = ostrcat(getconfig("pluginpath2", NULL), text, 0, 0); 22 if(file_exist(tmpstr) == 1) return tmpstr; 23 24 return NULL; 25 } 26 else 27 { 28 if(strlen(text) < 13) return NULL; 29 30 tmpstr = ostrcat(getconfig("pluginpath", NULL), &text[13]); 31 if(file_exist(tmpstr) == 1) return tmpstr; 32 33 free(tmpstr); tmpstr = NULL; 34 tmpstr = ostrcat(getconfig("pluginpath1", NULL), &text[13]); 35 if(file_exist(tmpstr) == 1) return tmpstr; 36 37 free(tmpstr); tmpstr = NULL; 38 tmpstr = ostrcat(getconfig("pluginpath2", NULL), &text[13]); 39 if(file_exist(tmpstr) == 1) return tmpstr; 40 } 41 42 return NULL; 43 } 3 44 4 45 int osystem(char* cmd, int timeout) … … 1692 1733 } 1693 1734 1735 //flag 0: normal picons 1736 //flag 1: alternate picons 1694 1737 char* createpiconpath(struct channel* chnode, int flag) 1695 1738 { -
titan/titan/plugin.h
r23411 r24035 218 218 char *tmppath = NULL; 219 219 220 //pluginpath 220 221 tmppath = getconfig("pluginpath", NULL); 221 222 … … 252 253 free(filelist); 253 254 254 255 // 2. plugindir 256 tmppath = getconfig("pluginpath_2", NULL); 255 //pluginpath1 256 tmppath = getconfig("pluginpath1", NULL); 257 257 258 258 if(tmppath == NULL) … … 262 262 if(count < 0) 263 263 { 264 perr("scandir_2"); 264 perr("scandir1"); 265 return 0; 266 } 267 268 while(count--) 269 { 270 //check if link is a dir 271 if(filelist[count]->d_type == DT_LNK || filelist[count]->d_type == DT_UNKNOWN) 272 { 273 tmpstr = createpath(tmppath, filelist[count]->d_name); 274 if(isdir(tmpstr) == 1) 275 filelist[count]->d_type = DT_DIR; 276 277 free(tmpstr); tmpstr = NULL; 278 } 279 280 if(filelist[count]->d_type == DT_DIR && ostrcmp(filelist[count]->d_name, ".") != 0 && ostrcmp(filelist[count]->d_name, "..") != 0) 281 { 282 pluginpath = createpath(tmppath, filelist[count]->d_name); 283 readplugin(pluginpath); 284 free(pluginpath); pluginpath = NULL; 285 } 286 free(filelist[count]); 287 } 288 free(filelist); 289 290 //pluginpath2 291 tmppath = getconfig("pluginpath2", NULL); 292 293 if(tmppath == NULL) 294 return 0; 295 296 count = scandir(tmppath, &filelist, 0, 0); 297 if(count < 0) 298 { 299 perr("scandir2"); 265 300 return 0; 266 301 } -
titan/titan/skin.h
r23991 r24035 478 478 { 479 479 if(ostrstr(picname, "%pluginpath%/") != NULL) 480 { 481 tmpstr = createpath(getconfig("pluginpath", NULL), &picname[13]); 482 } 480 tmpstr = createpluginpath(picname, 1); 483 481 else 484 482 tmpstr = createpath(getconfig("skinpath", NULL), picname);
Note: See TracChangeset
for help on using the changeset viewer.