iso9660.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #define VOLDESC 16 /* sector number */
  2. typedef uchar Byte2L[2];
  3. typedef uchar Byte2M[2];
  4. typedef uchar Byte4LM[4];
  5. typedef uchar Byte4L[4];
  6. typedef uchar Byte4M[4];
  7. typedef uchar Byte8LM[8];
  8. typedef union Drec Drec;
  9. typedef union Voldesc Voldesc;
  10. enum
  11. {
  12. Boot = 0,
  13. Primary = 1,
  14. Supplementary = 2,
  15. Partition = 3,
  16. Terminator = 255
  17. };
  18. union Voldesc
  19. { /* volume descriptor */
  20. uchar byte[Sectorsize];
  21. union { /* for CD001, the ECMA standard */
  22. struct
  23. {
  24. uchar type;
  25. uchar stdid[5];
  26. uchar version;
  27. uchar unused;
  28. uchar sysid[32];
  29. uchar bootid[32];
  30. uchar data[1977];
  31. } boot;
  32. struct
  33. {
  34. uchar type;
  35. uchar stdid[5];
  36. uchar version;
  37. uchar flags;
  38. uchar sysid[32];
  39. uchar volid[32];
  40. Byte8LM partloc;
  41. Byte8LM size;
  42. uchar escapes[32];
  43. Byte4LM vsetsize;
  44. Byte4LM vseqno;
  45. Byte4LM blksize;
  46. Byte8LM ptabsize;
  47. Byte4L lptable;
  48. Byte4L optlptable;
  49. Byte4M mptable;
  50. Byte4M optmptable;
  51. uchar rootdir[34];
  52. uchar volsetid[128];
  53. uchar pubid[128];
  54. uchar prepid[128];
  55. uchar appid[128];
  56. uchar copyright[37];
  57. uchar abstract[37];
  58. uchar bibliography[37];
  59. uchar cdate[17];
  60. uchar mdate[17];
  61. uchar expdate[17];
  62. uchar effdate[17];
  63. uchar fsversion;
  64. uchar unused3[1];
  65. uchar appuse[512];
  66. uchar unused4[653];
  67. } desc;
  68. } z;
  69. union
  70. { /* for CDROM, the `High Sierra' standard */
  71. struct
  72. {
  73. Byte8LM number;
  74. uchar type;
  75. uchar stdid[5];
  76. uchar version;
  77. uchar flags;
  78. uchar sysid[32];
  79. uchar volid[32];
  80. Byte8LM partloc;
  81. Byte8LM size;
  82. uchar escapes[32];
  83. Byte4LM vsetsize;
  84. Byte4LM vseqno;
  85. Byte4LM blksize;
  86. uchar quux[40];
  87. uchar rootdir[34];
  88. uchar volsetid[128];
  89. uchar pubid[128];
  90. uchar prepid[128];
  91. uchar appid[128];
  92. uchar copyright[32];
  93. uchar abstract[32];
  94. uchar cdate[16];
  95. uchar mdate[16];
  96. uchar expdate[16];
  97. uchar effdate[16];
  98. uchar fsversion;
  99. } desc;
  100. } r;
  101. };
  102. union Drec
  103. {
  104. struct
  105. {
  106. uchar reclen;
  107. uchar attrlen;
  108. Byte8LM addr;
  109. Byte8LM size;
  110. uchar date[6];
  111. uchar tzone; /* flags in high sierra */
  112. uchar flags; /* ? in high sierra */
  113. uchar unitsize; /* ? in high sierra */
  114. uchar gapsize; /* ? in high sierra */
  115. Byte4LM vseqno; /* ? in high sierra */
  116. uchar namelen;
  117. uchar name[1];
  118. };
  119. struct
  120. {
  121. uchar r_pad[24];
  122. uchar r_flags;
  123. };
  124. };
  125. struct Isofile
  126. {
  127. short fmt; /* 'z' if iso, 'r' if high sierra */
  128. short blksize;
  129. long offset; /* true offset when reading directory */
  130. long odelta; /* true size of directory just read */
  131. long doffset; /* plan9 offset when reading directory */
  132. Drec d;
  133. };