See: https://prodos8.com/docs/technote/30/ 2.2.3 Sparse Files https://prodos8.com/docs/techref/file-use/ B.3.6 - Sparse Files https://prodos8.com/docs/techref/file-organization/ ===========================================================================
| 139 | // https://prodos8.com/docs/techref/file-organization/ |
| 140 | //=========================================================================== |
| 141 | bool Util_ProDOS_IsFileBlockSparse( int nOffset, const uint8_t* pFileData, const size_t nFileSize ) |
| 142 | { |
| 143 | if ((size_t)nOffset >= nFileSize) |
| 144 | return false; |
| 145 | |
| 146 | const int nEnd = (nOffset + PRODOS_BLOCK_SIZE ) > nFileSize |
| 147 | ? nOffset + (nFileSize % PRODOS_BLOCK_SIZE) |
| 148 | : nOffset + PRODOS_BLOCK_SIZE; |
| 149 | for (int iOffset = nOffset ; iOffset < nEnd; iOffset++ ) |
| 150 | { |
| 151 | if (pFileData[ iOffset ]) |
| 152 | { |
| 153 | return false; |
| 154 | } |
| 155 | } |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | // Swizzles sectors in ProDOS order to DOS33 order in-place |
| 160 | //=========================================================================== |
no outgoing calls
no test coverage detected