xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

drive.h
Go to the documentation of this file.
1 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
2 
3 /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
4  Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
5  Provided under GPL version 2 or later.
6 */
7 
8 
9 #ifndef __DRIVE
10 #define __DRIVE
11 
12 #include "libburn.h"
13 #include "toc.h"
14 #include "structure.h"
15 #include <pthread.h>
16 
17 struct burn_drive;
18 struct command;
19 struct mempage;
20 struct scsi_mode_data;
22 struct burn_feature_descr;
23 
24 #define LEAD_IN 1
25 #define GAP 2
26 #define USER_DATA 3
27 #define LEAD_OUT 4
28 #define SYNC 5
29 
30 #define SESSION_LEADOUT_ENTRY(d,s) (d)->toc->session[(s)].leadout_entry
31 
32 #define CURRENT_SESSION_START(d) \
33  burn_msf_to_lba(d->toc->session[d->currsession].start_m, \
34  d->toc->session[d->currsession].start_s, \
35  d->toc->session[d->currsession].start_f)
36 
37 #define SESSION_END(d,s) \
38  TOC_ENTRY_PLBA((d)->toc, SESSION_LEADOUT_ENTRY((d), (s)))
39 
40 #define PREVIOUS_SESSION_END(d) \
41  TOC_ENTRY_PLBA((d)->toc, SESSION_LEADOUT_ENTRY((d), (d)->currsession-1))
42 
43 #define LAST_SESSION_END(d) \
44  TOC_ENTRY_PLBA((d)->toc, \
45  SESSION_LEADOUT_ENTRY((d), (d)->toc->sessions-1))
46 
47 struct burn_drive *burn_drive_register(struct burn_drive *);
48 int burn_drive_unregister(struct burn_drive *d);
49 
50 unsigned int burn_drive_count(void);
51 
52 /* ts A61007 */
53 /* void burn_wait_all(void); */
54 /* @param flag bit0= demand freed drives (else released drives) */
55 int burn_drives_are_clear(int flag);
56 
58 int burn_track_control(struct burn_drive *d, int);
61 void burn_drive_free(struct burn_drive *d);
62 void burn_drive_free_all(void);
63 
64 /* @param flag bit0= reset global drive list */
65 int burn_drive_scan_sync(struct burn_drive_info *drives[],
66  unsigned int *n_drives, int flag);
67 
68 void burn_disc_erase_sync(struct burn_drive *d, int fast);
70  enum burn_write_types write_type);
71 
72 int burn_drive_is_open(struct burn_drive *d);
73 int burn_drive_is_occupied(struct burn_drive *d);
74 int burn_drive_forget(struct burn_drive *d, int force);
75 int burn_drive_convert_fs_adr_sub(char *path, char adr[], int *rec_count);
76 
77 /* ts A61021 : the unspecific part of sg.c:enumerate_common()
78 */
79 int burn_setup_drive(struct burn_drive *d, char *fname);
80 
81 /* ts A61021 : after-setup activities from sg.c:enumerate_common()
82 */
84 
85 /* ts A61125 : media status aspects of burn_drive_grab() */
87 
88 /* ts A61125 : model aspects of burn_drive_release */
89 int burn_drive_mark_unready(struct burn_drive *d, int flag);
90 
91 
92 /* ts A61226 */
94  struct burn_speed_descriptor *prev,
95  struct burn_speed_descriptor *next, int flag);
96 
97 /* ts A61226 */
98 /* @param flag bit0= destroy whole next-chain of descriptors */
100 
101 
102 /* ts A61226 : free dynamically allocated sub data of struct scsi_mode_data */
103 int burn_mdata_free_subs(struct scsi_mode_data *m);
104 
105 
106 /* ts A61230 */
107 void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag);
108 
109 
110 /* ts A70207 : evaluate write mode related peculiarities of a disc */
114  int unknown_track_size; /* 0=known, 1=unknown, 2=unknown+defaulted */
116  int audio;
119  int will_append; /* because of media state or multi session disc */
120 };
122  struct burn_write_opts *opts,
123  struct burn_disc_mode_demands *result, int flag);
124 
125 
126 /* ts A70924 : convert a special stdio address into fd number.
127  @return >0 is a valid fd , -1 indicates unsuitable address string.
128 */
129 int burn_drive__fd_from_special_adr(char *adr);
130 
131 
132 /* ts A70929 : Find the drive which is being worked on by pid , tid */
133 int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid,
134  pthread_t tid);
135 
136 
137 /* ts A51221 - A80731 : Whitelist inquiry functions */
138 int burn_drive_is_banned(char *device_address);
140 char *burn_drive_whitelist_item(int idx, int flag);
141 
142 
143 /* ts A80801 */
144 int burn_drive_is_listed(char *path, struct burn_drive **found, int flag);
145 
146 
147 /* ts B00226 : Outsourced backend of burn_abort()
148  @param elapsed to be subtracted from start time
149  @param flag bit0= do not shutdown the library
150 */
151 int burn_abort_5(int patience,
152  int (*pacifier_func)(void *handle, int patience, int elapsed),
153  void *handle, int elapsed, int flag);
154 
155 /* ts B10730 */
156 /* Send a default mode page 05 to CD and DVD-R-oids */
157 int burn_drive_send_default_page_05(struct burn_drive *d, int flag);
158 
159 
160 /* ts B40106 */
162  unsigned char *descr, int descr_len, int flag);
163 
164 /* ts B40106 */
165 int burn_feature_descr_free(struct burn_feature_descr **new, int flag);
166 
167 /* ts B40107 */
168 int burn_drive_has_feature(struct burn_drive *d, int feature_code,
169  struct burn_feature_descr **descr, int flag);
170 
171 int burn_drive_grab_stdio(struct burn_drive *d, int flag);
172 
173 #endif /* __DRIVE */
int burn_drive_inquire_media(struct burn_drive *d)
Definition: drive.c:282
int burn_drive_unregister(struct burn_drive *d)
Definition: drive.c:600
void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
Definition: drive.c:952
int burn_drive_mark_unready(struct burn_drive *d, int flag)
Definition: drive.c:656
int burn_drive_grab_stdio(struct burn_drive *d, int flag)
Definition: drive.c:412
int burn_drive_send_default_page_05(struct burn_drive *d, int flag)
Definition: drive.c:309
struct burn_drive * burn_drive_register(struct burn_drive *)
Definition: drive.c:540
int burn_drive_is_occupied(struct burn_drive *d)
Definition: drive.c:203
int burn_drive_whitelist_count(void)
Definition: drive.c:1736
int burn_feature_descr_free(struct burn_feature_descr **new, int flag)
Definition: drive.c:3575
int burn_drive_forget(struct burn_drive *d, int force)
Definition: drive.c:1495
int burn_speed_descriptor_destroy(struct burn_speed_descriptor **s, int flag)
Definition: drive.c:2823
int burn_drive_is_banned(char *device_address)
Definition: drive.c:1723
int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid, pthread_t tid)
Definition: drive.c:3386
int burn_drive_is_open(struct burn_drive *d)
Definition: drive.c:167
int burn_drive_get_block_types(struct burn_drive *d, enum burn_write_types write_type)
void burn_write_empty_sector(int fd)
int burn_drive_scan_sync(struct burn_drive_info *drives[], unsigned int *n_drives, int flag)
Definition: drive.c:1391
char * burn_drive_whitelist_item(int idx, int flag)
Definition: drive.c:1741
int burn_drive_is_listed(char *path, struct burn_drive **found, int flag)
Definition: drive.c:250
int burn_drive_convert_fs_adr_sub(char *path, char adr[], int *rec_count)
Definition: drive.c:2291
struct burn_drive * burn_drive_finish_enum(struct burn_drive *d)
Definition: drive.c:612
int burn_setup_drive(struct burn_drive *d, char *fname)
Definition: drive.c:79
int burn_sector_length_write(struct burn_drive *d)
unsigned int burn_drive_count(void)
Definition: drive.c:243
int burn_speed_descriptor_new(struct burn_speed_descriptor **s, struct burn_speed_descriptor *prev, struct burn_speed_descriptor *next, int flag)
Definition: drive.c:2790
int burn_abort_5(int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle, int elapsed, int flag)
Definition: drive.c:2448
int burn_drive__fd_from_special_adr(char *adr)
Definition: drive.c:337
int burn_drives_are_clear(int flag)
Definition: drive.c:810
int burn_track_control(struct burn_drive *d, int)
int burn_drive_has_feature(struct burn_drive *d, int feature_code, struct burn_feature_descr **descr, int flag)
Definition: drive.c:3593
void burn_write_empty_subcode(int fd)
void burn_drive_free_all(void)
Definition: drive.c:155
int burn_mdata_free_subs(struct scsi_mode_data *m)
Definition: drive.c:2864
void burn_disc_erase_sync(struct burn_drive *d, int fast)
Definition: drive.c:851
int burn_feature_descr_new(struct burn_feature_descr **new, unsigned char *descr, int descr_len, int flag)
Definition: drive.c:3543
int burn_disc_get_write_mode_demands(struct burn_disc *disc, struct burn_write_opts *opts, struct burn_disc_mode_demands *result, int flag)
Definition: drive.c:3142
void burn_drive_free(struct burn_drive *d)
Definition: drive.c:141
burn_write_types
Definition: libburn.h:138