| 1 |
/*
|
| 2 |
* This file has been modified for the cdrkit suite.
|
| 3 |
*
|
| 4 |
* The behaviour and appearence of the program code below can differ to a major
|
| 5 |
* extent from the version distributed by the original author(s).
|
| 6 |
*
|
| 7 |
* For details, see Changelog file distributed with the cdrkit package. If you
|
| 8 |
* received this file from another source then ask the distributing person for
|
| 9 |
* a log of modifications.
|
| 10 |
*
|
| 11 |
*/
|
| 12 |
|
| 13 |
/* @(#)cdrecord.h 1.165 05/06/11 Copyright 1995-2005 J. Schilling */
|
| 14 |
/*
|
| 15 |
* Definitions for cdrecord
|
| 16 |
*
|
| 17 |
* Copyright (c) 1995-2005 J. Schilling
|
| 18 |
*/
|
| 19 |
/*
|
| 20 |
* This program is free software; you can redistribute it and/or modify
|
| 21 |
* it under the terms of the GNU General Public License version 2
|
| 22 |
* as published by the Free Software Foundation.
|
| 23 |
*
|
| 24 |
* This program is distributed in the hope that it will be useful,
|
| 25 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 26 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 27 |
* GNU General Public License for more details.
|
| 28 |
*
|
| 29 |
* You should have received a copy of the GNU General Public License along with
|
| 30 |
* this program; see the file COPYING. If not, write to the Free Software
|
| 31 |
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 32 |
*/
|
| 33 |
|
| 34 |
/*
|
| 35 |
* Make sure it is there. We need it for off_t.
|
| 36 |
*/
|
| 37 |
#ifndef _INCL_SYS_TYPES_H
|
| 38 |
#include <sys/types.h>
|
| 39 |
#define _INCL_SYS_TYPES_H
|
| 40 |
#endif
|
| 41 |
|
| 42 |
#ifndef _UTYPES_H
|
| 43 |
#include <utypes.h>
|
| 44 |
#endif
|
| 45 |
|
| 46 |
/*
|
| 47 |
* Defines for command line option flags
|
| 48 |
*/
|
| 49 |
#define F_DUMMY 0x00000001L /* Do dummy (simulation) writes */
|
| 50 |
#define F_TOC 0x00000002L /* Get TOC */
|
| 51 |
#define F_EJECT 0x00000004L /* Eject disk after doing the work */
|
| 52 |
#define F_LOAD 0x00000008L /* Load disk only */
|
| 53 |
#define F_MULTI 0x00000010L /* Create linkable TOC/multi-session */
|
| 54 |
#define F_MSINFO 0x00000020L /* Get multi-session info */
|
| 55 |
#define F_FIX 0x00000040L /* Fixate disk only */
|
| 56 |
#define F_NOFIX 0x00000080L /* Do not fixate disk */
|
| 57 |
#define F_VERSION 0x00000100L /* Print version info */
|
| 58 |
#define F_CHECKDRIVE 0x00000200L /* Check for driver */
|
| 59 |
#define F_INQUIRY 0x00000400L /* Do inquiry */
|
| 60 |
#define F_PRCAP 0x00000800L /* Print capabilities */
|
| 61 |
#define F_SCANBUS 0x00001000L /* Scan SCSI Bus */
|
| 62 |
#define F_RESET 0x00002000L /* Reset SCSI Bus */
|
| 63 |
#define F_BLANK 0x00004000L /* Blank CD-RW */
|
| 64 |
#define F_PRATIP 0x00008000L /* Print ATIP info */
|
| 65 |
#define F_PRDINFO 0x00010000L /* Print disk info (XXX not yet used) */
|
| 66 |
#define F_IGNSIZE 0x00020000L /* Ignore disk size */
|
| 67 |
#define F_SAO 0x00040000L /* Session at once */
|
| 68 |
#define F_RAW 0x00080000L /* Raw mode */
|
| 69 |
#define F_WRITE 0x00100000L /* Disk is going to be written */
|
| 70 |
#define F_FORCE 0x00200000L /* Force things (e.g. blank on dead disk) */
|
| 71 |
#define F_WAITI 0x00400000L /* Wait until data is available on stdin */
|
| 72 |
#define F_OVERBURN 0x00800000L /* Allow oveburning */
|
| 73 |
#define F_CLONE 0x01000000L /* Do clone writing */
|
| 74 |
#define F_STDIN 0x02000000L /* We are using stdin as CD data */
|
| 75 |
#define F_IMMED 0x04000000L /* Try tu use IMMED SCSI flag if possible */
|
| 76 |
#define F_DLCK 0x08000000L /* Load disk and lock door */
|
| 77 |
#define F_SETDROPTS 0x10000000L /* Set driver opts and exit */
|
| 78 |
#define F_FORMAT 0x20000000L /* Format media */
|
| 79 |
#define F_ABORT 0x40000000L /* Send abort sequence to drive */
|
| 80 |
|
| 81 |
#ifdef min
|
| 82 |
#undef min
|
| 83 |
#endif
|
| 84 |
#define min(a, b) ((a) < (b) ? (a):(b))
|
| 85 |
|
| 86 |
#ifdef max
|
| 87 |
#undef max
|
| 88 |
#endif
|
| 89 |
#define max(a, b) ((a) < (b) ? (b):(a))
|
| 90 |
|
| 91 |
#undef roundup
|
| 92 |
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
|
| 93 |
|
| 94 |
/*
|
| 95 |
* NOTICE: You should not make CDR_BUF_SIZE more than
|
| 96 |
* the buffer size of the CD-Recorder.
|
| 97 |
*
|
| 98 |
* The Philips CDD 521 is the recorder with the smallest buffer.
|
| 99 |
* It only has 256kB of buffer RAM.
|
| 100 |
*
|
| 101 |
* WARNING: Philips CDD 521 dies if CDR_BUF_SIZE is to big.
|
| 102 |
* If you like to support the CDD 521 keep the buffer
|
| 103 |
* at 63kB.
|
| 104 |
*/
|
| 105 |
/*#define CDR_BUF_SIZE (126*1024)*/
|
| 106 |
#define CDR_BUF_SIZE (63*1024)
|
| 107 |
#define CDR_MAX_BUF_SIZE (256*1024)
|
| 108 |
|
| 109 |
/*
|
| 110 |
* Never set MIN_GRACE_TIME < 3 seconds. We need to give
|
| 111 |
* the volume management a chance to settle before we
|
| 112 |
* start writing.
|
| 113 |
*/
|
| 114 |
#ifndef MIN_GRACE_TIME
|
| 115 |
#define MIN_GRACE_TIME 0 /* changed to 0, there is no point in forcing it in this application. Fix your volume management if it breaks because it could not read the medium. */
|
| 116 |
#endif
|
| 117 |
#ifndef GRACE_TIME
|
| 118 |
#define GRACE_TIME 9 /* 9 seconds */
|
| 119 |
#endif
|
| 120 |
|
| 121 |
/*
|
| 122 |
* Some sector sizes used for reading/writing ...
|
| 123 |
*/
|
| 124 |
#define DATA_SEC_SIZE 2048 /* 2048 bytes */
|
| 125 |
#define MODE2_SEC_SIZE 2336 /* 2336 bytes */
|
| 126 |
#define AUDIO_SEC_SIZE 2352 /* 2352 bytes */
|
| 127 |
#define RAW16_SEC_SIZE (2352+16) /* 2368 bytes */
|
| 128 |
#define RAW96_SEC_SIZE (2352+96) /* 2448 bytes */
|
| 129 |
|
| 130 |
#define MAX_TRACK 99 /* Red Book track limit */
|
| 131 |
|
| 132 |
#define PAD_SECS 15 /* NOTE: pad must be less than BUF_SIZE */
|
| 133 |
#define PAD_SIZE (PAD_SECS * DATA_SEC_SIZE)
|
| 134 |
|
| 135 |
/*
|
| 136 |
* FIFO size must be at least 2x CDR_MAX_BUF_SIZE
|
| 137 |
*/
|
| 138 |
#define DEFAULT_FIFOSIZE (4L*1024L*1024L)
|
| 139 |
|
| 140 |
#if !defined(HAVE_LARGEFILES) && SIZEOF_LLONG > SIZEOF_LONG
|
| 141 |
typedef Llong tsize_t;
|
| 142 |
#else
|
| 143 |
typedef off_t tsize_t;
|
| 144 |
#endif
|
| 145 |
|
| 146 |
#ifdef nono
|
| 147 |
typedef struct tindex {
|
| 148 |
int dummy; /* Not yet implemented */
|
| 149 |
} tindex_t;
|
| 150 |
#endif
|
| 151 |
|
| 152 |
typedef struct ofile {
|
| 153 |
struct ofile *next; /* Next open file */
|
| 154 |
int f; /* Open file */
|
| 155 |
char *filename; /* File name */
|
| 156 |
int refcnt; /* open reference count */
|
| 157 |
} ofile_t;
|
| 158 |
|
| 159 |
typedef struct track {
|
| 160 |
void *xfp; /* Open file for this track from xopen()*/
|
| 161 |
char *filename; /* File name for this track */
|
| 162 |
|
| 163 |
tsize_t itracksize; /* Size of track bytes (-1 == until EOF)*/
|
| 164 |
/* This is in units of isecsize */
|
| 165 |
tsize_t tracksize; /* Size of track bytes (-1 == until EOF)*/
|
| 166 |
/* This is in units of secsize */
|
| 167 |
|
| 168 |
long trackstart; /* Start sector # of this track */
|
| 169 |
long tracksecs; /* Size of this track (sectors) */
|
| 170 |
long padsecs; /* Pad size for this track (sectors) */
|
| 171 |
long pregapsize; /* Pre-gap size for this track (sectors)*/
|
| 172 |
long index0start; /* Index 0 start within this tr(sectors)*/
|
| 173 |
int isecsize; /* Read input sector size for this track*/
|
| 174 |
int secsize; /* Sector size for this track (bytes) */
|
| 175 |
int secspt; /* # of sectors to copy for one transfer*/
|
| 176 |
int pktsize; /* # of blocks per write packet */
|
| 177 |
Uchar dataoff; /* offset of user data in raw sector */
|
| 178 |
Uchar tracks; /* Number of tracks on this disk */
|
| 179 |
Uchar track; /* Track # as offset in track[] array */
|
| 180 |
Uchar trackno; /* Track # on disk for this track */
|
| 181 |
Uchar tracktype; /* Track type (toc type) */
|
| 182 |
Uchar dbtype; /* Data block type for this track */
|
| 183 |
int sectype; /* Sector type */
|
| 184 |
int flags; /* Flags (see below) */
|
| 185 |
int nindex; /* Number of indices for track */
|
| 186 |
long *tindex; /* Track index descriptor */
|
| 187 |
char *isrc; /* ISRC code for this track / disk MCN */
|
| 188 |
void *text; /* Opaque CD-Text data (txtptr_t *) */
|
| 189 |
} track_t;
|
| 190 |
|
| 191 |
#define track_base(tp) ((tp) - (tp)->track)
|
| 192 |
|
| 193 |
/*
|
| 194 |
* Defines for tp->flags
|
| 195 |
*/
|
| 196 |
#define TI_AUDIO 0x00001 /* File is an audio track */
|
| 197 |
#define TI_PREEMP 0x00002 /* Audio track recorded w/preemphasis */
|
| 198 |
#define TI_MIX 0x00004 /* This is a mixed mode track */
|
| 199 |
#define TI_RAW 0x00008 /* Write this track in raw mode */
|
| 200 |
#define TI_PAD 0x00010 /* Pad data track */
|
| 201 |
#define TI_SWAB 0x00020 /* Swab audio data */
|
| 202 |
#define TI_ISOSIZE 0x00040 /* Use iso size for track */
|
| 203 |
#define TI_NOAUHDR 0x00080 /* Don't look for audio header */
|
| 204 |
#define TI_FIRST 0x00100 /* This is the first track */
|
| 205 |
#define TI_LAST 0x00200 /* This is the last track */
|
| 206 |
#define TI_PACKET 0x00400 /* Fixed- or variable-packet track */
|
| 207 |
#define TI_NOCLOSE 0x00800 /* Don't close the track after writing */
|
| 208 |
#define TI_TAO 0x01000 /* This track is written in TAO mode */
|
| 209 |
#define TI_PREGAP 0x02000 /* Prev. track incl. pregap of this tr. */
|
| 210 |
#define TI_SCMS 0x04000 /* Force to follow the SCMS rules */
|
| 211 |
#define TI_COPY 0x08000 /* Allow digital copy */
|
| 212 |
#define TI_SHORT_TRACK 0x10000 /* Ignore min 4 second Red Book std. */
|
| 213 |
#define TI_RAW16 0x20000 /* This track uses 16 bytes subch. */
|
| 214 |
#define TI_RAW96R 0x40000 /* This track uses 96 bytes RAW subch. */
|
| 215 |
#define TI_CLONE 0x80000 /* Special clone treatment needed */
|
| 216 |
#define TI_TEXT 0x100000 /* This track holds CD-Text information */
|
| 217 |
#define TI_DVD 0x200000 /* We are writing a DVD track */
|
| 218 |
#define TI_SAO 0x400000 /* This track is written in SAO mode */
|
| 219 |
#define TI_USEINFO 0x800000 /* Use information from *.inf files */
|
| 220 |
#define TI_QUADRO 0x1000000 /* Four Channel Audio Data */
|
| 221 |
|
| 222 |
|
| 223 |
#define is_audio(tp) (((tp)->flags & TI_AUDIO) != 0)
|
| 224 |
#define is_preemp(tp) (((tp)->flags & TI_PREEMP) != 0)
|
| 225 |
#define is_pad(tp) (((tp)->flags & TI_PAD) != 0)
|
| 226 |
#define is_swab(tp) (((tp)->flags & TI_SWAB) != 0)
|
| 227 |
#define is_first(tp) (((tp)->flags & TI_FIRST) != 0)
|
| 228 |
#define is_last(tp) (((tp)->flags & TI_LAST) != 0)
|
| 229 |
#define is_packet(tp) (((tp)->flags & TI_PACKET) != 0)
|
| 230 |
#define is_noclose(tp) (((tp)->flags & TI_NOCLOSE) != 0)
|
| 231 |
#define is_tao(tp) (((tp)->flags & TI_TAO) != 0)
|
| 232 |
#define is_sao(tp) (((tp)->flags & TI_SAO) != 0)
|
| 233 |
#define is_raw(tp) (((tp)->flags & TI_RAW) != 0)
|
| 234 |
#define is_raw16(tp) (((tp)->flags & TI_RAW16) != 0)
|
| 235 |
#define is_raw96(tp) (((tp)->flags & (TI_RAW|TI_RAW16)) == TI_RAW)
|
| 236 |
#define is_raw96p(tp) (((tp)->flags & (TI_RAW|TI_RAW16|TI_RAW96R)) == TI_RAW)
|
| 237 |
#define is_raw96r(tp) (((tp)->flags & (TI_RAW|TI_RAW16|TI_RAW96R)) == (TI_RAW|TI_RAW96R))
|
| 238 |
#define is_pregap(tp) (((tp)->flags & TI_PREGAP) != 0)
|
| 239 |
#define is_scms(tp) (((tp)->flags & TI_SCMS) != 0)
|
| 240 |
#define is_copy(tp) (((tp)->flags & TI_COPY) != 0)
|
| 241 |
#define is_shorttrk(tp) (((tp)->flags & TI_SHORT_TRACK) != 0)
|
| 242 |
#define is_clone(tp) (((tp)->flags & TI_CLONE) != 0)
|
| 243 |
#define is_text(tp) (((tp)->flags & TI_TEXT) != 0)
|
| 244 |
#define is_quadro(tp) (((tp)->flags & TI_QUADRO) != 0)
|
| 245 |
|
| 246 |
/*
|
| 247 |
* Defines for toc type / track type
|
| 248 |
*/
|
| 249 |
#define TOC_DA 0 /* CD-DA */
|
| 250 |
#define TOC_ROM 1 /* CD-ROM */
|
| 251 |
#define TOC_XA1 2 /* CD_ROM XA with first track in mode 1 */
|
| 252 |
#define TOC_XA2 3 /* CD_ROM XA with first track in mode 2 */
|
| 253 |
#define TOC_CDI 4 /* CDI */
|
| 254 |
|
| 255 |
#define TOC_MASK 7 /* Mask needed for toctname[] */
|
| 256 |
|
| 257 |
/*
|
| 258 |
* Additional flags in toc type / trackp->tracktype
|
| 259 |
* XXX TOCF_DUMMY istr schon in dp->cdr_cmdflags & F_DUMMY
|
| 260 |
* XXX TOCF_MULTI istr schon in dp->cdr_cmdflags & F_MULTI
|
| 261 |
*/
|
| 262 |
#define TOCF_DUMMY 0x10 /* Write in dummy (simulation) mode */
|
| 263 |
#define TOCF_MULTI 0x20 /* Multisession (Open Next Programarea) */
|
| 264 |
|
| 265 |
#define TOCF_MASK 0xF0 /* All possible flags in tracktype */
|
| 266 |
|
| 267 |
extern char *toc2name[]; /* Convert toc type to name */
|
| 268 |
extern int toc2sess[]; /* Convert toc type to session format */
|
| 269 |
|
| 270 |
/*
|
| 271 |
* Defines for sector type
|
| 272 |
*
|
| 273 |
* Mode is 2 bits
|
| 274 |
* Aud is 1 bit
|
| 275 |
*
|
| 276 |
* Sector is: aud << 2 | mode
|
| 277 |
*/
|
| 278 |
#define ST_ROM_MODE1 1 /* CD-ROM in mode 1 (vanilla cdrom) */
|
| 279 |
#define ST_ROM_MODE2 2 /* CD-ROM in mode 2 */
|
| 280 |
#define ST_AUDIO_NOPRE 4 /* CD-DA stereo without preemphasis */
|
| 281 |
#define ST_AUDIO_PRE 5 /* CD-DA stereo with preemphasis */
|
| 282 |
|
| 283 |
#define ST_PREEMPMASK 0x01 /* Mask for preemphasis bit */
|
| 284 |
#define ST_AUDIOMASK 0x04 /* Mask for audio bit */
|
| 285 |
#define ST_MODEMASK 0x03 /* Mask for mode bits in sector type */
|
| 286 |
#define ST_MASK 0x07 /* Mask needed for sectname[] */
|
| 287 |
|
| 288 |
/*
|
| 289 |
* There are 6 different generic basic sector types.
|
| 290 |
*/
|
| 291 |
#define ST_MODE_AUDIO 0x00 /* Generic Audio mode */
|
| 292 |
#define ST_MODE_0 0x10 /* Generic Zero mode */
|
| 293 |
#define ST_MODE_1 0x20 /* Generic CD-ROM mode (ISO/IEC 10149) */
|
| 294 |
#define ST_MODE_2 0x30 /* Generic Mode 2 (ISO/IEC 10149) */
|
| 295 |
#define ST_MODE_2_FORM_1 0x40 /* Generic Mode 2 form 1 */
|
| 296 |
#define ST_MODE_2_FORM_2 0x50 /* Generic Mode 2 form 2 */
|
| 297 |
#define ST_MODE_2_MIXED 0x60 /* Generic Mode 2 mixed form (1/2) */
|
| 298 |
|
| 299 |
#define ST_MODE_MASK 0x70 /* Mask needed to get generic sectype */
|
| 300 |
|
| 301 |
#define ST_MODE_RAW 0x08 /* Do not touch EDC & subchannels */
|
| 302 |
#define ST_NOSCRAMBLE 0x80 /* Do not srcamble sectors */
|
| 303 |
|
| 304 |
#define SECT_AUDIO (ST_AUDIO_NOPRE | ST_MODE_AUDIO)
|
| 305 |
#define SECT_AUDIO_NOPRE (ST_AUDIO_NOPRE | ST_MODE_AUDIO)
|
| 306 |
#define SECT_AUDIO_PRE (ST_AUDIO_PRE | ST_MODE_AUDIO)
|
| 307 |
#define SECT_MODE_0 (ST_ROM_MODE1 | ST_MODE_0)
|
| 308 |
#define SECT_ROM (ST_ROM_MODE1 | ST_MODE_1)
|
| 309 |
#define SECT_MODE_2 (ST_ROM_MODE2 | ST_MODE_2)
|
| 310 |
#define SECT_MODE_2_F1 (ST_ROM_MODE2 | ST_MODE_2_FORM_1)
|
| 311 |
#define SECT_MODE_2_F2 (ST_ROM_MODE2 | ST_MODE_2_FORM_2)
|
| 312 |
#define SECT_MODE_2_MIX (ST_ROM_MODE2 | ST_MODE_2_MIXED)
|
| 313 |
|
| 314 |
extern char *st2name[]; /* Convert sector type to name */
|
| 315 |
extern int st2mode[]; /* Convert sector type to control nibble*/
|
| 316 |
|
| 317 |
/*
|
| 318 |
* Control nibble bits:
|
| 319 |
*
|
| 320 |
* 0 with preemphasis (audio) / incremental (data)
|
| 321 |
* 1 digital copy permitted
|
| 322 |
* 2 data (not audio) track
|
| 323 |
* 3 4 channels (not 2)
|
| 324 |
*/
|
| 325 |
#define TM_PREEM 0x1 /* Audio track with preemphasis */
|
| 326 |
#define TM_INCREMENTAL 0x1 /* Incremental data track */
|
| 327 |
#define TM_ALLOW_COPY 0x2 /* Digital copy permitted */
|
| 328 |
#define TM_DATA 0x4 /* This is a data track */
|
| 329 |
#define TM_QUADRO 0x8 /* Four channel audio */
|
| 330 |
|
| 331 |
/*
|
| 332 |
* Adr nibble:
|
| 333 |
*/
|
| 334 |
#define ADR_NONE 0 /* Sub-Q mode info not supplied */
|
| 335 |
#define ADR_POS 1 /* Sub-Q encodes position data */
|
| 336 |
#define ADR_MCN 2 /* Sub-Q encodes Media Catalog Number */
|
| 337 |
#define ADR_ISRC 3 /* Sub-Q encodes ISRC */
|
| 338 |
|
| 339 |
/*
|
| 340 |
* Defines for write type (from SCSI-3/mmc)
|
| 341 |
*/
|
| 342 |
#define WT_PACKET 0x0 /* Packet writing */
|
| 343 |
#define WT_TAO 0x1 /* Track at once */
|
| 344 |
#define WT_SAO 0x2 /* Session at once */
|
| 345 |
#define WT_RAW 0x3 /* Raw */
|
| 346 |
#define WT_RES_4 0x4 /* Reserved */
|
| 347 |
#define WT_RES_5 0x5 /* Reserved */
|
| 348 |
#define WT_RES_6 0x6 /* Reserved */
|
| 349 |
#define WT_RES_7 0x7 /* Reserved */
|
| 350 |
#define WT_RES_8 0x8 /* Reserved */
|
| 351 |
#define WT_RES_9 0x9 /* Reserved */
|
| 352 |
#define WT_RES_A 0xA /* Reserved */
|
| 353 |
#define WT_RES_B 0xB /* Reserved */
|
| 354 |
#define WT_RES_C 0xC /* Reserved */
|
| 355 |
#define WT_RES_D 0xD /* Reserved */
|
| 356 |
#define WT_RES_E 0xE /* Reserved */
|
| 357 |
#define WT_RES_F 0xF /* Reserved */
|
| 358 |
|
| 359 |
/*
|
| 360 |
* Data block layout:
|
| 361 |
*
|
| 362 |
* - Sync pattern 12 Bytes: 0x00 0xFF 0xFF ... 0xFF 0xFF 0x00
|
| 363 |
* - Block header 4 Bytes: | minute | second | frame | mode |
|
| 364 |
* Mode byte:
|
| 365 |
* Bits 7, 6, 5 Run-in/Run-out/Link
|
| 366 |
* Bits 4, 3, 2 Reserved
|
| 367 |
* Bits 1, 0 Mode
|
| 368 |
* - Rest of sector see below.
|
| 369 |
*
|
| 370 |
* Mode 0 Format:
|
| 371 |
* 0 12 Bytes Sync header
|
| 372 |
* 12 4 Bytes Block header with Data mode == 0
|
| 373 |
* 16 2336 Bytes of zero data
|
| 374 |
*
|
| 375 |
* Mode 1 Format:
|
| 376 |
* 0 12 Bytes Sync header
|
| 377 |
* 12 4 Bytes Block header with Data mode == 1
|
| 378 |
* 16 2048 Bytes of user data
|
| 379 |
* 2064 4 Bytes CRC for Bytes 0-2063
|
| 380 |
* 2068 8 Bytes Zero fill
|
| 381 |
* 2076 172 Bytes P parity symbols
|
| 382 |
* 2248 104 Bytes Q parity symbols
|
| 383 |
*
|
| 384 |
* Mode 2 Format (formless):
|
| 385 |
* 0 12 Bytes Sync header
|
| 386 |
* 12 4 Bytes Block header with Data mode == 2
|
| 387 |
* 16 2336 Bytes of user data
|
| 388 |
*
|
| 389 |
* Mode 2 form 1 Format:
|
| 390 |
* 0 12 Bytes Sync header
|
| 391 |
* 12 4 Bytes Block header with Data mode == 2
|
| 392 |
* 16 4 Bytes subheader first copy
|
| 393 |
* 20 4 Bytes subheader second copy
|
| 394 |
* 24 2048 Bytes of user data
|
| 395 |
* 2072 4 Bytes CRC for Bytes 16-2071
|
| 396 |
* 2076 172 Bytes P parity symbols
|
| 397 |
* 2248 104 Bytes Q parity symbols
|
| 398 |
*
|
| 399 |
* Mode 2 form 2 Format:
|
| 400 |
* 0 12 Bytes Sync header
|
| 401 |
* 12 4 Bytes Block header with Data mode == 2
|
| 402 |
* 16 4 Bytes subheader first copy
|
| 403 |
* 20 4 Bytes subheader second copy
|
| 404 |
* 24 2324 Bytes of user data
|
| 405 |
* 2348 4 Bytes Optional CRC for Bytes 16-2347
|
| 406 |
*/
|
| 407 |
|
| 408 |
/*
|
| 409 |
* Mode Byte definitions (the 4th Byte in the Block header)
|
| 410 |
*/
|
| 411 |
#define SH_MODE_DATA 0x00 /* User Data Block */
|
| 412 |
#define SH_MODE_RI4 0x20 /* Fourth run in Block */
|
| 413 |
#define SH_MODE_RI3 0x40 /* Third run in Block */
|
| 414 |
#define SH_MODE_RI2 0x60 /* Second run in Block */
|
| 415 |
#define SH_MODE_RI1 0x80 /* First run in Block */
|
| 416 |
#define SH_MODE_LINK 0xA0 /* Link Block */
|
| 417 |
#define SH_MODE_RO2 0xC0 /* Second run out Block */
|
| 418 |
#define SH_MODE_RO1 0xE0 /* First run out Block */
|
| 419 |
#define SH_MODE_M0 0x00 /* Mode 0 Data */
|
| 420 |
#define SH_MODE_M1 0x01 /* Mode 1 Data */
|
| 421 |
#define SH_MODE_M2 0x02 /* Mode 2 Data */
|
| 422 |
#define SH_MODE_MR 0x03 /* Reserved */
|
| 423 |
|
| 424 |
/*
|
| 425 |
* Defines for data block type (from SCSI-3/mmc)
|
| 426 |
*
|
| 427 |
* Mandatory are only:
|
| 428 |
* DB_ROM_MODE1 (8) Mode 1 (ISO/IEC 10149)
|
| 429 |
* DB_XA_MODE2 (10) Mode 2-F1 (CD-ROM XA form 1)
|
| 430 |
* DB_XA_MODE2_MIX (13) Mode 2-MIX (CD-ROM XA 1/2+subhdr)
|
| 431 |
*/
|
| 432 |
#define DB_RAW 0 /* 2352 bytes of raw data */
|
| 433 |
#define DB_RAW_PQ 1 /* 2368 bytes (raw data + P/Q Subchannel) */
|
| 434 |
#define DB_RAW_PW 2 /* 2448 bytes (raw data + P-W Subchannel) */
|
| 435 |
#define DB_RAW_PW_R 3 /* 2448 bytes (raw data + P-W raw Subchannel)*/
|
| 436 |
#define DB_RES_4 4 /* - Reserved */
|
| 437 |
#define DB_RES_5 5 /* - Reserved */
|
| 438 |
#define DB_RES_6 6 /* - Reserved */
|
| 439 |
#define DB_VU_7 7 /* - Vendor specific */
|
| 440 |
#define DB_ROM_MODE1 8 /* 2048 bytes Mode 1 (ISO/IEC 10149) */
|
| 441 |
#define DB_ROM_MODE2 9 /* 2336 bytes Mode 2 (ISO/IEC 10149) */
|
| 442 |
#define DB_XA_MODE2 10 /* 2048 bytes Mode 2 (CD-ROM XA form 1) */
|
| 443 |
#define DB_XA_MODE2_F1 11 /* 2056 bytes Mode 2 (CD-ROM XA form 1) */
|
| 444 |
#define DB_XA_MODE2_F2 12 /* 2324 bytes Mode 2 (CD-ROM XA form 2) */
|
| 445 |
#define DB_XA_MODE2_MIX 13 /* 2332 bytes Mode 2 (CD-ROM XA 1/2+subhdr) */
|
| 446 |
#define DB_RES_14 14 /* - Reserved */
|
| 447 |
#define DB_VU_15 15 /* - Vendor specific */
|
| 448 |
|
| 449 |
extern char *db2name[]; /* Convert data block type to name */
|
| 450 |
|
| 451 |
/*
|
| 452 |
* Defines for multi session type (from SCSI-3/mmc)
|
| 453 |
*/
|
| 454 |
#define MS_NONE 0 /* No B0 pointer. Next session not allowed*/
|
| 455 |
#define MS_FINAL 1 /* B0 = FF:FF:FF. Next session not allowed*/
|
| 456 |
#define MS_RES 2 /* Reserved */
|
| 457 |
#define MS_MULTI 3 /* B0 = Next PA. Next session allowed */
|
| 458 |
|
| 459 |
/*
|
| 460 |
* Defines for session format (from SCSI-3/mmc)
|
| 461 |
*/
|
| 462 |
#define SES_DA_ROM 0x00 /* CD-DA or CD-ROM disk */
|
| 463 |
#define SES_CDI 0x10 /* CD-I disk */
|
| 464 |
#define SES_XA 0x20 /* CD-ROM XA disk */
|
| 465 |
#define SES_UNDEF 0xFF /* Undefined disk type (read disk info) */
|
| 466 |
|
| 467 |
/*
|
| 468 |
* Defines for blanking of CD-RW discs (from SCSI-3/mmc)
|
| 469 |
*/
|
| 470 |
#define BLANK_DISC 0x00 /* Erase the entire disc */
|
| 471 |
#define BLANK_MINIMAL 0x01 /* Erase the PMA, 1st session TOC, pregap */
|
| 472 |
#define BLANK_TRACK 0x02 /* Erase an incomplete track */
|
| 473 |
#define BLANK_UNRESERVE 0x03 /* Unreserve a track */
|
| 474 |
#define BLANK_TAIL 0x04 /* Erase the tail of a track */
|
| 475 |
#define BLANK_UNCLOSE 0x05 /* Unclose the last session */
|
| 476 |
#define BLANK_SESSION 0x06 /* Erase the last session */
|
| 477 |
|
| 478 |
/*
|
| 479 |
* Defines for formating DVD (custom values)
|
| 480 |
*/
|
| 481 |
#define FULL_FORMAT 0x00 /* Interactive format */
|
| 482 |
#define BACKGROUND_FORMAT 0x01 /* Background format */
|
| 483 |
#define FORCE_FORMAT 0x02 /* Force reformat */
|
| 484 |
|
| 485 |
/*
|
| 486 |
* Defines for formating DVD (custom values)
|
| 487 |
*/
|
| 488 |
#define FULL_FORMAT 0x00 /* Interactive format */
|
| 489 |
#define BACKGROUND_FORMAT 0x01 /* Background format */
|
| 490 |
#define FORCE_FORMAT 0x02 /* Force reformat */
|
| 491 |
|
| 492 |
/*
|
| 493 |
* Useful definitions for audio tracks
|
| 494 |
*/
|
| 495 |
#define msample (44100 * 2) /* one 16bit audio sample */
|
| 496 |
#define ssample (msample * 2) /* one stereo sample */
|
| 497 |
#define samples(v) ((v) / ssample) /* # of stereo samples */
|
| 498 |
#define hsamples(v) ((v) / (ssample/100)) /* 100* # of stereo samples/s*/
|
| 499 |
#define fsamples(v) ((v) / (ssample/75)) /* 75* # of stereo samples/s */
|
| 500 |
|
| 501 |
#define minutes(v) ((int)(samples(v) / 60))
|
| 502 |
#define seconds(v) ((int)(samples(v) % 60))
|
| 503 |
#define hseconds(v) ((int)(hsamples(v) % 100))
|
| 504 |
#define frames(v) ((int)(fsamples(v) % 75))
|
| 505 |
|
| 506 |
/*
|
| 507 |
* sector based macros
|
| 508 |
*/
|
| 509 |
#define Sminutes(s) ((int)((s) / (60*75)))
|
| 510 |
#define Sseconds(s) ((int)((s) / 75))
|
| 511 |
#define Shseconds(s) ((int)(((s) % 75)*100)/75)
|
| 512 |
#define Sframes(s) ((int)((s) % 75))
|
| 513 |
|
| 514 |
typedef struct msf {
|
| 515 |
char msf_min;
|
| 516 |
char msf_sec;
|
| 517 |
char msf_frame;
|
| 518 |
} msf_t;
|
| 519 |
|
| 520 |
/*
|
| 521 |
* Definitions for read TOC/PMA/ATIP command
|
| 522 |
*/
|
| 523 |
#define FMT_TOC 0
|
| 524 |
#define FMT_SINFO 1
|
| 525 |
#define FMT_FULLTOC 2
|
| 526 |
#define FMT_PMA 3
|
| 527 |
#define FMT_ATIP 4
|
| 528 |
#define FMT_CDTEXT 5
|
| 529 |
|
| 530 |
/*
|
| 531 |
* Definitions for read disk information "recording flags"
|
| 532 |
* used in UInt16_t "ds_cdrflags".
|
| 533 |
*/
|
| 534 |
#define RF_WRITE 0x0001 /* Disk is going to be written */
|
| 535 |
#define RF_BLANK 0x0002 /* Disk is going to be erased */
|
| 536 |
#define RF_PRATIP 0x0004 /* Print ATIP info */
|
| 537 |
#define RF_LEADIN 0x0008 /* Lead-in has been "manually" written */
|
| 538 |
#define RF_BURNFREE 0x0010 /* BUFFER underrun free recording */
|
| 539 |
#define RF_VARIREC 0x0020 /* Plextor VariRec */
|
| 540 |
#define RF_AUDIOMASTER 0x0040 /* Yamaha AudioMaster */
|
| 541 |
#define RF_FORCESPEED 0x0080 /* WriteSpeed forced high */
|
| 542 |
#define RF_DID_STAT 0x0100 /* Already did call cdrstats() */
|
| 543 |
#define RF_DID_CDRSTAT 0x0200 /* Already did call (*dp->cdr_stats)() */
|
| 544 |
#define RF_WR_WAIT 0x0400 /* Wait during writing to free bus */
|
| 545 |
#define RF_SINGLESESS 0x0800 /* Plextor single sess. mode */
|
| 546 |
#define RF_HIDE_CDR 0x1000 /* Plextor hide CDR features */
|
| 547 |
#define RF_SPEEDREAD 0x2000 /* Plextor SpeedReed */
|
| 548 |
#define RF_GIGAREC 0x4000 /* Plextor GigaRec */
|
| 549 |
|
| 550 |
/*
|
| 551 |
* Definitions for read disk information "disk status"
|
| 552 |
* used in "ds_diskstat".
|
| 553 |
*/
|
| 554 |
#define DS_EMPTY 0 /* Empty disk */
|
| 555 |
#define DS_APPENDABLE 1 /* Incomplete disk (appendable) */
|
| 556 |
#define DS_COMPLETE 2 /* Complete disk (closed/no B0 pointer) */
|
| 557 |
#define DS_RESERVED 3 /* Reserved */
|
| 558 |
|
| 559 |
/*
|
| 560 |
* Definitions for read disk information "session status"
|
| 561 |
* used in "ds_sessstat".
|
| 562 |
*/
|
| 563 |
#define SS_EMPTY 0 /* Empty session */
|
| 564 |
#define SS_APPENDABLE 1 /* Incomplete session */
|
| 565 |
#define SS_RESERVED 2 /* Reserved */
|
| 566 |
#define SS_COMPLETE 3 /* Complete session (needs DS_COMPLETE) */
|
| 567 |
|
| 568 |
/*
|
| 569 |
* Definitions for disk_status write mode
|
| 570 |
* used in "ds_wrmode".
|
| 571 |
*/
|
| 572 |
#define WM_NONE 0 /* No write mode selected */
|
| 573 |
#define WM_BLANK 1 /* Blanking mode */
|
| 574 |
#define WM_FORMAT 2 /* Formatting */
|
| 575 |
#define WM_PACKET 4 /* Packet writing */
|
| 576 |
#define WM_TAO 8 /* Track at Once */
|
| 577 |
#define WM_SAO 12 /* Session at Once w/ cooked sectors */
|
| 578 |
#define WM_SAO_RAW16 13 /* Session at Once RAW+16 byte sectors */
|
| 579 |
#define WM_SAO_RAW96P 14 /* Session at Once RAW+96P byte sectors */
|
| 580 |
#define WM_SAO_RAW96R 15 /* Session at Once RAW+96R byte sectors */
|
| 581 |
#define WM_RAW 16 /* RAW with cooked sectors is impossible*/
|
| 582 |
#define WM_RAW_RAW16 17 /* RAW with RAW+16 byte sectors */
|
| 583 |
#define WM_RAW_RAW96P 18 /* RAW with RAW+96P byte sectors */
|
| 584 |
#define WM_RAW_RAW96R 19 /* RAW with RAW+96R byte sectors */
|
| 585 |
|
| 586 |
#define wm_base(wm) ((wm)/4*4) /* The basic write mode for this mode */
|
| 587 |
|
| 588 |
/*
|
| 589 |
* Definitions for disk_status flags
|
| 590 |
* used in UInt16_t "ds_flags".
|
| 591 |
*/
|
| 592 |
#define DSF_DID_V 0x0001 /* Disk id valid */
|
| 593 |
#define DSF_DBC_V 0x0002 /* Disk bar code valid */
|
| 594 |
#define DSF_URU 0x0004 /* Disk is for unrestricted use */
|
| 595 |
#define DSF_ERA 0x0008 /* Disk is erasable */
|
| 596 |
#define DSF_HIGHSP_ERA 0x0010 /* Disk is high speed erasable */
|
| 597 |
#define DSF_ULTRASP_ERA 0x0020 /* Disk is ultra speed erasable */
|
| 598 |
#define DSF_ULTRASPP_ERA 0x0040 /* Disk is ultra speed+ erasable */
|
| 599 |
|
| 600 |
|
| 601 |
#define DSF_DVD 0x0100 /* Disk is a DVD */
|
| 602 |
#define DSF_DVD_PLUS_R 0x0200 /* Disk is a DVD+R */
|
| 603 |
#define DSF_DVD_PLUS_RW 0x0400 /* Disk is a DVD+RW */
|
| 604 |
#define DSF_NEED_FORMAT 0x0800 /* Disk needs to be formatted */
|
| 605 |
|
| 606 |
/*
|
| 607 |
* Definitions for disktype flags
|
| 608 |
*/
|
| 609 |
#define DT_CD 0x001 /*is a CD */
|
| 610 |
#define DT_DVD 0x002 /*is a DVD */
|
| 611 |
|
| 612 |
/*
|
| 613 |
* Definitions for disktype flags
|
| 614 |
*/
|
| 615 |
#define DT_CD 0x001 /*is a CD */
|
| 616 |
#define DT_DVD 0x002 /*is a DVD */
|
| 617 |
|
| 618 |
/*
|
| 619 |
* Definitions for disk_status disk type
|
| 620 |
* used in "ds_type".
|
| 621 |
*/
|
| 622 |
/* None defined yet */
|
| 623 |
|
| 624 |
typedef struct disk_status dstat_t;
|
| 625 |
|
| 626 |
struct disk_status {
|
| 627 |
UInt32_t ds_diskid; /* Disk identification */
|
| 628 |
UInt16_t ds_cdrflags; /* Recording flags from cdrecord*/
|
| 629 |
UInt16_t ds_flags; /* Disk_status flags */
|
| 630 |
Uchar ds_wrmode; /* Selected write mode */
|
| 631 |
Uchar ds_type; /* Abstract disk type */
|
| 632 |
|
| 633 |
Uchar ds_disktype; /* Disk type (from TOC/PMA) */
|
| 634 |
Uchar ds_diskstat; /* Disk status (MMC) */
|
| 635 |
Uchar ds_sessstat; /* Status of last sesion (MMC) */
|
| 636 |
Uchar ds_trfirst; /* first track # */
|
| 637 |
Uchar ds_trlast; /* last track # */
|
| 638 |
Uchar ds_trfirst_ls; /* first track # in last session*/
|
| 639 |
Uchar ds_barcode[8]; /* Disk bar code */
|
| 640 |
|
| 641 |
Int32_t ds_first_leadin; /* Start of first lead in (ATIP)*/
|
| 642 |
Int32_t ds_last_leadout; /* Start of last lead out (ATIP)*/
|
| 643 |
Int32_t ds_curr_leadin; /* Start of next lead in */
|
| 644 |
Int32_t ds_curr_leadout; /* Start of next lead out */
|
| 645 |
|
| 646 |
Int32_t ds_maxblocks; /* # of official blocks on disk */
|
| 647 |
Int32_t ds_maxrblocks; /* # real blocks on disk */
|
| 648 |
Int32_t ds_fwa; /* first writable addr */
|
| 649 |
|
| 650 |
Int32_t ds_startsec; /* Actual start sector */
|
| 651 |
Int32_t ds_endsec; /* Actual end sector */
|
| 652 |
Int32_t ds_buflow; /* # of times drive buffer empty*/
|
| 653 |
|
| 654 |
UInt16_t ds_minbuf; /* Minimum drive bufer fill rt. */
|
| 655 |
|
| 656 |
UInt16_t ds_at_min_speed; /* The minimal ATIP write speed */
|
| 657 |
UInt16_t ds_at_max_speed; /* The maximal ATIP write speed */
|
| 658 |
UInt16_t ds_dr_cur_rspeed; /* The drive's cur read speed */
|
| 659 |
UInt16_t ds_dr_max_rspeed; /* The drive's max read speed */
|
| 660 |
UInt16_t ds_dr_cur_wspeed; /* The drive's cur write speed */
|
| 661 |
UInt16_t ds_dr_max_wspeed; /* The drive's max write speed */
|
| 662 |
UInt16_t ds_wspeed; /* The selected/drive wr. speed */
|
| 663 |
};
|
| 664 |
|
| 665 |
/*
|
| 666 |
* First approach of a CDR device abstraction layer.
|
| 667 |
* This interface will change as long as I did not find the
|
| 668 |
* optimum that fits for all devices.
|
| 669 |
*
|
| 670 |
* Called with pointer to whole track array:
|
| 671 |
* cdr_send_cue()
|
| 672 |
* cdr_write_leadin()
|
| 673 |
* cdr_open_session()
|
| 674 |
* cdr_fixate()
|
| 675 |
*
|
| 676 |
* Called with (track_t *) 0 or pointer to current track:
|
| 677 |
* cdr_next_wr_address()
|
| 678 |
*
|
| 679 |
* Called with pointer to current track:
|
| 680 |
* cdr_open_track()
|
| 681 |
* cdr_close_track()
|
| 682 |
*
|
| 683 |
* Calling sequence:
|
| 684 |
* cdr_identify() May modify driver
|
| 685 |
* Here, the cdr_t will be allocated and
|
| 686 |
* copied to a new writable area.
|
| 687 |
* cdr_attach() Get drive properties
|
| 688 |
* cdr_buffer_cap()
|
| 689 |
* cdr_getdisktype() GET ATIP
|
| 690 |
* cdr_init() set TAO for -msinfo
|
| 691 |
* cdr_check_session XXX ????
|
| 692 |
* cdr_opt1() set early options
|
| 693 |
* cdr_set_speed_dummy(scgp, dp, &speed)
|
| 694 |
* <--- Grace time processing goes here
|
| 695 |
* { do_opc(); cdr_blank() }
|
| 696 |
* cdr_opt2() set late options
|
| 697 |
* cdr_open_session() set up params (no wrt.)
|
| 698 |
* do_opc()
|
| 699 |
* cdr_write_leadin() start writing
|
| 700 |
* LOOP {
|
| 701 |
* cdr_open_track()
|
| 702 |
* cdr_next_wr_address() only TAO / Packet
|
| 703 |
* write_track_data()
|
| 704 |
* cdr_close_track()
|
| 705 |
* }
|
| 706 |
* write_leadout() XXX should go -> driver!
|
| 707 |
* cdr_fixate()
|
| 708 |
* cdr_stats()
|
| 709 |
*/
|
| 710 |
/*--------------------------------------------------------------------------*/
|
| 711 |
typedef struct cdr_cmd cdr_t;
|
| 712 |
|
| 713 |
#ifdef _SCG_SCSITRANSP_H
|
| 714 |
struct cdr_cmd {
|
| 715 |
int cdr_dev; /* Numerical device type */
|
| 716 |
UInt32_t cdr_cmdflags; /* Command line options */
|
| 717 |
UInt32_t cdr_flags; /* Drive related flags */
|
| 718 |
UInt8_t cdr_cdrw_support; /* CD-RW write media types */
|
| 719 |
UInt16_t cdr_speeddef; /* Default write speed */
|
| 720 |
UInt16_t cdr_speedmax; /* Max. write speed */
|
| 721 |
|
| 722 |
char *cdr_drname; /* Driver ID string */
|
| 723 |
char *cdr_drtext; /* Driver ID text */
|
| 724 |
struct cd_mode_page_2A *cdr_cdcap;
|
| 725 |
dstat_t *cdr_dstat;
|
| 726 |
#ifdef _SCG_SCSIREG_H
|
| 727 |
/* identify drive */
|
| 728 |
cdr_t *(*cdr_identify)(SCSI *scgp, cdr_t *, struct scsi_inquiry *);
|
| 729 |
#else
|
| 730 |
/* identify drive */
|
| 731 |
cdr_t *(*cdr_identify)(SCSI *scgp, cdr_t *, void *);
|
| 732 |
#endif
|
| 733 |
/* init error decoding etc*/
|
| 734 |
int (*cdr_attach)(SCSI *scgp, cdr_t *);
|
| 735 |
/* init drive to useful deflts */
|
| 736 |
int (*cdr_init)(SCSI *scgp, cdr_t *);
|
| 737 |
/* get disk type */
|
| 738 |
int (*cdr_getdisktype)(SCSI *scgp, cdr_t *);
|
| 739 |
/* load disk */
|
| 740 |
int (*cdr_load)(SCSI *scgp, cdr_t *);
|
| 741 |
/* unload disk */
|
| 742 |
int (*cdr_unload)(SCSI *scgp, cdr_t *);
|
| 743 |
/* read buffer capacity */
|
| 744 |
int (*cdr_buffer_cap)(SCSI *scgp, long *sizep, long *freep);
|
| 745 |
/* check if recover is needed */
|
| 746 |
int (*cdr_check_recovery)(SCSI *scgp, cdr_t *);
|
| 747 |
/* do recover */
|
| 748 |
int (*cdr_recover)(SCSI *scgp, cdr_t *, int track);
|
| 749 |
/* set recording speed & dummy write */
|
| 750 |
int (*cdr_set_speed_dummy)(SCSI *scgp, cdr_t *, int *speedp);
|
| 751 |
/* set sector size */
|
| 752 |
int (*cdr_set_secsize)(SCSI *scgp, int secsize);
|
| 753 |
/* get next writable addr. */
|
| 754 |
int (*cdr_next_wr_address)(SCSI *scgp, track_t *trackp, long *ap);
|
| 755 |
/* reserve track for future use */
|
| 756 |
int (*cdr_reserve_track)(SCSI *scgp, Ulong len);
|
| 757 |
int (*cdr_write_trackdata)(SCSI *scgp, caddr_t buf, long daddr, long bytecnt,
|
| 758 |
int seccnt, BOOL islast);
|
| 759 |
/* generate cue sheet */
|
| 760 |
int (*cdr_gen_cue)(track_t *trackp, void *cuep, BOOL needgap);
|
| 761 |
/* send cue sheet */
|
| 762 |
int (*cdr_send_cue)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 763 |
/* write leadin */
|
| 764 |
int (*cdr_write_leadin)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 765 |
/* open new track */
|
| 766 |
int (*cdr_open_track)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 767 |
/* close written track */
|
| 768 |
int (*cdr_close_track)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 769 |
/* open new session */
|
| 770 |
int (*cdr_open_session)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 771 |
/* really needed ??? */
|
| 772 |
int (*cdr_close_session)(SCSI *scgp, cdr_t *);
|
| 773 |
/* abort current write */
|
| 774 |
int (*cdr_abort_session)(SCSI *scgp, cdr_t *);
|
| 775 |
/* read session offset*/
|
| 776 |
int (*cdr_session_offset)(SCSI *scgp, long *soff);
|
| 777 |
/* write toc on disk */
|
| 778 |
int (*cdr_fixate)(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 779 |
/* final statistics printing*/
|
| 780 |
int (*cdr_stats)(SCSI *scgp, cdr_t *);
|
| 781 |
/* blank something */
|
| 782 |
int (*cdr_blank)(SCSI *scgp, cdr_t *, long addr, int blanktype);
|
| 783 |
/* format media */
|
| 784 |
int (*cdr_format)(SCSI *scgp, cdr_t *, int fmtflags);
|
| 785 |
/* Do OPC */
|
| 786 |
int (*cdr_opc)(SCSI *scgp, caddr_t bp, int cnt, int doopc);
|
| 787 |
/* do early option processing*/
|
| 788 |
int (*cdr_opt1)(SCSI *scgp, cdr_t *);
|
| 789 |
/* do late option processing */
|
| 790 |
int (*cdr_opt2)(SCSI *scgp, cdr_t *);
|
| 791 |
/* calculate optimale split */
|
| 792 |
int (*cdr_layer_split)(SCSI *scgp, cdr_t *, long tsize);
|
| 793 |
int profile;
|
| 794 |
BOOL is_dvd;
|
| 795 |
};
|
| 796 |
#endif
|
| 797 |
|
| 798 |
/*
|
| 799 |
* Definitions for cdr_flags
|
| 800 |
*/
|
| 801 |
#define CDR_TAO 0x01 /* Drive supports Track at once */
|
| 802 |
#define CDR_SAO 0x02 /* Drive supports Sess at once */
|
| 803 |
#define CDR_PACKET 0x04 /* Drive supports packet writing*/
|
| 804 |
#define CDR_RAW 0x08 /* Drive supports raw writing */
|
| 805 |
#define CDR_RAW16 0x10 /* Drive supports RAW raw16 */
|
| 806 |
#define CDR_RAW96P 0x20 /* Drive supports RAW raw96 pak */
|
| 807 |
#define CDR_RAW96R 0x40 /* Drive supports RAW raw96 raw */
|
| 808 |
#ifdef __needed__
|
| 809 |
#define CDR_SRAW16 0x100 /* Drive supports SAO raw16 */
|
| 810 |
#endif
|
| 811 |
#define CDR_SRAW96P 0x200 /* Drive supports SAO raw96 pak */
|
| 812 |
#define CDR_SRAW96R 0x400 /* Drive supports SAO raw96 raw */
|
| 813 |
#define CDR_SWABAUDIO 0x1000 /* Drive swabs audio data */
|
| 814 |
#define CDR_ISREADER 0x2000 /* Drive is s CD-ROM reader */
|
| 815 |
#define CDR_TRAYLOAD 0x4000 /* Drive loads CD with tray */
|
| 816 |
#define CDR_CADDYLOAD 0x8000 /* Drive loads CD with caddy */
|
| 817 |
#define CDR_NO_LOLIMIT 0x10000 /* Drive ignores lead-out limit */
|
| 818 |
#define CDR_DVD 0x20000 /* Drive is a DVD drive */
|
| 819 |
#define CDR_SIMUL 0x40000 /* Drive is simulated */
|
| 820 |
#define CDR_BURNFREE 0x80000 /* Drive sup. BUFund. free rec. */
|
| 821 |
#define CDR_VARIREC 0x100000 /* Drive sup. VariRec Plex. */
|
| 822 |
#define CDR_AUDIOMASTER 0x200000 /* Drive sup. AudioMaster Yamah.*/
|
| 823 |
#define CDR_FORCESPEED 0x400000 /* Drive sup. WriteSpeed ctl. */
|
| 824 |
#define CDR_DISKTATTOO 0x800000 /* Drive sup. Yamaha DiskT@2 */
|
| 825 |
#define CDR_SINGLESESS 0x1000000 /* Drive sup. single sess. mode */
|
| 826 |
#define CDR_HIDE_CDR 0x2000000 /* Drive sup. hide CDR features */
|
| 827 |
#define CDR_SPEEDREAD 0x4000000 /* Drive sup. SpeedReed */
|
| 828 |
#define CDR_GIGAREC 0x8000000 /* Drive sup. GigaRec Plex. */
|
| 829 |
#define CDR_MMC 0x10000000 /* Drive is MMC compliant */
|
| 830 |
#define CDR_MMC2 0x20000000 /* Drive is MMC-2 compliant */
|
| 831 |
#define CDR_MMC3 0x40000000 /* Drive is MMC-3 compliant */
|
| 832 |
#ifdef PROTOTYPES
|
| 833 |
#define CDR_ALLOC 0x80000000UL /* structure is allocated */
|
| 834 |
#else
|
| 835 |
#define CDR_ALLOC 0x80000000 /* structure is allocated */
|
| 836 |
#endif
|
| 837 |
|
| 838 |
/*
|
| 839 |
* Definitions for cdr_cdrw_support
|
| 840 |
*/
|
| 841 |
#define CDR_CDRW_NONE 0x00 /* CD-RW writing not supported */
|
| 842 |
#define CDR_CDRW_MULTI 0x01 /* CD-RW multi speed supported */
|
| 843 |
#define CDR_CDRW_HIGH 0x02 /* CD-RW high speed supported */
|
| 844 |
#define CDR_CDRW_ULTRA 0x04 /* CD-RW ultra high speed supported */
|
| 845 |
#define CDR_CDRW_ULTRAP 0x08 /* CD-RW ultra high speed+ supported */
|
| 846 |
#define CDR_CDRW_ALL 0xFF /* All bits set: unknown - support all */
|
| 847 |
|
| 848 |
/*
|
| 849 |
* cdrecord.c
|
| 850 |
*/
|
| 851 |
extern int read_buf(int f, char *bp, int size);
|
| 852 |
extern int fill_buf(int f, track_t *trackp, long secno, char *bp, int size);
|
| 853 |
extern int get_buf(int f, track_t *trackp, long secno, char **bpp, int size);
|
| 854 |
#ifdef _SCG_SCSITRANSP_H
|
| 855 |
extern int write_secs(SCSI *scgp, cdr_t *dp, char *bp, long startsec,
|
| 856 |
int bytespt, int secspt, BOOL islast);
|
| 857 |
extern int pad_track(SCSI *scgp, cdr_t *dp, track_t *trackp,
|
| 858 |
long startsec, Llong amt,
|
| 859 |
BOOL dolast, Llong *bytesp);
|
| 860 |
extern void load_media(SCSI *scgp, cdr_t *, BOOL);
|
| 861 |
extern void unload_media(SCSI *scgp, cdr_t *, int);
|
| 862 |
extern void reload_media(SCSI *scgp, cdr_t *);
|
| 863 |
#endif
|
| 864 |
extern void raisepri(int);
|
| 865 |
extern int getnum(char *arg, long *valp);
|
| 866 |
|
| 867 |
/*
|
| 868 |
* cd_misc.c
|
| 869 |
*/
|
| 870 |
extern int from_bcd(int b);
|
| 871 |
extern int to_bcd(int i);
|
| 872 |
extern long msf_to_lba(int m, int s, int f, BOOL force_positive);
|
| 873 |
extern BOOL lba_to_msf(long lba, msf_t *mp);
|
| 874 |
extern void sec_to_msf(long sec, msf_t *mp);
|
| 875 |
extern void print_min_atip(long li, long lo);
|
| 876 |
|
| 877 |
/*
|
| 878 |
* fifo.c
|
| 879 |
*/
|
| 880 |
extern void init_fifo(long);
|
| 881 |
extern BOOL init_faio(track_t *track, int);
|
| 882 |
extern BOOL await_faio(void);
|
| 883 |
extern void kill_faio(void);
|
| 884 |
extern int wait_faio(void);
|
| 885 |
extern int faio_read_buf(int f, char *bp, int size);
|
| 886 |
extern int faio_get_buf(int f, char **bpp, int size);
|
| 887 |
extern void fifo_stats(void);
|
| 888 |
extern int fifo_percent(BOOL addone);
|
| 889 |
|
| 890 |
/*
|
| 891 |
* wm_session.c
|
| 892 |
*/
|
| 893 |
#ifdef _SCG_SCSITRANSP_H
|
| 894 |
extern int write_session_data(SCSI *scgp, cdr_t *dp, track_t *trackp);
|
| 895 |
#endif
|
| 896 |
|
| 897 |
/*
|
| 898 |
* wm_track.c
|
| 899 |
*/
|
| 900 |
#ifdef _SCG_SCSITRANSP_H
|
| 901 |
/*extern int write_track_data __PR((SCSI *scgp, cdr_t *dp, track_t *trackp));*/
|
| 902 |
#endif
|
| 903 |
|
| 904 |
/*
|
| 905 |
* wm_packet.c
|
| 906 |
*/
|
| 907 |
#ifdef _SCG_SCSITRANSP_H
|
| 908 |
extern int write_packet_data(SCSI *scgp, cdr_t *dp, track_t *trackp);
|
| 909 |
#endif
|
| 910 |
|
| 911 |
/*
|
| 912 |
* modes.c
|
| 913 |
*/
|
| 914 |
#ifdef _SCG_SCSITRANSP_H
|
| 915 |
extern BOOL get_mode_params(SCSI *scgp, int page, char *pagename,
|
| 916 |
Uchar *modep, Uchar *cmodep,
|
| 917 |
Uchar *dmodep, Uchar *smodep,
|
| 918 |
int *lenp);
|
| 919 |
extern BOOL set_mode_params(SCSI *scgp, char *pagename, Uchar *modep,
|
| 920 |
int len, int save, int secsize);
|
| 921 |
#endif
|
| 922 |
|
| 923 |
/*
|
| 924 |
* misc.c
|
| 925 |
*/
|
| 926 |
#ifdef timerclear
|
| 927 |
extern void timevaldiff(struct timeval *start, struct timeval *stop);
|
| 928 |
extern void prtimediff(const char *fmt, struct timeval *start,
|
| 929 |
struct timeval *stop);
|
| 930 |
#endif
|
| 931 |
|
| 932 |
/*
|
| 933 |
* getnum.c
|
| 934 |
*/
|
| 935 |
extern int getnum(char *arg, long *valp);
|
| 936 |
extern int getllnum(char *arg, Llong *lvalp);
|
| 937 |
|
| 938 |
/*
|
| 939 |
* scsi_cdr.c
|
| 940 |
*/
|
| 941 |
#ifdef _SCG_SCSITRANSP_H
|
| 942 |
extern BOOL unit_ready(SCSI *scgp);
|
| 943 |
extern BOOL wait_unit_ready(SCSI *scgp, int secs);
|
| 944 |
extern BOOL scsi_in_progress(SCSI *scgp);
|
| 945 |
extern BOOL cdr_underrun(SCSI *scgp);
|
| 946 |
extern int test_unit_ready(SCSI *scgp);
|
| 947 |
extern int rezero_unit(SCSI *scgp);
|
| 948 |
extern int request_sense(SCSI *scgp);
|
| 949 |
extern int request_sense_b(SCSI *scgp, caddr_t bp, int cnt);
|
| 950 |
extern int inquiry(SCSI *scgp, caddr_t, int);
|
| 951 |
extern int read_capacity(SCSI *scgp);
|
| 952 |
#ifdef EOF /* stdio.h has been included */
|
| 953 |
extern void print_capacity(SCSI *scgp, FILE *f);
|
| 954 |
#endif
|
| 955 |
extern int scsi_load_unload(SCSI *scgp, int);
|
| 956 |
extern int scsi_prevent_removal(SCSI *scgp, int);
|
| 957 |
extern int scsi_start_stop_unit(SCSI *scgp, int, int, BOOL immed);
|
| 958 |
|
| 959 |
#define ROTCTL_CLV 0 /* CLV or PCAV */
|
| 960 |
#define ROTCTL_CAV 1 /* True CAV */
|
| 961 |
|
| 962 |
extern int scsi_set_speed(SCSI *scgp, int readspeed, int writespeed,
|
| 963 |
int rotctl);
|
| 964 |
extern int scsi_get_speed(SCSI *scgp, int *readspeedp, int *writespeedp);
|
| 965 |
extern int qic02(SCSI *scgp, int);
|
| 966 |
extern int write_xscsi(SCSI *scgp, caddr_t, long, long, int);
|
| 967 |
extern int write_xg0(SCSI *scgp, caddr_t, long, long, int);
|
| 968 |
extern int write_xg1(SCSI *scgp, caddr_t, long, long, int);
|
| 969 |
extern int write_xg5(SCSI *scgp, caddr_t, long, long, int);
|
| 970 |
extern int seek_scsi(SCSI *scgp, long addr);
|
| 971 |
extern int seek_g0(SCSI *scgp, long addr);
|
| 972 |
extern int seek_g1(SCSI *scgp, long addr);
|
| 973 |
extern int scsi_flush_cache(SCSI *scgp, BOOL immed);
|
| 974 |
extern int read_buffer(SCSI *scgp, caddr_t bp, int cnt, int mode);
|
| 975 |
extern int write_buffer(SCSI *scgp, char *buffer, long length, int mode,
|
| 976 |
int bufferid, long offset);
|
| 977 |
extern int read_subchannel(SCSI *scgp, caddr_t bp, int track, int cnt,
|
| 978 |
int msf, int subq, int fmt);
|
| 979 |
extern int read_toc(SCSI *scgp, caddr_t, int, int, int, int);
|
| 980 |
extern int read_toc_philips(SCSI *scgp, caddr_t, int, int, int, int);
|
| 981 |
extern int read_header(SCSI *scgp, caddr_t, long, int, int);
|
| 982 |
extern int read_disk_info(SCSI *scgp, caddr_t, int);
|
| 983 |
|
| 984 |
#define TI_TYPE_LBA 0 /* Address is LBA */
|
| 985 |
#define TI_TYPE_TRACK 1 /* Address: 0 -> TOC, xx -> Track xx, 0xFF -> Inv Track */
|
| 986 |
#define TI_TYPE_SESS 2 /* Address is session # */
|
| 987 |
extern int read_track_info(SCSI *scgp, caddr_t, int type, int addr, int cnt);
|
| 988 |
extern int read_rzone_info(SCSI *scgp, caddr_t bp, int cnt);
|
| 989 |
extern int reserve_tr_rzone(SCSI *scgp, long size);
|
| 990 |
extern int read_dvd_structure(SCSI *scgp, caddr_t bp, int cnt, int addr,
|
| 991 |
int layer, int fmt);
|
| 992 |
extern int send_dvd_structure(SCSI *scgp, caddr_t bp, int cnt, int layer,
|
| 993 |
int fmt);
|
| 994 |
extern int send_opc(SCSI *scgp, caddr_t, int cnt, int doopc);
|
| 995 |
|
| 996 |
#define CL_TYPE_STOP_DEICE 0 /* Stop De-icing a DVD+RW Media */
|
| 997 |
#define CL_TYPE_TRACK 1 /* Close Track # */
|
| 998 |
#define CL_TYPE_SESSION 2 /* Close Session/Border / Stop backgrnd. format */
|
| 999 |
#define CL_TYPE_INTER_BORDER 3 /* Close intermediate Border */
|
| 1000 |
#define CL_TYPE_OPEN_SESSION 4 /* Close the Open Session and Record an Extended lead-out */
|
| 1001 |
#define CL_TYPE_FINALISE_MINRAD 5 /* Finalize the Disc with a Minimum Recorded Radius */
|
| 1002 |
#define CL_TYPE_FINALISE 6 /* Finalize the disc */
|
| 1003 |
extern int scsi_close_tr_session(SCSI *scgp, int type, int track,
|
| 1004 |
BOOL immed);
|
| 1005 |
extern int read_master_cue(SCSI *scgp, caddr_t bp, int sheet, int cnt);
|
| 1006 |
extern int send_cue_sheet(SCSI *scgp, caddr_t bp, long size);
|
| 1007 |
extern int read_buff_cap(SCSI *scgp, long *, long *);
|
| 1008 |
extern int scsi_blank(SCSI *scgp, long addr, int blanktype, BOOL immed);
|
| 1009 |
extern BOOL allow_atapi(SCSI *scgp, BOOL new);
|
| 1010 |
extern int mode_select(SCSI *scgp, Uchar *, int, int, int);
|
| 1011 |
extern int mode_sense(SCSI *scgp, Uchar *dp, int cnt, int page, int pcf);
|
| 1012 |
extern int mode_select_sg0(SCSI *scgp, Uchar *, int, int, int);
|
| 1013 |
extern int mode_sense_sg0(SCSI *scgp, Uchar *dp, int cnt, int page, int pcf);
|
| 1014 |
extern int mode_select_g0(SCSI *scgp, Uchar *, int, int, int);
|
| 1015 |
extern int mode_select_g1(SCSI *scgp, Uchar *, int, int, int);
|
| 1016 |
extern int mode_sense_g0(SCSI *scgp, Uchar *dp, int cnt, int page, int pcf);
|
| 1017 |
extern int mode_sense_g1(SCSI *scgp, Uchar *dp, int cnt, int page, int pcf);
|
| 1018 |
extern int read_tochdr(SCSI *scgp, cdr_t *, int *, int *);
|
| 1019 |
extern int read_cdtext(SCSI *scgp);
|
| 1020 |
extern int read_trackinfo(SCSI *scgp, int, long *, struct msf *, int *,
|
| 1021 |
int *, int *);
|
| 1022 |
extern int read_B0(SCSI *scgp, BOOL isbcd, long *b0p, long *lop);
|
| 1023 |
extern int read_session_offset(SCSI *scgp, long *);
|
| 1024 |
extern int read_session_offset_philips(SCSI *scgp, long *);
|
| 1025 |
extern int sense_secsize(SCSI *scgp, int current);
|
| 1026 |
extern int select_secsize(SCSI *scgp, int);
|
| 1027 |
extern BOOL is_cddrive(SCSI *scgp);
|
| 1028 |
extern BOOL is_unknown_dev(SCSI *scgp);
|
| 1029 |
extern int read_scsi(SCSI *scgp, caddr_t, long, int);
|
| 1030 |
extern int read_g0(SCSI *scgp, caddr_t, long, int);
|
| 1031 |
extern int read_g1(SCSI *scgp, caddr_t, long, int);
|
| 1032 |
extern BOOL getdev(SCSI *scgp, BOOL);
|
| 1033 |
#ifdef EOF /* stdio.h has been included */
|
| 1034 |
extern void printinq(SCSI *scgp, FILE *f);
|
| 1035 |
#endif
|
| 1036 |
extern void printdev(SCSI *scgp);
|
| 1037 |
extern BOOL do_inquiry(SCSI *scgp, BOOL);
|
| 1038 |
extern BOOL recovery_needed(SCSI *scgp, cdr_t *);
|
| 1039 |
extern int scsi_load(SCSI *scgp, cdr_t *);
|
| 1040 |
extern int scsi_unload(SCSI *scgp, cdr_t *);
|
| 1041 |
extern int scsi_cdr_write(SCSI *scgp, caddr_t bp, long sectaddr,
|
| 1042 |
long size, int blocks, BOOL islast);
|
| 1043 |
extern struct cd_mode_page_2A *mmc_cap(SCSI *scgp, Uchar *modep);
|
| 1044 |
extern void mmc_getval(struct cd_mode_page_2A *mp, BOOL *cdrrp, BOOL *cdwrp,
|
| 1045 |
BOOL *cdrrwp, BOOL *cdwrwp, BOOL *dvdp, BOOL *dvdwp);
|
| 1046 |
extern BOOL is_mmc(SCSI *scgp, BOOL *cdwp, BOOL *dvdwp);
|
| 1047 |
extern BOOL mmc_check(SCSI *scgp, BOOL *cdrrp, BOOL *cdwrp, BOOL *cdrrwp,
|
| 1048 |
BOOL *cdwrwp, BOOL *dvdp, BOOL *dvdwp);
|
| 1049 |
extern void print_capabilities(SCSI *scgp);
|
| 1050 |
#endif
|
| 1051 |
|
| 1052 |
/*
|
| 1053 |
* scsi_cdr.c
|
| 1054 |
*/
|
| 1055 |
#ifdef _SCG_SCSITRANSP_H
|
| 1056 |
extern void print_capabilities_mmc4(SCSI *scgp);
|
| 1057 |
#endif
|
| 1058 |
|
| 1059 |
/*
|
| 1060 |
* scsi_mmc.c
|
| 1061 |
*/
|
| 1062 |
#ifdef _SCG_SCSITRANSP_H
|
| 1063 |
extern int get_configuration(SCSI *scgp, caddr_t bp, int cnt,
|
| 1064 |
int st_feature, int rt);
|
| 1065 |
extern int get_curprofile(SCSI *scgp);
|
| 1066 |
extern int print_profiles(SCSI *scgp);
|
| 1067 |
extern int get_proflist(SCSI *scgp, BOOL *wp, BOOL *cdp, BOOL *dvdp,
|
| 1068 |
BOOL *dvdplusp, BOOL *ddcdp);
|
| 1069 |
extern int get_wproflist(SCSI *scgp, BOOL *cdp, BOOL *dvdp,
|
| 1070 |
BOOL *dvdplusp, BOOL *ddcdp);
|
| 1071 |
#endif
|
| 1072 |
|
| 1073 |
/*
|
| 1074 |
* scsi_mmc.c
|
| 1075 |
*/
|
| 1076 |
#ifdef _SCG_SCSITRANSP_H
|
| 1077 |
extern int get_supported_cdrw_media_types(SCSI *scgp);
|
| 1078 |
#endif
|
| 1079 |
|
| 1080 |
/*
|
| 1081 |
* mmc_misc.c
|
| 1082 |
*/
|
| 1083 |
#ifdef _SCG_SCSITRANSP_H
|
| 1084 |
extern int check_writemodes_mmc(SCSI *scgp, cdr_t *dp);
|
| 1085 |
#endif /* _SCG_SCSITRANSP_H */
|
| 1086 |
|
| 1087 |
/*
|
| 1088 |
* cdr_drv.c
|
| 1089 |
*/
|
| 1090 |
#ifdef _SCG_SCSITRANSP_H
|
| 1091 |
#ifdef _SCG_SCSIREG_H
|
| 1092 |
extern cdr_t *drive_identify(SCSI *scgp, cdr_t *, struct scsi_inquiry *ip);
|
| 1093 |
#else
|
| 1094 |
extern cdr_t *drive_identify(SCSI *scgp, cdr_t *, void *ip);
|
| 1095 |
#endif
|
| 1096 |
extern int drive_attach(SCSI *scgp, cdr_t *);
|
| 1097 |
#endif
|
| 1098 |
extern int attach_unknown(void);
|
| 1099 |
#ifdef _SCG_SCSITRANSP_H
|
| 1100 |
extern int blank_dummy(SCSI *scgp, cdr_t *, long addr, int blanktype);
|
| 1101 |
int format_dummy(SCSI *scgp, cdr_t *, int fmtflags);
|
| 1102 |
extern int drive_getdisktype(SCSI *scgp, cdr_t *dp);
|
| 1103 |
extern int cmd_ill(SCSI *scgp);
|
| 1104 |
extern int cmd_dummy(SCSI *scgp, cdr_t *);
|
| 1105 |
extern int no_sendcue(SCSI *scgp, cdr_t *, track_t *trackp);
|
| 1106 |
extern int buf_dummy(SCSI *scgp, long *sp, long *fp);
|
| 1107 |
#endif
|
| 1108 |
extern BOOL set_cdrcmds(char *name, cdr_t **dpp);
|
| 1109 |
#ifdef _SCG_SCSITRANSP_H
|
| 1110 |
extern cdr_t *get_cdrcmds(SCSI *scgp);
|
| 1111 |
#endif
|
| 1112 |
|
| 1113 |
|
| 1114 |
/*
|
| 1115 |
* drv_mmc.c
|
| 1116 |
*/
|
| 1117 |
extern void mmc_opthelp(cdr_t *dp, int excode);
|
| 1118 |
extern char *hasdrvopt(char *optstr, char *optname);
|
| 1119 |
#ifdef _SCG_SCSITRANSP_H
|
| 1120 |
extern struct ricoh_mode_page_30 *get_justlink_ricoh(SCSI *scgp, Uchar *mode);
|
| 1121 |
#endif
|
| 1122 |
|
| 1123 |
/*
|
| 1124 |
* isosize.c
|
| 1125 |
*/
|
| 1126 |
extern Llong isosize(int f);
|
| 1127 |
|
| 1128 |
/*
|
| 1129 |
* audiosize.c
|
| 1130 |
*/
|
| 1131 |
extern BOOL is_auname(const char *name);
|
| 1132 |
extern off_t ausize(int f);
|
| 1133 |
extern BOOL is_wavname(const char *name);
|
| 1134 |
extern off_t wavsize(int f);
|
| 1135 |
|
| 1136 |
/*
|
| 1137 |
* auinfo.c
|
| 1138 |
*/
|
| 1139 |
extern BOOL auinfosize(char *name, track_t *trackp);
|
| 1140 |
extern void auinfo(char *name, int track, track_t *trackp);
|
| 1141 |
#ifdef CDTEXT_H
|
| 1142 |
extern textptr_t *gettextptr(int track, track_t *trackp);
|
| 1143 |
#endif
|
| 1144 |
extern void setmcn(char *mcn, track_t *trackp);
|
| 1145 |
extern void setisrc(char *isrc, track_t *trackp);
|
| 1146 |
extern void setindex(char *tindex, track_t *trackp);
|
| 1147 |
|
| 1148 |
/*
|
| 1149 |
* diskid.c
|
| 1150 |
*/
|
| 1151 |
extern void pr_manufacturer(msf_t *mp, BOOL rw, BOOL audio);
|
| 1152 |
extern int manufacturer_id(msf_t *mp);
|
| 1153 |
extern long disk_rcap(msf_t *mp, long maxblock, BOOL rw, BOOL audio);
|
| 1154 |
|
| 1155 |
/*--------------------------------------------------------------------------*/
|
| 1156 |
/* Test only */
|
| 1157 |
/*--------------------------------------------------------------------------*/
|
| 1158 |
#ifdef _SCSIMMC_H
|
| 1159 |
/*extern int do_cue __PR((track_t *trackp, struct mmc_cue **cuep));*/
|
| 1160 |
#else
|
| 1161 |
/*extern int do_cue __PR((track_t *trackp, void *cuep));*/
|
| 1162 |
#endif
|
| 1163 |
|
| 1164 |
/*
|
| 1165 |
* subchan.c
|
| 1166 |
*/
|
| 1167 |
extern int do_leadin(track_t *trackp);
|
| 1168 |
#ifdef _SCG_SCSITRANSP_H
|
| 1169 |
extern int write_leadin(SCSI *scgp, cdr_t *dp, track_t *trackp,
|
| 1170 |
int leadinstart);
|
| 1171 |
extern int write_leadout(SCSI *scgp, cdr_t *dp, track_t *trackp);
|
| 1172 |
#endif
|
| 1173 |
extern void fillsubch(track_t *trackp, Uchar *sp, int secno, int nsecs);
|
| 1174 |
extern void filltpoint(Uchar *sub, int ctrl_adr, int point, msf_t *mp);
|
| 1175 |
extern void fillttime(Uchar *sub, msf_t *mp);
|
| 1176 |
extern void qpto96(Uchar *sub, Uchar *subq, int dop);
|
| 1177 |
extern void addrw(Uchar *sub, Uchar *subrwptr);
|
| 1178 |
extern void qwto16(Uchar *subq, Uchar *subptr);
|
| 1179 |
extern void subrecodesecs(track_t *trackp, Uchar *bp, int address, int nsecs);
|
| 1180 |
|
| 1181 |
/*
|
| 1182 |
* sector.c
|
| 1183 |
*/
|
| 1184 |
extern int encspeed(BOOL be_verbose);
|
| 1185 |
extern void encsectors(track_t *trackp, Uchar *bp, int address, int nsecs);
|
| 1186 |
extern void scrsectors(track_t *trackp, Uchar *bp, int address, int nsecs);
|
| 1187 |
extern void encodesector(Uchar *sp, int sectype, int address);
|
| 1188 |
extern void fillsector(Uchar *sp, int sectype, int address);
|
| 1189 |
|
| 1190 |
/*
|
| 1191 |
* clone.c
|
| 1192 |
*/
|
| 1193 |
extern void clone_toc(track_t *trackp);
|
| 1194 |
extern void clone_tracktype(track_t *trackp);
|
| 1195 |
|
| 1196 |
/*
|
| 1197 |
* cdtext.c
|
| 1198 |
*/
|
| 1199 |
extern BOOL checktextfile(char *fname);
|
| 1200 |
extern void packtext(int tracks, track_t *trackp);
|
| 1201 |
#ifdef _SCG_SCSITRANSP_H
|
| 1202 |
extern int write_cdtext(SCSI *scgp, cdr_t *dp, long startsec);
|
| 1203 |
#endif
|
| 1204 |
|
| 1205 |
/*
|
| 1206 |
* cue.c
|
| 1207 |
*/
|
| 1208 |
extern int parsecue(char *cuefname, track_t trackp[]);
|
| 1209 |
#ifdef EOF /* stdio.h has been included */
|
| 1210 |
extern void fparsecue(FILE *f, track_t trackp[]);
|
| 1211 |
#endif
|