libburn.h File Reference

#include <sys/types.h>
Include dependency graph for libburn.h:

Go to the source code of this file.

Data Structures

struct  burn_toc_entry
 Information about a track on a disc - this is from the q sub channel of the lead-in area of a disc. More...
struct  burn_source
 Data source interface for tracks. More...
struct  burn_drive_info
 Information on a drive in the system. More...
struct  burn_progress
 Operation progress report. More...
struct  burn_speed_descriptor
 Description of a speed capability as reported by the drive in conjunction with eventually loaded media. More...
struct  burn_multi_caps
 The reply structure for burn_disc_get_multi_caps(). More...

Defines

#define BURN_CDROM   0
 Session format for normal audio or data discs.
#define BURN_CDI   0x10
 Session format for obsolete CD-I discs.
#define BURN_CDXA   0x20
 Session format for CDROM-XA discs.
#define BURN_POS_END   100
#define BURN_MODE_BITS   127
 Mask for mode bits.
#define BURN_MODE0   (1 << 0)
 Track mode - mode 0 data 0 bytes of user data.
#define BURN_MODE_RAW   (1 << 1)
 Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY!
#define BURN_MODE1   (1 << 2)
 Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy.
#define BURN_MODE2   (1 << 3)
 Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required.
#define BURN_FORM1   (1 << 4)
 Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader.
#define BURN_FORM2   (1 << 5)
 Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data.
#define BURN_AUDIO   (1 << 6)
 Track mode - audio 2352 bytes per sector.
#define BURN_4CH   (1 << 7)
 Track mode modifier - 4 channel audio.
#define BURN_COPY   (1 << 8)
 Track mode modifier - Digital copy permitted, can be set on any track.
#define BURN_PREEMPHASIS   (1 << 9)
 Track mode modifier - 50/15uS pre-emphasis.
#define BURN_SUBCODE_P16   (1 << 10)
 Input mode modifier - subcodes present packed 16.
#define BURN_SUBCODE_P96   (1 << 11)
 Input mode modifier - subcodes present packed 96.
#define BURN_SUBCODE_R96   (1 << 12)
 Input mode modifier - subcodes present raw 96.
#define BURN_DRIVE_WHITELIST_LEN   255
 Maximum number of particularly permissible drive addresses.
#define BURN_DRIVE_ADR_LEN   1024
 Maximum length+1 to expect with a persistent drive address string.
#define BURN_FORMAT_IS_UNFORMATTED   1
 Possible formatting status values.
#define BURN_FORMAT_IS_FORMATTED   2
#define BURN_FORMAT_IS_UNKNOWN   3
#define BURN_REASONS_LEN   4096
 The length of a rejection reasons string for burn_precheck_write() and burn_write_opts_auto_write_type() .
#define burn_header_version_major   0
 These three release version numbers tell the revision of this header file and of the API it describes.
#define burn_header_version_minor   7
#define burn_header_version_micro   0
#define BURN_MSGS_MESSAGE_LEN   4096

Typedefs

typedef int(* burn_abort_handler_t )(void *handle, int signum, int flag)
 The prototype of a handler function suitable for burn_set_abort_handling().

Enumerations

enum  burn_write_types {
  BURN_WRITE_PACKET, BURN_WRITE_TAO, BURN_WRITE_SAO, BURN_WRITE_RAW,
  BURN_WRITE_NONE
}
 

Possible disc writing style/modes.

More...
enum  burn_block_types {
  BURN_BLOCK_RAW0 = 1, BURN_BLOCK_RAW16 = 2, BURN_BLOCK_RAW96P = 4, BURN_BLOCK_RAW96R = 8,
  BURN_BLOCK_MODE1 = 256, BURN_BLOCK_MODE2R = 512, BURN_BLOCK_MODE2_PATHETIC = 1024, BURN_BLOCK_MODE2_LAME = 2048,
  BURN_BLOCK_MODE2_OBSCURE = 4096, BURN_BLOCK_MODE2_OK = 8192, BURN_BLOCK_SAO = 16384
}
 

Data format to send to the drive.

More...
enum  burn_disc_status {
  BURN_DISC_UNREADY, BURN_DISC_BLANK, BURN_DISC_EMPTY, BURN_DISC_APPENDABLE,
  BURN_DISC_FULL, BURN_DISC_UNGRABBED, BURN_DISC_UNSUITABLE
}
 

Possible status of the drive in regard to the disc in it.

More...
enum  burn_source_status { BURN_SOURCE_OK, BURN_SOURCE_EOF, BURN_SOURCE_FAILED }
 

Possible data source return values.

More...
enum  burn_drive_status {
  BURN_DRIVE_IDLE, BURN_DRIVE_SPAWNING, BURN_DRIVE_READING, BURN_DRIVE_WRITING,
  BURN_DRIVE_WRITING_LEADIN, BURN_DRIVE_WRITING_LEADOUT, BURN_DRIVE_ERASING, BURN_DRIVE_GRABBING,
  BURN_DRIVE_WRITING_PREGAP, BURN_DRIVE_CLOSING_TRACK, BURN_DRIVE_CLOSING_SESSION, BURN_DRIVE_FORMATTING,
  BURN_DRIVE_READING_SYNC, BURN_DRIVE_WRITING_SYNC
}
 

Possible busy states for a drive.

More...

Functions

int burn_initialize (void)
 Initialize the library.
void burn_finish (void)
 Shutdown the library.
int burn_abort (int patience, int(*pacifier_func)(void *handle, int patience, int elapsed), void *handle)
 Abort any running drive operation and finally call burn_finish().
int burn_abort_pacifier (void *handle, int patience, int elapsed)
 A pacifier function suitable for burn_abort.
void burn_set_verbosity (int level)
 ts A61006 : This is for development only.
void burn_preset_device_open (int exclusive, int blocking, int abort_on_busy)
 Set parameters for behavior on opening device files.
void burn_allow_untested_profiles (int yes)
 Allows the use of media types which are implemented in libburn but not yet tested.
int burn_drive_scan_and_grab (struct burn_drive_info *drive_infos[], char *adr, int load)
 Aquire a drive with known persistent address.
int burn_drive_add_whitelist (char *device_address)
 Add a device to the list of permissible drives.
void burn_drive_clear_whitelist (void)
 Remove all drives from whitelist.
int burn_drive_scan (struct burn_drive_info *drive_infos[], unsigned int *n_drives)
 Scan for drives.
int burn_drive_info_forget (struct burn_drive_info *drive_info, int force)
 Release memory about a single drive and any exclusive lock on it.
void burn_drive_info_free (struct burn_drive_info drive_infos[])
 When no longer needed, free a whole burn_drive_info array which was returned by burn_drive_scan().
int burn_drive_d_get_adr (struct burn_drive *drive, char adr[])
 Inquire the persistent address of the given drive.
int burn_drive_get_adr (struct burn_drive_info *drive_info, char adr[])
 Inquire the persistent address of a drive via a given drive_info object.
int burn_drive_is_enumerable_adr (char *adr)
 Evaluate whether the given address would be a possible persistent drive address of libburn.
int burn_drive_convert_fs_adr (char *path, char adr[])
 Try to convert a given existing filesystem address into a persistent drive address.
int burn_drive_convert_scsi_adr (int bus_no, int host_no, int channel_no, int target_no, int lun_no, char adr[])
 Try to convert a given SCSI address of bus,host,channel,target,lun into a persistent drive address.
