"Fossies" - the Fresh Open Source Software Archive

Member "xorriso-1.5.4/libburn/drive.h" (30 Jan 2021, 5401 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "drive.h" see the Fossies "Dox" file reference documentation.

    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;
   21 struct burn_speed_descriptor;
   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 
   57 int burn_sector_length_write(struct burn_drive *d);
   58 int burn_track_control(struct burn_drive *d, int);
   59 void burn_write_empty_sector(int fd);
   60 void burn_write_empty_subcode(int fd);
   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);
   69 int burn_drive_get_block_types(struct burn_drive *d,
   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 */
   83 struct burn_drive *burn_drive_finish_enum(struct burn_drive *d);
   84 
   85 /* ts A61125 : media status aspects of burn_drive_grab() */
   86 int burn_drive_inquire_media(struct burn_drive *d);
   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 */
   93 int burn_speed_descriptor_new(struct burn_speed_descriptor **s,
   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 */
   99 int burn_speed_descriptor_destroy(struct burn_speed_descriptor **s, int flag);
  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 */
  111 struct burn_disc_mode_demands {
  112     int multi_session;
  113     int multi_track;
  114     int unknown_track_size; /* 0=known, 1=unknown, 2=unknown+defaulted */
  115     int mixed_mode;
  116     int audio;
  117     int exotic_track;
  118     int block_types;
  119     int will_append; /* because of media state or multi session disc */
  120 };
  121 int burn_disc_get_write_mode_demands(struct burn_disc *disc,
  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);
  139 int burn_drive_whitelist_count(void);
  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 */
  161 int burn_feature_descr_new(struct burn_feature_descr **new,
  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 */