VirtualBox

Ignore:
Timestamp:
May 1, 2017 11:26:04 PM (8 years ago)
Author:
vboxsync
Message:

iso9660vfs.cpp: Can find and read files from iso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/iso9660.h

    r66728 r66735  
    4141#define ISO9660_SECTOR_SIZE                 2048
    4242
     43/** Accessor for ISO9660U16 and ISO9660U32 that retrievs the member value for
     44 *  the host endianess. */
     45#ifdef RT_BIG_ENDIAN
     46# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->be)
     47#else
     48# define ISO9660_GET_ENDIAN(a_pInt) ((a_pInt)->le)
     49#endif
     50
    4351
    4452/**
     
    100108    /** 0x0e: Hundreth of second (00-99). */
    101109    char                achCentisecond[2];
    102     /** 0x10: The UCT (GMT) offset in 15 min units. */
    103     int8_t              offUct;
     110    /** 0x10: The UTC (GMT) offset in 15 min units. */
     111    int8_t              offUtc;
    104112} ISO9660TIMESTAMP;
    105113AssertCompileSize(ISO9660TIMESTAMP, 17);
     
    115123{
    116124    /** 0: Years since 1900. */
    117     uint8_t             uYear;
     125    uint8_t             bYear;
    118126    /** 1: Month of year (1-12). */
    119     uint8_t             uMonth;
     127    uint8_t             bMonth;
    120128    /** 2: Day of month (1-31). */
    121     uint8_t             uDay;
     129    uint8_t             bDay;
    122130    /** 3: Hour of day (0-23). */
    123     uint8_t             uHour;
     131    uint8_t             bHour;
    124132    /** 4: Minute of hour (0-59). */
    125     uint8_t             uMinute;
     133    uint8_t             bMinute;
    126134    /** 5: Second of minute (0-59). */
    127     uint8_t             uSecond;
    128     /** 6: The UCT (GMT) offset in 15 min units. */
    129     int8_t              offUct;
     135    uint8_t             bSecond;
     136    /** 6: The UTC (GMT) offset in 15 min units. */
     137    int8_t              offUtc;
    130138} ISO9660RECTIMESTAMP;
    131139AssertCompileSize(ISO9660RECTIMESTAMP, 7);
     
    178186AssertCompileMemberOffset(ISO9660DIRREC, bFileIdLength, 0x20);
    179187AssertCompileMemberOffset(ISO9660DIRREC, achFileId,     0x21);
     188/** Pointer to an ISO 9660 directory record. */
     189typedef ISO9660DIRREC *PISO9660DIRREC;
     190/** Pointer to a const ISO 9660 directory record. */
     191typedef ISO9660DIRREC const *PCISO9660DIRREC;
    180192
    181193/** @name ISO9660_FILE_FLAGS_XXX
     
    278290/** @name ISO9660_PERM_XXX - ISO9660EXATTRREC::fPermissions
    279291 * @{ */
    280 /** @todo figure out this wird permsission stuff...   */
     292/** @todo figure out this wird permission stuff...   */
    281293/** @} */
    282294
     
    305317/** See ISO9660BOOTRECORD. */
    306318#define ISO9660VOLDESC_TYPE_BOOT_RECORD     UINT8_C(0x00)
     319/** See ISO9660PRIMARYVOLDESC. */
    307320#define ISO9660VOLDESC_TYPE_PRIMARY         UINT8_C(0x01)
     321/** See ISO9660SUPVOLDESC. */
    308322#define ISO9660VOLDESC_TYPE_SUPPLEMENTARY   UINT8_C(0x02)
     323/** See ISO9660VOLPARTDESC. */
    309324#define ISO9660VOLDESC_TYPE_PARTITION       UINT8_C(0x03)
    310 /** Terminates the volume descriptor set.  Has no data (zeros). */
     325/** Terminates the volume descriptor set.  Has no data (zeros), version is 1. */
    311326#define ISO9660VOLDESC_TYPE_TERMINATOR      UINT8_C(0xff)
    312327/** @} */
     
    370385    /** 0x058: Unused field(s), zero filled. */
    371386    uint8_t             abUnused89[32];
    372     /** 0x078: The volume set size ??in bytes?? */
    373     ISO9660U16          cbVolumeSet;
     387    /** 0x078: The number of volumes in the volume set. */
     388    ISO9660U16          cVolumesInSet;
    374389    /** 0x07c: Volume sequence number. */
    375390    ISO9660U16          VolumeSeqNo;
     
    378393    /** 0x084: Path table size. */
    379394    ISO9660U32          cbPathTable;
    380     /** 0x08c: Type L path table location (block offset). */
     395    /** 0x08c: Type L(ittle endian) path table location (block offset). */
    381396    ISO9660U32LE        offTypeLPathTable;
    382     /** 0x090: Optional type L path table location (block offset). */
     397    /** 0x090: Optional type L(ittle endian) path table location (block offset). */
    383398    ISO9660U32LE        offOptionalTypeLPathTable;
    384     /** 0x094: Type M path table location (block offset). */
     399    /** 0x094: Type M (big endian) path table location (block offset). */
    385400    ISO9660U32BE        offTypeMPathTable;
    386     /** 0x098: Optional type M path table location (block offset). */
     401    /** 0x098: Optional type M (big endian) path table location (block offset). */
    387402    ISO9660U32BE        offOptionalTypeMPathTable;
    388403    /** 0x09c: Directory entry for the root directory (union). */
     
    424439    ISO9660TIMESTAMP    EffectiveTime;
    425440    /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
    426     uint8_t             uFileStructureVersion;
     441    uint8_t             bFileStructureVersion;
    427442    /** 0x372: Reserve for future, MBZ. */
    428443    uint8_t             bReserved883;
     
    440455/** The value of ISO9660PRIMARYVOLDESC::Hdr.uDescVersion. */
    441456#define ISO9660PRIMARYVOLDESC_VERSION           UINT8_C(1)
    442 /** The value of ISO9660PRIMARYVOLDESC::uFileStructureVersion and
    443  *  ISO9660SUPVOLDESC::uFileStructureVersion. */
     457/** The value of ISO9660PRIMARYVOLDESC::bFileStructureVersion and
     458 *  ISO9660SUPVOLDESC::bFileStructureVersion. */
    444459#define ISO9660_FILE_STRUCTURE_VERSION          UINT8_C(1)
    445460
     
    475490     * Complicated stuff, see ISO 2022 and ECMA-35.
    476491     * @note This is reserved in the primary volume descriptor. */
    477     uint8_t             achEscapeSequences[32];
    478     /** 0x078: The volume set size ??in bytes?? */
    479     ISO9660U16          cbVolumeSet;
     492    uint8_t             abEscapeSequences[32];
     493    /** 0x078: The number of volumes in the volume set. */
     494    ISO9660U16          cVolumesInSet;
    480495    /** 0x07c: Volume sequence number. */
    481496    ISO9660U16          VolumeSeqNo;
     
    484499    /** 0x084: Path table size. */
    485500    ISO9660U32          cbPathTable;
    486     /** 0x08c: Type L path table location (block offset). */
     501    /** 0x08c: Type L(ittle endian) path table location (block offset). */
    487502    ISO9660U32LE        offTypeLPathTable;
    488     /** 0x090: Optional type L path table location (block offset). */
     503    /** 0x090: Optional type L(ittle endian) path table location (block offset). */
    489504    ISO9660U32LE        offOptionalTypeLPathTable;
    490     /** 0x094: Type M path table location (block offset). */
     505    /** 0x094: Type M (big endian) path table location (block offset). */
    491506    ISO9660U32BE        offTypeMPathTable;
    492     /** 0x098: Optional type M path table location (block offset). */
     507    /** 0x098: Optional type M (big endian) path table location (block offset). */
    493508    ISO9660U32BE        offOptionalTypeMPathTable;
    494509    /** 0x09c: Directory entry for the root directory (union). */
     
    496511    {
    497512        uint8_t         ab[34];
     513        ISO9660DIRREC   DirRec;
    498514    }                   RootDir;
    499515    /** 0x0be: Volume set identifier (d1-characters).
     
    536552    ISO9660TIMESTAMP    EffectiveTime;
    537553    /** 0x371: File structure version (ISO9660_FILE_STRUCTURE_VERSION). */
    538     uint8_t             uFileStructureVersion;
     554    uint8_t             bFileStructureVersion;
    539555    /** 0x372: Reserve for future, MBZ. */
    540556    uint8_t             bReserved883;
     
    590606#define ISO9660VOLPARTDESC_VERSION               UINT8_C(1)
    591607
     608
     609
     610/** @name Joliet escape sequence identifiers.
     611 *
     612 * These bytes appears in the supplementary volume descriptor field
     613 * abEscapeSequences.  The ISO9660SUPVOLDESC_VOL_F_ESC_NOT_REG flags will not
     614 * be set.
     615 *
     616 * @{ */
     617#define ISO9660_JOLIET_ESC_SEQ_0            UINT8_C(0x25)   /**< First escape sequence byte.*/
     618#define ISO9660_JOLIET_ESC_SEQ_1            UINT8_C(0x2f)   /**< Second escape sequence byte.*/
     619#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_1    UINT8_C(0x40)   /**< Third escape sequence byte: level 1 */
     620#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_2    UINT8_C(0x43)   /**< Third escape sequence byte: level 2 */
     621#define ISO9660_JOLIET_ESC_SEQ_2_LEVEL_3    UINT8_C(0x45)   /**< Third escape sequence byte: level 3 */
    592622/** @} */
    593623
     624
     625/** @} */
     626
    594627#endif
    595628
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette