See the changelog. :)
[rox-ripper.git] / CDROM.py
blob33e7723daee1bfae9c999a5ba074b6700e908e73
1 """
2 CDROM.py
3 Constants for CDLow.py
4 Copyright 2003 Christian Storgaard
5 Changes made by Ron Kuslak <rds@rdsarts.com>, 12/15/2003,
6 and are limited to the formating of this message.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 """
23 import struct
24 def sizeof(type):
25 return struct.calcsize(type)
27 CDC_CD_R=0x2000
28 CDC_CD_RW=0x4000
29 CDC_CLOSE_TRAY=0x1
30 CDC_DRIVE_STATUS=0x800
31 CDC_DVD=0x8000
32 CDC_DVD_R=0x10000
33 CDC_DVD_RAM=0x20000
34 CDC_GENERIC_PACKET=0x1000
35 CDC_IOCTLS=0x400
36 CDC_LOCK=0x4
37 CDC_MCN=0x40
38 CDC_MEDIA_CHANGED=0x80
39 CDC_MULTI_SESSION=0x20
40 CDC_OPEN_TRAY=0x2
41 CDC_PLAY_AUDIO=0x100
42 CDC_RESET=0x200
43 CDC_SELECT_DISC=0x10
44 CDC_SELECT_SPEED=0x8
45 CDO_AUTO_CLOSE=0x1
46 CDO_AUTO_EJECT=0x2
47 CDO_CHECK_TYPE=0x10
48 CDO_LOCK=0x8
49 CDO_USE_FFLAGS=0x4
50 CDROMAUDIOBUFSIZ=0x5382
51 CDROMCLOSETRAY=0x5319
52 CDROMEJECT=0x5309
53 CDROMEJECT_SW=0x530f
54 CDROMGETSPINDOWN=0x531d
55 CDROMMULTISESSION=0x5310
56 CDROMPAUSE=0x5301
57 CDROMPLAYBLK=0x5317
58 CDROMPLAYMSF=0x5303
59 CDROMPLAYTRKIND=0x5304
60 CDROMREADALL=0x5318
61 CDROMREADAUDIO=0x530e
62 CDROMREADCOOKED=0x5315
63 CDROMREADMODE1=0x530d
64 CDROMREADMODE2=0x530c
65 CDROMREADRAW=0x5314
66 CDROMREADTOCENTRY=0x5306
67 CDROMREADTOCHDR=0x5305
68 CDROMRESET=0x5312
69 CDROMRESUME=0x5302
70 CDROMSEEK=0x5316
71 CDROMSETSPINDOWN=0x531e
72 CDROMSTART=0x5308
73 CDROMSTOP=0x5307
74 CDROMSUBCHNL=0x530b
75 CDROMVOLCTRL=0x530a
76 CDROMVOLREAD=0x5313
77 CDROM_AUDIO_COMPLETED=0x13
78 CDROM_AUDIO_ERROR=0x14
79 CDROM_AUDIO_INVALID=0x00
80 CDROM_AUDIO_NO_STATUS=0x15
81 CDROM_AUDIO_PAUSED=0x12
82 CDROM_AUDIO_PLAY=0x11
83 CDROM_CHANGER_NSLOTS=0x5328
84 CDROM_CLEAR_OPTIONS=0x5321
85 CDROM_DATA_TRACK=0x04
86 CDROM_DEBUG=0x5330
87 CDROM_DISC_STATUS=0x5327
88 CDROM_DRIVE_STATUS=0x5326
89 CDROM_GET_CAPABILITY=0x5331
90 CDROM_GET_MCN=0x5311
91 CDROM_GET_UPC=CDROM_GET_MCN
92 CDROM_LAST_WRITTEN=0x5395
93 CDROM_LBA=0x01
94 CDROM_LEADOUT=0xAA
95 CDROM_LOCKDOOR=0x5329
96 CDROM_MEDIA_CHANGED=0x5325
97 CDROM_MSF=0x02
98 CDROM_NEXT_WRITABLE=0x5394
99 CDROM_PACKET_SIZE=12
100 CDROM_SELECT_DISC=0x5323
101 CDROM_SELECT_SPEED=0x5322
102 CDROM_SEND_PACKET=0x5393
103 CDROM_SET_OPTIONS=0x5320
104 CDSL_CURRENT=( (int ) ( ~ 0 >> 1 ) )
105 CDSL_NONE=( (int ) ( ~ 0 >> 1 ) - 1 )
106 CDS_AUDIO=100
107 CDS_DATA_1=101
108 CDS_DATA_2=102
109 CDS_DISC_OK=4
110 CDS_DRIVE_NOT_READY=3
111 CDS_MIXED=105
112 CDS_NO_DISC=1
113 CDS_NO_INFO=0
114 CDS_TRAY_OPEN=2
115 CDS_XA_2_1=103
116 CDS_XA_2_2=104
117 CD_CHUNK_SIZE=24
118 CD_ECC_SIZE=276
119 CD_EDC_SIZE=4
120 CD_FRAMES=75
121 CD_FRAMESIZE=2048
122 CD_FRAMESIZE_RAW=2352
123 CD_SYNC_SIZE=12
124 CD_HEAD_SIZE=4
125 CD_FRAMESIZE_RAW0=( CD_FRAMESIZE_RAW - CD_SYNC_SIZE - CD_HEAD_SIZE )
126 CD_FRAMESIZE_RAW1=( CD_FRAMESIZE_RAW - CD_SYNC_SIZE )
127 CD_FRAMESIZE_RAWER=2646
128 CD_FRAMESIZE_SUB=96
129 CD_MINS=74
130 CD_MSF_OFFSET=150
131 CD_NUM_OF_CHUNKS=98
132 CD_PART_MAX=64
133 CD_PART_MASK=( CD_PART_MAX - 1 )
134 CD_SECS=60
135 CD_SUBHEAD_SIZE=8
136 CD_XA_HEAD=( CD_HEAD_SIZE + CD_SUBHEAD_SIZE )
137 CD_XA_SYNC_HEAD=( CD_SYNC_SIZE + CD_XA_HEAD )
138 CD_XA_TAIL=( CD_EDC_SIZE + CD_ECC_SIZE )
139 CD_ZERO_SIZE=8
140 CGC_DATA_NONE=3
141 CGC_DATA_READ=2
142 CGC_DATA_UNKNOWN=0
143 CGC_DATA_WRITE=1
144 DVD_AUTH=0x5392
145 DVD_AUTH_ESTABLISHED=5
146 DVD_AUTH_FAILURE=6
147 DVD_CGMS_RESTRICTED=3
148 DVD_CGMS_SINGLE=2
149 DVD_CGMS_UNRESTRICTED=0
150 DVD_CPM_COPYRIGHTED=1
151 DVD_CPM_NO_COPYRIGHT=0
152 DVD_CP_SEC_EXIST=1
153 DVD_CP_SEC_NONE=0
154 DVD_HOST_SEND_CHALLENGE=1
155 DVD_HOST_SEND_KEY2=4
156 DVD_HOST_SEND_RPC_STATE=11
157 DVD_INVALIDATE_AGID=9
158 DVD_LAYERS=4
159 DVD_LU_SEND_AGID=0
160 DVD_LU_SEND_ASF=8
161 DVD_LU_SEND_CHALLENGE=3
162 DVD_LU_SEND_KEY1=2
163 DVD_LU_SEND_RPC_STATE=10
164 DVD_LU_SEND_TITLE_KEY=7
165 DVD_READ_STRUCT=0x5390
166 DVD_STRUCT_BCA=0x03
167 DVD_STRUCT_COPYRIGHT=0x01
168 DVD_STRUCT_DISCKEY=0x02
169 DVD_STRUCT_MANUFACT=0x04
170 DVD_STRUCT_PHYSICAL=0x00
171 DVD_WRITE_STRUCT=0x5391
172 #'EOPNOTSUPP' undefined in 'EDRIVE_CANT_DO_THIS'
173 GPCMD_BLANK=0xa1
174 GPCMD_CLOSE_TRACK=0x5b
175 GPCMD_FLUSH_CACHE=0x35
176 GPCMD_FORMAT_UNIT=0x04
177 GPCMD_GET_CONFIGURATION=0x46
178 GPCMD_GET_EVENT_STATUS_NOTIFICATION=0x4a
179 GPCMD_GET_MEDIA_STATUS=0xda
180 GPCMD_GET_PERFORMANCE=0xac
181 GPCMD_INQUIRY=0x12
182 GPCMD_LOAD_UNLOAD=0xa6
183 GPCMD_MECHANISM_STATUS=0xbd
184 GPCMD_MODE_SELECT_10=0x55
185 GPCMD_MODE_SENSE_10=0x5a
186 GPCMD_PAUSE_RESUME=0x4b
187 GPCMD_PLAYAUDIO_TI=0x48
188 GPCMD_PLAY_AUDIO_10=0x45
189 GPCMD_PLAY_AUDIO_MSF=0x47
190 GPCMD_PLAY_AUDIO_TI=0x48
191 GPCMD_PLAY_CD=0xbc
192 GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL=0x1e
193 GPCMD_READ_10=0x28
194 GPCMD_READ_12=0xa8
195 GPCMD_READ_CD=0xbe
196 GPCMD_READ_CDVD_CAPACITY=0x25
197 GPCMD_READ_CD_MSF=0xb9
198 GPCMD_READ_DISC_INFO=0x51
199 GPCMD_READ_DVD_STRUCTURE=0xad
200 GPCMD_READ_FORMAT_CAPACITIES=0x23
201 GPCMD_READ_HEADER=0x44
202 GPCMD_READ_SUBCHANNEL=0x42
203 GPCMD_READ_TOC_PMA_ATIP=0x43
204 GPCMD_READ_TRACK_RZONE_INFO=0x52
205 GPCMD_REPAIR_RZONE_TRACK=0x58
206 GPCMD_REPORT_KEY=0xa4
207 GPCMD_REQUEST_SENSE=0x03
208 GPCMD_RESERVE_RZONE_TRACK=0x53
209 GPCMD_SCAN=0xba
210 GPCMD_SEEK=0x2b
211 GPCMD_SEND_DVD_STRUCTURE=0xad
212 GPCMD_SEND_EVENT=0xa2
213 GPCMD_SEND_KEY=0xa3
214 GPCMD_SEND_OPC=0x54
215 GPCMD_SET_READ_AHEAD=0xa7
216 GPCMD_SET_SPEED=0xbb
217 GPCMD_SET_STREAMING=0xb6
218 GPCMD_START_STOP_UNIT=0x1b
219 GPCMD_STOP_PLAY_SCAN=0x4e
220 GPCMD_TEST_UNIT_READY=0x00
221 GPCMD_VERIFY_10=0x2f
222 GPCMD_WRITE_10=0x2a
223 GPCMD_WRITE_AND_VERIFY_10=0x2e
224 GPMODE_ALL_PAGES=0x3f
225 GPMODE_AUDIO_CTL_PAGE=0x0e
226 GPMODE_CAPABILITIES_PAGE=0x2a
227 GPMODE_CDROM_PAGE=0x0d
228 GPMODE_FAULT_FAIL_PAGE=0x1c
229 GPMODE_POWER_PAGE=0x1a
230 GPMODE_R_W_ERROR_PAGE=0x01
231 GPMODE_TO_PROTECT_PAGE=0x1d
232 GPMODE_WRITE_PARMS_PAGE=0x05
233 _I386_BYTEORDER_H=None
234 _I386_TYPES_H=None
235 _LINUX_BYTEORDER_GENERIC_H=None
236 _LINUX_BYTEORDER_LITTLE_ENDIAN_H=None
237 _LINUX_BYTEORDER_SWAB_H=None
238 _LINUX_CDROM_H=None
239 __ELF__=1
240 __LITTLE_ENDIAN=1234
241 __LITTLE_ENDIAN_BITFIELD=None
242 #'__u16' undefined in '___constant_swab16'
243 #'__u32' undefined in '___constant_swab32'
244 #'__u64' undefined in '___constant_swab64'
245 #'__u16' undefined in '___swab16'
246 #'__u32' undefined in '___swab32'
247 #'__u64' undefined in '___swab64'
248 #'__u16' undefined in '__arch__swab16'
249 #'__u16' undefined in '__arch__swab16'
250 #'__arch__swab16p': failed dependancy:'__arch__swab16'
251 #'do' undefined in '__arch__swab16s'
252 #'__u32' undefined in '__arch__swab32'
253 #'__u32' undefined in '__arch__swab32'
254 #'__arch__swab32p': failed dependancy:'__arch__swab32'
255 #'do' undefined in '__arch__swab32s'
256 #'__u64' undefined in '__arch__swab64'
257 #'__u64' undefined in '__arch__swab64'
258 #'__arch__swab64p': failed dependancy:'__arch__swab64'
259 #'do' undefined in '__arch__swab64s'
260 #'__fswab16' undefined in '__swab16'
261 #'__be16_to_cpu': failed dependancy:'__swab16'
262 #'__swab16p' undefined in '__be16_to_cpup'
263 #'__swab16s' undefined in '__be16_to_cpus'
264 #'__fswab32' undefined in '__swab32'
265 #'__be32_to_cpu': failed dependancy:'__swab32'
266 #'__swab32p' undefined in '__be32_to_cpup'
267 #'__swab32s' undefined in '__be32_to_cpus'
268 #'__fswab64' undefined in '__swab64'
269 #'__be64_to_cpu': failed dependancy:'__swab64'
270 #'__swab64p' undefined in '__be64_to_cpup'
271 #'__swab64s' undefined in '__be64_to_cpus'
272 #'__u16' undefined in '___constant_swab16'
273 #'__constant_be16_to_cpu': failed dependancy:'___constant_swab16'
274 #'__u32' undefined in '___constant_swab32'
275 #'__constant_be32_to_cpu': failed dependancy:'___constant_swab32'
276 #'__u64' undefined in '___constant_swab64'
277 #'__constant_be64_to_cpu': failed dependancy:'___constant_swab64'
278 #'__u16' undefined in '___constant_swab16'
279 #'__constant_cpu_to_be16': failed dependancy:'___constant_swab16'
280 #'__u32' undefined in '___constant_swab32'
281 #'__constant_cpu_to_be32': failed dependancy:'___constant_swab32'
282 #'__u64' undefined in '___constant_swab64'
283 #'__constant_cpu_to_be64': failed dependancy:'___constant_swab64'
284 def __constant_cpu_to_le16(x):
285 return ( (__u16 ) (x ) )
286 def __constant_cpu_to_le32(x):
287 return ( (__u32 ) (x ) )
288 def __constant_cpu_to_le64(x):
289 return ( (__u64 ) (x ) )
290 #'__u32' undefined in '___constant_swab32'
291 #'__constant_htonl': failed dependancy:'___constant_swab32'
292 #'__u16' undefined in '___constant_swab16'
293 #'__constant_htons': failed dependancy:'___constant_swab16'
294 def __constant_le16_to_cpu(x):
295 return ( (__u16 ) (x ) )
296 def __constant_le32_to_cpu(x):
297 return ( (__u32 ) (x ) )
298 def __constant_le64_to_cpu(x):
299 return ( (__u64 ) (x ) )
300 #'__u32' undefined in '___constant_swab32'
301 #'__constant_ntohl': failed dependancy:'___constant_swab32'
302 #'__u16' undefined in '___constant_swab16'
303 #'__constant_ntohs': failed dependancy:'___constant_swab16'
304 #'__fswab16' undefined in '__swab16'
305 #'__cpu_to_be16': failed dependancy:'__swab16'
306 #'__swab16p' undefined in '__cpu_to_be16p'
307 #'__swab16s' undefined in '__cpu_to_be16s'
308 #'__fswab32' undefined in '__swab32'
309 #'__cpu_to_be32': failed dependancy:'__swab32'
310 #'__swab32p' undefined in '__cpu_to_be32p'
311 #'__swab32s' undefined in '__cpu_to_be32s'
312 #'__fswab64' undefined in '__swab64'
313 #'__cpu_to_be64': failed dependancy:'__swab64'
314 #'__swab64p' undefined in '__cpu_to_be64p'
315 #'__swab64s' undefined in '__cpu_to_be64s'
316 def __cpu_to_le16(x):
317 return ( (__u16 ) (x ) )
318 #Traceback (most recent call last):
319 # File "./h2py.py", line 203, in output_py
320 # exec(_outs,env)
321 # File "<string>", line 1
322 # def __cpu_to_le16p(x): return ( * (__u16* ) (x ) )
324 # SyntaxError: invalid syntax
325 #skipping '__cpu_to_le16p'
326 #'do' undefined in '__cpu_to_le16s'
327 def __cpu_to_le32(x):
328 return ( (__u32 ) (x ) )
329 #Traceback (most recent call last):
330 # File "./h2py.py", line 203, in output_py
331 # exec(_outs,env)
332 # File "<string>", line 1
333 # def __cpu_to_le32p(x): return ( * (__u32* ) (x ) )
335 # SyntaxError: invalid syntax
336 #skipping '__cpu_to_le32p'
337 #'do' undefined in '__cpu_to_le32s'
338 def __cpu_to_le64(x):
339 return ( (__u64 ) (x ) )
340 #Traceback (most recent call last):
341 # File "./h2py.py", line 203, in output_py
342 # exec(_outs,env)
343 # File "<string>", line 1
344 # def __cpu_to_le64p(x): return ( * (__u64* ) (x ) )
346 # SyntaxError: invalid syntax
347 #skipping '__cpu_to_le64p'
348 #'do' undefined in '__cpu_to_le64s'
349 __i386=1
350 __i386__=1
351 def __le16_to_cpu(x):
352 return ( (__u16 ) (x ) )
353 #Traceback (most recent call last):
354 # File "./h2py.py", line 203, in output_py
355 # exec(_outs,env)
356 # File "<string>", line 1
357 # def __le16_to_cpup(x): return ( * (__u16* ) (x ) )
359 # SyntaxError: invalid syntax
360 #skipping '__le16_to_cpup'
361 #'do' undefined in '__le16_to_cpus'
362 def __le32_to_cpu(x):
363 return ( (__u32 ) (x ) )
364 #Traceback (most recent call last):
365 # File "./h2py.py", line 203, in output_py
366 # exec(_outs,env)
367 # File "<string>", line 1
368 # def __le32_to_cpup(x): return ( * (__u32* ) (x ) )
370 # SyntaxError: invalid syntax
371 #skipping '__le32_to_cpup'
372 #'do' undefined in '__le32_to_cpus'
373 def __le64_to_cpu(x):
374 return ( (__u64 ) (x ) )
375 #Traceback (most recent call last):
376 # File "./h2py.py", line 203, in output_py
377 # exec(_outs,env)
378 # File "<string>", line 1
379 # def __le64_to_cpup(x): return ( * (__u64* ) (x ) )
381 # SyntaxError: invalid syntax
382 #skipping '__le64_to_cpup'
383 #'do' undefined in '__le64_to_cpus'
384 __linux=1
385 __linux__=1
386 #'__fswab16' undefined in '__swab16'
387 #'__fswab32' undefined in '__swab32'
388 #'__fswab64' undefined in '__swab64'
389 __unix=1
390 __unix__=1
391 i386=1
392 linux=1
393 unix=1