/* common.c */ #include "\yossi\common.h" #include #include char *strmfe (char *out, char *in, char *ext) { strcpy (out, in); strtok (out, "."); strcat (out, "."); strcat (out, ext); return out; } char *change_file_ext (char *file, char *ext) { static char new_name[MAX_FILE_NAME]; strmfe (new_name, file, ext); return (new_name); } char is_file_later(char *file1, char *file2) { struct ffblk fb1, fb2; char f1, f2, rc; f1 = findfirst (file1, &fb1, 0); f2 = findfirst (file2, &fb2, 0); if (f1 == 0 && f2 == 0) /* Both files exists */ { if (fb1.ff_fdate > fb2.ff_fdate || fb1.ff_fdate == fb2.ff_fdate && fb1.ff_ftime > fb2.ff_ftime) rc = YES; else rc = NO; } else rc = YES; return rc; } void swap_char (char *c1, char *c2) { char t; t = *c1; *c1 = *c2; *c2 = t; }