home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / include / mach-o / fat.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-14  |  2.4 KB  |  62 lines

  1. /*
  2.  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  6.  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
  7.  * Reserved.  This file contains Original Code and/or Modifications of
  8.  * Original Code as defined in and that are subject to the Apple Public
  9.  * Source License Version 1.1 (the "License").  You may not use this file
  10.  * except in compliance with the License.  Please obtain a copy of the
  11.  * License at http://www.apple.com/publicsource and read it before using
  12.  * this file.
  13.  * 
  14.  * The Original Code and all software distributed under the License are
  15.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  16.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  17.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  18.  * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
  19.  * License for the specific language governing rights and limitations
  20.  * under the License.
  21.  * 
  22.  * @APPLE_LICENSE_HEADER_END@
  23.  */
  24. /*
  25.  * This header file describes the structures of the file format for "fat"
  26.  * architecture specific file (wrapper design).  At the begining of the file
  27.  * there is one fat_header structure followed by a number of fat_arch
  28.  * structures.  For each architecture in the file, specified by a pair of
  29.  * cputype and cpusubtype, the fat_header describes the file offset, file
  30.  * size and alignment in the file of the architecture specific member.
  31.  * The padded bytes in the file to place each member on it's specific alignment
  32.  * are defined to be read as zeros and can be left as "holes" if the file system
  33.  * can support them as long as they read as zeros.
  34.  *
  35.  * All structures defined here are always written and read to/from disk
  36.  * in big-endian order.
  37.  */
  38.  
  39. /*
  40.  * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types
  41.  * and contains the constants for the possible values of these types.
  42.  */
  43. #import <mach/machine.h>
  44. #import <architecture/byte_order.h>
  45.  
  46. #define FAT_MAGIC    0xcafebabe
  47. #define FAT_CIGAM    NXSwapLong(FAT_MAGIC)
  48.  
  49. struct fat_header {
  50.     unsigned long    magic;        /* FAT_MAGIC */
  51.     unsigned long    nfat_arch;    /* number of structs that follow */
  52. };
  53.  
  54. struct fat_arch {
  55.     cpu_type_t    cputype;    /* cpu specifier (int) */
  56.     cpu_subtype_t    cpusubtype;    /* machine specifier (int) */
  57.     unsigned long    offset;        /* file offset to this object file */
  58.     unsigned long    size;        /* size of this object file */
  59.     unsigned long    align;        /* alignment as a power of 2 */
  60. };
  61.  
  62.