00001 00002 #ifndef LIBISOBURN_LIBISOBURN_H_ 00003 #define LIBISOBURN_LIBISOBURN_H_ 00004 00005 /* 00006 Lower level API definition of libisoburn. 00007 00008 Copyright 2007-2018 Vreixo Formoso Lopes <metalpain2002@yahoo.es> 00009 and Thomas Schmitt <scdbackup@gmx.net> 00010 Provided under GPL version 2 or later. 00011 */ 00012 00013 #ifdef __cplusplus 00014 extern "C" { 00015 #endif 00016 00017 /** Overview 00018 00019 libisoburn is a frontend for libraries libburn and libisofs which enables 00020 creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported 00021 by libburn. This includes media like DVD+RW, which do not support multi-session 00022 management on media level and even plain disk files or block devices. 00023 00024 The price for that is thorough specialization on data files in ISO-9660 00025 filesystem images. So libisoburn is not suitable for audio (CD-DA) or any 00026 other CD layout which does not entirely consist of ISO-9660 sessions. 00027 00028 Note that there is a higher level of API: xorriso.h. One should not mix it 00029 with the API calls of libisoburn.h, libisofs.h, and libburn.h. 00030 00031 00032 Connector functions 00033 00034 libisofs and libburn do not depend on each other but share some interfaces 00035 by which they can cooperate. 00036 libisoburn establishes the connection between both modules by creating the 00037 necessary interface objects and attaching them to the right places. 00038 00039 00040 Wrapper functions 00041 00042 The principle of this frontend is that you may use any call of libisofs or 00043 libburn unless it has a isoburn_*() wrapper listed in the following function 00044 documentation. 00045 00046 E.g. call isoburn_initialize() rather than iso_init(); burn_initialize(); 00047 and call isoburn_drive_scan_and_grab() rather than burn_drive_scan_and_grab(). 00048 But you may call burn_disc_get_profile() directly if you want to display 00049 the media type. 00050 00051 The wrappers will transparently provide the necessary emulations which 00052 are appropriate for particular target drives and media states. 00053 To learn about them you have to read both API descriptions: the one of 00054 the wrapper and the one of the underlying libburn or libisofs call. 00055 00056 Macros BURN_* and functions burn_*() are documented in <libburn1/libburn.h> 00057 Macros ISO_* and functions iso_*() are documented in <libisofs1/libisofs.h> 00058 00059 00060 Usage model 00061 00062 There may be an input drive and an output drive. Either of them may be missing 00063 with the consequence that no reading or no writing is possible. 00064 Both drive roles can be fulfilled by the same drive. 00065 00066 Input can be a random access readable libburn drive: 00067 optical media, regular files, block devices. 00068 Output can be any writeable libburn drive: 00069 writeable optical media in burner, writeable file objects (no directories). 00070 00071 libburn demands rw-permissions to drive device file or file object. 00072 00073 If the input drive provides a suitable ISO RockRidge image, then its tree 00074 may be loaded into memory and can then be manipulated by libisofs API calls. 00075 The loading is done by isoburn_read_image() under control of 00076 struct isoburn_read_opts which the application obtains from libisoburn 00077 and manipulates by the family of isoburn_ropt_set_*() functions. 00078 00079 Writing of result images is controlled by libisofs related parameters 00080 in a struct isoburn_imgen_opts which the application obtains from libisoburn 00081 and manipulates by the family of isoburn_igopt_set_*() functions. 00082 00083 All multi-session aspects are handled by libisoburn according to these 00084 settings. The application does not have to analyze media state and write 00085 job parameters. It rather states its desires which libisoburn tries to 00086 fulfill, or else will refuse to start the write run. 00087 00088 00089 Setup for Growing, Modifying or Blind Growing 00090 00091 The connector function family offers alternative API calls for performing 00092 the setup for several alternative image generation strategies. 00093 00094 Growing: 00095 If input and output drive are the same, then isoburn_prepare_disc() is to 00096 be used. It will lead to an add-on session on appendable or overwriteable 00097 media with existing ISO image. With blank media it will produce a first 00098 session. 00099 00100 Modifying: 00101 If the output drive is not the input drive, and if it bears blank media 00102 or overwriteable without a valid ISO image, then one may produce a consolidated 00103 image with old and new data. This will copy file data from an eventual input 00104 drive with valid image, add any newly introduced data from the local 00105 filesystem, and produce a first session on output media. 00106 To prepare for such an image generation run, use isoburn_prepare_new_image(). 00107 00108 Blind Growing: 00109 This method reads the old image from one drive and writes the add-on session 00110 to a different drive. That output drive is nevertheless supposed to 00111 finally lead to the same medium from where the session was loaded. Usually it 00112 will be stdio:/dev/fd/1 (i.e. stdout) being piped into some burn program 00113 like with this classic gesture: 00114 mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev 00115 Blind growing is prepared by the call isoburn_prepare_blind_grow(). 00116 The input drive should be released immediately after this call in order 00117 to allow the consumer of the output stream to access that drive for writing. 00118 00119 After either of these setups, some peripheral libburn drive parameter settings 00120 like burn_write_opts_set_simulate(), burn_write_opts_set_multi(), 00121 burn_drive_set_speed(), burn_write_opts_set_underrun_proof() should be made. 00122 Do not set the write mode. It will be chosen by libisoburn so it matches job 00123 and media state. 00124 00125 Writing the image 00126 00127 Then one may start image generation and write threads by isoburn_disc_write(). 00128 Progress may be watched at the output drive by burn_drive_get_status() and 00129 isoburn_get_fifo_status(). 00130 00131 At some time, the output drive will be BURN_DRIVE_IDLE indicating that 00132 writing has ended. 00133 One should inquire isoburn_drive_wrote_well() to learn about overall success. 00134 00135 Finally one must call isoburn_activate_session() which will complete any 00136 eventual multi-session emulation. 00137 00138 00139 Application Constraints 00140 00141 Applications shall include libisofs1/libisofs.h , libburn1/libburn.h and this 00142 file itself: libisoburn/libisoburn.h . 00143 They shall link with -lisofs -lburn -lisoburn or with the .o files emerging 00144 from building those libraries from their sources. 00145 00146 Applications must use 64 bit off_t. 00147 E.g. on 32-bit GNU/Linux by defining 00148 #define _LARGEFILE_SOURCE 00149 #define _FILE_OFFSET_BITS 64 00150 The minimum requirement is to interface with the library by 64 bit signed 00151 integers where libisofs.h or libisoburn.h prescribe off_t. 00152 Failure to do so may result in surprising malfunction or memory faults. 00153 00154 Application files which include libisofs1/libisofs.h or libisoburn/libisoburn.h 00155 must provide definitions for uint32_t and uint8_t. 00156 This can be achieved either: 00157 - by using autotools which will define HAVE_STDINT_H or HAVE_INTTYPES_H 00158 according to its ./configure tests, 00159 - or by defining the macros HAVE_STDINT_H or HAVE_INTTYPES_H according 00160 to the local situation, 00161 - or by appropriately defining uint32_t and uint8_t by other means, 00162 e.g. by including inttypes.h before including libisofs.h and libisoburn.h 00163 00164 */ 00165 #ifdef HAVE_STDINT_H 00166 #include <stdint.h> 00167 #else 00168 #ifdef HAVE_INTTYPES_H 00169 #include <inttypes.h> 00170 #endif 00171 #endif 00172 00173 00174 /* Important: If you add a public API function then add its name to file 00175 libisoburn/libisoburn.ver 00176 */ 00177 00178 00179 /* API functions */ 00180 00181 00182 /** Initialize libisoburn, libisofs and libburn. 00183 Wrapper for : iso_init() and burn_initialize() 00184 @since 0.1.0 00185 @param msg A character array for eventual messages (e.g. with errors) 00186 @param flag Bitfield for control purposes (unused yet, submit 0) 00187 @return 1 indicates success, 0 is failure 00188 */ 00189 int isoburn_initialize(char msg[1024], int flag); 00190 00191 00192 /** Check whether all features of header file libisoburn.h from the given 00193 major.minor.micro revision triple can be delivered by the library version 00194 which is performing this call. 00195 An application of libisoburn can easily memorize the version of the 00196 libisoburn.h header in its own code. Immediately after isoburn_initialize() 00197 it should simply do this check: 00198 if (! isoburn_is_compatible(isoburn_header_version_major, 00199 isoburn_header_version_minor, 00200 isoburn_header_version_micro, 0)) 00201 ...refuse to start the program with this dynamic library version... 00202 @since 0.1.0 00203 @param major obtained at build time 00204 @param minor obtained at build time 00205 @param micro obtained at build time 00206 @param flag Bitfield for control purposes. Unused yet. Submit 0. 00207 @return 1= library can work for caller 00208 0= library is not usable in some aspects. Caller must restrict 00209 itself to an earlier API version or must not use this libray 00210 at all. 00211 */ 00212 int isoburn_is_compatible(int major, int minor, int micro, int flag); 00213 00214 00215 /** Obtain the three release version numbers of the library. These are the 00216 numbers encountered by the application when linking with libisoburn, 00217 i.e. possibly not before run time. 00218 Better do not base the fundamental compatibility decision of an application 00219 on these numbers. For a reliable check use isoburn_is_compatible(). 00220 @since 0.1.0 00221 @param major The maturity version (0 for now, as we are still learning) 00222 @param minor The development goal version. 00223 @param micro The development step version. This has an additional meaning: 00224 00225 Pare numbers indicate a version with frozen API. I.e. you can 00226 rely on the same set of features to be present in all 00227 published releases with that major.minor.micro combination. 00228 Features of a pare release will stay available and ABI 00229 compatible as long as the SONAME of libisoburn stays "1". 00230 Currently there are no plans to ever change the SONAME. 00231 00232 Odd numbers indicate that API upgrades are in progress. 00233 I.e. new features might be already present or they might 00234 be still missing. Newly introduced features may be changed 00235 incompatibly or even be revoked before release of a pare 00236 version. 00237 So micro revisions {1,3,5,7,9} should never be used for 00238 dynamic linking unless the proper library match can be 00239 guaranteed by external circumstances. 00240 00241 @return 1 success, <=0 might in future become an error indication 00242 */ 00243 void isoburn_version(int *major, int *minor, int *micro); 00244 00245 00246 /** The minimum version of libisofs to be used with this version of libisoburn 00247 at compile time. 00248 @since 0.1.0 00249 */ 00250 #define isoburn_libisofs_req_major 1 00251 #define isoburn_libisofs_req_minor 5 00252 #define isoburn_libisofs_req_micro 0 00253 00254 /** The minimum version of libburn to be used with this version of libisoburn 00255 at compile time. 00256 @since 0.1.0 00257 */ 00258 #define isoburn_libburn_req_major 1 00259 #define isoburn_libburn_req_minor 5 00260 #define isoburn_libburn_req_micro 0 00261 00262 /** The minimum compile time requirements of libisoburn towards libjte are 00263 the same as of a suitable libisofs towards libjte. 00264 So use these macros from libisofs.h : 00265 iso_libjte_req_major 00266 iso_libjte_req_minor 00267 iso_libjte_req_micro 00268 @since 0.6.4 00269 */ 00270 00271 /** The minimum version of libisofs to be used with this version of libisoburn 00272 at runtime. This is checked already in isoburn_initialize() which will 00273 refuse on outdated version. So this call is for information purposes after 00274 successful startup only. 00275 @since 0.1.0 00276 @param major isoburn_libisofs_req_major as seen at build time 00277 @param minor as seen at build time 00278 @param micro as seen at build time 00279 @return 1 success, <=0 might in future become an error indication 00280 */ 00281 int isoburn_libisofs_req(int *major, int *minor, int *micro); 00282 00283 00284 /** The minimum version of libjte to be used with this version of libisoburn 00285 at runtime. The use of libjte is optional and depends on configure 00286 tests. It can be prevented by ./configure option --disable-libjte . 00287 This is checked already in isoburn_initialize() which will refuse on 00288 outdated version. So this call is for information purposes after 00289 successful startup only. 00290 @since 0.6.4 00291 */ 00292 int isoburn_libjte_req(int *major, int *minor, int *micro); 00293 00294 00295 /** The minimum version of libburn to be used with this version of libisoburn 00296 at runtime. This is checked already in isoburn_initialize() which will 00297 refuse on outdated version. So this call is for information purposes after 00298 successful startup only. 00299 @since 0.1.0 00300 @param major isoburn_libburn_req_major as seen at build time 00301 @param minor as seen at build time 00302 @param micro as seen at build time 00303 @return 1 success, <=0 might in future become an error indication 00304 */ 00305 int isoburn_libburn_req(int *major, int *minor, int *micro); 00306 00307 00308 /** These three release version numbers tell the revision of this header file 00309 and of the API it describes. They are memorized by applications at build 00310 time. 00311 @since 0.1.0 00312 */ 00313 #define isoburn_header_version_major 1 00314 #define isoburn_header_version_minor 5 00315 #define isoburn_header_version_micro 0 00316 /** Note: 00317 Above version numbers are also recorded in configure.ac because libtool 00318 wants them as parameters at build time. 00319 For the library compatibility check, ISOBURN_*_VERSION in configure.ac 00320 are not decisive. Only the three numbers here do matter. 00321 */ 00322 /** Usage discussion: 00323 00324 Some developers of the libburnia project have differing 00325 opinions how to ensure the compatibility of libaries 00326 and applications. 00327 00328 It is about whether to use at compile time and at runtime 00329 the version numbers isoburn_header_version_* provided here. 00330 Thomas Schmitt advises to use them. 00331 Vreixo Formoso advises to use other means. 00332 00333 At compile time: 00334 00335 Vreixo Formoso advises to leave proper version matching 00336 to properly programmed checks in the the application's 00337 build system, which will eventually refuse compilation. 00338 00339 Thomas Schmitt advises to use the macros defined here 00340 for comparison with the application's requirements of 00341 library revisions and to eventually break compilation. 00342 00343 Both advises are combinable. I.e. be master of your 00344 build system and have #if checks in the source code 00345 of your application, nevertheless. 00346 00347 At runtime (via *_is_compatible()): 00348 00349 Vreixo Formoso advises to compare the application's 00350 requirements of library revisions with the runtime 00351 library. This is to allow runtime libraries which are 00352 young enough for the application but too old for 00353 the lib*.h files seen at compile time. 00354 00355 Thomas Schmitt advises to compare the header 00356 revisions defined here with the runtime library. 00357 This is to enforce a strictly monotonous chain 00358 of revisions from app to header to library, 00359 at the cost of excluding some older libraries. 00360 00361 These two advises are mutually exclusive. 00362 00363 ----------------------------------------------------- 00364 00365 For an implementation of the Thomas Schmitt approach, 00366 see libisoburn/burn_wrap.c : isoburn_initialize() 00367 This connects libisoburn as "application" with libisofs 00368 as "library". 00369 00370 The compatible part of Vreixo Formoso's approach is implemented 00371 in configure.ac LIBBURN_REQUIRED, LIBISOFS_REQUIRED. 00372 In isoburn_initialize() it would rather test by 00373 iso_lib_is_compatible(isoburn_libisofs_req_major,... 00374 than by 00375 iso_lib_is_compatible(iso_lib_header_version_major,... 00376 and would leave out the ugly compile time traps. 00377 00378 */ 00379 00380 00381 /** Announce to the library an application provided method for immediate 00382 delivery of messages. It is used when no drive is affected directly or 00383 if the drive has no own msgs_submit() method attached by 00384 isoburn_drive_set_msgs_submit. 00385 If no method is preset or if the method is set to NULL then libisoburn 00386 delivers its messages through the message queue of libburn. 00387 @param msgs_submit The function call which implements the method 00388 @param submit_handle Handle to be used as first argument of msgs_submit 00389 @param submit_flag Flag to be used as last argument of msgs_submit 00390 @param flag Unused yet, submit 0 00391 @since 0.2.0 00392 */ 00393 int isoburn_set_msgs_submit(int (*msgs_submit)(void *handle, int error_code, 00394 char msg_text[], int os_errno, 00395 char severity[], int flag), 00396 void *submit_handle, int submit_flag, int flag); 00397 00398 00399 /** Acquire a target drive by its filesystem path or libburn persistent 00400 address. 00401 Wrapper for: burn_drive_scan_and_grab() 00402 @since 0.1.0 00403 @param drive_infos On success returns a one element array with the drive 00404 (cdrom/burner). Thus use with driveno 0 only. On failure 00405 the array has no valid elements at all. 00406 The returned array should be freed via burn_drive_info_free() 00407 when the drive is no longer needed. But before this is done 00408 one has to call isoburn_drive_release(drive_infos[0].drive). 00409 @param adr The persistent address of the desired drive or the path 00410 to a file object. 00411 @param load 1 attempt to load the disc tray. 0 no attempt,rather failure. 00412 @return 1 = success , 0 = drive not found , <0 = other error 00413 */ 00414 int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], 00415 char* adr, int load); 00416 00417 00418 /** Acquire a target drive by its filesystem path or libburn persistent 00419 address. This is a modern successor of isoburn_drive_scan_and_grab(). 00420 Wrapper for: burn_drive_scan_and_grab() 00421 @since 0.1.2 00422 @param drive_infos On success returns a one element array with the drive 00423 (cdrom/burner). Thus use with driveno 0 only. On failure 00424 the array has no valid elements at all. 00425 The returned array should be freed via burn_drive_info_free() 00426 when the drive is no longer needed. But before this is done 00427 one has to call isoburn_drive_release(drive_infos[0].drive). 00428 @param adr The persistent address of the desired drive or the path 00429 to a file object. 00430 @param flag bit0= attempt to load the disc tray. 00431 Else: failure if not loaded. 00432 bit1= regard overwriteable media as blank 00433 bit2= if the drive is a regular disk file: 00434 truncate it to the write start address when writing 00435 begins 00436 bit3= if the drive reports a read-only profile try to read 00437 table of content by scanning for ISO image headers. 00438 (depending on media type and drive this might 00439 help or it might make the resulting toc even worse) 00440 bit4= do not emulate table of content on overwriteable media 00441 bit5= ignore ACL from external filesystems 00442 bit6= ignore POSIX Extended Attributes from external 00443 filesystems (xattr) 00444 bit7= pretend read-only profile and scan for table of content 00445 bit8= re-assess already acquired (*drive_infos)[0] rather 00446 than acquiring adr 00447 @since 1.1.8 00448 bit9= when scanning for ISO 9660 sessions by bit3: 00449 Do not demand a valid superblock at LBA 0, ignore it in 00450 favor of one at LBA 32, and scan until end of medium. 00451 @since 1.2.6 00452 bit10= if not bit6: accept all xattr namespaces from external 00453 filesystems, not only "user.". 00454 @since 1.5.0 00455 @return 1 = success , 0 = drive not found , <0 = other error 00456 00457 Please excuse the typo "aquire" in the function name. 00458 */ 00459 int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], 00460 char* adr, int flag); 00461 00462 /** Acquire a drive from the burn_drive_info[] array which was obtained by 00463 a previous call of burn_drive_scan(). 00464 Wrapper for: burn_drive_grab() 00465 @since 0.1.0 00466 @param drive The drive to grab. E.g. drive_infos[1].drive . 00467 Call isoburn_drive_release(drive) when it it no longer needed. 00468 @param load 1 attempt to load the disc tray. 0 no attempt, rather failure. 00469 @return 1 success, <=0 failure 00470 */ 00471 int isoburn_drive_grab(struct burn_drive *drive, int load); 00472 00473 00474 /** Attach to a drive an application provided method for immediate 00475 delivery of messages. 00476 If no method is set or if the method is set to NULL then libisoburn 00477 delivers messages of the drive through the global msgs_submit() method 00478 set by isoburn_set_msgs_submiti() or by the message queue of libburn. 00479 @since 0.2.0 00480 @param d The drive to which this function, handle and flag shall apply 00481 @param msgs_submit The function call which implements the method 00482 @param submit_handle Handle to be used as first argument of msgs_submit 00483 @param submit_flag Flag to be used as last argument of msgs_submit 00484 @param flag Unused yet, submit 0 00485 */ 00486 int isoburn_drive_set_msgs_submit(struct burn_drive *d, 00487 int (*msgs_submit)(void *handle, int error_code, 00488 char msg_text[], int os_errno, 00489 char severity[], int flag), 00490 void *submit_handle, int submit_flag, int flag); 00491 00492 00493 /** Inquire the medium status. Expect the whole spectrum of libburn BURN_DISC_* 00494 with multi-session media. Emulated states with random access media are 00495 BURN_DISC_BLANK and BURN_DISC_APPENDABLE. 00496 Wrapper for: burn_disc_get_status() 00497 @since 0.1.0 00498 @param drive The drive to inquire. 00499 @return The status of the drive, or what kind of disc is in it. 00500 Note: BURN_DISC_UNGRABBED indicates wrong API usage 00501 */ 00502 #ifdef __cplusplus 00503 enum burn::burn_disc_status isoburn_disc_get_status(struct burn_drive *drive); 00504 #else 00505 enum burn_disc_status isoburn_disc_get_status(struct burn_drive *drive); 00506 #endif 00507 00508 00509 /** Sets the medium status to BURN_DISC_FULL unconditionally. 00510 @since 1.3.8 00511 @param drive The drive with the medium to be handled as if it was closed. 00512 @ 00513 */ 00514 int isoburn_disc_pretend_full_uncond(struct burn_drive *drive); 00515 00516 00517 /** Tells whether the medium can be treated by isoburn_disc_erase(). 00518 Wrapper for: burn_disc_erasable() 00519 @since 0.1.0 00520 @param d The drive to inquire. 00521 @return 0=not erasable , else erasable 00522 */ 00523 int isoburn_disc_erasable(struct burn_drive *d); 00524 00525 00526 /** Mark the medium as blank. With multi-session media this will call 00527 burn_disc_erase(). With random access media, an eventual ISO-9660 00528 filesystem will get invalidated by altering its start blocks on the medium. 00529 In case of success, the medium is in status BURN_DISC_BLANK afterwards. 00530 Wrapper for: burn_disc_erase() 00531 @since 0.1.0 00532 @param drive The drive with the medium to erase. 00533 @param fast 1=fast erase, 0=thorough erase 00534 With DVD-RW, fast erase yields media incapable of multi-session. 00535 */ 00536 void isoburn_disc_erase(struct burn_drive *drive, int fast); 00537 00538 00539 /** Set up isoburn_disc_get_msc1() to return a fabricated value. 00540 This makes only sense between acquiring the drive and reading the 00541 image. After isoburn_read_image() it will confuse the coordination 00542 of libisoburn and libisofs. 00543 Note: Sessions and tracks are counted beginning with 1, not with 0. 00544 @since 0.1.6 00545 @param d The drive where msc1 is to be set 00546 @param adr_mode Determines how to interpret adr_value and to set msc1. 00547 If adr_value shall represent a number then decimal ASCII 00548 digits are expected. 00549 0= start lba of last session in TOC, ignore adr_value 00550 1= start lba of session number given by adr_value 00551 2= start lba of track given number by adr_value 00552 3= adr_value itself is the lba to be used 00553 4= start lba of last session with volume id 00554 given by adr_value 00555 @param adr_value A string describing the value to be eventually used. 00556 @param flag Bitfield for control purposes. 00557 bit0= @since 0.2.2 00558 with adr_mode 3: adr_value might be 16 blocks too high 00559 (e.g. -C stemming from growisofs). Probe for ISO head 00560 at adr_value-16 and eventually adjust setting. 00561 bit1= insist in seeing a disc object with at least one session 00562 bit2= with adr_mode 4: use adr_value as regular expression 00563 */ 00564 int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, 00565 int flag); 00566 00567 00568 /* ----------------------------------------------------------------------- */ 00569 /* 00570 00571 Wrappers for emulation of TOC on overwriteable media 00572 00573 Media which match the overwriteable usage model lack of a history of sessions 00574 and tracks. libburn will not even hand out a burn_disc object for them and 00575 always declare them blank. libisoburn checks for a valid ISO filesystem 00576 header at LBA 0 and eventually declares them appendable. 00577 Nevertheless one can only determine an upper limit of the size of the overall 00578 image (by isoburn_get_min_start_byte()) but not a list of stored sessions 00579 and their LBAs, as it is possible with true multi-session media. 00580 00581 The following wrappers add the capability to obtain a session and track TOC 00582 from emulated multi-session images on overwriteables if the first session 00583 was written by libisoburn-0.1.6 or later (i.e. with a header copy at LBA 32). 00584 00585 Be aware that the structs emitted by these isoburn calls are not compatible 00586 with the libburn structs. I.e. you may use them only with isoburn_toc_* 00587 calls. 00588 isoburn_toc_disc needs to be freed after use. isoburn_toc_session and 00589 isoburn_toc_track vanish together with their isoburn_toc_disc. 00590 */ 00591 00592 /* Opaque handles to media, session, track */ 00593 struct isoburn_toc_disc; 00594 struct isoburn_toc_session; 00595 struct isoburn_toc_track; 00596 00597 00598 /** Obtain a master handle for the table of content. 00599 This handle governs allocated resources which have to be released by 00600 isoburn_toc_disc_free() when no longer needed. 00601 Wrapper for: burn_drive_get_disc() 00602 @since 0.1.6 00603 @param d The drive with the medium to inspect 00604 @return NULL in case there is no content info, else it is a valid handle 00605 */ 00606 struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d); 00607 00608 00609 /** Tell the number of 2048 byte blocks covered by the table of content. 00610 This number includes the eventual gaps between sessions and tracks. 00611 So this call is not really a wrapper for burn_disc_get_sectors(). 00612 @since 0.1.6 00613 @param disc The master handle of the medium 00614 @return Number of blocks, <=0 indicates unknown or unreadable state 00615 */ 00616 int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc); 00617 00618 00619 /** Get the array of session handles and the number of complete sessions 00620 from the table of content. 00621 The result array contains *num + isoburn_toc_disc_get_incmpl_sess() 00622 elements. All above *num are incomplete sessions. 00623 Typically there is at most one incomplete session with no track. 00624 Wrapper for: burn_disc_get_sessions() 00625 @since 0.1.6 00626 @param disc The master handle of the medium 00627 @param num returns the number of sessions in the array 00628 @return the address of the array of session handles 00629 */ 00630 struct isoburn_toc_session **isoburn_toc_disc_get_sessions( 00631 struct isoburn_toc_disc *disc, int *num); 00632 00633 00634 /** Obtain the number of incomplete sessions which are recorded in the 00635 result array of isoburn_toc_disc_get_sessions() after the complete 00636 sessions. See above. 00637 @since 1.2.8 00638 @param disc The master handle of the medium 00639 @return the number of incomplete sessions 00640 */ 00641 int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc); 00642 00643 00644 /** Tell the number of 2048 byte blocks covered by a particular session. 00645 Wrapper for: burn_session_get_sectors() 00646 @since 0.1.6 00647 @param s The session handle 00648 @return number of blocks, <=0 indicates unknown or unreadable state 00649 */ 00650 int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s); 00651 00652 00653 /** Obtain a copy of the entry which describes the end of a particular session. 00654 Wrapper for: burn_session_get_leadout_entry() 00655 @since 0.1.6 00656 @param s The session handle 00657 @param entry A pointer to memory provided by the caller. It will be filled 00658 with info according to struct burn_toc_entry as defined 00659 in libburn.h 00660 */ 00661 void isoburn_toc_session_get_leadout_entry(struct isoburn_toc_session *s, 00662 struct burn_toc_entry *entry); 00663 00664 00665 /** Get the array of track handles from a particular session. 00666 Wrapper for: burn_session_get_tracks() 00667 @since 0.1.6 00668 @param s The session handle 00669 @param num returns the number of tracks in the array 00670 @return the address of the array of track handles, 00671 NULL if no tracks are registered with session s 00672 */ 00673 struct isoburn_toc_track **isoburn_toc_session_get_tracks( 00674 struct isoburn_toc_session *s, int *num); 00675 00676 00677 /** Obtain a copy of the entry which describes a particular track. 00678 Wrapper for: burn_track_get_entry() 00679 @since 0.1.6 00680 @param t The track handle 00681 @param entry A pointer to memory provided by the caller. It will be filled 00682 with info according to struct burn_toc_entry as defined 00683 in libburn.h 00684 */ 00685 void isoburn_toc_track_get_entry(struct isoburn_toc_track *t, 00686 struct burn_toc_entry *entry); 00687 00688 00689 /** Obtain eventual ISO image parameters of an emulated track. This info was 00690 gained with much effort and thus gets cached in the track object. 00691 If this call returns 1 then one can save a call of isoburn_read_iso_head() 00692 with return mode 1 which could cause an expensive read operation. 00693 @since 0.4.0 00694 @param t The track handle 00695 @param start_lba Returns the start address of the ISO session 00696 @param image_blocks Returns the number of 2048 bytes blocks 00697 @param volid Caller provided memory for the volume id 00698 @param flag unused yet, submit 0 00699 @return 0= not an emulated ISO session , 1= reply is valid 00700 */ 00701 int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba, 00702 int *image_blocks, char volid[33], int flag); 00703 00704 00705 00706 /** Release the memory associated with a master handle of a medium. 00707 The handle is invalid afterwards and may not be used any more. 00708 Wrapper for: burn_disc_free() 00709 @since 0.1.6 00710 @param disc The master handle of the medium 00711 */ 00712 void isoburn_toc_disc_free(struct isoburn_toc_disc *disc); 00713 00714 00715 /** Try whether the data at the given address look like a ISO 9660 00716 image header and obtain its alleged size. Depending on the info mode 00717 one other string of text information can be retrieved too. 00718 @since 0.1.6 00719 @param d The drive with the medium to inspect 00720 @param lba The block number from where to read 00721 @param image_blocks Returns the number of 2048 bytes blocks in the session 00722 @param info Caller provided memory, enough to take eventual info reply 00723 @param flag bit0-7: info return mode 00724 0= do not return anything in info (do not even touch it) 00725 1= copy volume id to info (info needs 33 bytes) 00726 2= @since 0.2.2 : 00727 copy 64 kB header to info (needs 65536 bytes) 00728 bit13= @since 0.2.2: 00729 Do not read head from medium but use first 64 kB from 00730 info. 00731 In this case it is permissible to submit d == NULL. 00732 bit14= check both half buffers (not only second) 00733 return 2 if found in first block 00734 bit15= return -1 on read error 00735 @return >0 seems to be a valid ISO image, 0 format not recognized, <0 error 00736 */ 00737 int isoburn_read_iso_head(struct burn_drive *d, int lba, 00738 int *image_blocks, char *info, int flag); 00739 00740 00741 /** Try to convert the given entity address into various entity addresses 00742 which would describe it. 00743 Note: Sessions and tracks are counted beginning with 1, not with 0. 00744 @since 0.3.2 00745 @param d The drive where msc1 is to be set 00746 @param adr_mode Determines how to interpret the input adr_value. 00747 If adr_value shall represent a number then decimal ASCII 00748 digits are expected. 00749 0= start lba of last session in TOC, ignore adr_value 00750 1= start lba of session number given by adr_value 00751 2= start lba of track given number by adr_value 00752 3= adr_value itself is the lba to be used 00753 4= start lba of last session with volume id 00754 given by adr_value 00755 @param adr_value A string describing the value to be eventually used. 00756 @param lba returns the block address of the entity, -1 means invalid 00757 @param track returns the track number of the entity, -1 means invalid 00758 @param session returns the session number of the entity, -1 means invalid 00759 @param volid returns the volume id of the entity if it is a ISO session 00760 @param flag Bitfield for control purposes. 00761 bit2= with adr_mode 4: use adr_value as regular expression 00762 @return <=0 error , 1 ok, ISO session, 2 ok, not an ISO session 00763 */ 00764 int isoburn_get_mount_params(struct burn_drive *d, 00765 int adr_mode, char *adr_value, 00766 int *lba, int *track, int *session, 00767 char volid[33], int flag); 00768 00769 00770 /* ----------------------------------------------------------------------- */ 00771 /* 00772 00773 Options for image reading. 00774 00775 An application shall create an option set object by isoburn_ropt_new(), 00776 program it by isoburn_ropt_set_*(), use it with isoburn_read_image(), 00777 and finally delete it by isoburn_ropt_destroy(). 00778 00779 */ 00780 /* ----------------------------------------------------------------------- */ 00781 00782 struct isoburn_read_opts; 00783 00784 /** Produces a set of image read options, initialized with default values. 00785 @since 0.1.0 00786 @param o the newly created option set object 00787 @param flag Bitfield for control purposes. Submit 0 for now. 00788 @return 1=ok , <0 = failure 00789 */ 00790 int isoburn_ropt_new(struct isoburn_read_opts **o, int flag); 00791 00792 00793 /** Deletes an option set which was created by isoburn_ropt_new(). 00794 @since 0.1.0 00795 @param o The option set to work on 00796 @param flag Bitfield for control purposes. Submit 0 for now. 00797 @return 1= **o destroyed , 0= *o was already NULL (harmless) 00798 */ 00799 int isoburn_ropt_destroy(struct isoburn_read_opts **o, int flag); 00800 00801 /** Sets the size and granularity of the cache which libisoburn provides to 00802 libisofs for reading of ISO image data. This cache consists of several 00803 tiles which are buffers of a given size. The ISO image is divided into 00804 virtual tiles of that size. A cache tile may hold an in-memory copy 00805 of such a virtual image tile. 00806 When libisofs requests to read a block, then first the cache is inquired 00807 whether it holds that block. If not, then the block is read via libburn 00808 together with its neighbors in their virtual image tile into a free 00809 cache tile. If no cache tile is free, then the one will be re-used which 00810 has the longest time of not being hit by a read attempt. 00811 00812 A larger cache might speed up image loading by reducing the number of 00813 libburn read calls on the directory tree. It might also help with 00814 reading the content of many small files, if for some reason it is not an 00815 option to sort access by LBA. 00816 Caching will not provide much benefit with libburn "stdio:" drives, 00817 because the operating system is supposed to provide the same speed-up 00818 in a more flexible way. 00819 00820 @since 1.2.2 00821 @param o The option set to work on. 00822 It is permissible to submit NULL in order to just 00823 have the parameters tested. 00824 @param cache_tiles Number of tiles in the cache. Not less than 1. 00825 Default is 32. 00826 @param tile_blocks Number of blocks per tile. Must be a power of 2. 00827 Default is 32. 00828 cache_tiles * tile_blocks * 2048 must not exceed 00829 1073741824 (= 1 GiB). 00830 @param flag Bitfield for control purposes. Unused yet. Submit 0. 00831 @return <=0 error , >0 ok 00832 */ 00833 int isoburn_ropt_set_data_cache(struct isoburn_read_opts *o, 00834 int cache_tiles, int tile_blocks, int flag); 00835 00836 /** Inquire the current settings of isoburn_set_data_cache(). 00837 @since 1.2.2 00838 @param o The option set to work on. 00839 NULL has the same effect as flag bit0. 00840 @param cache_tiles Will return the number of tiles in the cache. 00841 @param tile_blocks Will return the number of blocks per tile. 00842 @param set_flag Will return control bits. None are defined yet. 00843 @param flag Bitfield for control purposes 00844 bit0= return default values rather than current ones 00845 @return <=0 error , >0 reply is valid 00846 */ 00847 int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, 00848 int *cache_tiles, int *tile_blocks, 00849 int *set_flag, int flag); 00850 00851 00852 /** Which existing ISO 9660 extensions in the image to read or not to read. 00853 Whether to read the content of an existing image at all. 00854 The bits can be combined by | and inquired by &. 00855 @since 0.1.0 00856 @param ext Bitfield: 00857 bit0= norock 00858 Do not read Rock Ridge extensions 00859 bit1= nojoliet 00860 Do not read Joliet extensions 00861 bit2= noiso1999 00862 Do not read ISO 9660:1999 enhanced tree 00863 bit3= preferjoliet 00864 When both Joliet and RR extensions are present, the RR 00865 tree is used. If you prefer using Joliet, set this to 1. 00866 bit4= pretend_blank 00867 Always create empty image.Ignore any image on input drive. 00868 bit5= noaaip 00869 @since 0.3.4 00870 Do not load AAIP information from image. This information 00871 eventually contains ACL or XFS-style Extended Attributes. 00872 bit6= noacl 00873 @since 0.3.4 00874 Do not obtain ACL from external filesystem objects (e.g. 00875 local filesystem files). 00876 bit7= noea 00877 @since 0.3.4 00878 Do not obtain XFS-style Extended Attributes from external 00879 filesystem objects (e.g. local filesystem files). 00880 bit8= noino 00881 @since 0.4.0 00882 Do not load eventual inode numbers from RRIP entry PX, 00883 but generate a new unique inode number for each imported 00884 IsoNode object. 00885 PX inode numbers mark families of hardlinks by giving all 00886 family members the same inode number. libisofs keeps the 00887 PX inode numbers unaltered when IsoNode objects get 00888 written into an ISO image. 00889 bit9= nomd5 00890 @since 0.4.2 00891 Do not load the eventual MD5 checksum array. 00892 Do not check eventual session_md5 tags. 00893 bit10= nomd5tag 00894 @since 1.0.4 00895 Do not check eventual session_md5 tags although bit9 00896 is not set. 00897 bit11= do_ecma119_map 00898 @since 1.4.2 00899 Set iso_read_opts_set_ecma119_map() to map_mode rather 00900 than relying on the default setting of libisofs. 00901 bit12 - bit13= map_mode 00902 @since 1.4.2 00903 How to convert file names if neither Rock Ridge nor 00904 Joliet names are present and acceptable. 00905 0 = unmapped: Take name as recorded in ECMA-119 directory 00906 record (not suitable for writing them to 00907 a new ISO filesystem) 00908 1 = stripped: Like unmapped, but strip off trailing ";1" 00909 or ".;1" 00910 2 = uppercase: Like stripped, but map {a-z} to {A-Z} 00911 3 = lowercase: Like stripped, but map {A-Z} to {a-z} 00912 @return 1 success, <=0 failure 00913 */ 00914 #define isoburn_ropt_norock 1 00915 #define isoburn_ropt_nojoliet 2 00916 #define isoburn_ropt_noiso1999 4 00917 #define isoburn_ropt_preferjoliet 8 00918 #define isoburn_ropt_pretend_blank 16 00919 #define isoburn_ropt_noaaip 32 00920 #define isoburn_ropt_noacl 64 00921 #define isoburn_ropt_noea 128 00922 #define isoburn_ropt_noino 256 00923 #define isoburn_ropt_nomd5 512 00924 #define isoburn_ropt_nomd5tag 1024 00925 #define isoburn_ropt_map_unmapped ( 2048 | 0 ) 00926 #define isoburn_ropt_map_stripped ( 2048 | 4096 ) 00927 #define isoburn_ropt_map_uppercase ( 2048 | 8192 ) 00928 #define isoburn_ropt_map_lowercase ( 2048 | 12288 ) 00929 00930 int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext); 00931 int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext); 00932 00933 00934 /** Default attributes to use if no RockRidge extension gets loaded. 00935 @since 0.1.0 00936 @param o The option set to work on 00937 @param uid user id number (see /etc/passwd) 00938 @param gid group id number (see /etc/group) 00939 @param mode permissions (not file type) as of man 2 stat. 00940 With directories, r-permissions will automatically imply 00941 x-permissions. See isoburn_ropt_set_default_dirperms() below. 00942 @return 1 success, <=0 failure 00943 */ 00944 int isoburn_ropt_set_default_perms(struct isoburn_read_opts *o, 00945 uid_t uid, gid_t gid, mode_t mode); 00946 int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o, 00947 uid_t *uid, gid_t *gid, mode_t *mode); 00948 00949 /** Default attributes to use on directories if no RockRidge extension 00950 gets loaded. 00951 Above call isoburn_ropt_set_default_perms() automatically adds 00952 x-permissions to r-permissions for directories. This call here may 00953 be done afterwards to set independend permissions for directories, 00954 especially to override the automatically added x-permissions. 00955 @since 0.1.0 00956 @param o The option set to work on 00957 @param mode permissions (not file type) as of man 2 stat. 00958 @return 1 success, <=0 failure 00959 */ 00960 int isoburn_ropt_set_default_dirperms(struct isoburn_read_opts *o, 00961 mode_t mode); 00962 int isoburn_ropt_get_default_dirperms(struct isoburn_read_opts *o, 00963 mode_t *mode); 00964 00965 00966 /** Set the character set for reading RR file names from ISO images. 00967 @since 0.1.0 00968 @param o The option set to work on 00969 @param input_charset Set this to NULL to use the default locale charset 00970 For selecting a particular character set, submit its 00971 name, e.g. as listed by program iconv -l. 00972 Example: "UTF-8". 00973 @return 1 success, <=0 failure 00974 */ 00975 int isoburn_ropt_set_input_charset(struct isoburn_read_opts *o, 00976 char *input_charset); 00977 int isoburn_ropt_get_input_charset(struct isoburn_read_opts *o, 00978 char **input_charset); 00979 00980 00981 /** 00982 Enable or disable methods to automatically choose an input charset. 00983 This eventually overrides the name set via isoburn_ropt_set_input_charset() 00984 @since 0.3.8 00985 @param o The option set to work on 00986 @param mode Bitfield for control purposes: 00987 bit0= set the input character set automatically from 00988 attribute "isofs.cs" of root directory. 00989 Submit any other bits with value 0. 00990 @return 1 success, <=0 failure 00991 */ 00992 int isoburn_ropt_set_auto_incharset(struct isoburn_read_opts *o, int mode); 00993 int isoburn_ropt_get_auto_incharset(struct isoburn_read_opts *o, int *mode); 00994 00995 00996 /** Control an offset to be applied to all block address pointers in the ISO 00997 image in order to compensate for an eventual displacement of the image 00998 relative to the start block address for which it was produced. 00999 E.g. if track number 2 from CD gets copied into a disk file and shall then 01000 be loaded as ISO filesystem, then the directory tree and all data file 01001 content of the track copy will become readable by setting the track start 01002 address as displacement and -1 as displacement_sign. 01003 Data file content outside the track will of course not be accessible and 01004 eventually produce read errors. 01005 @since 0.6.6 01006 @param o The option set to work on 01007 @param displacement 0 or a positive number 01008 @param displacement_sign Determines wether to add or subtract displacement 01009 to block addresses before applying them to the 01010 storage object for reading: 01011 +1 = add , -1= subtract , else keep unaltered 01012 */ 01013 int isoburn_ropt_set_displacement(struct isoburn_read_opts *o, 01014 uint32_t displacement, int displacement_sign); 01015 int isoburn_ropt_get_displacement(struct isoburn_read_opts *o, 01016 uint32_t *displacement, int *displacement_sign); 01017 01018 /* If you get here because of a compilation error like 01019 01020 /usr/include/libisoburn/libisoburn.h:895: error: 01021 expected declaration specifiers or '...' before 'uint32_t' 01022 01023 then see above paragraph "Application Constraints" about the definition 01024 of uint32_t. 01025 */ 01026 01027 /** Set the name truncation mode and the maximum name length for imported 01028 file objects. 01029 @since 1.4.2 01030 @param o The option set to work on 01031 @param mode 0= Do not truncate but throw error 01032 ISO_RR_NAME_TOO_LONG if a file name 01033 is longer than parameter length. 01034 1= Truncate to length and overwrite the last 01035 32 bytes of that length by the hex 01036 representation of ithe MD5 of the whole 01037 oversized name. 01038 Potential incomplete UTF-8 characters will 01039 get their leading bytes replaced by '_'. 01040 This is the default. 01041 @param length Maximum byte count of a file name. Permissible 01042 values are 64 to 255. Default is 255. 01043 01044 */ 01045 int isoburn_ropt_set_truncate_mode(struct isoburn_read_opts *o, 01046 int mode, int length); 01047 int isoburn_ropt_get_truncate_mode(struct isoburn_read_opts *o, 01048 int *mode, int *length); 01049 01050 01051 /** After calling function isoburn_read_image() there are informations 01052 available in the option set. 01053 This info can be obtained as bits in parameter has_what. Like: 01054 joliet_available = (has_what & isoburn_ropt_has_joliet); 01055 @since 0.1.0 01056 @param o The option set to work on 01057 @param size Number of image data blocks, 2048 bytes each. 01058 @param has_what Bitfield: 01059 bit0= has_rockridge 01060 RockRidge extension info is available (POSIX filesystem) 01061 bit1= has_joliet 01062 Joliet extension info is available (suitable for MS-Windows) 01063 bit2= has_iso1999 01064 ISO version 2 Enhanced Volume Descriptor is available. 01065 This is rather exotic. 01066 bit3= has_el_torito 01067 El-Torito boot record is present 01068 @return 1 success, <=0 failure 01069 */ 01070 #define isoburn_ropt_has_rockridge 1 01071 #define isoburn_ropt_has_joliet 2 01072 #define isoburn_ropt_has_iso1999 4 01073 #define isoburn_ropt_has_el_torito 8 01074 01075 int isoburn_ropt_get_size_what(struct isoburn_read_opts *o, 01076 uint32_t *size, int *has_what); 01077 01078 /* ts A90122 */ 01079 /* >>> to be implemented: 01080 #define isoburn_ropt_has_acl 64 01081 #define isoburn_ropt_has_ea 128 01082 */ 01083 01084 01085 01086 /* ----------------------------------------------------------------------- */ 01087 /* End of Options for image reading */ 01088 /* ----------------------------------------------------------------------- */ 01089 01090 /* ----------------------------------------------------------------------- */ 01091 /* 01092 01093 Options for image generation by libisofs and image transport to libburn. 01094 01095 An application shall create an option set by isoburn_igopt_new(), 01096 program it by isoburn_igopt_set_*(), use it with either 01097 isoburn_prepare_new_image() or isoburn_prepare_disc(), and finally delete 01098 it by isoburn_igopt_destroy(). 01099 01100 */ 01101 /* ----------------------------------------------------------------------- */ 01102 01103 struct isoburn_imgen_opts; 01104 01105 /** Produces a set of generation and transfer options, initialized with default 01106 values. 01107 @since 0.1.0 01108 @param o the newly created option set object 01109 @param flag Bitfield for control purposes. Submit 0 for now. 01110 @return 1=ok , <0 = failure 01111 */ 01112 int isoburn_igopt_new(struct isoburn_imgen_opts **o, int flag); 01113 01114 01115 /** Deletes an option set which was created by isoburn_igopt_new(). 01116 @since 0.1.0 01117 @param o The option set to give up 01118 @param flag Bitfield for control purposes. Submit 0 for now. 01119 @return 1= **o destroyed , 0= *o was already NULL (harmless) 01120 */ 01121 int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag); 01122 01123 01124 /** ISO level to write at. 01125 @since 0.1.0 01126 @param o The option set to work on 01127 @param level is a term of the ISO 9660 standard. It should be one of: 01128 1= filenames restricted to form 8.3 01129 2= filenames allowed up to 31 characters 01130 3= file content may be larger than 4 GB - 1. 01131 @return 1 success, <=0 failure 01132 */ 01133 int isoburn_igopt_set_level(struct isoburn_imgen_opts *o, int level); 01134 int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level); 01135 01136 01137 /** Which extensions to support. 01138 @since 0.1.0 01139 @param o The option set to work on 01140 @param ext Bitfield: 01141 bit0= rockridge 01142 Rock Ridge extensions add POSIX file attributes like 01143 owner, group, access permissions, long filenames. Very 01144 advisable if the designed audience has Unix style systems. 01145 bit1= joliet 01146 Longer filenames for Windows systems. 01147 Weaker than RockRidge, but also readable with GNU/Linux. 01148 bit2= iso1999 01149 This is rather exotic. Better do not surprise the readers. 01150 bit3= hardlinks 01151 Enable hardlink consolidation. IsoNodes which refer to the 01152 same source object and have the same properties will get 01153 the same ISO image inode numbers. 01154 If combined with isoburn_igopt_rrip_version_1_10 below, 01155 then the PX entry layout of RRIP-1.12 will be used within 01156 RRIP-1.10 (mkisofs does this without causing visible trouble). 01157 bit5= aaip 01158 The libisofs specific SUSP based extension of ECMA-119 which 01159 can encode ACL and XFS-style Extended Attributes. 01160 bit6= session_md5 01161 @since 0.4.2 01162 Produce and write MD5 checksum tags of superblock, directory 01163 tree, and the whole session stream. 01164 bit7= file_md5 01165 @since 0.4.2 01166 Produce and write MD5 checksums for each single IsoFile. 01167 bit8= file_stability (only together with file_md5) 01168 @since 0.4.2 01169 Compute MD5 of each file before copying it into the image and 01170 compare this with the MD5 of the actual copying. If they do 01171 not match then issue MISHAP event. 01172 See also libisofs.h iso_write_opts_set_record_md5() 01173 bit9= no_emul_toc 01174 @since 0.5.8 01175 On overwriteable media or random access files do not write 01176 the first session to LBA 32 and do not copy the first 64kB 01177 of the first session to LBA 0, but rather write the first 01178 session to LBA 0 directly. 01179 bit10= will_cancel 01180 @since 0.6.6 01181 Announce to libisofs that only the image size is desired 01182 and that the write thread will be cancelled by 01183 isoburn_cancel_prepared_write() before actual image writing 01184 occurs. Without this, cancellation can cause a MISHAP event. 01185 bit11= old_empty 01186 @since 1.0.2 01187 Let symbolic links and device files point to block 0, and let 01188 empty data files point to the address of the Volume Descriptor 01189 Set Terminator. This was done by libisofs in the past. 01190 By default there is now a single dedicated block of zero bytes 01191 after the end of the directory trees, of which the address 01192 is used for all files without own content. 01193 bit12= hfsplus 01194 @since 1.2.4 01195 Produce a HFS+ partition inside the ISO image and announce it 01196 by an Apple Partition Map in the System Area. 01197 >>> GPT production ? 01198 Caution: Interferes with isoburn_igopt_set_system_area() by 01199 overwriting the first 8 bytes of the data, and 01200 several blocks of 2 KiB after the first one. 01201 bit13= fat 01202 @since 1.2.4 01203 >>> Not yet implemented. Planned to co-exist with hfsplus. 01204 Produce a FAT32 partition inside the ISO image and announce it 01205 by an MBR partition entry in the System Area. 01206 Caution: Interferes with isoburn_igopt_set_system_area() by 01207 >>> what impact ? 01208 01209 @return 1 success, <=0 failure 01210 */ 01211 #define isoburn_igopt_rockridge 1 01212 #define isoburn_igopt_joliet 2 01213 #define isoburn_igopt_iso1999 4 01214 #define isoburn_igopt_hardlinks 8 01215 #define isoburn_igopt_aaip 32 01216 #define isoburn_igopt_session_md5 64 01217 #define isoburn_igopt_file_md5 128 01218 #define isoburn_igopt_file_stability 256 01219 #define isoburn_igopt_no_emul_toc 512 01220 #define isoburn_igopt_will_cancel 1024 01221 #define isoburn_igopt_old_empty 2048 01222 #define isoburn_igopt_hfsplus 4096 01223 #define isoburn_igopt_fat 8192 01224 int isoburn_igopt_set_extensions(struct isoburn_imgen_opts *o, int ext); 01225 int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext); 01226 01227 /** Relaxed constraints. Setting any of the bits to 1 break the specifications, 01228 but it is supposed to work on most moderns systems. Use with caution. 01229 @since 0.1.0 01230 @param o The option set to work on 01231 @param relax Bitfield: 01232 bit0= omit_version_numbers 01233 Omit the version number (";1") at the end of the 01234 ISO-9660 and Joliet identifiers. 01235 Version numbers are usually not used by readers. 01236 bit1= allow_deep_paths 01237 Allow ISO-9660 directory hierarchy to be deeper 01238 than 8 levels. 01239 bit2= allow_longer_paths 01240 Allow path in the ISO-9660 tree to have more than 01241 255 characters. 01242 bit3= max_37_char_filenames 01243 Allow a single file or directory hierarchy to have 01244 up to 37 characters. This is larger than the 31 01245 characters allowed by ISO level 2, and the extra space 01246 is taken from the version number, so this also forces 01247 omit_version_numbers. 01248 bit4= no_force_dots 01249 ISO-9660 forces filenames to have a ".", that separates 01250 file name from extension. libisofs adds it if original 01251 filename has none. Set this to 1 to prevent this 01252 behavior. 01253 bit5= allow_lowercase 01254 Allow lowercase characters in ISO-9660 filenames. 01255 By default, only uppercase characters, numbers and 01256 a few other characters are allowed. 01257 bit6= allow_full_ascii 01258 Allow all ASCII characters to be appear on an ISO-9660 01259 filename. Note that "/" and "\0" characters are never 01260 allowed, even in RR names. 01261 bit7= joliet_longer_paths 01262 Allow paths in the Joliet tree to have more than 01263 240 characters. 01264 bit8= always_gmt 01265 Write timestamps as GMT although the specs prescribe local 01266 time with eventual non-zero timezone offset. Negative 01267 timezones (west of GMT) can trigger bugs in some operating 01268 systems which typically appear in mounted ISO images as if 01269 the timezone shift from GMT was applied twice 01270 (e.g. in New York 22:36 becomes 17:36). 01271 bit9= rrip_version_1_10 01272 Write Rock Ridge info as of specification RRIP-1.10 rather 01273 than RRIP-1.12: signature "RRIP_1991A" rather than 01274 "IEEE_1282", field PX without file serial number. 01275 bit10= dir_rec_mtime 01276 Store as ECMA-119 Directory Record timestamp the mtime 01277 of the source rather than the image creation time. 01278 bit11= aaip_susp_1_10 01279 Write AAIP fields without announcing AAIP by an ER field and 01280 without distinguishing RRIP fields from the AAIP field by 01281 prefixed ES fields. This saves 5 to 10 bytes per file and 01282 might avoid problems with readers which only accept RRIP. 01283 SUSP-1.10 allows it, SUSP-1.12 frowns on it. 01284 bit12= only_iso_numbers 01285 Same as bit1 omit_version_number but restricted to the names 01286 in the eventual Joliet tree. 01287 @since 0.5.4 01288 For reasons of backward compatibility it is not possible yet 01289 to disable version numbers for ISO 9660 while enabling them 01290 for Joliet. 01291 bit13= no_j_force_dots 01292 Same as no_force_dots but affecting the names in the eventual 01293 Joliet tree rather than the ISO 9660 / ECMA-119 names. 01294 @since 0.5.4 01295 Previous versions added dots to Joliet names unconditionally. 01296 bit14= allow_dir_id_ext 01297 Convert directory names for ECMA-119 similar to other file 01298 names, but do not force a dot or add a version number. 01299 This violates ECMA-119 by allowing one "." and especially 01300 ISO level 1 by allowing DOS style 8.3 names rather than 01301 only 8 characters. 01302 (mkisofs and its clones obviously do this violation.) 01303 @since 1.0.0 01304 bit15= joliet_long_names 01305 Allow for Joliet leaf names up to 103 characters rather than 01306 up to 64. 01307 @since 1.0.6 01308 bit16= joliet_rec_mtime 01309 Like dir_rec_mtime, but for the Joliet tree. 01310 @since 1.2.0 01311 bit17= iso1999_rec_mtime 01312 Like dir_rec_mtime, but for the ISO 9660:1999 tree. 01313 @since 1.2.0 01314 bit18= allow_7bit_ascii 01315 Like allow_full_ascii, but only allowing 7-bit characters. 01316 Lowercase letters get mapped to uppercase if not 01317 allow_lowercase is set. 01318 Gets overridden if allow_full_ascii is enabled. 01319 bit19= joliet_utf16 01320 Encode Joliet names by character set UTF-16BE rather than 01321 UCS-2. The difference is with characters which are not present 01322 in UCS-2 and get encoded in UTF-16 by 2 words of 16 bit each. 01323 Both words then stem from a reserved subset of UCS-2. 01324 @since 1.3.6 01325 @return 1 success, <=0 failure 01326 */ 01327 #define isoburn_igopt_omit_version_numbers 1 01328 #define isoburn_igopt_allow_deep_paths 2 01329 #define isoburn_igopt_allow_longer_paths 4 01330 #define isoburn_igopt_max_37_char_filenames 8 01331 #define isoburn_igopt_no_force_dots 16 01332 #define isoburn_igopt_allow_lowercase 32 01333 #define isoburn_igopt_allow_full_ascii 64 01334 #define isoburn_igopt_joliet_longer_paths 128 01335 #define isoburn_igopt_always_gmt 256 01336 #define isoburn_igopt_rrip_version_1_10 512 01337 #define isoburn_igopt_dir_rec_mtime 1024 01338 #define isoburn_igopt_aaip_susp_1_10 2048 01339 #define isoburn_igopt_only_iso_versions 4096 01340 #define isoburn_igopt_no_j_force_dots 8192 01341 #define isoburn_igopt_allow_dir_id_ext 16384 01342 #define isoburn_igopt_joliet_long_names 32768 01343 #define isoburn_igopt_joliet_rec_mtime 0x10000 01344 #define isoburn_igopt_iso1999_rec_mtime 0x20000 01345 #define isoburn_igopt_allow_7bit_ascii 0x40000 01346 #define isoburn_igopt_joliet_utf16 0x80000 01347 int isoburn_igopt_set_relaxed(struct isoburn_imgen_opts *o, int relax); 01348 int isoburn_igopt_get_relaxed(struct isoburn_imgen_opts *o, int *relax); 01349 01350 01351 /** If not isoburn_igopt_allow_deep_paths is in effect, then it may become 01352 necessary to relocate directories so that no ECMA-119 file path 01353 has more than 8 components. These directories are grafted into either 01354 the root directory of the ISO image or into a dedicated relocation 01355 directory. For details see libisofs.h. 01356 Wrapper for: iso_write_opts_set_rr_reloc() 01357 @since 1.2.2 01358 @param o The option set to work on 01359 @param name The name of the relocation directory in the root directory. 01360 Do not prepend "/". An empty name or NULL will direct 01361 relocated directories into the root directory. This is the 01362 default. 01363 If the given name does not exist in the root directory when 01364 isoburn_disc_write() is called, and if there are directories 01365 at path level 8, then directory /name will be created 01366 automatically. 01367 @param flags Bitfield for control purposes. 01368 bit0= Mark the relocation directory by a Rock Ridge RE entry, 01369 if it gets created during isoburn_disc_write(). This 01370 will make it invisible for most Rock Ridge readers. 01371 bit1= not settable via API (used internally) 01372 @return > 0 success, <= 0 failure 01373 */ 01374 int isoburn_igopt_set_rr_reloc(struct isoburn_imgen_opts *o, char *name, 01375 int flags); 01376 01377 /** Obtain the settings of isoburn_igopt_set_rr_reloc(). 01378 @since 1.2.2 01379 @param o The option set to work on 01380 @param name Will return NULL or a pointer to the name of the relocation 01381 directory in the root directory. Do not alter or dispose the 01382 memory which holds this name. 01383 @param flags Will return the flags bitfield. 01384 @return > 0 success, <= 0 failure 01385 */ 01386 int isoburn_igopt_get_rr_reloc(struct isoburn_imgen_opts *o, char **name, 01387 int *flags); 01388 01389 01390 /** Caution: This option breaks any assumptions about names that 01391 are supported by ECMA-119 specifications. 01392 Try to omit any translation which would make a file name compliant to the 01393 ECMA-119 rules. This includes and exceeds omit_version_numbers, 01394 max_37_char_filenames, no_force_dots bit0, allow_full_ascii. Further it 01395 prevents the conversion from local character set to ASCII. 01396 The maximum name length is given by this call. If a filename exceeds 01397 this length or cannot be recorded untranslated for other reasons, then 01398 image production gets aborted. 01399 Currently the length limit is 96 characters, because an ECMA-119 directory 01400 record may at most have 254 bytes and up to 158 other bytes must fit into 01401 the record. Probably 96 more bytes can be made free for the name in future. 01402 @since 1.0.0 01403 @param o The option set to work on 01404 @param len 0 = disable this feature and perform name translation 01405 according to other settings. 01406 >0 = Omit any translation. Eventually abort image production 01407 if a name is longer than the given value. 01408 -1 = Like >0. Allow maximum possible length. 01409 isoburn_igopt_get_untranslated_name_len() will tell the 01410 effectively resulting value. 01411 @return >0 success, <=0 failure 01412 */ 01413 int isoburn_igopt_set_untranslated_name_len(struct isoburn_imgen_opts *o, 01414 int len); 01415 int isoburn_igopt_get_untranslated_name_len(struct isoburn_imgen_opts *o, 01416 int *len); 01417 01418 01419 /** Whether and how files should be sorted. 01420 @since 0.1.0 01421 @param o The option set to work on 01422 @param value Bitfield: bit0= sort_files_by_weight 01423 files should be sorted based on their weight. 01424 Weight is attributed to files in the image 01425 by libisofs call iso_node_set_sort_weight(). 01426 @return 1 success, <=0 failure 01427 */ 01428 #define isoburn_igopt_sort_files_by_weight 1 01429 int isoburn_igopt_set_sort_files(struct isoburn_imgen_opts *o, int value); 01430 int isoburn_igopt_get_sort_files(struct isoburn_imgen_opts *o, int *value); 01431 01432 01433 /** Set the override values for files and directory permissions. 01434 The parameters replace_* these take one of three values: 0, 1 or 2. 01435 If 0, the corresponding attribute will be kept as set in the IsoNode 01436 at the time of image generation. 01437 If set to 1, the corresponding attrib. will be changed by a default 01438 suitable value. 01439 With value 2, the attrib. will be changed with the value specified 01440 in the corresponding *_mode options. Note that only the permissions 01441 are set, the file type remains unchanged. 01442 @since 0.1.0 01443 @param o The option set to work on 01444 @param replace_dir_mode whether and how to override directories 01445 @param replace_file_mode whether and how to override files of other type 01446 @param dir_mode Mode to use on dirs with replace_dir_mode == 2. 01447 @param file_mode; Mode to use on files with replace_file_mode == 2. 01448 @return 1 success, <=0 failure 01449 */ 01450 int isoburn_igopt_set_over_mode(struct isoburn_imgen_opts *o, 01451 int replace_dir_mode, int replace_file_mode, 01452 mode_t dir_mode, mode_t file_mode); 01453 int isoburn_igopt_get_over_mode(struct isoburn_imgen_opts *o, 01454 int *replace_dir_mode, int *replace_file_mode, 01455 mode_t *dir_mode, mode_t *file_mode); 01456 01457 /** Set the override values values for group id and user id. 01458 The rules are like with above overriding of mode values. replace_* controls 01459 whether and how. The other two parameters provide values for eventual use. 01460 @since 0.1.0 01461 @param o The option set to work on 01462 @param replace_uid whether and how to override user ids 01463 @param replace_gid whether and how to override group ids 01464 @param uid User id to use with replace_uid == 2. 01465 @param gid Group id to use on files with replace_gid == 2. 01466 @return 1 success, <=0 failure 01467 */ 01468 int isoburn_igopt_set_over_ugid(struct isoburn_imgen_opts *o, 01469 int replace_uid, int replace_gid, 01470 uid_t uid, gid_t gid); 01471 int isoburn_igopt_get_over_ugid(struct isoburn_imgen_opts *o, 01472 int *replace_uid, int *replace_gid, 01473 uid_t *uid, gid_t *gid); 01474 01475 /** Set the charcter set to use for representing RR filenames in the image. 01476 @since 0.1.0 01477 @param o The option set to work on 01478 @param output_charset Set this to NULL to use the default output charset. 01479 For selecting a particular character set, submit its 01480 name, e.g. as listed by program iconv -l. 01481 Example: "UTF-8". 01482 @return 1 success, <=0 failure 01483 */ 01484 int isoburn_igopt_set_out_charset(struct isoburn_imgen_opts *o, 01485 char *output_charset); 01486 int isoburn_igopt_get_out_charset(struct isoburn_imgen_opts *o, 01487 char **output_charset); 01488 01489 01490 /** The number of bytes to be used for the fifo which decouples libisofs 01491 and libburn for better throughput and for reducing the risk of 01492 interrupting signals hitting the libburn thread which operates the 01493 MMC drive. 01494 The size will be rounded up to the next full 2048. 01495 Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway). 01496 @since 0.1.0 01497 @param o The option set to work on 01498 @param fifo_size Number of bytes to use 01499 @return 1 success, <=0 failure 01500 */ 01501 int isoburn_igopt_set_fifo_size(struct isoburn_imgen_opts *o, int fifo_size); 01502 int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size); 01503 01504 01505 /** Obtain after image preparation the block address where the session will 01506 start on the medium. 01507 This value cannot be set by the application but only be inquired. 01508 @since 0.1.4 01509 @param o The option set to work on 01510 @param lba The block number of the session start on the medium. 01511 <0 means that no address has been determined yet. 01512 @return 1 success, <=0 failure 01513 */ 01514 int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba); 01515 01516 01517 /** Obtain after image preparation the lowest block address of file content 01518 data. Failure can occur if libisofs is too old to provide this information, 01519 if the result exceeds 31 bit, or if the call is made before image 01520 preparation. 01521 This value cannot be set by the application but only be inquired. 01522 @since 0.3.6 01523 @param o The option set to work on 01524 @param lba The block number of the session start on the medium. 01525 <0 means that no address has been determined yet. 01526 @return 1 success, <=0 failure 01527 */ 01528 int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba); 01529 01530 01531 /** Set or get parameters "name" and "timestamp" for a scdbackup checksum 01532 tag. It will be appended to the libisofs session tag if the image starts at 01533 LBA 0. See isoburn_disc_track_lba_nwa. The scdbackup tag can be used 01534 to verify the image by command scdbackup_verify $device -auto_end. 01535 See scdbackup/README appendix VERIFY for its inner details. 01536 @since 0.4.4 01537 @param o The option set to work on 01538 @param name The tag name. 80 characters max. 01539 An empty name disables production of an scdbackup tag. 01540 @param timestamp A string of up to 13 characters YYMMDD.hhmmss 01541 A9 = 2009, B0 = 2010, B1 = 2011, ... C0 = 2020, ... 01542 @param tag_written Either NULL or the address of an array with at least 512 01543 characters. In the latter case the eventually produced 01544 scdbackup tag will be copied to this array when the image 01545 gets written. This call sets scdbackup_tag_written[0] = 0 01546 to mark its preliminary invalidity. 01547 @return 1 success, <=0 failure 01548 */ 01549 int isoburn_igopt_set_scdbackup_tag(struct isoburn_imgen_opts *o, char *name, 01550 char *timestamp, char *tag_written); 01551 int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o, 01552 char name[81], char timestamp[19], 01553 char **tag_written); 01554 01555 01556 /** Attach 32 kB of binary data which shall get written to the first 32 kB 01557 of the ISO image, the System Area. 01558 options can cause manipulations of these data before writing happens. 01559 If system area data are giveni or options bit0 is set, then bit1 of 01560 el_torito_set_isolinux_options() is automatically disabled. 01561 @since 0.5.4 01562 @param o The option set to work on 01563 @param data Either NULL or 32 kB of data. Do not submit less bytes ! 01564 @param options Can cause manipulations of submitted data before they 01565 get written: 01566 bit0= apply a --protective-msdos-label as of grub-mkisofs. 01567 This means to patch bytes 446 to 512 of the system 01568 area so that one partition is defined which begins 01569 at the second 512-byte block of the image and ends 01570 where the image ends. 01571 This works with and without system_area_data. 01572 bit1= apply isohybrid MBR patching to the system area. 01573 This works only with system area data from 01574 SYSLINUX plus an ISOLINUX boot image (see 01575 iso_image_set_boot_image()) and only if not bit0 01576 is set. 01577 bit2-7= System area type 01578 0= with bit0 or bit1: MBR 01579 else: unspecified type 01580 @since 0.6.4 01581 1= MIPS Big Endian Volume Header 01582 Submit up to 15 MIPS Big Endian boot files by 01583 iso_image_add_mips_boot_file() of libisofs. 01584 This will overwrite the first 512 bytes of 01585 the submitted data. 01586 2= DEC Boot Block for MIPS Little Endian 01587 The first boot file submitted by 01588 iso_image_add_mips_boot_file() will be activated. 01589 This will overwrite the first 512 bytes of 01590 the submitted data. 01591 @since 0.6.6 01592 3= SUN Disk Label for SUN SPARC 01593 Submit up to 7 SPARC boot images by 01594 isoburn_igopt_set_partition_img() for partition 01595 numbers 2 to 8. 01596 This will overwrite the first 512 bytes of 01597 the submitted data. 01598 @since 1.3.8 01599 4= HP-PA PALO boot sector header version 4 01600 Submit all five parameters of 01601 iso_image_set_hppa_palo() as non-NULL texts. 01602 5= HP-PA PALO boot sector header version 5 01603 Submit all five parameters of 01604 iso_image_set_hppa_palo() as non-NULL texts. 01605 bit8-9= Only with System area type 0 = MBR 01606 @since 1.0.4 01607 Cylinder alignment mode eventually pads the image 01608 to make it end at a cylinder boundary. 01609 0 = auto (align if bit1) 01610 1 = always align to cylinder boundary 01611 2 = never align to cylinder boundary 01612 bit10-13= System area sub type 01613 @since 1.2.4 01614 With type 0 = MBR: 01615 Gets overridden by bit0 and bit1. 01616 0 = no particular sub type 01617 1 = CHRP: A single MBR partition of type 0x96 01618 covers the ISO image. Not compatible with 01619 any other feature which needs to have own 01620 MBR partition entries. 01621 bit14= Only with System area type 0 = MBR 01622 GRUB2 boot provisions: 01623 @since 1.3.0 01624 Patch system area at byte 0x1b0 to 0x1b7 with 01625 (512-block address + 4) of the first boot image file. 01626 Little-endian 8-byte. 01627 Should be combined with options bit0. 01628 Will not be in effect if options bit1 is set. 01629 @return 1 success, 0 no data to get, <0 failure 01630 */ 01631 int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o, 01632 char data[32768], int options); 01633 int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o, 01634 char data[32768], int *options); 01635 01636 /** Control production of a second set of volume descriptors (superblock) 01637 and directory trees, together with a partition table in the MBR where the 01638 first partition has non-zero start address and the others are zeroed. 01639 The first partition stretches to the end of the whole ISO image. 01640 The additional volume descriptor set and trees can be used to mount the 01641 ISO image at the start of the first partition, while it is still possible 01642 to mount it via the normal first volume descriptor set and tree at the 01643 start of the image or storage device. 01644 This makes few sense on optical media. But on USB sticks it creates a 01645 conventional partition table which makes it mountable on e.g. Linux via 01646 /dev/sdb and /dev/sdb1 alike. 01647 @since 0.6.2 01648 @param opts 01649 The option set to be manipulated. 01650 @param block_offset_2k 01651 The offset of the partition start relative to device start. 01652 This is counted in 2 kB blocks. The partition table will show the 01653 according number of 512 byte sectors. 01654 Default is 0 which causes no second set and trees. 01655 If it is not 0 then it must not be smaller than 16. 01656 @param secs_512_per_head 01657 Number of 512 byte sectors per head. 1 to 63. 0=automatic. 01658 @param heads_per_cyl 01659 Number of heads per cylinder. 1 to 255. 0=automatic. 01660 @return 1 success, <=0 failure 01661 */ 01662 int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts, 01663 uint32_t block_offset_2k, 01664 int secs_512_per_head, int heads_per_cyl); 01665 int isoburn_igopt_get_part_offset(struct isoburn_imgen_opts *opts, 01666 uint32_t *block_offset_2k, 01667 int *secs_512_per_head, int *heads_per_cyl); 01668 01669 01670 /** Explicitly set the four timestamps of the emerging ISO image. 01671 Default with all parameters is 0. 01672 @since 0.5.4 01673 @param opts 01674 The option set to work on 01675 @param creation_time 01676 ECMA-119 Volume Creation Date and Time 01677 When "the information in the volume was created." 01678 A value of 0 means that the timepoint of write start is to be used. 01679 @param modification_time 01680 ECMA-119 Volume Modification Date and Time 01681 When "the informationin the volume was last modified." 01682 A value of 0 means that the timepoint of write start is to be used. 01683 @param expiration_time 01684 ECMA-119 Volume Expiration Date and Time 01685 When "the information in the volume may be regarded as obsolete." 01686 A value of 0 means that the information never shall expire. 01687 @param effective_time 01688 ECMA-119 Volume Effective Date and Time 01689 When "the information in the volume may be used." 01690 A value of 0 means that not such retention is intended. 01691 @param uuid 01692 If this text is not empty, then it overrides vol_modification_time 01693 by copying the first 16 decimal digits from uuid, eventually 01694 padding up with decimal '1', and writing a NUL-byte as timezone GMT. 01695 It should express a reasonable time in form YYYYMMDDhhmmsscc 01696 E.g.: 2010040711405800 = 7 Apr 2010 11:40:58 (+0 centiseconds) 01697 @return 1 success, <=0 failure 01698 */ 01699 int isoburn_igopt_set_pvd_times(struct isoburn_imgen_opts *opts, 01700 time_t creation_time, time_t modification_time, 01701 time_t expiration_time, time_t effective_time, 01702 char *uuid); 01703 int isoburn_igopt_get_pvd_times(struct isoburn_imgen_opts *opts, 01704 time_t *creation_time, time_t *modification_time, 01705 time_t *expiration_time, time_t *effective_time, 01706 char uuid[17]); 01707 01708 01709 /** Associate a libjte environment object to the upcoming write run. 01710 libjte implements Jigdo Template Extraction as of Steve McIntyre and 01711 Richard Atterer. 01712 A non-NULL libjte_handle will cause failure to write if libjte was not 01713 enabled in libisofs at compile time. 01714 @since 0.6.4 01715 @param opts 01716 The option set to work on 01717 @param libjte_handle 01718 Pointer to a struct libjte_env e.g. created by libjte_new(). 01719 It must stay existent from the start of image writing by 01720 isoburn_prepare_*() until the write thread has ended. 01721 E.g. until libburn indicates the end of its write run. 01722 @return 1 success, <=0 failure 01723 */ 01724 int isoburn_igopt_attach_jte(struct isoburn_imgen_opts *opts, 01725 void *libjte_handle); 01726 01727 /** Remove eventual association to a libjte environment handle. 01728 @since 0.6.4 01729 @param opts 01730 The option set to work on 01731 @param libjte_handle 01732 If not submitted as NULL, this will return the previously set 01733 libjte handle. 01734 @return 1 success, <=0 failure 01735 */ 01736 int isoburn_igopt_detach_jte(struct isoburn_imgen_opts *opts, 01737 void **libjte_handle); 01738 01739 01740 /** Set or get the number of trailing zero byte blocks to be written by 01741 libisofs. The image size counter of the emerging ISO image will include 01742 them. Eventual checksums will take them into respect. 01743 They will be written immediately before the eventual image checksum area 01744 which is at the very end of the image. 01745 For a motivation see iso_write_opts_set_tail_blocks() in libisofs.h . 01746 @since 0.6.4 01747 @param opts 01748 The option set to work on 01749 @param num_blocks 01750 Number of extra 2 kB blocks to be written by libisofs. 01751 @return 1 success, <=0 failure 01752 */ 01753 int isoburn_igopt_set_tail_blocks(struct isoburn_imgen_opts *opts, 01754 uint32_t num_blocks); 01755 int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts, 01756 uint32_t *num_blocks); 01757 01758 01759 /** Copy a data file from the local filesystem into the emerging ISO image. 01760 Mark it by an MBR partition entry as PreP partition and also cause 01761 protective MBR partition entries before and after this partition. 01762 See libisofs.h iso_write_opts_set_prep_img(). 01763 @since 1.2.4 01764 @param opts 01765 The option set to be manipulated. 01766 @param path 01767 File address in the local file system. 01768 @param flag 01769 With isoburn_igopt_set_prep_partition(): 01770 Control bits as of iso_write_opts_set_efi_bootp() 01771 bit0= The path contains instructions for the interval libisofs 01772 reader. See libisofs.h. 01773 @since 1.4.0 01774 With isoburn_igopt_get_prep_partition(): 01775 bit0= add the current flag setting & 0x3fffffff to return value 1. 01776 @return 1 success, <=0 failure 01777 */ 01778 int isoburn_igopt_set_prep_partition(struct isoburn_imgen_opts *opts, 01779 char *path, int flag); 01780 int isoburn_igopt_get_prep_partition(struct isoburn_imgen_opts *opts, 01781 char **path, int flag); 01782 01783 /** Copy a data file from the local filesystem into the emerging ISO image 01784 and mark it by a GPT entry as EFI system partition. 01785 @since 1.2.4 01786 @param opts 01787 The option set to be manipulated. 01788 @param path 01789 File address in the local file system. 01790 Instead of a disk path, the word --efi-boot-image may be given. 01791 It exposes in GPT the content of the first El Torito EFI boot image 01792 as EFI system partition. 01793 @param flag 01794 With isoburn_igopt_get_efi_bootp(): 01795 Control bits as of iso_write_opts_set_efi_bootp() 01796 bit0= The path contains instructions for the interval libisofs 01797 reader. See libisofs.h. 01798 @since 1.4.0 01799 With isoburn_igopt_set_efi_bootp(): 01800 bit0= add the current flag setting & 0x3fffffff to return value 1. 01801 @return 1 success, <=0 failure 01802 */ 01803 int isoburn_igopt_set_efi_bootp(struct isoburn_imgen_opts *opts, 01804 char *path, int flag); 01805 int isoburn_igopt_get_efi_bootp(struct isoburn_imgen_opts *opts, 01806 char **path, int flag); 01807 01808 01809 /** Cause an arbitrary data file to be appended to the ISO image and to be 01810 described by a partition table entry in an MBR or SUN Disk Label at the 01811 start of the ISO image. 01812 The partition entry will bear the size of the image file rounded up to 01813 the next multiple of 2048 bytes. 01814 MBR or SUN Disk Label are selected by isoburn_igopt_set_system_area() 01815 system area type: 0 selects MBR partition table. 3 selects a SUN partition 01816 table with 320 kB start alignment. 01817 @since 0.6.4 01818 @param opts 01819 The option set to be manipulated. 01820 @param partition_number 01821 Depicts the partition table entry which shall describe the 01822 appended image. 01823 Range with MBR: 1 to 4. 1 will cause the whole ISO image to be 01824 unclaimable space before partition 1. 01825 @since 0.6.6 01826 Range with SUN Disk Label: 2 to 8. 01827 @param image_path 01828 File address in the local file system. 01829 With SUN Disk Label: an empty name causes the partition to become 01830 a copy of the next lower partition. 01831 @param partition_type 01832 The MBR partition type. E.g. FAT12 = 0x01 , FAT16 = 0x06, 01833 Linux Native Partition = 0x83. See fdisk command L. 01834 This parameter is ignored with SUN Disk Label. 01835 @return 01836 <=0 = error, 1 = success 01837 */ 01838 int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts, 01839 int partition_number, uint8_t partition_type, 01840 char *image_path); 01841 01842 /** Inquire the current settings made by isoburn_igopt_set_partition_img(). 01843 @since 0.6.4 01844 @param opts 01845 The option set to be inquired. 01846 @param num_entries 01847 Number of array elements in partition_types[] and image_paths[]. 01848 @param partition_types 01849 The partition type associated with the partition. Valid only if 01850 image_paths[] of the same index is not NULL. 01851 @param image_paths 01852 Its elements get filled with either NULL or a pointer to a string 01853 with a file address or an empty text. 01854 @return 01855 <0 = error 01856 0 = no partition image set 01857 >0 highest used partition number 01858 */ 01859 int isoburn_igopt_get_partition_img(struct isoburn_imgen_opts *opts, 01860 int num_entries, 01861 uint8_t partition_types[], 01862 char *image_paths[]); 01863 01864 01865 /** Set flag bits for a partition defined by isoburn_igopt_set_partition_img(). 01866 The bits will be forwarded to libisofs iso_write_opts_set_partition_img(). 01867 @since 1.4.0 01868 @param opts 01869 The option set to be manipulated. 01870 @param partition_number 01871 Depicts the partition table entry to which shall the flags bits 01872 shall apply. 01873 @param flag 01874 Control bits as of iso_write_opts_set_partition_img() 01875 bit0= The path contains instructions for the interval libisofs 01876 reader. See libisofs.h. 01877 @since 1.4.0 01878 @return 01879 <=0 = error, 1 = success 01880 */ 01881 int isoburn_igopt_set_part_flag(struct isoburn_imgen_opts *opts, 01882 int partition_number, int flag); 01883 01884 /** Inquire the current settings made by isoburn_igopt_set_part_flags(). 01885 @since 1.4.0 01886 @param opts 01887 The option set to be inquired. 01888 @param num_entries 01889 Number of array elements in part_flags[]. 01890 @param part_flags 01891 The array elements 0 to num_entries - 1 will get filled by the 01892 flag bits of the images of the corresponding partition. 01893 @return 01894 <0 = error 01895 0 = no partition image set 01896 >0 highest used partition number 01897 */ 01898 int isoburn_igopt_get_part_flags(struct isoburn_imgen_opts *opts, 01899 int num_entries, int part_flags[]); 01900 01901 01902 /** Control whether partitions created by iso_write_opts_set_partition_img() 01903 are to be represented in MBR or as GPT partitions. 01904 @since 1.4.0 01905 @param opts 01906 The option set to be manipulated. 01907 @param gpt 01908 0= represent as MBR partition; as GPT only if other GPT partitions 01909 are present 01910 1= represent as GPT partition and cause protective MBR with a single 01911 partition which covers the whole output data. 01912 This may fail if other settings demand MBR partitions. 01913 Do not use other values for now. 01914 @return 01915 <=0 = error, 1 = success 01916 */ 01917 int isoburn_igopt_set_appended_as_gpt(struct isoburn_imgen_opts *opts, 01918 int gpt); 01919 01920 /** Inquire the current setting made by isoburn_igopt_set_appended_as_gpt(). 01921 @since 1.4.0 01922 @param opts 01923 The option set to be inquired. 01924 @param gpt 01925 Returns the current value. 01926 @return 01927 <=0 = error, 1 = success 01928 */ 01929 int isoburn_igopt_get_appended_as_gpt(struct isoburn_imgen_opts *opts, 01930 int *gpt); 01931 01932 01933 /** Control whether partitions created by iso_write_opts_set_partition_img() 01934 are to be represented in Apple Partition Map. 01935 @since 1.4.4 01936 @param opts 01937 The option set to be manipulated. 01938 @param apm 01939 0= do not represent appended partitions in APM 01940 1= represent in APM, even if not 01941 iso_write_opts_set_part_like_isohybrid() enables it and no 01942 other APM partitions emerge. 01943 Do not use other values for now. 01944 @return 01945 <=0 = error, 1 = success 01946 */ 01947 int isoburn_igopt_set_appended_as_apm(struct isoburn_imgen_opts *opts, 01948 int apm); 01949 01950 /** Inquire the current setting made by isoburn_igopt_set_appended_as_apm(). 01951 @since 1.4.4 01952 @param opts 01953 The option set to be inquired. 01954 @param apm 01955 Returns the current value. 01956 @return 01957 <=0 = error, 1 = success 01958 */ 01959 int isoburn_igopt_get_appended_as_apm(struct isoburn_imgen_opts *opts, 01960 int *apm); 01961 01962 01963 /** Control whether bits 2 to 8 of el_torito_set_isolinux_options() 01964 shall apply even if not isohybrid MBR patching is enabled (bit1 of 01965 parameter options of isoburn_igopt_set_system_area()). 01966 For details see iso_write_opts_set_part_like_isohybrid() in libisofs.h. 01967 @since 1.4.4 01968 @param opts 01969 The option set to be manipulated. 01970 @param alike 01971 0= Apply isohybrid behavior only with ISOLINUX isohybrid. 01972 Do not mention appended partitions in APM unless 01973 isoburn_igopt_set_appended_as_apm() is enabled. 01974 1= Apply isohybrid behavior even without ISOLINUX isohybrid. 01975 @return 01976 <=0 = error, 1 = success 01977 */ 01978 int isoburn_igopt_set_part_like_isohybrid(struct isoburn_imgen_opts *opts, 01979 int alike); 01980 01981 /** Inquire the current setting of isoburn_igopt_set_part_like_isohybrid(). 01982 @since 1.4.4 01983 @param opts 01984 The option set to be inquired. 01985 @param alike 01986 Returns the current value. 01987 @return 01988 <=0 = error, 1 = success 01989 */ 01990 int isoburn_igopt_get_part_like_isohybrid(struct isoburn_imgen_opts *opts, 01991 int *alike); 01992 01993 /** Set the partition type of the MBR partition which represents the ISO 01994 filesystem or at least protects it. 01995 This is without effect if no such partition emerges by other settings or 01996 if the partition type is prescribed mandatorily like 0xee for 01997 GPT protective MBR or 0x96 for CHRP. 01998 @since 1.4.8 01999 @param opts 02000 The option set to be manipulated. 02001 @param part_type 02002 0x00 to 0xff as desired partition type. 02003 Any other value (e.g. -1) enables the default types of the various 02004 occasions. 02005 */ 02006 int isoburn_igopt_set_iso_mbr_part_type(struct isoburn_imgen_opts *opts, 02007 int part_type); 02008 02009 /** Inquire the current setting of isoburn_igopt_set_iso_mbr_part_type(). 02010 @since 1.4.8 02011 @param opts 02012 The option set to be inquired. 02013 @param part_type 02014 Returns the current value: -1, 0x00 to 0xff. 02015 @return 02016 <=0 = error, 1 = success 02017 */ 02018 int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts, 02019 int *part_type); 02020 02021 /** Control whether the emerging GPT gets a pseudo-randomly generated disk GUID 02022 or whether it gets a user supplied GUID. 02023 The partition GUIDs will be generated in a reproducible way by exoring a 02024 little-endian 32 bit counter with the disk GUID beginning at byte offset 9. 02025 @since 1.4.6 02026 @param opts 02027 The option set to be manipulated. 02028 @param guid 02029 16 bytes of user supplied GUID. 02030 The upper 4 bit of guid[6] and guid[7] should bear the value 4 to 02031 express the version 4 in both endiannesses. Bit 7 of byte[8] should 02032 be set to 1 and bit 6 be set to 0, in order to express the RFC 4122 02033 variant of GUID, where version 4 means "random". 02034 @param mode 02035 0 = ignore parameter guid and produce the GPT disk GUID by a 02036 pseudo-random algorithm. This is the default setting. 02037 1 = use parameter guid as GPT disk GUID 02038 2 = ignore parameter guid and derive the GPT disk GUID from 02039 parameter uuid of isoburn_igopt_set_pvd_times(). 02040 The 16 bytes of uuid get copied and bytes 6, 7, 8 get their 02041 upper bits changed to comply to RFC 4122. 02042 If no such uuid is given when ISO production starts, then 02043 mode 2 defaults to mode 0. 02044 */ 02045 int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts, 02046 uint8_t guid[16], int mode); 02047 02048 /** Inquire the current setting of isoburn_igopt_set_gpt_guid(). 02049 @since 1.4.6 02050 @param opts 02051 The option set to be inquired. 02052 @param guid 02053 Returns the current guid if current mode is 1. 02054 @param mode 02055 Returns the current value. 02056 @return 02057 <=0 = error, 1 = success 02058 */ 02059 int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts, 02060 uint8_t guid[16], int *mode); 02061 02062 02063 /** Set a name for the system area. This setting is ignored unless system area 02064 type 3 "SUN Disk Label" is in effect by iso_write_opts_set_system_area(). 02065 In this case it will replace the default text at the start of the image: 02066 "CD-ROM Disc with Sun sparc boot created by libisofs" 02067 @since 0.6.6 02068 @param opts 02069 The option set to be manipulated. 02070 @param label 02071 A text of up to 128 characters. 02072 @return 02073 <=0 = error, 1 = success 02074 */ 02075 int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label); 02076 02077 /** Inquire the current setting made by isoburn_igopt_set_disc_label(). 02078 @since 0.6.6 02079 @param opts 02080 The option set to be inquired. 02081 @param label 02082 Returns a pointer to the currently set label string. 02083 Do not alter this string. 02084 Use only as long as the opts object exists. 02085 @return 02086 <=0 = error, 1 = success 02087 */ 02088 int isoburn_igopt_get_disc_label(struct isoburn_imgen_opts *opts, 02089 char **label); 02090 02091 /** Set a serial number for the HFS+ extension of the emerging ISO image. 02092 @since 1.2.4 02093 @param opts 02094 The option set to be manipulated. 02095 @param serial_number 02096 8 bytes which should be unique to the image. 02097 If all bytes are 0, then the serial number will be generated as 02098 random number by libisofs. This is the default setting. 02099 @return 02100 <=0 = error, 1 = success 02101 */ 02102 int isoburn_igopt_set_hfsp_serial_number(struct isoburn_imgen_opts *opts, 02103 uint8_t serial_number[8]); 02104 02105 02106 /** Inquire the current setting made by isoburn_igopt_set_disc_label() 02107 @since 1.2.4 02108 @param opts 02109 The option set to be inquired. 02110 @param serial_number 02111 Will get filled with the current setting. 02112 @return 02113 <=0 = error, 1 = success 02114 */ 02115 int isoburn_igopt_get_hfsp_serial_number(struct isoburn_imgen_opts *opts, 02116 uint8_t serial_number[8]); 02117 02118 /** Set the allocation block size for HFS+ production and the block size 02119 for layout and address unit of Apple Partition map. 02120 @since 1.2.4 02121 @param opts 02122 The option set to be manipulated. 02123 @param hfsp_block_size 02124 -1 means that this setting shall be left unchanged 02125 0 allows the automatic default setting 02126 512 and 2048 enforce a size. 02127 @param apm_block_size 02128 -1 means that this setting shall be left unchanged 02129 0 allows the automatic default setting 02130 512 and 2048 enforce a size. 02131 Size 512 cannot be combined with GPT production. 02132 Size 2048 cannot be mounted -t hfsplus by Linux kernels at least up 02133 to 2.6.32. 02134 @return 02135 <=0 = error, 1 = success 02136 */ 02137 int isoburn_igopt_set_hfsp_block_size(struct isoburn_imgen_opts *opts, 02138 int hfsp_block_size, int apm_block_size); 02139 02140 /** Inquire the current setting made by isoburn_igopt_set_hfsp_block_size 02141 @since 1.2.4 02142 @param opts 02143 The option set to be inquired. 02144 @param hfsp_block_size 02145 Will be set to a value as described above. Except -1. 02146 @param apm_block_size 02147 Will be set to a value as described above. Except -1. 02148 @return 02149 <=0 = error, 1 = success 02150 */ 02151 int isoburn_igopt_get_hfsp_block_size(struct isoburn_imgen_opts *opts, 02152 int *hfsp_block_size, int *apm_block_size); 02153 02154 02155 /** Set or inquire the write type for the next write run on optical media. 02156 @since 1.2.4 02157 @param opts 02158 The option set to be manipulated or inquired. 02159 @param do_tao 02160 The value to be set or the variable where to return the current 02161 setting: 02162 0 = Let libburn choose according to other write parameters. 02163 This is advisable unless there are particular reasons not to 02164 use one of the two write types. Be aware that 1 and -1 can 02165 lead to failure if the write type is not appropriate for 02166 the given media situation. 02167 1 = Use BURN_WRITE_TAO which does 02168 TAO on CD, Incremental on DVD-R, 02169 no track reservation on DVD+R and BD-R 02170 -1 = Use BURN_WRITE_SAO which does 02171 SAO on CD, DAO on DVD-R, 02172 track reservation on DVD+R and BD-R 02173 @return 02174 <=0 = error, 1 = success 02175 */ 02176 int isoburn_igopt_set_write_type(struct isoburn_imgen_opts *opts, int do_tao); 02177 int isoburn_igopt_get_write_type(struct isoburn_imgen_opts *opts, int *do_tao); 02178 02179 /** Set or inquire whether a final fsync(2) is performed when updating the 02180 multi-session information of libburn stdio pseudo-drives by 02181 isoburn_activate_session(). 02182 Note: 02183 fsync(2) calls during and at the end of isoburn_disc_write() are controlled 02184 by libburn call burn_write_opts_set_stdio_fsync(). 02185 @since 1.2.4 02186 @param opts 02187 The option set to be manipulated or inquired. 02188 @param do_sync 02189 1= call fsync(2) with stdio drives in isoburn_activate_session() 02190 0= do not 02191 @return 02192 <=0 = error, 1 = success 02193 */ 02194 int isoburn_igopt_set_stdio_endsync(struct isoburn_imgen_opts *opts, 02195 int do_sync); 02196 int isoburn_igopt_get_stdio_endsync(struct isoburn_imgen_opts *opts, 02197 int *do_sync); 02198 02199 /* ----------------------------------------------------------------------- */ 02200 /* End of Options for image generation */ 02201 /* ----------------------------------------------------------------------- */ 02202 02203 02204 /** Frontend of libisofs call iso_conv_name_chars() controlled by 02205 struct isoburn_imgen_opts rather than IsoWriteOpts. 02206 See libisofs.h for a more detailed description. 02207 @since 1.3.6 02208 @param opts 02209 Defines options like output charset, UCS-2 versus UTF-16 for Joliet, 02210 and naming restrictions. 02211 @param name 02212 The input text which shall be converted. 02213 @param name_len 02214 The number of bytes in input text. 02215 @param result 02216 Will return the conversion result in case of success. Terminated by 02217 a trailing zero byte. 02218 Use free() to dispose it when no longer needed. 02219 @param result_len 02220 Will return the number of bytes in result (excluding trailing zero) 02221 @param flag 02222 Bitfield for control purposes. 02223 bit0-bit7= Name space 02224 0= generic (to_charset is valid, 02225 no reserved characters, no length limits) 02226 1= Rock Ridge (to_charset is valid) 02227 2= Joliet (to_charset gets overridden by UCS-2 or UTF-16) 02228 3= ECMA-119 (to_charset gets overridden by the 02229 dull ISO 9660 subset of ASCII) 02230 4= HFS+ (to_charset gets overridden by UTF-16BE) 02231 bit8= Treat input text as directory name 02232 (matters for Joliet and ECMA-119) 02233 bit9= Do not issue error messages 02234 bit15= Reverse operation (best to be done only with results of 02235 previous conversions) 02236 @return 02237 1 means success, <=0 means error 02238 */ 02239 int isoburn_conv_name_chars(struct isoburn_imgen_opts *opts, 02240 char *name, size_t name_len, 02241 char **result, size_t *result_len, int flag); 02242 02243 02244 /** Get the image attached to a drive, if any. 02245 @since 0.1.0 02246 @param d The drive to inquire 02247 @return A reference to attached image, or NULL if the drive has no image 02248 attached. This reference needs to be released via iso_image_unref() 02249 when it is not longer needed. 02250 */ 02251 IsoImage *isoburn_get_attached_image(struct burn_drive *d); 02252 02253 /** Get the start address of the image that is attached to the drive, if any. 02254 @since 1.2.2 02255 @param d The drive to inquire 02256 @return The logical block address where the System Area of the image 02257 starts. <0 means that the address is invalid. 02258 */ 02259 int isoburn_get_attached_start_lba(struct burn_drive *d); 02260 02261 02262 /** Load the ISO filesystem directory tree from the medium in the given drive. 02263 This will give libisoburn the base on which it can let libisofs perform 02264 image growing or image modification. The loaded volset gets attached 02265 to the drive object and handed out to the application. 02266 Not a wrapper, but peculiar to libisoburn. 02267 @since 0.1.0 02268 @param d The drive which holds an existing ISO filesystem or blank media. 02269 d is allowed to be NULL which produces an empty ISO image. In 02270 this case one has to call before writing isoburn_attach_volset() 02271 with the volset from this call and with the intended output 02272 drive. 02273 @param read_opts The read options which can be chosen by the application 02274 @param image the image read, if the disc is blank it will have no files. 02275 This reference needs to be released via iso_image_unref() when 02276 it is not longer needed. The drive, if not NULL, will hold an 02277 own reference which it will release when it gets a new volset 02278 or when it gets released via isoburn_drive_release(). 02279 You can pass NULL if you already have a reference or you plan to 02280 obtain it later with isoburn_get_attached_image(). Of course, if 02281 you haven't specified a valid drive (i.e., if d == NULL), this 02282 parameter can't be NULL. 02283 @return <=0 error , 1 = success 02284 */ 02285 int isoburn_read_image(struct burn_drive *d, 02286 struct isoburn_read_opts *read_opts, 02287 IsoImage **image); 02288 02289 /** Set a callback function for producing pacifier messages during the lengthy 02290 process of image reading. The callback function and the application handle 02291 are stored until they are needed for the underlying call to libisofs. 02292 Other than with libisofs the handle is managed entirely by the application. 02293 An idle .free() function is exposed to libisofs. The handle has to stay 02294 valid until isoburn_read_image() is done. It has to be detached by 02295 isoburn_set_read_pacifier(drive, NULL, NULL); 02296 before it may be removed from memory. 02297 @since 0.1.0 02298 @param drive The drive which will be used with isoburn_read_image() 02299 It has to be acquired by an isoburn_* wrapper call. 02300 @param read_pacifier The callback function 02301 @param app_handle The app handle which the callback function can obtain 02302 via iso_image_get_attached_data() from its IsoImage* 02303 @return 1 success, <=0 failure 02304 */ 02305 int isoburn_set_read_pacifier(struct burn_drive *drive, 02306 int (*read_pacifier)(IsoImage*, IsoFileSource*), 02307 void *app_handle); 02308 02309 /** Inquire the partition offset of the loaded image. The first 512 bytes of 02310 the image get examined whether they bear an MBR signature and a first 02311 partition table entry which matches the size of the image. In this case 02312 the start address is recorded as partition offset and internal buffers 02313 get adjusted. 02314 See also isoburn_igopt_set_part_offset(). 02315 @since 0.6.2 02316 @param drive The drive with the loaded image 02317 @param block_offset_2k returns the recognized partition offset 02318 @return <0 = error 02319 0 = no partition offset recognized 02320 1 = acceptable non-zero offset, buffers are adjusted 02321 2 = offset is credible but not acceptable for buffer size 02322 */ 02323 int isoburn_get_img_partition_offset(struct burn_drive *drive, 02324 uint32_t *block_offset_2k); 02325 02326 02327 /** Set the IsoImage to be used with a drive. This eventually releases 02328 the reference to the old IsoImage attached to the drive. 02329 Caution: Use with care. It hardly makes sense to replace an image that 02330 reflects a valid ISO image on the medium. 02331 This call is rather intended for writing a newly created and populated 02332 image to blank media. The use case in xorriso is to let an image survive 02333 the change or demise of the outdev target drive. 02334 @since 0.1.0 02335 @param d The drive which shall be write target of the volset. 02336 @param image The image that represents the image to be written. 02337 This image pointer MUST already be a valid reference suitable 02338 for iso_image_unref(). 02339 It may have been obtained by appropriate libisofs calls or by 02340 isoburn_read_image() with d==NULL. 02341 @return <=0 error , 1 = success 02342 */ 02343 int isoburn_attach_image(struct burn_drive *d, IsoImage *image); 02344 02345 02346 /** Set the start address of the image that is attached to the drive, if any. 02347 @since 1.2.2 02348 @param d The drive to inquire 02349 @param lba The logical block address where the System Area of the image 02350 starts. <0 means that the address is invalid. 02351 @param flag Bitfield, submit 0 for now. 02352 @return <=0 error (e.g. because no image is attached), 1 = success 02353 */ 02354 int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag); 02355 02356 02357 /** Return the best possible estimation of the currently available capacity of 02358 the medium. This might depend on particular write option settings and on 02359 drive state. 02360 An eventual start address for emulated multi-session will be subtracted 02361 from the capacity estimation given by burn_disc_available_space(). 02362 Negative results get defaulted to 0. 02363 Wrapper for: burn_disc_available_space() 02364 @since 0.1.0 02365 @param d The drive to query. 02366 @param o If not NULL: write parameters to be set on drive before query 02367 @return number of most probably available free bytes 02368 */ 02369 off_t isoburn_disc_available_space(struct burn_drive *d, 02370 struct burn_write_opts *o); 02371 02372 02373 /** Obtain the start block number of the most recent session on the medium. In 02374 case of random access media this will normally be 0. Successful return is 02375 not a guarantee that there is a ISO-9660 image at all. The call will fail, 02376 nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE 02377 or BURN_DISC_FULL. 02378 Note: The result of this call may be fabricated by a previous call of 02379 isoburn_set_msc1() which can override the rule to load the most recent 02380 session. 02381 Wrapper for: burn_disc_get_msc1() 02382 @since 0.1.0 02383 @param d The drive to inquire 02384 @param start_lba Contains on success the start address in 2048 byte blocks 02385 @return <=0 error , 1 = success 02386 */ 02387 int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba); 02388 02389 02390 /** Use this with trackno==0 to obtain the predicted start block number of the 02391 new session. The interesting number is returned in parameter nwa. 02392 Wrapper for: burn_disc_track_lba_nwa() 02393 @since 0.1.0 02394 @param d The drive to inquire 02395 @param o If not NULL: write parameters to be set on drive before query 02396 @param trackno Submit 0. 02397 @param lba return value: start lba 02398 @param nwa return value: Next Writeable Address 02399 @return 1=nwa is valid , 0=nwa is not valid , -1=error 02400 */ 02401 int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o, 02402 int trackno, int *lba, int *nwa); 02403 02404 02405 /** Obtain the size which was attributed to an emulated appendable on actually 02406 overwriteable media. This value is supposed to be <= 2048 * nwa as of 02407 isoburn_disc_track_lba_nwa(). 02408 @since 0.1.0 02409 @param d The drive holding the medium. 02410 @param start_byte The reply value counted in bytes, not in sectors. 02411 @param flag Unused yet. Submit 0. 02412 @return 1=stat_byte is valid, 0=not an emulated appendable, -1=error 02413 */ 02414 int isoburn_get_min_start_byte(struct burn_drive *d, off_t *start_byte, 02415 int flag); 02416 02417 02418 /** Start production of an ISO 9660 image using the method of Growing: 02419 Create a disc object for writing the new session from the created or loaded 02420 iso_volset which has been manipulated via libisofs, to the same medium from 02421 where the image was eventually loaded. 02422 This call starts a libisofs thread which begins to produce the image. 02423 It has to be revoked by isoburn_cancel_prepared_write() if for some reason 02424 this image data stream shall not be consumed. 02425 The returned struct burn_disc is ready for use by a subsequent call to 02426 isoburn_disc_write(). After this asynchronous writing has ended and the 02427 drive is BURN_DRIVE_IDLE again, the burn_disc object has to be disposed 02428 by burn_disc_free(). 02429 @since 0.1.0 02430 @param drive The combined source and target drive, grabbed with 02431 isoburn_drive_scan_and_grab(). . 02432 @param disc Returns the newly created burn_disc object. 02433 @param opts Image generation options, see isoburn_igopt_*() 02434 @return <=0 error , 1 = success 02435 */ 02436 int isoburn_prepare_disc(struct burn_drive *drive, struct burn_disc **disc, 02437 struct isoburn_imgen_opts *opts); 02438 02439 02440 /** Start production of an ISO 9660 image using the method of Modifying: 02441 Create a disc object for producing a new image from a previous image 02442 plus the changes made by user. The generated burn_disc is suitable 02443 to be written to a grabbed drive with blank writeable medium. 02444 But you must not use the same drive for input and output, because data 02445 will be read from the source drive while at the same time the target 02446 drive is already writing. 02447 This call starts a libisofs thread which begins to produce the image. 02448 It has to be revoked by isoburn_cancel_prepared_write() if for some reason 02449 this image data stream shall not be consumed. 02450 The resulting burn_disc object has to be disposed when all its writing 02451 is done and the drive is BURN_DRIVE_IDLE again after asynchronous 02452 burn_disc_write(). 02453 @since 0.1.0 02454 @param in_drive The input drive, grabbed with isoburn_drive_aquire() or 02455 one of its alternatives. 02456 @param disc Returns the newly created burn_disc object. 02457 @param opts Options for image generation and data transport to the 02458 medium. 02459 @param out_drive The output drive, from isoburn_drive_aquire() et.al.. 02460 @return <=0 error , 1 = success 02461 */ 02462 int isoburn_prepare_new_image(struct burn_drive *in_drive, 02463 struct burn_disc **disc, 02464 struct isoburn_imgen_opts *opts, 02465 struct burn_drive *out_drive); 02466 02467 02468 /** Start production of an ISO 9660 image using the method of Blind Growing: 02469 Create a disc object for writing an add-on session from the created or 02470 loaded IsoImage which has been manipulated via libisofs, to a different 02471 drive than the one from where it was loaded. 02472 Usually output will be stdio:/dev/fd/1 (i.e. stdout) being piped 02473 into some burn program like with this classic gesture: 02474 mkisofs -M $dev -C $msc1,$nwa | cdrecord -waiti dev=$dev 02475 Parameter translation into libisoburn: 02476 $dev is the address by which parameter in_drive of this call was 02477 acquired $msc1 was set by isoburn_set_msc1() before image reading 02478 or was detected from the in_drive medium 02479 $nwa is a parameter of this call 02480 or can be used as detected from the in_drive medium 02481 02482 This call starts a libisofs thread which begins to produce the image. 02483 It has to be revoked by isoburn_cancel_prepared_write() if for some reason 02484 this image data stream shall not be consumed. 02485 This call waits for libisofs output to become available and then detaches 02486 the input drive object from the data source object by which libisofs was 02487 reading from the input drive. 02488 So, as far as libisofs is concerned, that drive may be released immediately 02489 after this call in order to allow the consumer to access the drive for 02490 writing. 02491 The consumer should wait for input to become available and only then open 02492 its burn drive. With cdrecord this is caused by option -waiti. 02493 02494 The resulting burn_disc object has to be disposed when all its writing 02495 is done and the drive is BURN_DRIVE_IDLE again after asynchronous 02496 burn_disc_write(). 02497 @since 0.2.2 02498 @param in_drive The input drive,grabbed with isoburn_drive_scan_and_grab(). 02499 @param disc Returns the newly created burn_disc object. 02500 @param opts Options for image generation and data transport to media. 02501 @param out_drive The output drive, from isoburn_drive_aquire() et.al.. 02502 typically stdio:/dev/fd/1 . 02503 @param nwa The address (2048 byte block count) where the add-on 02504 session will be finally stored on a mountable medium 02505 or in a mountable file. 02506 If nwa is -1 then the address is used as determined from 02507 the in_drive medium. 02508 @return <=0 error , 1 = success 02509 */ 02510 int isoburn_prepare_blind_grow(struct burn_drive *in_drive, 02511 struct burn_disc **disc, 02512 struct isoburn_imgen_opts *opts, 02513 struct burn_drive *out_drive, int nwa); 02514 02515 02516 /** 02517 Revoke isoburn_prepare_*() instead of running isoburn_disc_write(). 02518 libisofs reserves resources and maybe already starts generating the 02519 image stream when one of above three calls is performed. It is mandatory to 02520 either run isoburn_disc_write() or to revoke the preparations by the 02521 call described here. 02522 If this call returns 0 or 1 then the write thread of libisofs has ended. 02523 @since 0.1.0 02524 @param input_drive The drive or in_drive which was used with the 02525 preparation call. 02526 @param output_drive The out_drive used with isoburn_prepare_new_image(), 02527 NULL if none. 02528 @param flag Bitfield, submit 0 for now. 02529 bit0= -reserved for internal use- 02530 @return <0 error, 0= no pending preparations detectable, 1 = canceled 02531 */ 02532 int isoburn_cancel_prepared_write(struct burn_drive *input_drive, 02533 struct burn_drive *output_drive, int flag); 02534 02535 02536 /** 02537 Override the truncation setting that was made with flag bit2 during the 02538 call of isoburn_drive_aquire. This applies only to stdio pseudo drives. 02539 @since 0.1.6 02540 @param drive The drive which was acquired and shall be used for writing. 02541 @param flag Bitfield controlling the setting: 02542 bit0= truncate (else do not truncate) 02543 bit1= do not warn if call is inappropriate to drive 02544 bit2= only set if truncation is currently enabled 02545 do not warn if call is inappropriate to drive 02546 @return 1 success, 0 inappropriate drive, <0 severe error 02547 */ 02548 int isoburn_set_truncate(struct burn_drive *drive, int flag); 02549 02550 02551 /** Start writing of the new session. 02552 This call is asynchrounous. I.e. it returns quite soon and the progress has 02553 to be watched by a loop with call burn_drive_get_status() until 02554 BURN_DRIVE_IDLE is returned. 02555 Wrapper for: burn_disc_write() 02556 @since 0.1.0 02557 @param o Options which control the burn process. See burnwrite_opts_*() 02558 in libburn.h. 02559 @param disc Disc object created either by isoburn_prepare_disc() or by 02560 isoburn_prepare_new_image(). 02561 */ 02562 void isoburn_disc_write(struct burn_write_opts *o, struct burn_disc *disc); 02563 02564 02565 /** Inquire state and fill parameters of the fifo which is attached to 02566 the emerging track. This should be done in the pacifier loop while 02567 isoburn_disc_write() or burn_disc_write() are active. 02568 This works only with drives obtained by isoburn_drive_scan_and_grab() 02569 or isoburn_drive_grab(). If isoburn_prepare_new_image() was used, then 02570 parameter out_drive must have announced the track output drive. 02571 Hint: If only burn_write_opts and not burn_drive is known, then the drive 02572 can be obtained by burn_write_opts_get_drive(). 02573 @since 0.1.0 02574 @param d The drive to which the track with the fifo gets burned. 02575 @param size The total size of the fifo 02576 @param free_bytes The current free capacity of the fifo 02577 @param status_text Returns a pointer to a constant text, see below 02578 @return <0 reply invalid, >=0 fifo status code: 02579 bit0+1=input status, bit2=consumption status, i.e: 02580 0="standby" : data processing not started yet 02581 1="active" : input and consumption are active 02582 2="ending" : input has ended without error 02583 3="failing" : input had error and ended, 02584 4="unused" : ( consumption has ended before processing start ) 02585 5="abandoned" : consumption has ended prematurely 02586 6="ended" : consumption has ended without input error 02587 7="aborted" : consumption has ended after input error 02588 */ 02589 int isoburn_get_fifo_status(struct burn_drive *d, int *size, int *free_bytes, 02590 char **status_text); 02591 02592 02593 /** Inquire whether the most recent write run was successful. 02594 Wrapper for: burn_drive_wrote_well() 02595 @since 0.1.0 02596 @param d The drive to inquire 02597 @return 1=burn seems to have went well, 0=burn failed 02598 */ 02599 int isoburn_drive_wrote_well(struct burn_drive *d); 02600 02601 02602 /** Call this after isoburn_disc_write has finished and burn_drive_wrote_well() 02603 indicates success. It will eventually complete the emulation of 02604 multi-session functionality, if needed at all. Let libisoburn decide. 02605 Not a wrapper, but peculiar to libisoburn. 02606 @since 0.1.0 02607 @param d The output drive to which the session was written 02608 @return 1 success , <=0 failure 02609 */ 02610 int isoburn_activate_session(struct burn_drive *d); 02611 02612 02613 /** Wait after normal end of operations until libisofs ended all write 02614 threads and freed resource reservations. 02615 This call is not mandatory. But without it, messages from the ending 02616 threads might appear after the application ended its write procedure. 02617 @since 0.1.0 02618 @param input_drive The drive or in_drive which was used with the 02619 preparation call. 02620 @param output_drive The out_drive used with isoburn_prepare_new_image(), 02621 NULL if none. 02622 @param flag Bitfield, submit 0 for now. 02623 @return <=0 error , 1 = success 02624 */ 02625 int isoburn_sync_after_write(struct burn_drive *input_drive, 02626 struct burn_drive *output_drive, int flag); 02627 02628 02629 /** Release an acquired drive. 02630 Wrapper for: burn_drive_release() 02631 @since 0.1.0 02632 @param drive The drive to be released 02633 @param eject 1= eject medium from drive , 0= do not eject 02634 */ 02635 void isoburn_drive_release(struct burn_drive *drive, int eject); 02636 02637 02638 /** Shutdown all three libraries. 02639 Wrapper for : iso_finish() and burn_finish(). 02640 @since 0.1.0 02641 */ 02642 void isoburn_finish(void); 02643 02644 02645 /* 02646 The following calls are for expert applications only. 02647 An application should have a special reason to use them. 02648 */ 02649 02650 02651 /** Inquire wether the medium needs emulation or would be suitable for 02652 generic multi-session via libburn. 02653 @since 0.1.0 02654 @param d The drive to inquire 02655 @return 0 is generic multi-session 02656 1 is emulated multi-session 02657 -1 is not suitable for isoburn 02658 */ 02659 int isoburn_needs_emulation(struct burn_drive *d); 02660 02661 02662 /* ---------------------------- Test area ----------------------------- */ 02663 02664 /* no tests active, currently */ 02665 02666 #ifdef __cplusplus 02667 } /* extern "C" */ 02668 #endif 02669 02670 #endif /* LIBISOBURN_LIBISOBURN_H_ */ 02671