-#if 0
-//==========================================================================
-// ThinFatFile
-// Checks the loaded file for a fat header; if present, updates
-// loadAddr and length to be the portion of the fat file relevant
-// to the current architecture; otherwise leaves them unchanged.
-
-static void
-ThinFatFile(void **loadAddrP, unsigned long *lengthP)
-{
- // Check for fat files.
- struct fat_header *fhp = (struct fat_header *)kLoadAddr;
- struct fat_arch *fap = (struct fat_arch *)((void *)kLoadAddr +
- sizeof(struct fat_header));
- int nfat, swapped;
- void *loadAddr = 0;
- unsigned long length = 0;
-
- if (fhp->magic == FAT_MAGIC) {
- nfat = fhp->nfat_arch;
- swapped = 0;
- } else if (fhp->magic == FAT_CIGAM) {
- nfat = OSSwapInt32(fhp->nfat_arch);
- swapped = 1;
- } else {
- nfat = 0;
- swapped = 0;
- }
-
- for (; nfat > 0; nfat--, fap++) {
- if (swapped) {
- fap->cputype = OSSwapInt32(fap->cputype);
- fap->offset = OSSwapInt32(fap->offset);
- fap->size = OSSwapInt32(fap->size);
- }
- if (fap->cputype == CPU_TYPE_I386) {
- loadAddr = (void *)kLoadAddr + fap->offset;
- length = fap->size;
- break;
- }
- }
- if (loadAddr)
- *loadAddrP = loadAddr;
- if (length)
- *lengthP = length;
-}
-#endif