| 99 | } |
| 100 | |
| 101 | S32 iFileSeek(tag_xFile* file, S32 offset, S32 whence) |
| 102 | { |
| 103 | tag_iFile* ps = &file->ps; |
| 104 | S32 position, new_pos; |
| 105 | |
| 106 | switch (whence) |
| 107 | { |
| 108 | case IFILE_SEEK_SET: |
| 109 | { |
| 110 | new_pos = offset; |
| 111 | break; |
| 112 | } |
| 113 | case IFILE_SEEK_CUR: |
| 114 | { |
| 115 | if (DVDGetCommandBlockStatus(&ps->fileInfo.cb) == DVD_STATE_BUSY) |
| 116 | { |
| 117 | return -1; |
| 118 | } |
| 119 | |
| 120 | new_pos = offset + ps->offset; |
| 121 | break; |
| 122 | } |
| 123 | case IFILE_SEEK_END: |
| 124 | { |
| 125 | new_pos = ps->fileInfo.length - offset; |
| 126 | |
| 127 | if (new_pos < 0) |
| 128 | { |
| 129 | new_pos = 0; |
| 130 | } |
| 131 | |
| 132 | break; |
| 133 | } |
| 134 | default: |
| 135 | { |
| 136 | new_pos = offset; |
| 137 | break; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | ps->offset = new_pos; |
| 142 | |
| 143 | return ps->offset; |
| 144 | } |
| 145 | |
| 146 | static void ifilereadCB(tag_xFile* file) |
| 147 | { |
no test coverage detected