| 29 | static WinPosSave savePos[kLastWindowKind + 1]; |
| 30 | |
| 31 | static void |
| 32 | InitWinFile(void) |
| 33 | { |
| 34 | StringHandle sh; |
| 35 | long len; |
| 36 | short ref = 0; |
| 37 | |
| 38 | if (winFileInit) { |
| 39 | return; |
| 40 | } |
| 41 | /* We trust the glue. If there's an error, store in game dir. */ |
| 42 | if (FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder, |
| 43 | &winFileVol, &winFileDir)) { |
| 44 | winFileVol = 0; |
| 45 | winFileDir = 0; |
| 46 | } |
| 47 | sh = GetString(128); |
| 48 | if (sh && *sh) { |
| 49 | BlockMove(*sh, winFileName, **sh + 1); |
| 50 | ReleaseResource((Handle) sh); |
| 51 | } |
| 52 | if (HOpen(winFileVol, winFileDir, winFileName, fsRdPerm, &ref)) { |
| 53 | return; |
| 54 | } |
| 55 | len = sizeof(savePos); |
| 56 | if (!FSRead(ref, &len, savePos)) { |
| 57 | winFileInit = 1; |
| 58 | } |
| 59 | FSClose(ref); |
| 60 | } |
| 61 | |
| 62 | static void |
| 63 | FlushWinFile(void) |
no outgoing calls
no test coverage detected