|
发表于 2005-4-14 12:46:04
|
显示全部楼层
man strsep
----
static int check_bin_file(const char* file)
{
char* z, *p;
const char bin_files[] = "release note.txt|make.bat|t2phase.bat|built32mbit.bat|hex2fls.exe";
z = strdup(bin_files);
while( (p = strsep(&z, "|"))){
if(p == '\0'){
return -1;
}else{
if(strcmp(p, file) == 0)
return 0;
else
return -1;
}
}
free(z);
return -1;
} |
|