int burn_drive_obtain_scsi_adr (char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
 Try to obtain bus,host,channel,target,lun from path.
int burn_drive_grab (struct burn_drive *drive, int load)
 Grab a drive.
int burn_drive_snooze (struct burn_drive *d, int flag)
 Calm down or alert a drive.
void burn_drive_release (struct burn_drive *drive, int eject)
 Release a drive.
int burn_drive_leave_locked (struct burn_drive *d, int flag)
 Like burn_drive_release() but keeping the drive tray closed and its eject button disabled.
enum burn_disc_status burn_disc_get_status (struct burn_drive *drive)
 Returns what kind of disc a drive is holding.
int burn_disc_pretend_blank (struct burn_drive *drive)
 WARNING: This revives an old bug-like behavior that might be dangerous.
int burn_disc_pretend_full (struct burn_drive *drive)
 WARNING: This overrides the safety measures against unsuitable media.
int burn_disc_read_atip (struct burn_drive *drive)
 Reads ATIP information from inserted media.
int burn_drive_get_start_end_lba (struct burn_drive *drive, int *start_lba, int *end_lba, int flag)
 Returns start and end lba of the media which is currently inserted in the given drive.
int burn_disc_track_lba_nwa (struct burn_drive *d, struct burn_write_opts *o, int trackno, int *lba, int *nwa)
 Read start lba and Next Writeable Address of a track from media.
int burn_disc_get_msc1 (struct burn_drive *d, int *start_lba)
 Read start lba of the first track in the last complete session.
off_t burn_disc_available_space (struct burn_drive *d, struct burn_write_opts *o)
 Return the best possible estimation of the currently available capacity of the media.
int burn_disc_get_profile (struct burn_drive *d, int *pno, char name[80])
 Tells the MMC Profile identifier of the loaded media.
int burn_disc_erasable (struct burn_drive *d)
 Tells whether a disc can be erased or not.
enum burn_drive_status burn_drive_get_status (struct burn_drive *drive, struct burn_progress *p)
 Returns the progress and status of a drive.
struct burn_write_opts * burn_write_opts_new (struct burn_drive *drive)
 Creates a write_opts struct for burning to the specified drive.
struct burn_drive * burn_write_opts_get_drive (struct burn_write_opts *opts)
 Inquires the drive associated with a burn_write_opts object.
void burn_write_opts_free (struct burn_write_opts *opts)
 Frees a write_opts struct created with burn_write_opts_new.
struct burn_read_opts * burn_read_opts_new (struct burn_drive *drive)
 Creates a read_opts struct for reading from the specified drive must be freed with burn_read_opts_free.
void burn_read_opts_free (struct burn_read_opts *opts)
 Frees a read_opts struct created with burn_read_opts_new.
void burn_disc_erase (struct burn_drive *drive, int fast)
 Erase a disc in the drive.
void burn_disc_format (struct burn_drive *drive, off_t size, int flag)
 Format media for use with libburn.
int burn_disc_get_formats (struct burn_drive *drive, int *status, off_t *size, unsigned *bl_sas, int *num_formats)
 Inquire the formatting status, the associated sizes and the number of available formats.
int burn_disc_get_format_descr (struct burn_drive *drive, int index, int *type, off_t *size, unsigned *tdp)
 Inquire parameters of an available media format.
void burn_disc_read (struct burn_drive *drive, const struct burn_read_opts *o)
 Read a disc from the drive and write it to an fd pair.
int burn_precheck_write (struct burn_write_opts *o, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int silent)
 Examines a completed setup for burn_disc_write() whether it is permissible with drive and media.
void burn_disc_write (struct burn_write_opts *o, struct burn_disc *disc)
 Write a disc in the drive.
int burn_drive_set_stream_recording (struct burn_drive *drive, int recmode, int start, int flag)
 Control stream recording during the write run and eventually set the start LBA for stream recording.
void burn_drive_cancel (struct burn_drive *drive)
 Cancel an operation on a drive.
int burn_drive_wrote_well (struct burn_drive *d)
 Inquire whether the most recent write run was successful.
int burn_msf_to_sectors (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to sector count.
void burn_sectors_to_msf (int sectors, int *m, int *s, int *f)
 Convert a sector count to minute-second-frame (MSF).
int burn_msf_to_lba (int m, int s, int f)
 Convert a minute-second-frame (MSF) value to an lba.
void burn_lba_to_msf (int lba, int *m, int *s, int *f)
 Convert an lba to minute-second-frame (MSF).
struct burn_disc * burn_disc_create (void)
 Create a new disc.
void burn_disc_free (struct burn_disc *d)
 Delete disc and decrease the reference count on all its sessions.
struct burn_session * burn_session_create (void)
 Create a new session.
void burn_session_free (struct burn_session *s)
 Free a session (and decrease reference count on all tracks inside).
int burn_disc_add_session (struct burn_disc *d, struct burn_session *s, unsigned int pos)
 Add a session to a disc at a specific position, increasing the sessions's reference count.
int burn_disc_remove_session (struct burn_disc *d, struct burn_session *s)
 Remove a session from a disc.
struct burn_track * burn_track_create (void)
 Create a track (for TAO recording, or to put in a session).
void burn_track_free (struct burn_track *t)
 Free a track.
int burn_session_add_track (struct burn_session *s, struct burn_track *t, unsigned int pos)
 Add a track to a session at specified position.
int burn_session_remove_track (struct burn_session *s, struct burn_track *t)
 Remove a track from a session.
void burn_track_define_data (struct burn_track *t, int offset, int tail, int pad, int mode)
 Define the data in a track.
int burn_track_set_byte_swap (struct burn_track *t, int swap_source_bytes)
 Define whether a track shall swap bytes of its input stream.
void burn_track_set_isrc (struct burn_track *t, char *country, char *owner, unsigned char year, unsigned int serial)
 Set the ISRC details for a track.
void burn_track_clear_isrc (struct burn_track *t)
 Disable ISRC parameters for a track.
void burn_session_hide_first_track (struct burn_session *s, int onoff)
 Hide the first track in the "pre gap" of the disc.
struct burn_disc * burn_drive_get_disc (struct burn_drive *d)
 Get the drive's disc struct - free when done.
enum burn_source_status burn_track_set_source (struct burn_track *t, struct burn_source *s)
 Set the track's data source.
int burn_track_set_default_size (struct burn_track *t, off_t size)
 Set a default track size to be used only if the track turns out to be of unpredictable length and if the effective write type demands a fixed size.
void burn_source_free (struct burn_source *s)
 Free a burn_source (decrease its refcount and maybe free it).
struct burn_sourceburn_file_source_new (const char *path, const char *subpath)
 Creates a data source for an image file (and maybe subcode file).
struct burn_sourceburn_fd_source_new (int datafd, int subfd, off_t size)
 Creates a data source for an image file (a track) from an open readable filedescriptor, an eventually open readable subcodes file descriptor and eventually a fixed size in bytes.
struct burn_sourceburn_fifo_source_new (struct burn_source *inp, int chunksize, int chunks, int flag)
 Creates a fifo which acts as proxy for an already existing data source.
int burn_fifo_inquire_status (struct burn_source *fifo, int *size, int *free_bytes, char **status_text)
 Inquires state and fill parameters of a fifo burn_source which was created by burn_fifo_source_new() .
int burn_fifo_peek_data (struct burn_source *source, char *buf, int bufsize, int flag)
 Obtain a preview of the first input data of a fifo which was created by burn_fifo_source_new().
int burn_track_set_size (struct burn_track *t, off_t size)
 Sets a fixed track size after the data source object has already been created.
int burn_track_get_sectors (struct burn_track *)
 Tells how long a track will be on disc >>> NOTE: Not reliable with tracks of undefined length.
int burn_track_get_counters (struct burn_track *t, off_t *read_bytes, off_t *written_bytes)
 Tells how many source bytes have been read and how many data bytes have been written by the track during burn.
void burn_drive_set_speed (struct burn_drive *d, int read, int write)
 Sets drive read and write speed Note: "k" is 1000, not 1024.
int burn_drive_set_buffer_waiting (struct burn_drive *d, int enable, int min_usec, int max_usec, int timeout_sec, int min_percent, int max_percent)
 Controls the behavior with writing when the drive buffer is suspected to be full.
void burn_structure_print_disc (struct burn_disc *d)
void burn_structure_print_session (struct burn_session *s)
void burn_structure_print_track (struct burn_track *t)
int burn_write_opts_set_write_type (struct burn_write_opts *opts, enum burn_write_types write_type, int block_type)
 Sets the write type for the write_opts struct.
enum burn_write_types burn_write_opts_auto_write_type (struct burn_write_opts *opts, struct burn_disc *disc, char reasons[BURN_REASONS_LEN], int flag)
 As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write type and block type for a given write job described by opts and disc.
void burn_write_opts_set_toc_entries (struct burn_write_opts *opts, int count, struct burn_toc_entry *toc_entries)
 Supplies toc entries for writing - not normally required for cd mastering.
void burn_write_opts_set_format (struct burn_write_opts *opts, int format)
 Sets the session format for a disc.
int burn_write_opts_set_simulate (struct burn_write_opts *opts, int sim)
 Sets the simulate value for the write_opts struct .
int burn_write_opts_set_underrun_proof (struct burn_write_opts *opts, int underrun_proof)
 Controls buffer underrun prevention.
void burn_write_opts_set_perform_opc (struct burn_write_opts *opts, int opc)
 Sets whether to use opc or not with the write_opts struct.
void burn_write_opts_set_has_mediacatalog (struct burn_write_opts *opts, int has_mediacatalog)
void burn_write_opts_set_mediacatalog (struct burn_write_opts *opts, unsigned char mediacatalog[13])
void burn_write_opts_set_multi (struct burn_write_opts *opts, int multi)
 Sets the multi flag which eventually marks the emerging session as not being the last one and thus creating a BURN_DISC_APPENDABLE media.
void burn_write_opts_set_start_byte (struct burn_write_opts *opts, off_t value)
 Sets a start address for writing to media and write modes which allow to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW).
void burn_write_opts_set_fillup (struct burn_write_opts *opts, int fill_up_media)
 Caution: still immature and likely to change.
void burn_write_opts_set_force (struct burn_write_opts *opts, int use_force)
 Eventually makes libburn ignore the failure of some conformance checks:

  • the check whether CD write+block type is supported by the drive
  • the check whether the media profile supports simulated burning.

void burn_write_opts_set_stream_recording (struct burn_write_opts *opts, int value)
 Eventually makes use of the more modern write command AAh WRITE12 and sets the Streaming bit.
void burn_read_opts_set_raw (struct burn_read_opts *opts, int raw_mode)
 Sets whether to read in raw mode or not.
void burn_read_opts_set_c2errors (struct burn_read_opts *opts, int c2errors)
 Sets whether to report c2 errors or not.
void burn_read_opts_read_subcodes_audio (struct burn_read_opts *opts, int subcodes_audio)
 Sets whether to read subcodes from audio tracks or not.
void burn_read_opts_read_subcodes_data (struct burn_read_opts *opts, int subcodes_data)
 Sets whether to read subcodes from data tracks or not.
void burn_read_opts_set_hardware_error_recovery (struct burn_read_opts *opts, int hardware_error_recovery)
 Sets whether to recover errors if possible.
void burn_read_opts_report_recovered_errors (struct burn_read_opts *opts, int report_recovered_errors)
 Sets whether to report recovered errors or not.
void burn_read_opts_transfer_damaged_blocks (struct burn_read_opts *opts, int transfer_damaged_blocks)
 Sets whether blocks with unrecoverable errors should be read or not.
void burn_read_opts_set_hardware_error_retries (struct burn_read_opts *opts, unsigned char hardware_error_retries)
 Sets the number of retries to attempt when trying to correct an error.
int burn_drive_get_all_profiles (struct burn_drive *d, int *num_profiles, int profiles[64], char is_current[64])
 Gets the list of profile codes supported by the drive.
int burn_obtain_profile_name (int profile_code, char name[80])
 Obtains the profile name associated with a profile code.
int burn_drive_get_write_speed (struct burn_drive *d)
 Gets the maximum write speed for a drive and eventually loaded media.
int burn_drive_get_min_write_speed (struct burn_drive *d)
 Gets the minimum write speed for a drive and eventually loaded media.
int burn_drive_get_read_speed (struct burn_drive *d)
 Gets the maximum read speed for a drive.
int burn_drive_get_speedlist (struct burn_drive *d, struct burn_speed_descriptor **speed_list)
 Obtain a copy of the current speed descriptor list.
int burn_drive_get_best_speed (struct burn_drive *d, int speed_goal, struct burn_speed_descriptor **best_descr, int flag)
 Look up the fastest speed descriptor which is not faster than the given speed_goal.
int burn_drive_free_speedlist (struct burn_speed_descriptor **speed_list)
 Dispose a speed descriptor list copy which was obtained by burn_drive_get_speedlist().
int burn_disc_get_multi_caps (struct burn_drive *d, enum burn_write_types wt, struct burn_multi_caps **caps, int flag)
 Allocates a struct burn_multi_caps (see above) and fills it with values which are appropriate for the drive and the loaded media.
int burn_disc_free_multi_caps (struct burn_multi_caps **caps)
 Removes from memory a multi session info structure which was returned by burn_disc_get_multi_caps().
void burn_track_get_entry (struct burn_track *t, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a track.
void burn_session_get_leadout_entry (struct burn_session *s, struct burn_toc_entry *entry)
 Gets a copy of the toc_entry structure associated with a session's lead out.
struct burn_session ** burn_disc_get_sessions (struct burn_disc *d, int *num)
 Gets an array of all the sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION.
int burn_disc_get_sectors (struct burn_disc *d)
struct burn_track ** burn_session_get_tracks (struct burn_session *s, int *num)
 Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK.
int burn_session_get_sectors (struct burn_session *s)
int burn_track_get_mode (struct burn_track *track)
 Gets the mode of a track.
int burn_session_get_hidefirst (struct burn_session *session)
 Returns whether the first track of a session is hidden in the pregap.
void burn_version (int *major, int *minor, int *micro)
 Returns the library's version in its parts.
int burn_msgs_set_severities (char *queue_severity, char *print_severity, char *print_id)
 Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time.
int burn_msgs_obtain (char *minimum_severity, int *error_code, char msg_text[], int *os_errno, char severity[])
 Obtain the oldest pending libburn message from the queue which has at least the given minimum_severity.
int burn_msgs_submit (int error_code, char msg_text[], int os_errno, char severity[], struct burn_drive *d)
 Submit a message to the libburn queueing system.
int burn_text_to_sev (char *severity_name, int *severity_number, int flag)
 Convert a severity name into a severity number, which gives the severity rank of the name.
int burn_sev_to_text (int severity_number, char **severity_name, int flag)
 Convert a severity number into a severity name.
int burn_set_messenger (void *messenger)
 Replace the messenger object handle of libburn by a compatible handle obtained from a related library.
void burn_set_signal_handling (void *handle, burn_abort_handler_t handler, int mode)
 Control builtin signal handling.
int burn_random_access_write (struct burn_drive *d, off_t byte_address, char *data, off_t data_count, int flag)
 Write data in random access mode.
int burn_get_read_capacity (struct burn_drive *d, int *capacity, int flag)
 Inquire the maximum amount of readable data.
int burn_read_data (struct burn_drive *d, off_t byte_address, char data[], off_t data_size, off_t *data_count, int flag)
 Read data in random access mode.
int burn_drive_get_drive_role (struct burn_drive *d)
 Inquire whether the drive object is a real MMC drive or a pseudo-drive created by a stdio: address.
int burn_drive_equals_adr (struct burn_drive *d1, char *adr2, int drive_role2)
 Find out whether a given address string would lead to the given drive object.

Define Documentation

#define BURN_4CH   (1 << 7)

Track mode modifier - 4 channel audio.

Definition at line 98 of file libburn.h.

#define BURN_AUDIO   (1 << 6)

Track mode - audio 2352 bytes per sector.

may be | with 4ch or preemphasis. NOT TO BE CONFUSED WITH BURN_MODE_RAW Audio data must be 44100Hz 16bit stereo with no riff or other header at beginning. Extra header data will cause pops or clicks. Audio data should also be in little-endian byte order. Big-endian audio data causes static.

Definition at line 96 of file libburn.h.

Referenced by libburner_payload(), and libburner_setup().

#define BURN_CDI   0x10

Session format for obsolete CD-I discs.

Definition at line 55 of file libburn.h.

#define BURN_CDROM   0

Session format for normal audio or data discs.

Definition at line 53 of file libburn.h.

#define BURN_CDXA   0x20

Session format for CDROM-XA discs.

Definition at line 57 of file libburn.h.

#define BURN_COPY   (1 << 8)

Track mode modifier - Digital copy permitted, can be set on any track.

Definition at line 100 of file libburn.h.

#define BURN_DRIVE_ADR_LEN   1024

Maximum length+1 to expect with a persistent drive address string.

Definition at line 946 of file libburn.h.

Referenced by libburner_aquire_by_adr(), libburner_aquire_by_driveno(), and libburner_setup().

#define BURN_DRIVE_WHITELIST_LEN   255

Maximum number of particularly permissible drive addresses.

Definition at line 879 of file libburn.h.

#define BURN_FORM1   (1 << 4)

Track mode modifier - Form 1, | with MODE2 for reasonable results 2048 bytes of user data, 4 bytes of subheader.

Definition at line 84 of file libburn.h.

#define BURN_FORM2   (1 << 5)

Track mode modifier - Form 2, | with MODE2 for reasonable results lots of user data.

not much LEC.

Definition at line 88 of file libburn.h.

#define BURN_FORMAT_IS_FORMATTED   2

Definition at line 1313 of file libburn.h.

#define BURN_FORMAT_IS_UNFORMATTED   1

Possible formatting status values.

Definition at line 1312 of file libburn.h.

Referenced by libburner_format().

#define BURN_FORMAT_IS_UNKNOWN   3

Definition at line 1314 of file libburn.h.

#define burn_header_version_major   0

These three release version numbers tell the revision of this header file and of the API it describes.

They are memorized by applications at build time. Immediately after burn_initialize() an application should do this check: burn_version(&major, &minor, &micro); if(major > burn_header_version_major || (major == burn_header_version_major && (minor > burn_header_version_minor || (minor == burn_header_version_minor && micro >= burn_header_version_micro)))) { ... Young enough. Go on with program run .... } else { ... Too old. Do not use this libburn version ... }

Definition at line 2306 of file libburn.h.

#define burn_header_version_micro   0

Definition at line 2308 of file libburn.h.

#define burn_header_version_minor   7

Definition at line 2307 of file libburn.h.

#define BURN_MODE0   (1 << 0)

Track mode - mode 0 data 0 bytes of user data.

it's all 0s. mode 0. get it? HAH

Definition at line 67 of file libburn.h.

#define BURN_MODE1   (1 << 2)

Track mode - mode 1 data 2048 bytes user data, and all the LEC money can buy.

Definition at line 75 of file libburn.h.

Referenced by libburner_payload().

#define BURN_MODE2   (1 << 3)

Track mode - mode 2 data defaults to formless, 2336 bytes of user data, unprotected | with a data form if required.

Definition at line 80 of file libburn.h.

#define BURN_MODE_BITS   127

Mask for mode bits.

Definition at line 62 of file libburn.h.

#define BURN_MODE_RAW   (1 << 1)

Track mode - mode "raw" - all 2352 bytes supplied by app FOR DATA TRACKS ONLY!

Definition at line 71 of file libburn.h.

#define BURN_MSGS_MESSAGE_LEN   4096

Definition at line 2377 of file libburn.h.

#define BURN_POS_END   100

Definition at line 59 of file libburn.h.

Referenced by libburner_payload().

#define BURN_PREEMPHASIS   (1 << 9)

Track mode modifier - 50/15uS pre-emphasis.

Definition at line 102 of file libburn.h.

#define BURN_REASONS_LEN   4096

The length of a rejection reasons string for burn_precheck_write() and burn_write_opts_auto_write_type() .

Definition at line 1376 of file libburn.h.

Referenced by libburner_payload().

#define BURN_SUBCODE_P16   (1 << 10)

Input mode modifier - subcodes present packed 16.

Definition at line 104 of file libburn.h.

#define BURN_SUBCODE_P96   (1 << 11)

Input mode modifier - subcodes present packed 96.

Definition at line 106 of file libburn.h.

#define BURN_SUBCODE_R96   (1 << 12)

Input mode modifier - subcodes present raw 96.

Definition at line 108 of file libburn.h.


Typedef Documentation

typedef int(* burn_abort_handler_t)(void *handle, int signum, int flag)

The prototype of a handler function suitable for burn_set_abort_handling().

Such a function has to return -2 if it does not want the process to exit with value 1.

Definition at line 2464 of file libburn.h.


Enumeration Type Documentation

Data format to send to the drive.

Enumerator:
BURN_BLOCK_RAW0 

sync, headers, edc/ecc provided by lib/user

BURN_BLOCK_RAW16 

sync, headers, edc/ecc and p/q subs provided by lib/user

BURN_BLOCK_RAW96P 

sync, headers, edc/ecc and packed p-w subs provided by lib/user

BURN_BLOCK_RAW96R 

sync, headers, edc/ecc and raw p-w subs provided by lib/user

BURN_BLOCK_MODE1 

only 2048 bytes of user data provided by lib/user

BURN_BLOCK_MODE2R 

2336 bytes of user data provided by lib/user

BURN_BLOCK_MODE2_PATHETIC 

2048 bytes of user data provided by lib/user subheader provided in write parameters are we ever going to support this shit? I vote no.

(supposed to be supported on all drives...)

BURN_BLOCK_MODE2_LAME 

2048 bytes of data + 8 byte subheader provided by lib/user hey, this is also dumb

BURN_BLOCK_MODE2_OBSCURE 

2324 bytes of data provided by lib/user subheader provided in write parameters no sir, I don't like it.

BURN_BLOCK_MODE2_OK 

2332 bytes of data supplied by lib/user 8 bytes sub header provided in write parameters this is the second least suck mode2, and is mandatory for all drives to support.

BURN_BLOCK_SAO 

SAO block sizes are based on cue sheet, so use this.

Definition at line 151 of file libburn.h.

00152 {
00153     /** sync, headers, edc/ecc provided by lib/user */
00154     BURN_BLOCK_RAW0 = 1,
00155     /** sync, headers, edc/ecc and p/q subs provided by lib/user */
00156     BURN_BLOCK_RAW16 = 2,
00157     /** sync, headers, edc/ecc and packed p-w subs provided by lib/user */
00158     BURN_BLOCK_RAW96P = 4,
00159     /** sync, headers, edc/ecc and raw p-w subs provided by lib/user */
00160     BURN_BLOCK_RAW96R = 8,
00161     /** only 2048 bytes of user data provided by lib/user */
00162     BURN_BLOCK_MODE1 = 256,
00163     /** 2336 bytes of user data provided by lib/user */
00164     BURN_BLOCK_MODE2R = 512,
00165     /** 2048 bytes of user data provided by lib/user
00166         subheader provided in write parameters
00167         are we ever going to support this shit?  I vote no.
00168         (supposed to be supported on all drives...)
00169     */
00170     BURN_BLOCK_MODE2_PATHETIC = 1024,
00171     /** 2048 bytes of data + 8 byte subheader provided by lib/user
00172         hey, this is also dumb
00173     */
00174     BURN_BLOCK_MODE2_LAME = 2048,
00175     /** 2324 bytes of data provided by lib/user
00176         subheader provided in write parameters
00177         no sir, I don't like it.
00178     */
00179     BURN_BLOCK_MODE2_OBSCURE = 4096,
00180     /** 2332 bytes of data supplied by lib/user
00181         8 bytes sub header provided in write parameters
00182         this is the second least suck mode2, and is mandatory for
00183         all drives to support.
00184     */
00185     BURN_BLOCK_MODE2_OK = 8192,
00186     /** SAO block sizes are based on cue sheet, so use this. */
00187     BURN_BLOCK_SAO = 16384
00188 };

Possible status of the drive in regard to the disc in it.

Enumerator:
BURN_DISC_UNREADY 

The current status is not yet known.

BURN_DISC_BLANK 

The drive holds a blank disc.

It is ready for writing from scratch. Unused multi-session media: CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R Blanked multi-session media (i.e. treated by burn_disc_erase()) CD-RW, DVD-RW Overwriteable media with or without valid data DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE

BURN_DISC_EMPTY 

There is no disc at all in the drive.

BURN_DISC_APPENDABLE 

There is an incomplete disc in the drive.

It is ready for appending another session. Written but not yet closed multi-session media CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R

BURN_DISC_FULL 

There is a disc with data on it in the drive.

It is usable only for reading. Written and closed multi-session media CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R Read-Only media CD-ROM, DVD-ROM, BD-ROM Note that many DVD-ROM drives report any written media as Read-Only media and not by their real media types.

BURN_DISC_UNGRABBED 

The drive was not grabbed when the status was inquired.

BURN_DISC_UNSUITABLE 

The media seems to be unsuitable for reading and for writing.

Definition at line 191 of file libburn.h.

00192 {
00193     /** The current status is not yet known */
00194     BURN_DISC_UNREADY,
00195 
00196     /** The drive holds a blank disc. It is ready for writing from scratch.
00197         Unused multi-session media:
00198           CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
00199         Blanked multi-session media (i.e. treated by burn_disc_erase())
00200           CD-RW, DVD-RW
00201         Overwriteable media with or without valid data
00202           DVD-RAM, DVD+RW, formatted DVD-RW, BD-RE
00203     */
00204     BURN_DISC_BLANK,
00205 
00206     /** There is no disc at all in the drive */
00207     BURN_DISC_EMPTY,
00208 
00209     /** There is an incomplete disc in the drive. It is ready for appending
00210         another session.
00211         Written but not yet closed multi-session media
00212           CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
00213     */
00214     BURN_DISC_APPENDABLE,
00215 
00216     /** There is a disc with data on it in the drive. It is usable only for
00217         reading.
00218         Written and closed multi-session media
00219           CD-R, CD-RW, DVD-R, DVD-RW, DVD+R, BD-R
00220         Read-Only media
00221           CD-ROM, DVD-ROM, BD-ROM
00222         Note that many DVD-ROM drives report any written media
00223         as Read-Only media and not by their real media types.
00224     */
00225     BURN_DISC_FULL,
00226 
00227     /* ts A61007 */
00228         /* @since 0.2.4 */
00229     /** The drive was not grabbed when the status was inquired */
00230     BURN_DISC_UNGRABBED,
00231 
00232     /* ts A61020 */
00233         /* @since 0.2.6 */
00234     /** The media seems to be unsuitable for reading and for writing */
00235     BURN_DISC_UNSUITABLE
00236 };

Possible busy states for a drive.

Enumerator:
BURN_DRIVE_IDLE 

The drive is not in an operation.

BURN_DRIVE_SPAWNING 

The library is spawning the processes to handle a pending operation (A read/write/etc is about to start but hasn't quite yet).

BURN_DRIVE_READING 

The drive is reading data from a disc.

BURN_DRIVE_WRITING 

The drive is writing data to a disc.

BURN_DRIVE_WRITING_LEADIN 

The drive is writing Lead-In.

BURN_DRIVE_WRITING_LEADOUT 

The drive is writing Lead-Out.

BURN_DRIVE_ERASING 

The drive is erasing a disc.

BURN_DRIVE_GRABBING 

The drive is being grabbed.

BURN_DRIVE_WRITING_PREGAP 

The drive gets written zeroes before the track payload data.

BURN_DRIVE_CLOSING_TRACK 

The drive is told to close a track (TAO only).

BURN_DRIVE_CLOSING_SESSION 

The drive is told to close a session (TAO only).

BURN_DRIVE_FORMATTING 

The drive is formatting media.

BURN_DRIVE_READING_SYNC 

The drive is busy in synchronous read (if you see this then it has been interrupted).

BURN_DRIVE_WRITING_SYNC 

The drive is busy in synchronous write (if you see this then it has been interrupted).

Definition at line 252 of file libburn.h.

00253 {
00254     /** The drive is not in an operation */
00255     BURN_DRIVE_IDLE,
00256     /** The library is spawning the processes to handle a pending
00257         operation (A read/write/etc is about to start but hasn't quite
00258         yet) */
00259     BURN_DRIVE_SPAWNING,
00260     /** The drive is reading data from a disc */
00261     BURN_DRIVE_READING,
00262     /** The drive is writing data to a disc */
00263     BURN_DRIVE_WRITING,
00264     /** The drive is writing Lead-In */
00265     BURN_DRIVE_WRITING_LEADIN,
00266     /** The drive is writing Lead-Out */
00267     BURN_DRIVE_WRITING_LEADOUT,
00268     /** The drive is erasing a disc */
00269     BURN_DRIVE_ERASING,
00270     /** The drive is being grabbed */
00271     BURN_DRIVE_GRABBING,
00272 
00273     /* ts A61102 */
00274         /* @since 0.2.6 */
00275     /** The drive gets written zeroes before the track payload data */
00276     BURN_DRIVE_WRITING_PREGAP,
00277     /** The drive is told to close a track (TAO only) */
00278     BURN_DRIVE_CLOSING_TRACK,
00279     /** The drive is told to close a session (TAO only) */
00280     BURN_DRIVE_CLOSING_SESSION,
00281 
00282     /* ts A61223 */
00283         /* @since 0.3.0 */
00284     /** The drive is formatting media */
00285     BURN_DRIVE_FORMATTING,
00286 
00287     /* ts A70822 */
00288         /* @since 0.4.0 */
00289     /** The drive is busy in synchronous read (if you see this then it
00290         has been interrupted) */
00291     BURN_DRIVE_READING_SYNC,
00292     /** The drive is busy in synchronous write (if you see this then it
00293         has been interrupted) */
00294     BURN_DRIVE_WRITING_SYNC
00295     
00296 };

Possible data source return values.

Enumerator:
BURN_SOURCE_OK 

The source is ok.

BURN_SOURCE_EOF 

The source is at end of file.

BURN_SOURCE_FAILED 

The source is unusable.

Definition at line 240 of file libburn.h.

00241 {
00242     /** The source is ok */
00243     BURN_SOURCE_OK,
00244     /** The source is at end of file */
00245     BURN_SOURCE_EOF,
00246     /** The source is unusable */
00247     BURN_SOURCE_FAILED
00248 };

Possible disc writing style/modes.

Enumerator:
BURN_WRITE_PACKET 

Packet writing.

currently unsupported, (for DVD Incremental Streaming use TAO)

BURN_WRITE_TAO 

With CD: Track At Once recording 2s gaps between tracks, no fonky lead-ins.

With sequential DVD-R[W]: Incremental Streaming With DVD-RAM/+RW: Random Writeable (used sequentially) With overwriteable DVD-RW: Rigid Restricted Overwrite

BURN_WRITE_SAO 

With CD: Session At Once Block type MUST be BURN_BLOCK_SAO ts A70122: Currently not capable of mixing data and audio tracks.

With sequential DVD-R[W]: Disc-at-once, DAO Single session, single track, fixed size mandatory, (-dvd-compat)

BURN_WRITE_RAW 

With CD: Raw disc at once recording.

all subcodes must be provided by lib or user only raw block types are supported

BURN_WRITE_NONE 

In replies this indicates that not any writing will work.

As parameter for inquiries it indicates that no particular write mode shall is specified. Do not use for setting a write mode for burning. It won't work.

Definition at line 111 of file libburn.h.

00112 {
00113     /** Packet writing.
00114           currently unsupported, (for DVD Incremental Streaming use TAO)
00115     */
00116     BURN_WRITE_PACKET,
00117 
00118     /** With CD:                     Track At Once recording
00119           2s gaps between tracks, no fonky lead-ins
00120 
00121         With sequential DVD-R[W]:    Incremental Streaming
00122         With DVD-RAM/+RW:            Random Writeable (used sequentially)
00123         With overwriteable DVD-RW:   Rigid Restricted Overwrite 
00124     */
00125     BURN_WRITE_TAO,
00126 
00127     /** With CD:                     Session At Once
00128           Block type MUST be BURN_BLOCK_SAO
00129           ts A70122: Currently not capable of mixing data and audio tracks.
00130 
00131         With sequential DVD-R[W]:    Disc-at-once, DAO
00132           Single session, single track, fixed size mandatory, (-dvd-compat)
00133     */
00134     BURN_WRITE_SAO,
00135 
00136     /** With CD: Raw disc at once recording.
00137           all subcodes must be provided by lib or user
00138           only raw block types are supported
00139     */
00140     BURN_WRITE_RAW,
00141 
00142     /** In replies this indicates that not any writing will work.
00143         As parameter for inquiries it indicates that no particular write
00144             mode shall is specified.
00145         Do not use for setting a write mode for burning. It won't work.
00146     */
00147     BURN_WRITE_NONE
00148 };


Function Documentation

int burn_abort ( int  patience,
int(*)(void *handle, int patience, int elapsed)  pacifier_func,
void *  handle 
)

Abort any running drive operation and finally call burn_finish().

You MUST calm down the busy drive if an aborting event occurs during a burn run. For that you may call this function either from your own signal handling code or indirectly by activating the builtin signal handling: burn_set_signal_handling("my_app_name : ", NULL, 0); Else you may eventually call burn_drive_cancel() on the active drive and wait for it to assume state BURN_DRIVE_IDLE.

Parameters:
patience Maximum number of seconds to wait for drives to finish
pacifier_func If not NULL: a function to produce appeasing messages. See burn_abort_pacifier() for an example.
handle Opaque handle to be used with pacifier_func
Returns:
1 ok, all went well 0 had to leave a drive in unclean state <0 severe error, do no use libburn again
Since:
0.2.6
int burn_abort_pacifier ( void *  handle,
int  patience,
int  elapsed 
)

A pacifier function suitable for burn_abort.

Parameters:
handle If not NULL, a pointer to a text suitable for printf("%s")
patience Maximum number of seconds to wait
elapsed Elapsed number of seconds
void burn_allow_untested_profiles ( int  yes  ) 

Allows the use of media types which are implemented in libburn but not yet tested.

The list of those untested profiles is subject to change. Currently it contains: 0x15 "DVD-R/DL sequential recording", If you really test such media, then please report the outcome on libburn-hackers@pykix.org If ever then this call should be done soon after burn_initialize() before any drive scanning.

Parameters:
yes 1=allow all implemented profiles, 0=only tested media (default)
Since:
0.3.4
int burn_disc_add_session ( struct burn_disc *  d,
struct burn_session *  s,
unsigned int  pos 
)

Add a session to a disc at a specific position, increasing the sessions's reference count.

Parameters:
d Disc to add the session to
s Session to add to the disc
pos position to add at (BURN_POS_END is "at the end")
Returns:
0 for failure, 1 for success

Referenced by libburner_payload().

off_t burn_disc_available_space ( struct burn_drive *  d,
struct burn_write_opts *  o 
)

Return the best possible estimation of the currently available capacity of the media.

This might depend on particular write option settings. For inquiring the space with such a set of options, the drive has to be grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value from the most recent automatic inquiry (e.g. during last drive grabbing). An eventual start address from burn_write_opts_set_start_byte() will be subtracted from the obtained capacity estimation. Negative results get defaulted to 0.

Parameters:
d The drive to query.
o If not NULL: write parameters to be set on drive before query
Returns:
number of most probably available free bytes
Since:
0.3.4
struct burn_disc* burn_disc_create ( void   )  [read]

Create a new disc.

Returns:
Pointer to a burn_disc object or NULL on failure.

Referenced by libburner_payload().

int burn_disc_erasable ( struct burn_drive *  d  ) 

Tells whether a disc can be erased or not.

Parameters:
d The drive to inquire.
Returns:
Non-zero means erasable

Referenced by libburner_blank_disc(), and libburner_payload().

void burn_disc_erase ( struct burn_drive *  drive,
int  fast 
)

Erase a disc in the drive.

The drive must be grabbed successfully BEFORE calling this functions. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function. An erase operation is not cancellable, as control of the operation is passed wholly to the drive and there is no way to interrupt it safely.

Parameters:
drive The drive with which to erase a disc.
fast Nonzero to do a fast erase, where only the disc's headers are erased; zero to erase the entire disc. With DVD-RW, fast blanking yields media capable only of DAO.

Referenced by libburner_blank_disc().

void burn_disc_format ( struct burn_drive *  drive,
off_t  size,
int  flag 
)

Format media for use with libburn.

This currently applies to DVD-RW in state "Sequential Recording" (profile 0014h) which get formatted to state "Restricted Overwrite" (profile 0013h). DVD+RW can be "de-iced" by setting bit2 of flag. DVD-RAM and BD-RE may get formatted initially or re-formatted to adjust their Defect Managment. This function usually returns while the drive is still in the process of formatting. The formatting is done, when burn_drive_get_status() returns BURN_DRIVE_IDLE. This may be immediately after return or may need several thousand seconds to occur.

Parameters:
drive The drive with the disc to format.
size The size in bytes to be used with the format command. It should be divisible by 32*1024. The effect of this parameter may depend on the media profile and on parameter flag.
flag Bitfield for control purposes: bit0= after formatting, write the given number of zero-bytes to the media and eventually perform preliminary closing. bit1+2: size mode 0 = use parameter size as far as it makes sense 1 = insist in size 0 even if there is a better default known (on DVD-RAM or BD-R identical to size mode 0, i.e. they never get formatted with payload size 0) 2 = without bit7: format to maximum available size with bit7 : take size from indexed format descriptor 3 = without bit7: format to default size with bit7 : take size from indexed format descriptor bit3= -reserved- bit4= enforce re-format of (partly) formatted media bit5= try to disable eventual defect management bit6= try to avoid lengthy media certification bit7, bit8 to bit15 = bit7 enables MMC expert application mode (else libburn tries to choose a suitable format type): If it is set then bit8 to bit15 contain the index of the format to use. See burn_disc_get_formats(), burn_disc_get_format_descr(). Acceptable types are: 0x00, 0x01, 0x10, 0x11, 0x13, 0x15, 0x26, 0x30, 0x31, 0x32. If bit7 is set, then bit4 is set automatically. bit16= enable POW on blank BD-R
Since:
0.3.0

Referenced by libburner_format().

void burn_disc_free ( struct burn_disc *  d  ) 

Delete disc and decrease the reference count on all its sessions.

Parameters:
d The disc to be freed

Referenced by libburner_payload().

int burn_disc_free_multi_caps ( struct burn_multi_caps **  caps  ) 

Removes from memory a multi session info structure which was returned by burn_disc_get_multi_caps().

The pointer *caps gets set to NULL.

Parameters:
caps the info structure to dispose (note: pointer to pointer)
Returns:
0 : *caps was already NULL, 1 : memory object was disposed
Since:
0.3.2
int burn_disc_get_format_descr ( struct burn_drive *  drive,
int  index,
int *  type,
off_t *  size,
unsigned *  tdp 
)

Inquire parameters of an available media format.

Parameters:
drive The drive with the disc to format.
index The index of the format item. Beginning with 0 up to reply parameter from burn_disc_get_formats() : num_formats - 1
type The format type. See mmc5r03c.pdf, 6.5, 04h FORMAT UNIT. 0x00=full, 0x10=CD-RW/DVD-RW full, 0x11=CD-RW/DVD-RW grow, 0x15=DVD-RW quick, 0x13=DVD-RW quick grow, 0x26=DVD+RW background, 0x30=BD-RE with spare areas, 0x31=BD-RE without spare areas
size The maximum size in bytes achievable with this format.
tdp Type Dependent Parameter. See mmc5r03c.pdf.
Returns:
1 reply is valid , <=0 failure
Since:
0.3.0
int burn_disc_get_formats ( struct burn_drive *  drive,
int *  status,
off_t *  size,
unsigned *  bl_sas,
int *  num_formats 
)

Inquire the formatting status, the associated sizes and the number of available formats.

The info is media specific and stems from MMC command 23h READ FORMAT CAPACITY. See mmc5r03c.pdf 6.24 for background details. Media type can be determined via burn_disc_get_profile().

Parameters:
drive The drive with the disc to format.
status The current formatting status of the inserted media. See BURN_FORMAT_IS_* macros. Note: "unknown" is the legal status for quick formatted, yet unwritten DVD-RW.
size The size in bytes associated with status. unformatted: the maximum achievable size of the media formatted: the currently formatted capacity unknown: maximum capacity of drive or of media
bl_sas Additional info "Block Length/Spare Area Size". Expected to be constantly 2048 for non-BD media.
num_formats The number of available formats. To be used with burn_disc_get_format_descr() to obtain such a format and eventually with burn_disc_format() to select one.
Returns:
1 reply is valid , <=0 failure
Since:
0.3.0

Referenced by libburner_format().

int burn_disc_get_msc1 ( struct burn_drive *  d,
int *  start_lba 
)

Read start lba of the first track in the last complete session.

This is the first parameter of mkisofs option -C. The second parameter is nwa as obtained by burn_disc_track_lba_nwa() with trackno 0.

Parameters:
d The drive to query.
start_lba returns the start address of that track
Returns:
<= 0 : failure, 1 = ok
Since:
0.3.2
int burn_disc_get_multi_caps ( struct burn_drive *  d,
enum burn_write_types  wt,
struct burn_multi_caps **  caps,
int  flag 
)

Allocates a struct burn_multi_caps (see above) and fills it with values which are appropriate for the drive and the loaded media.

The drive must be grabbed for this call. The returned structure has to be disposed via burn_disc_free_multi_caps() when no longer needed.

Parameters:
d The drive to inquire
wt With BURN_WRITE_NONE the best capabilities of all write modes get returned. If set to a write mode like BURN_WRITE_SAO the capabilities with that particular mode are returned and the return value is 0 if the desired mode is not possible.
caps returns the info structure
flag Bitfield for control purposes (unused yet, submit 0)
Returns:
< 0 : error , 0 : writing seems impossible , 1 : writing possible
Since:
0.3.2
int burn_disc_get_profile ( struct burn_drive *  d,
int *  pno,
char  name[80] 
)

Tells the MMC Profile identifier of the loaded media.

The drive must be grabbed in order to get a non-zero result. libburn currently writes only to profiles 0x09 "CD-R", 0x0a "CD-RW", 0x11 "DVD-R sequential recording", 0x12 "DVD-RAM", 0x13 "DVD-RW restricted overwrite", 0x14 "DVD-RW sequential recording", 0x1a "DVD+RW", 0x1b "DVD+R", 0x2b "DVD+R/DL", 0x41 "BD-R sequential recording", 0x43 "BD-RE", 0xffff "stdio file" Note: 0xffff is not a MMC profile but a libburn invention. If enabled by burn_allow_untested_profiles() it also writes to profiles 0x15 "DVD-R/DL sequential recording", Read-only are the profiles 0x08 "CD-ROM", 0x10 "DVD-ROM", 0x40 "BD-ROM", For now read-only is BD-R profile (testers wanted) 0x42 "BD-R random recording"

Parameters:
d The drive where the media is inserted.
pno Profile Number. See also mmc5r03c.pdf, table 89
name Profile Name (see above list, unknown profiles have empty name)
Returns:
1 profile is valid, 0 no profile info available
Since:
0.3.0

Referenced by libburner_aquire_drive(), and libburner_format().

int burn_disc_get_sectors ( struct burn_disc *  d  ) 
struct burn_session** burn_disc_get_sessions ( struct burn_disc *  d,
int *  num 
) [read]

Gets an array of all the sessions for the disc THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A SESSION.

Parameters:
d Disc to get session array for
num Returns the number of sessions in the array
Returns:
array of sessions
enum burn_disc_status burn_disc_get_status ( struct burn_drive *  drive  ) 

Returns what kind of disc a drive is holding.

This function may need to be called more than once to get a proper status from it. See burn_disc_status for details.

Parameters:
drive The drive to query for a disc.
Returns:
The status of the drive, or what kind of disc is in it. Note: BURN_DISC_UNGRABBED indicates wrong API usage

Referenced by libburner_blank_disc(), libburner_format(), and libburner_payload().

int burn_disc_pretend_blank ( struct burn_drive *  drive  ) 

WARNING: This revives an old bug-like behavior that might be dangerous.

Sets the drive status to BURN_DISC_BLANK if it is BURN_DISC_UNREADY or BURN_DISC_UNSUITABLE. Thus marking media as writable which actually failed to declare themselves either blank or (partially) filled.

Returns:
1 drive status has been set , 0 = unsuitable drive status
Since:
0.2.6
int burn_disc_pretend_full ( struct burn_drive *  drive  ) 

WARNING: This overrides the safety measures against unsuitable media.

Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually failed to declare themselves either blank or (partially) filled.

Since:
0.2.6
void burn_disc_read ( struct burn_drive *  drive,
const struct burn_read_opts *  o 
)

Read a disc from the drive and write it to an fd pair.

The drive must be grabbed successfully BEFORE calling this function. Always ensure that the drive reports a status of BURN_DISC_FULL before calling this function.

Parameters:
drive The drive from which to read a disc.
o The options for the read operation.
int burn_disc_read_atip ( struct burn_drive *  drive  ) 

Reads ATIP information from inserted media.

To be obtained via burn_drive_get_write_speed(), burn_drive_get_min_write_speed(), burn_drive_get_start_end_lba(). The drive must be grabbed for this call.

Parameters:
drive The drive to query.
Returns:
1=sucess, 0=no valid ATIP info read, -1 severe error
Since:
0.2.6
int burn_disc_remove_session ( struct burn_disc *  d,
struct burn_session *  s 
)

Remove a session from a disc.

Parameters:
d Disc to remove session from
s Session pointer to find and remove
int burn_disc_track_lba_nwa ( struct burn_drive *  d,
struct burn_write_opts *  o,
int  trackno,
int *  lba,
int *  nwa 
)

Read start lba and Next Writeable Address of a track from media.

Usually a track lba is obtained from the result of burn_track_get_entry(). This call retrieves an updated lba, eventual nwa, and can address the invisible track to come. The drive must be grabbed for this call. One may not issue this call during ongoing burn_disc_write() or burn_disc_erase().

Parameters:
d The drive to query.
o If not NULL: write parameters to be set on drive before query
trackno 0=next track to come, >0 number of existing track
lba return value: start lba
nwa return value: Next Writeable Address
Returns:
1=nwa is valid , 0=nwa is not valid , -1=error
Since:
0.2.6
void burn_disc_write ( struct burn_write_opts *  o,
struct burn_disc *  disc 
)

Write a disc in the drive.

The drive must be grabbed successfully before calling this function. Always ensure that the drive reports a status of BURN_DISC_BLANK ot BURN_DISC_APPENDABLE before calling this function. Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix of data and audio tracks. You must use BURN_WRITE_TAO for such sessions. To be set by burn_write_opts_set_write_type(). Note: This function is not suitable for overwriting data in the middle of a valid data area because it is allowed to append trailing data. For exact random access overwriting use burn_random_access_write().

Parameters:
o The options for the writing operation.
disc The struct burn_disc * that described the disc to be created

Referenced by libburner_payload().

int burn_drive_add_whitelist ( char *  device_address  ) 

Add a device to the list of permissible drives.

As soon as some entry is in the whitelist all non-listed drives are banned from scanning.

Returns:
1 success, <=0 failure
Since:
0.2.2
void burn_drive_cancel ( struct burn_drive *  drive  ) 

Cancel an operation on a drive.

This will only work when the drive's busy state is BURN_DRIVE_READING or BURN_DRIVE_WRITING.

Parameters:
drive The drive on which to cancel the current operation.
void burn_drive_clear_whitelist ( void   ) 

Remove all drives from whitelist.

This enables all possible drives.

int burn_drive_convert_fs_adr ( char *  path,
char  adr[] 
)

Try to convert a given existing filesystem address into a persistent drive address.

This succeeds with symbolic links or if a hint about the drive's system address can be read from the filesystem object and a matching drive is found.

Parameters:
path The address of an existing file system object
adr An application provided array of at least BURN_DRIVE_ADR_LEN characters size. The persistent address gets copied to it.
Returns:
1 = success , 0 = failure , -1 = severe error
Since:
0.2.6

Referenced by libburner_aquire_by_adr().

int burn_drive_convert_scsi_adr ( int  bus_no,
int  host_no,
int  channel_no,
int  target_no,
int  lun_no,
char  adr[] 
)

Try to convert a given SCSI address of bus,host,channel,target,lun into a persistent drive address.

If a SCSI address component parameter is < 0 then it is not decisive and the first enumerated address which matches the >= 0 parameters is taken as result. Note: bus and (host,channel) are supposed to be redundant.

Parameters:
bus_no "Bus Number" (something like a virtual controller)
host_no "Host Number" (something like half a virtual controller)
channel_no "Channel Number" (other half of "Host Number")
target_no "Target Number" or "SCSI Id" (a device)
lun_no "Logical Unit Number" (a sub device)
adr An application provided array of at least BURN_DRIVE_ADR_LEN characters size. The persistent address gets copied to it.
Returns:
1 = success , 0 = failure , -1 = severe error
Since:
0.2.6
int burn_drive_d_get_adr ( struct burn_drive *  drive,
char  adr[] 
)

Inquire the persistent address of the given drive.

Parameters:
drive The drive to inquire.
adr An application provided array of at least BURN_DRIVE_ADR_LEN characters size. The persistent address gets copied to it.
Returns:
>0 success , <=0 error (due to libburn internal problem)
Since:
0.4.0
int burn_drive_equals_adr ( struct burn_drive *  d1,
char *  adr2,
int  drive_role2 
)

Find out whether a given address string would lead to the given drive object.

This should be done in advance for track source addresses with parameter drive_role set to 2. Although a real MMC drive should hardly exist as two drive objects at the same time, this can easily happen with stdio-drives. So if more than one drive is used by the application, then this gesture is advised: burn_drive_d_get_adr(d2, adr2); if (burn_drive_equals_adr(d1, adr2, burn_drive_get_drive_role(d2))) ... Both drive objects point to the same storage facility ...

Parameters:
d1 Existing drive object
adr2 Address string to be tested. Prefix "stdio:" overrides parameter drive_role2 by either 0 or 2 as appropriate. The string must be shorter than BURN_DRIVE_ADR_LEN.
drive_role2 Role as burn_drive_get_drive_role() would attribute to adr2 if it was a drive. Use value 2 for checking track sources resp. pseudo-drive addresses without "stdio:". Use 1 for checking drive addresses including those with prefix "stdio:".
Returns:
1= adr2 leads to d1 , 0= adr2 seems not to lead to d1, -1 = adr2 is bad
Since:
0.4.0
int burn_drive_free_speedlist ( struct burn_speed_descriptor **  speed_list  ) 

Dispose a speed descriptor list copy which was obtained by burn_drive_get_speedlist().

Parameters:
speed_list The list copy. *speed_list gets set to NULL.
Returns:
1=list disposed , 0= *speedlist was already NULL
Since:
0.3.0
int burn_drive_get_adr ( struct burn_drive_info drive_info,
char  adr[] 
)

Inquire the persistent address of a drive via a given drive_info object.

(Note: This is a legacy call.)

Parameters:
drive_info The drive to inquire.Usually some &(drive_infos[driveno])
adr An application provided array of at least BURN_DRIVE_ADR_LEN characters size. The persistent address gets copied to it.
Returns:
>0 success , <=0 error (due to libburn internal problem)
Since:
0.2.6

Referenced by libburner_aquire_by_driveno().

int burn_drive_get_all_profiles ( struct burn_drive *  d,
int *  num_profiles,
int  profiles[64],
char  is_current[64] 
)

Gets the list of profile codes supported by the drive.

Profiles depict the feature sets which constitute media types. For known profile codes and names see burn_disc_get_profile().

Parameters:
d is the drive to query
num_profiles returns the number of supported profiles
profiles returns the profile codes
is_current returns the status of the corresponding profile code: 1= current, i.e. the matching media is loaded 0= not current, i.e. the matching media is not loaded
Returns:
always 1 for now
Since:
0.7.0
int burn_drive_get_best_speed ( struct burn_drive *  d,
int  speed_goal,
struct burn_speed_descriptor **  best_descr,
int  flag 
)

Look up the fastest speed descriptor which is not faster than the given speed_goal.

If it is 0, then the fastest one is chosen among the descriptors with the highest end_lba. If it is -1 then the slowest speed descriptor is chosen regardless of end_lba. Parameter flag decides whether the speed goal means write speed or read speed.

Parameters:
d Drive to query
speed_goal Upper limit for speed, 0=search for maximum speed , -1 search for minimum speed
best_descr Result of the search, NULL if no match
flag Bitfield for control purposes bit0= look for best read speed rather than write speed bit1= look for any source type (else look for source==2 first and for any other source type only with CD media)
Returns:
>0 indicates a valid best_descr, 0 = no valid best_descr
Since:
0.3.8
struct burn_disc* burn_drive_get_disc ( struct burn_drive *  d  )  [read]

Get the drive's disc struct - free when done.

Parameters:
d drive to query
Returns:
the disc struct or NULL on failure
int burn_drive_get_drive_role ( struct burn_drive *  d  ) 

Inquire whether the drive object is a real MMC drive or a pseudo-drive created by a stdio: address.

Parameters:
d The drive to inquire
Returns:
0= null-drive 1= real MMC drive 2= stdio-drive, random access, read-write 3= stdio-drive, sequential, write-only
Since:
0.4.0
int burn_drive_get_min_write_speed ( struct burn_drive *  d  ) 

Gets the minimum write speed for a drive and eventually loaded media.

The return value might change by the media type of already loaded media, again by call burn_drive_grab() and again by call burn_disc_read_atip().

Parameters:
d Drive to query
Returns:
Minimum write speed in K/s
Since:
0.2.6
int burn_drive_get_read_speed ( struct burn_drive *  d  ) 

Gets the maximum read speed for a drive.

Parameters:
d Drive to query
Returns:
Maximum read speed in K/s
int burn_drive_get_speedlist ( struct burn_drive *  d,
struct burn_speed_descriptor **  speed_list 
)

Obtain a copy of the current speed descriptor list.

The drive's list gets updated on various occasions such as burn_drive_grab() but the copy obtained here stays untouched. It has to be disposed via burn_drive_free_speedlist() when it is not longer needed. Speeds may appear several times in the list. The list content depends much on drive and media type. It seems that .source == 1 applies mostly to CD media whereas .source == 2 applies to any media.

Parameters:
d Drive to query
speed_list The copy. If empty, *speed_list gets returned as NULL.
Returns:
1=success , 0=list empty , <0 severe error
Since:
0.3.0
int burn_drive_get_start_end_lba ( struct burn_drive *  drive,
int *  start_lba,
int *  end_lba,
int  flag 
)

Returns start and end lba of the media which is currently inserted in the given drive.

The drive has to be grabbed to have hope for reply. Shortcomming (not a feature): unless burn_disc_read_atip() was called only blank media will return valid info.

Parameters:
drive The drive to query.
start_lba Returns the start lba value
end_lba Returns the end lba value
flag Bitfield for control purposes (unused yet, submit 0)
Returns:
1 if lba values are valid , 0 if invalid
Since:
0.2.6
enum burn_drive_status burn_drive_get_status ( struct burn_drive *  drive,
struct burn_progress p 
)

Returns the progress and status of a drive.

Parameters:
drive The drive to query busy state for.
p Returns the progress of the operation, NULL if you don't care
Returns:
the current status of the drive. See also burn_drive_status.

Referenced by libburner_blank_disc(), libburner_format(), and libburner_payload().

int burn_drive_get_write_speed ( struct burn_drive *  d  ) 

Gets the maximum write speed for a drive and eventually loaded media.

The return value might change by the media type of already loaded media, again by call burn_drive_grab() and again by call burn_disc_read_atip().

Parameters:
d Drive to query
Returns:
Maximum write speed in K/s
int burn_drive_grab ( struct burn_drive *  drive,
int  load 
)

Grab a drive.

This must be done before the drive can be used (for reading, writing, etc).

Parameters:
drive The drive to grab. This is found in a returned burn_drive_info struct.
load Nonzero to make the drive attempt to load a disc (close its tray door, etc).
Returns:
1 if it was possible to grab the drive, else 0

Referenced by libburner_aquire_by_driveno().

int burn_drive_info_forget ( struct burn_drive_info drive_info,
int  force 
)

Release memory about a single drive and any exclusive lock on it.

Become unable to inquire or grab it. Expect FATAL consequences if you try.

Parameters:
drive_info pointer to a single element out of the array obtained from burn_drive_scan() : &(drive_infos[driveno])
force controls degree of permissible drive usage at the moment this function is called, and the amount of automatically provided drive shutdown : 0= drive must be ungrabbed and BURN_DRIVE_IDLE 1= try to release drive resp. accept BURN_DRIVE_GRABBING Use these two only. Further values are to be defined.
Returns:
1 on success, 2 if drive was already forgotten, 0 if not permissible, <0 on other failures,
Since:
0.2.2

Referenced by libburner_aquire_by_driveno().

void burn_drive_info_free ( struct burn_drive_info  drive_infos[]  ) 

When no longer needed, free a whole burn_drive_info array which was returned by burn_drive_scan().

For freeing single drive array elements use burn_drive_info_forget().

int burn_drive_is_enumerable_adr ( char *  adr  ) 

Evaluate whether the given address would be a possible persistent drive address of libburn.

Returns:
1 means yes, 0 means no
Since:
0.2.6
int burn_drive_leave_locked ( struct burn_drive *  d,
int  flag 
)

Like burn_drive_release() but keeping the drive tray closed and its eject button disabled.

This physically locked drive state will last until the drive is grabbed again and released via burn_drive_release(). Programs like eject, cdrecord, growisofs will break that ban too.

Parameters:
drive The drive to release and leave locked.
flag Bitfield for control purposes (unused yet, submit 0)
Returns:
1 means success, <=0 means failure
Since:
0.4.0
int burn_drive_obtain_scsi_adr ( char *  path,
int *  bus_no,
int *  host_no,
int *  channel_no,
int *  target_no,
int *  lun_no 
)

Try to obtain bus,host,channel,target,lun from path.

If there is an SCSI address at all, then this call should succeed with a persistent drive address obtained via burn_drive_d_get_adr(). It is also supposed to succeed with any device file of a (possibly emulated) SCSI device.

Returns:
1 = success , 0 = failure , -1 = severe error
Since:
0.2.6
void burn_drive_release ( struct burn_drive *  drive,
int  eject 
)

Release a drive.

This should not be done until the drive is no longer busy (see burn_drive_get_status). Linux: The drive device file is not reserved afterwards. (O_EXCL, F_SETLK).

Parameters:
drive The drive to release.
eject Nonzero to make the drive eject the disc in it.

Referenced by main().

int burn_drive_scan ( struct burn_drive_info drive_infos[],
unsigned int *  n_drives 
)

Scan for drives.

This function MUST be called until it returns nonzero. In case of re-scanning: All pointers to struct burn_drive and all struct burn_drive_info arrays are invalidated by using this function. Do NOT store drive pointers across calls to this function ! To avoid invalid pointers one MUST free all burn_drive_info arrays by burn_drive_info_free() before calling burn_drive_scan() a second time. If there are drives left, then burn_drive_scan() will refuse to work.

After this call all drives depicted by the returned array are subject to eventual (O_EXCL) locking. See burn_preset_device_open(). This state ends either with burn_drive_info_forget() or with burn_drive_release(). It is unfriendly to other processes on the system to hold drives locked which one does not definitely plan to use soon.

Parameters:
drive_infos Returns an array of drive info items (cdroms/burners). The returned array must be freed by burn_drive_info_free() before burn_finish(), and also before calling this function burn_drive_scan() again.
n_drives Returns the number of drive items in drive_infos.
Returns:
0 while scanning is not complete >0 when it is finished sucessfully, <0 when finished but failed.

Referenced by libburner_aquire_by_driveno().

int burn_drive_scan_and_grab ( struct burn_drive_info drive_infos[],
char *  adr,
int  load 
)

Aquire a drive with known persistent address.

This is the sysadmin friendly way to open one drive and to leave all others untouched. It bundles the following API calls to form a non-obtrusive way to use libburn: burn_drive_add_whitelist() , burn_drive_scan() , burn_drive_grab() You are *strongly urged* to use this call whenever you know the drive address in advance.

If not, then you have to use directly above calls. In that case, you are strongly urged* to drop any unintended drive which will be exclusively occupied and not closed by burn_drive_scan(). This can be done by shutting down the library including a call to burn_finish(). You may later start a new libburn session and should then use the function described here with an address obtained after burn_drive_scan() via burn_drive_d_get_adr(drive_infos[driveno].drive,adr). Another way is to drop the unwanted drives by burn_drive_info_forget().

Operating on multiple drives:

Different than with burn_drive_scan() it is allowed to call burn_drive_scan_and_grab() without giving up any other scanned drives. So this call can be used to get a collection of more than one aquired drives. The attempt to aquire the same drive twice will fail, though.

Pseudo-drives:

burn_drive_scan_and_grab() is able to aquire virtual drives which will accept options much like a MMC burner drive. Many of those options will not cause any effect, though. The address of a pseudo-drive begins with prefix "stdio:" followed by a path. Examples: "stdio:/tmp/pseudo_drive" , "stdio:/dev/null" , "stdio:-"

If the path is empty, the result is a null-drive = drive role 0. It pretends to have loaded no media and supports no reading or writing.

If the path leads to an existing regular file, or to a not yet existing file, or to an existing block device, then the result is a random access stdio-drive capable of reading and writing = drive role 2.

If the path leads to an existing file of any type other than directory, then the result is a sequential write-only stdio-drive = drive role 3.

The special address form "stdio:/dev/fd/<number>" is interpreted literally as reference to open file descriptor <number>. This address form coincides with real files on some systems, but it is in fact hardcoded in libburn. Special address "stdio:-" means stdout = "stdio:/dev/fd/1". The role of such a drive is determined by the file type obtained via fstat(<number>).

Roles 2 and 3 perform all their eventual data transfer activities on a file via standard i/o functions open(2), lseek(2), read(2), write(2), close(2). The media profile is reported as 0xffff. Write space information from those media is not necessarily realistic.

The capabilities of role 2 resemble DVD-RAM but it can simulate writing. If the path does not exist in the filesystem yet, it is attempted to create it as a regular file as soon as write operations are started.

The capabilities of role 3 resemble a blank DVD-R. Nevertheless each burn_disc_write() run may only write a single track.

One may distinguish pseudo-drives from MMC drives by call burn_drive_get_drive_role().

Parameters:
drive_infos On success returns a one element array with the drive (cdrom/burner). Thus use with driveno 0 only. On failure the array has no valid elements at all. The returned array should be freed via burn_drive_info_free() when it is no longer needed. This is a result from call burn_drive_scan(). See there. Use with driveno 0 only.
adr The persistent address of the desired drive. Either once obtained by burn_drive_d_get_adr() or composed skillfully by application resp. its user. E.g. "/dev/sr0". Consider to preprocess it by burn_drive_convert_fs_adr().
load Nonzero to make the drive attempt to load a disc (close its tray door, etc).
Returns:
1 = success , 0 = drive not found , -1 = other error
Since:
0.2.2

Referenced by libburner_aquire_by_adr().

int burn_drive_set_buffer_waiting ( struct burn_drive *  d,
int  enable,
int  min_usec,
int  max_usec,
int  timeout_sec,
int  min_percent,
int  max_percent 
)

Controls the behavior with writing when the drive buffer is suspected to be full.

To check and wait for enough free buffer space before writing will move the task of waiting from the operating system's device driver to libburn. While writing is going on and waiting is enabled, any write operation will be checked whether it will fill the drive buffer up to more than max_percent. If so, then waiting will happen until the buffer fill is predicted with at most min_percent. Thus: if min_percent < max_percent then transfer rate will oscillate. This may allow the driver to operate on other devices, e.g. a disk from which to read the input for writing. On the other hand, this checking might reduce maximum throughput to the drive or even get misled by faulty buffer fill replies from the drive. If a setting parameter is < 0, then this setting will stay unchanged by the call. Known burner or media specific pitfalls: To have max_percent larger than the burner's best reported buffer fill has the same effect as min_percent==max_percent. Some burners do not report their full buffer with all media types. Some are not suitable because they report their buffer fill with delay.

Parameters:
d The drive to control
enable 0= disable , 1= enable waiting , (-1 = do not change setting)
min_usec Shortest possible sleeping period (given in micro seconds)
max_usec Longest possible sleeping period (given in micro seconds)
timeout_sec If a single write has to wait longer than this number of seconds, then waiting gets disabled and mindless writing starts. A value of 0 disables this timeout.
min_percent Minimum of desired buffer oscillation: 25 to 100
max_percent Maximum of desired buffer oscillation: 25 to 100
Returns:
1=success , 0=failure
Since:
0.3.8
void burn_drive_set_speed ( struct burn_drive *  d,
int  read,
int  write 
)

Sets drive read and write speed Note: "k" is 1000, not 1024.

1xCD = 176.4 k/s, 1xDVD = 1385 k/s. Fractional speeds should be rounded up. Like 4xCD = 706.

Parameters:
d The drive to set speed for
read Read speed in k/s (0 is max, -1 is min).
write Write speed in k/s (0 is max, -1 is min).

Referenced by libburner_payload().

int burn_drive_set_stream_recording ( struct burn_drive *  drive,
int  recmode,
int  start,
int  flag 
)

Control stream recording during the write run and eventually set the start LBA for stream recording.

Stream recording is set from struct burn_write_opts when the write run gets started. See burn_write_opts_set_stream_recording(). The call described here can be used later to override this setting and to program automatic switching at a given LBA. It also affects subsequent calls to burn_random_access_write().

Parameters:
drive The drive which performs the write operation.
recmode -1= disable stream recording 0= leave setting as is 1= enable stream recording
start The LBA where actual stream recording shall start. (0 means unconditional stream recording)
flag Bitfield for control purposes (unused yet, submit 0).
Returns:
1=success , <=0 failure
Since:
0.6.4
int burn_drive_snooze ( struct burn_drive *  d,
int  flag 
)

Calm down or alert a drive.

Some drives stay alert after reading for quite some time. This saves time with the startup for the next read operation but also causes noise and consumes extra energy. It makes sense to calm down the drive if no read operation is expected for the next few seconds. The drive will get alert automatically if operations are required.

Parameters:
drive The drive to influence.
flag Bitfield for control purposes bit0= become alert (else start snoozing) This is not mandatory to allow further drive operations
Returns:
1= success , 0= drive role not suitable for calming
Since:
0.7.0
int burn_drive_wrote_well ( struct burn_drive *  d  ) 

Inquire whether the most recent write run was successful.

Reasons for non-success may be: rejection of burn parameters, abort during fatal errors during write, a call to burn_drive_cancel() by the application thread.

Parameters:
d The drive to inquire.
Returns:
1=burn seems to have went well, 0=burn failed
Since:
0.2.6
struct burn_source* burn_fd_source_new ( int  datafd,
int  subfd,
off_t  size 
) [read]

Creates a data source for an image file (a track) from an open readable filedescriptor, an eventually open readable subcodes file descriptor and eventually a fixed size in bytes.

Parameters:
datafd The source of data.
subfd The eventual source of subchannel data. Only used in exotic raw write modes. Submit -1 for normal tasks.
size The eventual fixed size of eventually both fds. If this value is 0, the size will be determined from datafd.
Returns:
Pointer to a burn_source object, NULL indicates failure

Referenced by libburner_payload().

int burn_fifo_inquire_status ( struct burn_source fifo,
int *  size,
int *  free_bytes,
char **  status_text 
)

Inquires state and fill parameters of a fifo burn_source which was created by burn_fifo_source_new() .

Do not use with other burn_source variants.

Parameters:
fifo The fifo object to inquire
size The total size of the fifo
free_bytes The current free capacity of the fifo
status_text Returns a pointer to a constant text, see below
Returns:
<0 reply invalid, >=0 fifo status code: bit0+1=input status, bit2=consumption status, i.e: 0="standby" : data processing not started yet 1="active" : input and consumption are active 2="ending" : input has ended without error 3="failing" : input had error and ended, 4="unused" : ( consumption has ended before processing start ) 5="abandoned" : consumption has ended prematurely 6="ended" : consumption has ended without input error 7="aborted" : consumption has ended after input error
Since:
0.4.0

Referenced by libburner_payload().

int burn_fifo_peek_data ( struct burn_source source,
char *  buf,
int  bufsize,
int  flag 
)

Obtain a preview of the first input data of a fifo which was created by burn_fifo_source_new().

The data will later be delivered normally to the consumer track of the fifo. bufsize may not be larger than the fifo size (chunk_size * chunks). This call will succeed only if data consumption by the track has not started yet, i.e. best before the call to burn_disc_write(). It will start the worker thread of the fifo with the expectable side effects on the external data source. Then it waits either until enough data have arrived or until it becomes clear that this will not happen. The call may be repeated with increased bufsize. It will always yield the bytes beginning from the first one in the fifo.

Parameters:
fifo The fifo object to inquire
buf Pointer to memory of at least bufsize bytes where to deliver the peeked data
bufsize Number of bytes to peek from the start of the fifo data
flag Bitfield for control purposes (unused yet, submit 0).
Returns:
<0 on severe error, 0 if not enough data, 1 if bufsize bytes read
Since:
0.5.0
struct burn_source* burn_fifo_source_new ( struct burn_source inp,
int  chunksize,
int  chunks,
int  flag 
) [read]

Creates a fifo which acts as proxy for an already existing data source.

The fifo provides a ring buffer which shall smoothen the data stream between burn_source and writer thread. Each fifo serves only for one data source and gets attached to one track as its only data source by burn_track_set_source(). A fifo starts its life in "standby" mode with no buffer space allocated. As soon as its track requires bytes, the fifo establishes a worker thread and allocates its buffer. After input has ended and all buffer content is consumed, the buffer space gets freed and the worker thread ends. This happens asynchronously. So expect two buffers and worker threads to exist for a short time between tracks. Be modest in your size demands if multiple tracks are to be expected.

Parameters:
inp The burn_source for which the fifo shall act as proxy. It can be disposed by burn_source_free() immediately after this call.
chunksize The size in bytes of a chunk. Use 2048 for sources suitable for BURN_BLOCK_MODE1 and 2352 for sources which deliver for BURN_BLOCK_AUDIO. Some variations of burn_source might work only with a particular chunksize. E.g. libisofs demands 2048.
chunks The number of chunks to be allocated in ring buffer. This value must be >= 2.
flag Bitfield for control purposes (unused yet, submit 0).
Returns:
A pointer to the newly created burn_source. Later both burn_sources, inp and the returned fifo, have to be disposed by calling burn_source_free() for each. inp can be freed immediately, the returned fifo may be kept as handle for burn_fifo_inquire_status().
Since:
0.4.0

Referenced by libburner_payload().

struct burn_source* burn_file_source_new ( const char *  path,
const char *  subpath 
) [read]

Creates a data source for an image file (and maybe subcode file).

Parameters:
path The file address for the main channel payload.
subpath Eventual address for subchannel data. Only used in exotic raw write modes. Submit NULL for normal tasks.
Returns:
Pointer to a burn_source object, NULL indicates failure
void burn_finish ( void   ) 

Shutdown the library.

This should be called before exiting your application. Make sure that all drives you have grabbed are released before calling this.

Referenced by main().

int burn_get_read_capacity ( struct burn_drive *  d,
int *  capacity,
int  flag 
)

Inquire the maximum amount of readable data.

It is supposed that all LBAs in the range from 0 to media_read_acpacity-1 can be read via burn_read_data() although some of them may never have been recorded. If tracks are recognizable then it is better to only read LBAs which are part of some track.

Parameters:
d The drive from which to read
capacity Will return the result if valid
flag Bitfield for control purposes: Unused yet, submit 0.
Returns:
1=sucessful , <=0 an error occured
Since:
0.6.0
int burn_initialize ( void   ) 

Initialize the library.

This must be called before using any other functions in the library. It may be called more than once with no effect. It is possible to 'restart' the library by shutting it down and re-initializing it. Once this was necessary if you follow the older and more general way of accessing a drive via burn_drive_scan() and burn_drive_grab(). See burn_drive_scan_and_grab() with its strong urges and its explanations.

Returns:
Nonzero if the library was able to initialize; zero if initialization failed.

Referenced by main().

void burn_lba_to_msf ( int  lba,
int *  m,
int *  s,
int *  f 
)

Convert an lba to minute-second-frame (MSF).

Parameters:
lba The lba
m Returns the minute component
s Returns the second component
f Returns the frame component
int burn_msf_to_lba ( int  m,
int  s,
int  f 
)

Convert a minute-second-frame (MSF) value to an lba.

Parameters:
m Minute component
s Second component
f Frame component
Returns:
The lba
int burn_msf_to_sectors ( int  m,
int  s,
int  f 
)

Convert a minute-second-frame (MSF) value to sector count.

Parameters:
m Minute component
s Second component
f Frame component
Returns:
The sector count
int burn_msgs_obtain ( char *  minimum_severity,
int *  error_code,
char  msg_text[],
int *  os_errno,
char  severity[] 
)

Obtain the oldest pending libburn message from the queue which has at least the given minimum_severity.

This message and any older message of lower severity will get discarded from the queue and is then lost forever.

Parameters:
minimum_severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL". To call with minimum_severity "NEVER" will discard the whole queue.
error_code Will become a unique error code as liste in libburn/libdax_msgs.h
msg_text Must provide at least BURN_MSGS_MESSAGE_LEN bytes.
os_errno Will become the eventual errno related to the message
severity Will become the severity related to the message and should provide at least 80 bytes.
Returns:
1 if a matching item was found, 0 if not, <0 for severe errors
Since:
0.2.6
int burn_msgs_set_severities ( char *  queue_severity,
char *  print_severity,
char *  print_id 
)

Note: Above version numbers are also recorded in configure.ac because libtool wants them as parameters at build time.

For the library compatibility check BURN_*_VERSION in configure.ac are not decisive. Only the three numbers above do matter. Usage discussion:Some developers of the libburnia project have differing opinions how to ensure the compatibility of libaries and applications.

It is about whether to use at compile time and at runtime the version numbers isoburn_header_version_* provided here. Thomas Schmitt advises to use them. Vreixo Formoso advises to use other means.

At compile time:

Vreixo Formoso advises to leave proper version matching to properly programmed checks in the the application's build system, which will eventually refuse compilation.

Thomas Schmitt advises to use the macros defined here for comparison with the application's requirements of library revisions and to eventually break compilation.

Both advises are combinable. I.e. be master of your build system and have if checks in the source code of your application, nevertheless.

At runtime (via *_is_compatible()):

Vreixo Formoso advises to compare the application's requirements of library revisions with the runtime library. This is to allow runtime libraries which are young enough for the application but too old for the lib*.h files seen at compile time.

Thomas Schmitt advises to compare the header revisions defined here with the runtime library. This is to enforce a strictly monotonous chain of revisions from app to header to library, at the cost of excluding some older libraries.

These two advises are mutually exclusive. Control queueing and stderr printing of messages from libburn. Severity may be one of "NEVER", "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL".

Parameters:
queue_severity Gives the minimum limit for messages to be queued. Default: "NEVER". If you queue messages then you must consume them by burn_msgs_obtain().
print_severity Does the same for messages to be printed directly to stderr. Default: "FATAL".
print_id A text prefix to be printed before the message.
Returns:
>0 for success, <=0 for error
Since:
0.2.6

Referenced by main().

int burn_msgs_submit ( int  error_code,
char  msg_text[],
int  os_errno,
char  severity[],
struct burn_drive *  d 
)

Submit a message to the libburn queueing system.

It will be queued or printed as if it was generated by libburn itself.

Parameters:
error_code The unique error code of your message. Submit 0 if you do not have reserved error codes within the libburnia project.
msg_text Not more than BURN_MSGS_MESSAGE_LEN characters of message text.
os_errno Eventual errno related to the message. Submit 0 if the message is not related to a operating system error.
severity One of "ABORT", "FATAL", "FAILURE", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
d An eventual drive to which the message shall be related. Submit NULL if the message is not specific to a particular drive object.
Returns:
1 if message was delivered, <=0 if failure
Since:
0.4.0
int burn_obtain_profile_name ( int  profile_code,
char  name[80] 
)

Obtains the profile name associated with a profile code.

Parameters:
profile_code the profile code to be translated
name returns the profile name (e.g. "DVD+RW")
Returns:
1= known profile code , 0= unknown profile code
Since:
0.7.0
int burn_precheck_write ( struct burn_write_opts *  o,
struct burn_disc *  disc,
char  reasons[BURN_REASONS_LEN],
int  silent 
)

Examines a completed setup for burn_disc_write() whether it is permissible with drive and media.

This function is called by burn_disc_write() but an application might be interested in this check in advance.

Parameters:
o The options for the writing operation.
disc The descrition of the disc to be created
reasons Eventually returns a list of rejection reason statements
silent 1= do not issue error messages , 0= report problems
Returns:
1 ok, -1= no recordable media detected, 0= other failure
Since:
0.3.4
void burn_preset_device_open ( int  exclusive,
int  blocking,
int  abort_on_busy 
)

Set parameters for behavior on opening device files.

To be called early after burn_initialize() and before any bus scan. But not mandatory at all. Parameter value 1 enables a feature, 0 disables. Default is (1,0,0). Have a good reason before you change it.

Parameters:
exclusive Linux only: 0 = no attempt to make drive access exclusive. 1 = Try to open only devices which are not marked as busy and try to mark them busy if opened sucessfully. (O_EXCL) There are kernels which simply don't care about O_EXCL. Some have it off, some have it on, some are switchable. 2 = in case of a SCSI device, also try to open exclusively the matching /dev/sr, /dev/scd and /dev/st . One may select a device SCSI file family by adding 0 = default family 4 = /dev/srd 8 = /dev/scdd 16 = /dev/sgd Do not use other values ! Add 32 to demand an exclusive lock by fcntl(,F_SETLK,) after open() has succeeded.
blocking Try to wait for drives which do not open immediately but also do not return an error as well. (O_NONBLOCK) This might stall indefinitely with /dev/hdX hard disks.
abort_on_busy Unconditionally abort process when a non blocking exclusive opening attempt indicates a busy drive. Use this only after thorough tests with your app.
Since:
0.2.2
int burn_random_access_write ( struct burn_drive *  d,
off_t  byte_address,
char *  data,
off_t  data_count,
int  flag 
)

Write data in random access mode.

The drive must be grabbed successfully before calling this function which circumvents usual libburn session processing and rather writes data without preparations or finalizing. This will work only with overwriteable media which are also suitable for burn_write_opts_set_start_byte(). The same address alignment restrictions as with this function apply. I.e. for DVD it is best to align to 32 KiB blocks (= 16 LBA units). The amount of data to be written is subject to the same media dependent alignment rules. Again, 32 KiB is most safe. Call burn_disc_get_multi_caps() can obtain the necessary media info. See resulting struct burn_multi_caps elements .start_adr , .start_alignment , .start_range_low , .start_range_high . Other than burn_disc_write() this is a synchronous call which returns only after the write transaction has ended (sucessfully or not). So it is wise not to transfer giant amounts of data in a single call. Important: Data have to fit into the already formatted area of the media.

Parameters:
d The drive to which to write
byte_address The start address of the write in byte (1 LBA unit = 2048 bytes) (do respect media alignment)
data The bytes to be written
data_count The number of those bytes (do respect media alignment) data_count == 0 is permitted (e.g. to flush the drive buffer without further data transfer).
flag Bitfield for control purposes: bit0 = flush the drive buffer after eventual writing
Returns:
1=sucessful , <=0 : number of transfered bytes * -1
Since:
0.4.0
int burn_read_data ( struct burn_drive *  d,
off_t  byte_address,
char  data[],
off_t  data_size,
off_t *  data_count,
int  flag 
)

Read data in random access mode.

The drive must be grabbed successfully before calling this function. With all currently supported drives and media the byte_address has to be aligned to 2048 bytes. Only data tracks with 2048 bytes per sector can be read this way. I.e. not CD-audio, not CD-video-stream ... This is a synchronous call which returns only after the full read job has ended (sucessfully or not). So it is wise not to read giant amounts of data in a single call.

Parameters:
d The drive from which to read
byte_address The start address of the read in byte (aligned to 2048)
data A memory buffer capable of taking data_size bytes
data_size The amount of data to be read. This does not have to be aligned to any block size.
data_count The amount of data actually read (interesting on error)
flag Bitfield for control purposes: bit0= - reserved - bit1= do not submit error message if read error bit2= on error do not try to read a second time with single block steps.
Since:
0.5.2
Returns:
1=sucessful , <=0 an error occured
Since:
0.4.0
void burn_read_opts_free ( struct burn_read_opts *  opts  ) 

Frees a read_opts struct created with burn_read_opts_new.

Parameters:
opts write_opts to free
struct burn_read_opts* burn_read_opts_new ( struct burn_drive *  drive  )  [read]

Creates a read_opts struct for reading from the specified drive must be freed with burn_read_opts_free.

Parameters:
drive The drive to read from
Returns:
The read_opts
void burn_read_opts_read_subcodes_audio ( struct burn_read_opts *  opts,
int  subcodes_audio 
)

Sets whether to read subcodes from audio tracks or not.

Parameters:
opts The read opts to change
subcodes_audio If non-zero, read subcodes from audio tracks on the disc.
void burn_read_opts_read_subcodes_data ( struct burn_read_opts *  opts,
int  subcodes_data 
)

Sets whether to read subcodes from data tracks or not.

Parameters:
opts The read opts to change
subcodes_data If non-zero, read subcodes from data tracks on the disc.
void burn_read_opts_report_recovered_errors ( struct burn_read_opts *  opts,
int  report_recovered_errors 
)

Sets whether to report recovered errors or not.

Parameters:
opts The read opts to change
report_recovered_errors If non-zero, recovered errors will be reported.
void burn_read_opts_set_c2errors ( struct burn_read_opts *  opts,
int  c2errors 
)

Sets whether to report c2 errors or not.

Parameters:
opts The read opts to change
c2errors If non-zero, report c2 errors.
void burn_read_opts_set_hardware_error_recovery ( struct burn_read_opts *  opts,
int  hardware_error_recovery 
)

Sets whether to recover errors if possible.

Parameters:
opts The read opts to change
hardware_error_recovery If non-zero, attempt to recover errors if possible.
void burn_read_opts_set_hardware_error_retries ( struct burn_read_opts *  opts,
unsigned char  hardware_error_retries 
)

Sets the number of retries to attempt when trying to correct an error.

Parameters:
opts The read opts to change
hardware_error_retries The number of retries to attempt when correcting an error.
void burn_read_opts_set_raw ( struct burn_read_opts *  opts,
int  raw_mode 
)

Sets whether to read in raw mode or not.

Parameters:
opts The read opts to change
raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the disc is read, including headers.
void burn_read_opts_transfer_damaged_blocks ( struct burn_read_opts *  opts,
int  transfer_damaged_blocks 
)

Sets whether blocks with unrecoverable errors should be read or not.

Parameters:
opts The read opts to change
transfer_damaged_blocks If non-zero, blocks with unrecoverable errors will still be read.
void burn_sectors_to_msf ( int  sectors,
int *  m,
int *  s,
int *  f 
)

Convert a sector count to minute-second-frame (MSF).

Parameters:
sectors The sector count
m Returns the minute component
s Returns the second component
f Returns the frame component
int burn_session_add_track ( struct burn_session *  s,
struct burn_track *  t,
unsigned int  pos 
)

Add a track to a session at specified position.

Parameters:
s Session to add to
t Track to insert in session
pos position to add at (BURN_POS_END is "at the end")
Returns:
0 for failure, 1 for success

Referenced by libburner_payload().

struct burn_session* burn_session_create ( void   )  [read]

Create a new session.

Returns:
Pointer to a burn_session object or NULL on failure.

Referenced by libburner_payload().

void burn_session_free ( struct burn_session *  s  ) 

Free a session (and decrease reference count on all tracks inside).

Parameters:
s Session to be freed

Referenced by libburner_payload().

int burn_session_get_hidefirst ( struct burn_session *  session  ) 

Returns whether the first track of a session is hidden in the pregap.

Parameters:
session the session to query
Returns:
non-zero means the first track is hidden
void burn_session_get_leadout_entry ( struct burn_session *  s,
struct burn_toc_entry entry 
)

Gets a copy of the toc_entry structure associated with a session's lead out.

Parameters:
s Session to get the entry from
entry Struct for the library to fill out
int burn_session_get_sectors ( struct burn_session *  s  ) 
struct burn_track** burn_session_get_tracks ( struct burn_session *  s,
int *  num 
) [read]

Gets an array of all the tracks for a session THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK.

Parameters:
s session to get track array for
num Returns the number of tracks in the array
Returns:
array of tracks
void burn_session_hide_first_track ( struct burn_session *  s,
int  onoff 
)

Hide the first track in the "pre gap" of the disc.

Parameters:
s session to change
onoff 1 to enable hiding, 0 to disable
int burn_session_remove_track ( struct burn_session *  s,
struct burn_track *  t 
)

Remove a track from a session.

Parameters:
s Session to remove track from
t Track pointer to find and remove
Returns:
0 for failure, 1 for success
int burn_set_messenger ( void *  messenger  ) 

Replace the messenger object handle of libburn by a compatible handle obtained from a related library.

See also: libisofs, API function iso_get_messenger().

Parameters:
messenger The foreign but compatible message handle.
Returns:
1 : success, <=0 : failure
Since:
0.4.0
void burn_set_signal_handling ( void *  handle,
burn_abort_handler_t  handler,
int  mode 
)

Control builtin signal handling.

See also burn_abort().

Parameters:
handle Opaque handle eventually pointing to an application provided memory object
handler A function to be called on signals. It will get handle as argument. It should finally call burn_abort(). See there.
mode : 0 call handler(handle, signum, 0) on nearly all signals 1 enable system default reaction on all signals 2 try to ignore nearly all signals 10 like mode 2 but handle SIGABRT like with mode 0 Arguments (text, NULL, 0) activate the builtin abort handler. It will eventually call burn_abort() and then perform exit(1). If text is not NULL then it is used as prefix for pacifier messages of burn_abort_pacifier().
Since:
0.2.6

Referenced by main().

void burn_set_verbosity ( int  level  ) 

ts A61006 : This is for development only.

Not suitable for applications. Set the verbosity level of the library. The default value is 0, which means that nothing is output on stderr. The more you increase this, the more debug output should be displayed on stderr for you.

Parameters:
level The verbosity level desired. 0 for nothing, higher positive values for more information output.
int burn_sev_to_text ( int  severity_number,
char **  severity_name,
int  flag 
)

Convert a severity number into a severity name.

Since:
0.4.4
Parameters:
severity_number The rank number: the higher, the more severe.
severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
flag Bitfield for control purposes (unused yet, submit 0)
Since:
0.4.4
void burn_source_free ( struct burn_source s  ) 

Free a burn_source (decrease its refcount and maybe free it).

Parameters:
s Source to free

Referenced by libburner_payload().

void burn_structure_print_disc ( struct burn_disc *  d  ) 
void burn_structure_print_session ( struct burn_session *  s  ) 
void burn_structure_print_track ( struct burn_track *  t  ) 
int burn_text_to_sev ( char *  severity_name,
int *  severity_number,
int  flag 
)

Convert a severity name into a severity number, which gives the severity rank of the name.

Parameters:
severity_name A name as with burn_msgs_submit(), e.g. "SORRY".
severity_number The rank number: the higher, the more severe.
flag Bitfield for control purposes (unused yet, submit 0)
Returns:
>0 success, <=0 failure
Since:
0.4.0
void burn_track_clear_isrc ( struct burn_track *  t  ) 

Disable ISRC parameters for a track.

Parameters:
t The track to change
struct burn_track* burn_track_create ( void   )  [read]

Create a track (for TAO recording, or to put in a session).

Referenced by libburner_payload().

void burn_track_define_data ( struct burn_track *  t,
int  offset,
int  tail,
int  pad,
int  mode 
)

Define the data in a track.

Parameters:
t the track to define
offset The lib will write this many 0s before start of data
tail The number of extra 0s to write after data
pad 1 means the lib should pad the last sector with 0s if the track isn't exactly sector sized. (otherwise the lib will begin reading from the next track)
mode data format (bitfield)

Referenced by libburner_payload().

void burn_track_free ( struct burn_track *  t  ) 

Free a track.

Parameters:
t Track to free

Referenced by libburner_payload().

int burn_track_get_counters ( struct burn_track *  t,
off_t *  read_bytes,
off_t *  written_bytes 
)

Tells how many source bytes have been read and how many data bytes have been written by the track during burn.

Parameters:
t The track to inquire
read_bytes Number of bytes read from the track source
written_bytes Number of bytes written to track
Since:
0.2.6
void burn_track_get_entry ( struct burn_track *  t,
struct burn_toc_entry entry 
)

Gets a copy of the toc_entry structure associated with a track.

Parameters:
t Track to get the entry from
entry Struct for the library to fill out
int burn_track_get_mode ( struct burn_track *  track  ) 

Gets the mode of a track.

Parameters:
track the track to query
Returns:
the track's mode
int burn_track_get_sectors ( struct burn_track *   ) 

Tells how long a track will be on disc >>> NOTE: Not reliable with tracks of undefined length.

int burn_track_set_byte_swap ( struct burn_track *  t,
int  swap_source_bytes 
)

Define whether a track shall swap bytes of its input stream.

Parameters:
t The track to change
swap_source_bytes 0=do not swap, 1=swap byte pairs
Returns:
1=success , 0=unacceptable value
Since:
0.2.6
int burn_track_set_default_size ( struct burn_track *  t,
off_t  size 
)

Set a default track size to be used only if the track turns out to be of unpredictable length and if the effective write type demands a fixed size.

This can be useful to enable write types CD SAO or DVD DAO together with a track source like stdin. If the track source delivers fewer bytes than announced then the track will be padded up with zeros.

Parameters:
t The track to change
size The size to set
Returns:
0=failure 1=sucess
Since:
0.3.4
void burn_track_set_isrc ( struct burn_track *  t,
char *  country,
char *  owner,
unsigned char  year,
unsigned int  serial 
)

Set the ISRC details for a track.

Parameters:
t The track to change
country the 2 char country code. Each character must be only numbers or letters.
owner 3 char owner code. Each character must be only numbers or letters.
year 2 digit year. A number in 0-99 (Yep, not Y2K friendly).
serial 5 digit serial number. A number in 0-99999.
int burn_track_set_size ( struct burn_track *  t,
off_t  size 
)

Sets a fixed track size after the data source object has already been created.

Parameters:
t The track to operate on
size the number of bytes to use as track size
Returns:
<=0 indicates failure , >0 success
Since:
0.3.6
enum burn_source_status burn_track_set_source ( struct burn_track *  t,
struct burn_source s 
)

Set the track's data source.

Parameters:
t The track to set the data source for
s The data source to use for the contents of the track
Returns:
An error code stating if the source is ready for use for writing the track, or if an error occured

Referenced by libburner_payload().

void burn_version ( int *  major,
int *  minor,
int *  micro 
)

Returns the library's version in its parts.

This is the runtime counterpart of the three build time macros burn_header_version_* below.

Parameters:
major The major version number
minor The minor version number
micro The micro version number
enum burn_write_types burn_write_opts_auto_write_type ( struct burn_write_opts *  opts,
struct burn_disc *  disc,
char  reasons[BURN_REASONS_LEN],
int  flag 
)

As an alternative to burn_write_opts_set_write_type() this function tries to find a suitable write type and block type for a given write job described by opts and disc.

To be used after all other setups have been made, i.e. immediately before burn_disc_write().

Parameters:
opts The nearly complete write opts to change
disc The already composed session and track model
reasons This text string collects reasons for decision resp. failure
flag Bitfield for control purposes: bit0= do not choose type but check the one that is already set bit1= do not issue error messages via burn_msgs queue (is automatically set with bit0)
Returns:
Chosen write type. BURN_WRITE_NONE on failure.
Since:
0.3.2

Referenced by libburner_payload().

void burn_write_opts_free ( struct burn_write_opts *  opts  ) 

Frees a write_opts struct created with burn_write_opts_new.

Parameters:
opts write_opts to free

Referenced by libburner_payload().

struct burn_drive* burn_write_opts_get_drive ( struct burn_write_opts *  opts  )  [read]

Inquires the drive associated with a burn_write_opts object.

Parameters:
opts object to inquire
Returns:
pointer to drive
Since:
0.4.0
struct burn_write_opts* burn_write_opts_new ( struct burn_drive *  drive  )  [read]

Creates a write_opts struct for burning to the specified drive.

The returned object must later be freed with burn_write_opts_free().

Parameters:
drive The drive to write with
Returns:
The write_opts, NULL on error

Referenced by libburner_payload().

void burn_write_opts_set_fillup ( struct burn_write_opts *  opts,
int  fill_up_media 
)

Caution: still immature and likely to change.

Problems arose with sequential DVD-RW on one drive.

Controls whether the whole available space of the media shall be filled up by the last track of the last session.

Parameters:
opts The write opts to change
fill_up_media If 1 : fill up by last track, if 0 = do not fill up
Since:
0.3.4
void burn_write_opts_set_force ( struct burn_write_opts *  opts,
int  use_force 
)

Eventually makes libburn ignore the failure of some conformance checks:

  • the check whether CD write+block type is supported by the drive
  • the check whether the media profile supports simulated burning.

Parameters:
opts The write opts to change
use_force 1=ignore above checks, 0=refuse work on failed check
Since:
0.3.4
void burn_write_opts_set_format ( struct burn_write_opts *  opts,
int  format 
)

Sets the session format for a disc.

Parameters:
opts The write opts to change
format The session format to set
void burn_write_opts_set_has_mediacatalog ( struct burn_write_opts *  opts,
int  has_mediacatalog 
)
void burn_write_opts_set_mediacatalog ( struct burn_write_opts *  opts,
unsigned char  mediacatalog[13] 
)
void burn_write_opts_set_multi ( struct burn_write_opts *  opts,
int  multi 
)

Sets the multi flag which eventually marks the emerging session as not being the last one and thus creating a BURN_DISC_APPENDABLE media.

Parameters:
opts The option object to be manipulated
multi 1=media will be appendable, 0=media will be closed (default)
Since:
0.2.6

Referenced by libburner_payload().

void burn_write_opts_set_perform_opc ( struct burn_write_opts *  opts,
int  opc 
)

Sets whether to use opc or not with the write_opts struct.

Parameters:
opts The write opts to change
opc If non-zero, optical power calibration will be performed at start of burn

Referenced by libburner_payload().

int burn_write_opts_set_simulate ( struct burn_write_opts *  opts,
int  sim 
)

Sets the simulate value for the write_opts struct .

This corresponds to the Test Write bit in MMC mode page 05h. Several media types do not support this. See struct burn_multi_caps.might_simulate for actual availability of this feature. If the media is suitable, the drive will perform burn_write_disc() as a simulation instead of effective write operations. This means that the media content and burn_disc_get_status() stay unchanged. Note: With stdio-drives, the target file gets eventually created, opened, lseeked, and closed, but not written. So there are effects on it. Warning: Call burn_random_access_write() will never do simulation because it does not get any burn_write_opts.

Parameters:
opts The write opts to change
sim Non-zero enables simulation, 0 enables real writing
Returns:
Returns 1 on success and 0 on failure.

Referenced by libburner_payload().

void burn_write_opts_set_start_byte ( struct burn_write_opts *  opts,
off_t  value 
)

Sets a start address for writing to media and write modes which allow to choose this address at all (for now: DVD+RW, DVD-RAM, formatted DVD-RW).

now). The address is given in bytes. If it is not -1 then a write run will fail if choice of start address is not supported or if the block alignment of the address is not suitable for media and write mode. Alignment to 32 kB blocks is supposed to be safe with DVD media. Call burn_disc_get_multi_caps() can obtain the necessary media info. See resulting struct burn_multi_caps elements .start_adr , .start_alignment , .start_range_low , .start_range_high .

Parameters:
opts The write opts to change
value The address in bytes (-1 = start at default address)
Since:
0.3.0
void burn_write_opts_set_stream_recording ( struct burn_write_opts *  opts,
int  value 
)

Eventually makes use of the more modern write command AAh WRITE12 and sets the Streaming bit.

With DVD-RAM and BD this can override the traditional slowdown to half nominal speed. But if it speeds up writing then it also disables error management and correction. Weigh your priorities. This affects the write operations of burn_disc_write() and subsequent calls of burn_random_access_write().

Parameters:
opts The write opts to change
value 0=use 2Ah WRITE10, 1=use AAh WRITE12 with Streaming bit
Since:
0.6.4: >=16 use WRITE12 but not before the LBA given by value
0.4.6
void burn_write_opts_set_toc_entries ( struct burn_write_opts *  opts,
int  count,
struct burn_toc_entry toc_entries 
)

Supplies toc entries for writing - not normally required for cd mastering.

Parameters:
opts The write opts to change
count The number of entries
toc_entries 
int burn_write_opts_set_underrun_proof ( struct burn_write_opts *  opts,
int  underrun_proof 
)

Controls buffer underrun prevention.

Parameters:
opts The write opts to change
underrun_proof if non-zero, buffer underrun protection is enabled
Returns:
Returns 1 on success and 0 on failure.

Referenced by libburner_payload().

int burn_write_opts_set_write_type ( struct burn_write_opts *  opts,
enum burn_write_types  write_type,
int  block_type 
)

Sets the write type for the write_opts struct.

Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.

Parameters:
opts The write opts to change
write_type The write type to use
block_type The block type to use
Returns:
Returns 1 on success and 0 on failure.

Generated on 1 Oct 2009 for libburn by  doxygen 1.6.1