|
|
| version 1.4, 2004/08/14 12:16:17 | version 1.5, 2004/08/15 12:32:11 |
|---|---|
| Line 467 static int flagload_evt(STFLAGH sfh, con | Line 467 static int flagload_evt(STFLAGH sfh, con |
| // ---- disk | // ---- disk |
| typedef struct { | typedef struct { |
| OEMCHAR path[MAX_PATH]; | OEMCHAR fname[MAX_PATH]; |
| int readonly; | UINT32 ftype; |
| UINT readonly; | |
| DOSDATE date; | DOSDATE date; |
| DOSTIME time; | DOSTIME time; |
| } STATDISK; | } STATDISK; |
| Line 477 static const OEMCHAR str_fddx[] = OEMTEX | Line 478 static const OEMCHAR str_fddx[] = OEMTEX |
| static const OEMCHAR str_updated[] = OEMTEXT("%s: updated"); | static const OEMCHAR str_updated[] = OEMTEXT("%s: updated"); |
| static const OEMCHAR str_notfound[] = OEMTEXT("%s: not found"); | static const OEMCHAR str_notfound[] = OEMTEXT("%s: not found"); |
| static int disksave(STFLAGH sfh, const OEMCHAR *path, int readonly) { | static int disksave(STFLAGH sfh, const _FDDFILE *fdd) { |
| STATDISK st; | STATDISK st; |
| FILEH fh; | FILEH fh; |
| ZeroMemory(&st, sizeof(st)); | ZeroMemory(&st, sizeof(st)); |
| if ((path) && (path[0])) { | if (fdd->type != DISKTYPE_NOTREADY) { |
| file_cpyname(st.path, path, sizeof(st.path)); | file_cpyname(st.fname, fdd->fname, NELEMENTS(st.fname)); |
| st.readonly = readonly; | st.ftype = fdd->ftype; |
| fh = file_open_rb(path); | st.readonly = fdd->protect; |
| fh = file_open_rb(st.fname); | |
| if (fh != FILEH_INVALID) { | if (fh != FILEH_INVALID) { |
| file_getdatetime(fh, &st.date, &st.time); | file_getdatetime(fh, &st.date, &st.time); |
| file_close(fh); | file_close(fh); |
| Line 501 static int flagsave_disk(STFLAGH sfh, co | Line 503 static int flagsave_disk(STFLAGH sfh, co |
| REG8 i; | REG8 i; |
| ret = STATFLAG_SUCCESS; | ret = STATFLAG_SUCCESS; |
| for (i=0; i<4; i++) { | for (i=0; i<MAX_FDDFILE; i++) { |
| ret |= disksave(sfh, fddfile_diskname(i), fddfile_diskprotect(i)); | ret |= disksave(sfh, fddfile + i); |
| } | } |
| (void)tbl; | (void)tbl; |
| return(ret); | return(ret); |
| Line 518 static int diskcheck(STFLAGH sfh, const | Line 520 static int diskcheck(STFLAGH sfh, const |
| DOSTIME time; | DOSTIME time; |
| ret = statflag_read(sfh, &st, sizeof(st)); | ret = statflag_read(sfh, &st, sizeof(st)); |
| if (st.path[0]) { | if (st.fname[0]) { |
| fh = file_open_rb(st.path); | fh = file_open_rb(st.fname); |
| if (fh != FILEH_INVALID) { | if (fh != FILEH_INVALID) { |
| file_getdatetime(fh, &date, &time); | file_getdatetime(fh, &date, &time); |
| file_close(fh); | file_close(fh); |
| Line 546 static int flagcheck_disk(STFLAGH sfh, c | Line 548 static int flagcheck_disk(STFLAGH sfh, c |
| OEMCHAR buf[8]; | OEMCHAR buf[8]; |
| ret = 0; | ret = 0; |
| for (i=0; i<4; i++) { | for (i=0; i<MAX_FDDFILE; i++) { |
| OEMSPRINTF(buf, str_fddx, i+1); | OEMSPRINTF(buf, str_fddx, i+1); |
| ret |= diskcheck(sfh, buf); | ret |= diskcheck(sfh, buf); |
| } | } |
| Line 561 static int flagload_disk(STFLAGH sfh, co | Line 563 static int flagload_disk(STFLAGH sfh, co |
| STATDISK st; | STATDISK st; |
| ret = STATFLAG_SUCCESS; | ret = STATFLAG_SUCCESS; |
| for (i=0; i<4; i++) { | for (i=0; i<MAX_FDDFILE; i++) { |
| ret |= statflag_read(sfh, &st, sizeof(st)); | ret |= statflag_read(sfh, &st, sizeof(st)); |
| if (st.path[0]) { | if (st.fname[0]) { |
| fddfile_set(i, st.path, FTYPE_NONE, st.readonly); | fddfile_set(i, st.fname, st.ftype, st.readonly); |
| } | } |
| } | } |
| (void)tbl; | (void)tbl; |