*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
cluster <<= 1;
sector = cluster >> SECTOR_SHIFT;
offset = cluster & SECTOR_MASK;
- buf = ao_fat_sector_get(fat_start + fat * sectors_per_fat + sector);
+ buf = _ao_fat_sector_get(fat_start + fat * sectors_per_fat + sector);
if (!buf)
return 0;
if (fat32)
ret = get_u32(buf + offset);
else
ret = get_u16(buf + offset);
- ao_fat_sector_put(buf, 0);
+ _ao_fat_sector_put(buf, 0);
return ret;
}
fat32 ? !AO_FAT_IS_LAST_CLUSTER(cluster) : !AO_FAT_IS_LAST_CLUSTER16(cluster);
cluster = ao_fat_entry_raw_read(cluster, 0))
{
- if (!ao_fat_cluster_valid(cluster))
+ if (!_ao_fat_cluster_valid(cluster))
fatal("file %d: invalid cluster %08x\n", dent, cluster);
if (used[cluster])
fatal("file %d: duplicate cluster %08x also in file %d\n", dent, cluster, used[cluster]-1);
used = calloc(sizeof (dirent_t), number_cluster);
- for (r = 0; (dent = ao_fat_root_get(r)); r++) {
+ for (r = 0; (dent = _ao_fat_root_get(r)); r++) {
cluster_t clusters;
offset_t size;
cluster_t first_cluster;
if (fat32)
first_cluster |= (cluster_t) get_u16(dent + 0x14) << 16;
size = get_u32(dent + 0x1c);
- ao_fat_root_put(dent, r, 0);
+ _ao_fat_root_put(dent, r, 0);
if (name[0] == AO_FAT_DENT_END) {
break;
}
if (!fat32) {
for (; r < root_entries; r++) {
- uint8_t *dent = ao_fat_root_get(r);
+ uint8_t *dent = _ao_fat_root_get(r);
if (!dent)
fatal("cannot map dent %d\n", r);
if (dent[0] != AO_FAT_DENT_END)
fatal("found non-zero dent past end %d\n", r);
- ao_fat_root_put(dent, r, 0);
+ _ao_fat_root_put(dent, r, 0);
}
} else {
check_file((dirent_t) -1, root_cluster, used);
ao_fat_init();
check_bufio("top");
- ao_fat_setup();
+ _ao_fat_setup();
check_fs();
check_bufio("after setup");