iso9660.h
上传用户:xiejiait
上传日期:2007-01-06
资源大小:881k
文件大小:5k
源码类别:

SCSI/ASPI

开发平台:

MultiPlatform

  1. /* @(#)iso9660.h 1.4 99/10/18 Copyright 1996 J. Schilling */
  2. /*
  3.  * Copyright (c) 1996 J. Schilling
  4.  */
  5. /*
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2, or (at your option)
  9.  * any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; see the file COPYING.  If not, write to
  18.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20. #define _delta(from, to) ((to) - (from) + 1)
  21. #define VD_BOOT 0
  22. #define VD_PRIMARY 1
  23. #define VD_SUPPLEMENT 2
  24. #define VD_PARTITION 3
  25. #define VD_TERM 255
  26. #define VD_ID "CD001"
  27. struct iso9660_voldesc {
  28. char vd_type [_delta(1, 1)];
  29. char vd_id [_delta(2, 6)];
  30. char vd_version [_delta(7, 7)];
  31. char vd_fill [_delta(8, 2048)];
  32. };
  33. struct iso9660_boot_voldesc {
  34. char vd_type [_delta(1, 1)];
  35. char vd_id [_delta(2, 6)];
  36. char vd_version [_delta(7, 7)];
  37. char vd_bootsys [_delta(8, 39)];
  38. char vd_bootid [_delta(40, 71)];
  39. char vd_bootcode [_delta(72, 2048)];
  40. };
  41. struct iso9660_pr_voldesc {
  42. char vd_type [_delta(   1, 1)];
  43. char vd_id [_delta(   2, 6)];
  44. char vd_version [_delta(   7, 7)];
  45. char vd_unused1 [_delta(   8, 8)];
  46. char vd_system_id [_delta(   9, 40)];
  47. char vd_volume_id [_delta(  41, 72)];
  48. char vd_unused2 [_delta(  73, 80)];
  49. char vd_volume_space_size [_delta(  81, 88)];
  50. char vd_unused3 [_delta(  89, 120)];
  51. char vd_volume_set_size [_delta( 121, 124)];
  52. char vd_volume_seq_number [_delta( 125, 128)];
  53. char vd_lbsize [_delta( 129, 132)];
  54. char vd_path_table_size [_delta( 133, 140)];
  55. char vd_pos_path_table_l [_delta( 141, 144)];
  56. char vd_opt_pos_path_table_l [_delta( 145, 148)];
  57. char vd_pos_path_table_m [_delta( 149, 152)];
  58. char vd_opt_pos_path_table_m [_delta( 153, 156)];
  59. char vd_root_dir [_delta( 157, 190)];
  60. char vd_volume_set_id [_delta( 191, 318)];
  61. char vd_publisher_id [_delta( 319, 446)];
  62. char vd_data_preparer_id [_delta( 447, 574)];
  63. char vd_application_id [_delta( 575, 702)];
  64. char vd_copyr_file_id [_delta( 703, 739)];
  65. char vd_abstr_file_id [_delta( 740, 776)];
  66. char vd_bibl_file_id [_delta( 777, 813)];
  67. char vd_create_time [_delta( 814, 830)];
  68. char vd_mod_time [_delta( 831, 847)];
  69. char vd_expiry_time [_delta( 848, 864)];
  70. char vd_effective_time [_delta( 865, 881)];
  71. char vd_file_struct_vers [_delta( 882, 882)];
  72. char vd_reserved1 [_delta( 883, 883)];
  73. char vd_application_use [_delta( 884, 1395)];
  74. char vd_fill [_delta(1396, 2048)];
  75. };
  76. struct iso9660_dir {
  77. char dr_len [_delta(   1, 1)];
  78. char dr_eattr_len [_delta(   2, 2)];
  79. char dr_eattr_pos [_delta(   3, 10)];
  80. char dr_data_len [_delta(  11, 18)];
  81. char dr_recording_time [_delta(  19, 25)];
  82. char dr_file_flags [_delta(  26, 26)];
  83. char dr_file_unit_size [_delta(  27, 27)];
  84. char dr_interleave_gap [_delta(  28, 28)];
  85. char dr_volume_seq_number [_delta(  29, 32)];
  86. char dr_file_name_len [_delta(  33, 33)];
  87. char dr_file_name [_delta(  34, 34)];
  88. };
  89. struct iso9660_dtime {
  90. unsigned char dt_year;
  91. unsigned char dt_month;
  92. unsigned char dt_day;
  93. unsigned char dt_hour;
  94. unsigned char dt_minute;
  95. unsigned char dt_second;
  96.  char dt_gmtoff;
  97. };
  98. struct iso9660_ltime {
  99. char lt_year [_delta(   1, 4)];
  100. char lt_month [_delta(   5, 6)];
  101. char lt_day [_delta(   7, 8)];
  102. char lt_hour [_delta(   9, 10)];
  103. char lt_minute [_delta(  11, 12)];
  104. char lt_second [_delta(  13, 14)];
  105. char lt_hsecond [_delta(  15, 16)];
  106. char lt_gmtoff [_delta(  17, 17)];
  107. };
  108. struct iso9660_path_table {
  109. char pt_di_len [_delta(   1, 1)];
  110. char pt_eattr_len [_delta(   2, 2)];
  111. char pt_eattr_pos [_delta(   3, 6)];
  112. char pt_di_parent [_delta(   7, 8)];
  113. char pt_name [_delta(   9, 9)];
  114. };
  115. struct iso9660_eattr {
  116. char ea_owner [_delta(   1, 4)];
  117. char ea_group [_delta(   5, 8)];
  118. char ea_perm [_delta(   9, 10)];
  119. char ea_ctime [_delta(  11, 27)];
  120. char ea_mtime [_delta(  28, 44)];
  121. char ea_extime [_delta(  45, 61)];
  122. char ea_eftime [_delta(  62, 78)];
  123. char ea_record_format [_delta(  79, 79)];
  124. char ea_record_attr [_delta(  80, 80)];
  125. char ea_record_len [_delta(  81, 84)];
  126. char ea_system_id [_delta(  85, 116)];
  127. char ea_system_use [_delta( 117, 180)];
  128. char ea_version [_delta( 181, 181)];
  129. char ea_esc_seq_len [_delta( 182, 182)];
  130. char ea_reserved1 [_delta( 183, 246)];
  131. char ea_appl_use_len [_delta( 247, 250)];
  132. char ea_appl_use [_delta( 251, 251)]; /* actually more */
  133. /* char ea_esc_seq [_delta( xxx, xxx)]; */
  134. };
  135. #define PERM_MB_ONE 0xAAAA
  136. #define PERM_RSYS 0x0001
  137. #define PERM_XSYS 0x0004
  138. #define PERM_RUSR 0x0010
  139. #define PERM_XUSR 0x0040
  140. #define PERM_RGRP 0x0100
  141. #define PERM_XGRP 0x0400
  142. #define PERM_ROTH 0x1000
  143. #define PERM_XOTH 0x4000
  144. #define GET_UBYTE(a) a_to_u_byte(a)
  145. #define GET_SBYTE(a) a_to_byte(a)
  146. #define GET_SHORT(a) a_to_u_2_byte(&((unsigned char *) (a))[0])
  147. #define GET_BSHORT(a) a_to_u_2_byte(&((unsigned char *) (a))[2])
  148. #define GET_INT(a) a_to_4_byte(&((unsigned char *) (a))[0])
  149. #define GET_LINT(a) la_to_4_byte(&((unsigned char *) (a))[0])
  150. #define GET_BINT(a) a_to_4_byte(&((unsigned char *) (a))[4])