12 if(!FileName || !*FileName || !Name)
18 slash = strrchr(FileName,
'/');
25 strcpy(Path, FileName);
26 c = strrchr(Path,
'/');
29 strcpy(Name, slash + 1);
33 if(Path) Path[0] =
'\0';
34 strcpy(Name, FileName);
43 Name[strlen(Name) - 4] =
'\0';
47 if(
StringEndsWith(Name,
".rec.inf")) Name[strlen(Name) - 4] =
'\0';
48 if(
StringEndsWith(Name,
".mpg.inf")) Name[strlen(Name) - 4] =
'\0';
51 if(
StringEndsWith(Name,
".rec.nav")) Name[strlen(Name) - 4] =
'\0';
52 if(
StringEndsWith(Name,
".mpg.nav")) Name[strlen(Name) - 4] =
'\0';
57 dot = strrchr(Name,
'.');
61 if(dot) strcpy(Ext, dot);
70 if((Name[strlen(Name) - 2] ==
'-') && isdigit(Name[strlen(Name) - 1]) && (Name[strlen(Name) - 1] !=
'0'))
72 *Index = strtol(&Name[strlen(Name) - 1], NULL, 10);
73 Name[strlen(Name) - 2] =
'\0';
void SeparateFileNameComponents(const char *FileName, char *Path, char *Name, char *Ext, int *Index, bool *isRec, bool *isDel)
bool HDD_isRecFileName(const char *FileName)
bool StringEndsWith(const char *text, const char *postfix)