2008-01-10 11:45:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Adapter to libisoburn, libisofs and libburn for xorriso,
|
|
|
|
a command line oriented batch and dialog tool which creates, loads,
|
|
|
|
manipulates and burns ISO 9660 filesystem images.
|
|
|
|
|
|
|
|
Copyright 2007-2008 Thomas Schmitt, <scdbackup@gmx.net>
|
|
|
|
|
|
|
|
Provided under GPL version 2.
|
|
|
|
|
|
|
|
This file contains the inner isofs- and burn-library interface of xorriso.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Xorrisoburn_includeD
|
|
|
|
#define Xorrisoburn_includeD yes
|
|
|
|
|
|
|
|
struct XorrisO;
|
|
|
|
struct FindjoB;
|
2008-01-31 21:47:39 +00:00
|
|
|
|
|
|
|
/* The minimum version of libisoburn to be used with this version of xorriso
|
|
|
|
*/
|
|
|
|
#define xorriso_libisoburn_req_major 0
|
2008-02-15 21:19:24 +00:00
|
|
|
#define xorriso_libisoburn_req_minor 1
|
2008-04-28 12:34:39 +00:00
|
|
|
#define xorriso_libisoburn_req_micro 5
|
2008-01-10 11:45:53 +00:00
|
|
|
|
|
|
|
int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-01-15 20:41:56 +00:00
|
|
|
/* @param flag bit0= global shutdown of libraries */
|
|
|
|
int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag);
|
2008-01-15 17:45:08 +00:00
|
|
|
|
2008-01-10 11:45:53 +00:00
|
|
|
int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
/* @param flag bit0=aquire as isoburn input drive
|
|
|
|
bit1=aquire as libburn output drive (as isoburn drive if bit0)
|
|
|
|
@return <=0 failure , 1=success , 2=neither readable or writeable
|
|
|
|
*/
|
|
|
|
int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag);
|
|
|
|
|
|
|
|
int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
int Xorriso_write_session(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-03-01 15:13:13 +00:00
|
|
|
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
|
|
|
|
Set to NULL if calling this function from outside ISO world
|
|
|
|
@param flag bit0= mkdir: graft in as empty directory, not as copy from disk
|
|
|
|
bit1= do not report added files
|
|
|
|
@return <=0 = error , 1 = added simple node , 2 = added directory
|
2008-01-10 11:45:53 +00:00
|
|
|
*/
|
2008-03-01 15:13:13 +00:00
|
|
|
int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter,
|
2008-03-09 14:22:14 +00:00
|
|
|
char *disk_path, char *img_path,
|
|
|
|
off_t offset, off_t cut_size, int flag);
|
2008-01-10 11:45:53 +00:00
|
|
|
|
|
|
|
int Xorriso__text_to_sev(char *severity_name, int *severity_number,int flag);
|
|
|
|
|
|
|
|
/* @param flag bit0=report about output drive
|
|
|
|
bit1=short report form
|
|
|
|
*/
|
|
|
|
int Xorriso_toc(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
int Xorriso_show_devices(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
int Xorriso_tell_media_space(struct XorrisO *xorriso,
|
|
|
|
int *media_space, int *free_space, int flag);
|
|
|
|
|
2008-05-12 19:36:23 +00:00
|
|
|
/* @param flag bit0=fast , bit1=deformat
|
|
|
|
@return 0=failure, did not touch media , -1=failure, altered media
|
|
|
|
1=success, altered media , 2=success, did not touch media
|
|
|
|
*/
|
2008-01-10 11:45:53 +00:00
|
|
|
int Xorriso_blank_media(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-05-12 19:36:23 +00:00
|
|
|
/* @param flag bit0= try to achieve faster formatting
|
|
|
|
@return 0=failure, did not touch media , -1=failure, altered media
|
|
|
|
1=success, altered media , 2=success, did not touch media
|
|
|
|
*/
|
2008-01-10 11:45:53 +00:00
|
|
|
int Xorriso_format_media(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-05-13 11:58:43 +00:00
|
|
|
/* @return <=0 error, 1 success
|
|
|
|
*/
|
|
|
|
int Xorriso_list_formats(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-05-12 19:36:23 +00:00
|
|
|
/* @param flag bit2= formatting rather than blanking
|
|
|
|
@return 0=failure, did not touch media , -1=failure, altered media
|
|
|
|
1=success, altered media , 2=success, did not touch media
|
|
|
|
*/
|
|
|
|
int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
|
2008-01-10 11:45:53 +00:00
|
|
|
/* @param boss_iter Opaque internal handle. Use NULL outside xorrisoburn.c :
|
|
|
|
If not NULL then this is an iterator suitable for
|
|
|
|
iso_dir_iter_remove() which is then to be used instead
|
|
|
|
of iso_node_remove().
|
|
|
|
@param flag bit0= remove whole sub tree: rm -r
|
|
|
|
bit1= remove empty directory: rmdir
|
|
|
|
bit2= recursion: do not reassure in mode 2 "tree"
|
|
|
|
bit3= this is for overwriting and not for plain removal
|
|
|
|
@return <=0 = error
|
|
|
|
1 = removed simple node
|
|
|
|
2 = removed directory or tree
|
|
|
|
3 = did not remove on user revocation
|
|
|
|
*/
|
2008-03-07 18:24:26 +00:00
|
|
|
int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
|
2008-01-10 11:45:53 +00:00
|
|
|
char *path, int flag);
|
|
|
|
|
|
|
|
/* @param flag bit0= long format
|
|
|
|
bit1= do not print count of nodes
|
|
|
|
bit2= du format
|
|
|
|
bit3= print directories as themselves (ls -d)
|
|
|
|
*/
|
|
|
|
int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
|
|
|
|
int filec, char **filev, off_t boss_mem, int flag);
|
|
|
|
|
|
|
|
/* This function needs less buffer memory than Xorriso_ls_filev() but cannot
|
|
|
|
perform structured pattern matching.
|
|
|
|
@param flag bit0= long format
|
|
|
|
bit1= only check for directory existence
|
|
|
|
bit2= do not apply search pattern but accept any file
|
2008-03-07 22:04:58 +00:00
|
|
|
bit3= just count nodes and return number
|
2008-01-10 11:45:53 +00:00
|
|
|
*/
|
|
|
|
int Xorriso_ls(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
/* @param wd Path to prepend in case img_path is not absolute
|
|
|
|
@param img_path Absolute or relative path to be normalized
|
|
|
|
@param eff_path returns resulting effective path.
|
|
|
|
Must provide at least SfileadrL bytes of storage.
|
|
|
|
@param flag bit0= do not produce problem events (unless faulty path format)
|
|
|
|
bit1= work purely literally, do not use libisofs
|
|
|
|
bit2= (with bit1) this is an address in the disk world
|
|
|
|
@return -1 = faulty path format, 0 = not found ,
|
|
|
|
1 = found simple node , 2 = found directory
|
|
|
|
*/
|
|
|
|
int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
|
|
|
|
char *img_path, char eff_path[], int flag);
|
|
|
|
|
2008-03-01 15:13:13 +00:00
|
|
|
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
|
|
|
|
Set to NULL if calling this function from outside ISO world
|
|
|
|
*/
|
|
|
|
int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
|
|
|
|
char *origin, char *dest, int flag);
|
2008-01-10 11:45:53 +00:00
|
|
|
|
|
|
|
/* @param flag bit0= do not produce info message on success
|
|
|
|
@return 1=success, 0=was already directory, -1=was other type, -2=bad path
|
|
|
|
*/
|
|
|
|
int Xorriso_mkdir(struct XorrisO *xorriso, char *img_path, int flag);
|
|
|
|
|
|
|
|
/* @param flag bit0= a match count !=1 is a SORRY event */
|
|
|
|
int Xorriso_expand_pattern(struct XorrisO *xorriso,
|
|
|
|
int num_patterns, char **patterns, int extra_filec,
|
|
|
|
int *filec, char ***filev, off_t *mem, int flag);
|
|
|
|
|
|
|
|
int Xorriso_set_st_mode(struct XorrisO *xorriso, char *path,
|
|
|
|
mode_t mode_and, mode_t mode_or, int flag);
|
|
|
|
|
|
|
|
int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid,
|
|
|
|
int flag);
|
|
|
|
|
|
|
|
int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid,
|
|
|
|
int flag);
|
|
|
|
|
|
|
|
/* @parm flag bit0= atime, bit1= ctime, bit2= mtime, bit8=no auto ctime */
|
|
|
|
int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
|
|
|
|
int flag);
|
|
|
|
|
2008-03-06 11:43:08 +00:00
|
|
|
/* @param flag bit0= recursion
|
|
|
|
bit1= do not count deleted files with rm and rm_r
|
|
|
|
*/
|
2008-01-10 11:45:53 +00:00
|
|
|
int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
2008-03-02 20:15:36 +00:00
|
|
|
void *boss_iter, off_t boss_mem,
|
2008-01-10 11:45:53 +00:00
|
|
|
void *dir_node_generic, char *dir_path,
|
|
|
|
struct stat *dir_stbuf, int depth, int flag);
|
|
|
|
|
2008-01-14 22:47:44 +00:00
|
|
|
/* @param flag bit0= do not mark image as changed */
|
2008-01-10 11:45:53 +00:00
|
|
|
int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag);
|
|
|
|
|
2008-01-14 22:47:44 +00:00
|
|
|
int Xorriso_get_volid(struct XorrisO *xorriso, char volid[33], int flag);
|
|
|
|
|
2008-01-28 10:54:55 +00:00
|
|
|
int Xorriso_set_abort_severity(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-02-06 13:11:20 +00:00
|
|
|
int Xorriso_report_lib_versions(struct XorrisO *xorriso, int flag);
|
|
|
|
|
2008-05-10 19:43:16 +00:00
|
|
|
/* @return 0= stbuf content is valid ,
|
|
|
|
-1 = path not found , -2 = severe error occured
|
|
|
|
*/
|
2008-02-10 13:59:11 +00:00
|
|
|
int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
|
|
|
|
int flag);
|
2008-01-28 10:54:55 +00:00
|
|
|
|
2008-02-19 18:45:17 +00:00
|
|
|
/* @param flag bit0= -inq
|
|
|
|
bit1= -checkdrive
|
|
|
|
*/
|
|
|
|
int Xorriso_atip(struct XorrisO *xorriso, int flag);
|
|
|
|
|
|
|
|
int Xorriso_burn_track(struct XorrisO *xorriso, char *track_source, int flag);
|
|
|
|
|
|
|
|
/* @param flag bit1= outdev rather than indev
|
|
|
|
@return <=0 = failure , 1= ok , 2= ok, is CD profile
|
|
|
|
*/
|
|
|
|
int Xorriso_get_profile(struct XorrisO *xorriso, int *profile_number,
|
|
|
|
char profile_name[80], int flag);
|
|
|
|
|
2008-02-21 13:01:34 +00:00
|
|
|
/* @param flag bit0= do not mark image as changed */
|
|
|
|
int Xorriso_set_publisher(struct XorrisO *xorriso, char *name, int flag);
|
|
|
|
|
|
|
|
|
2008-02-26 21:45:28 +00:00
|
|
|
int Xorriso_iso_file_open(struct XorrisO *xorriso, char *pathname,
|
|
|
|
void **stream, int flag);
|
|
|
|
|
|
|
|
int Xorriso_iso_file_read(struct XorrisO *xorriso, void *stream, char *buf,
|
|
|
|
int count, int flag);
|
|
|
|
|
|
|
|
int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag);
|
|
|
|
|
2008-02-29 20:09:12 +00:00
|
|
|
/* @param bit0= copy link target properties rather than link properties
|
|
|
|
*/
|
|
|
|
int Xorriso_copy_properties(struct XorrisO *xorriso,
|
|
|
|
char *disk_path, char *img_path, int flag);
|
2008-02-26 21:45:28 +00:00
|
|
|
|
2008-03-09 14:22:14 +00:00
|
|
|
int Xorriso_cut_out(struct XorrisO *xorriso, char *disk_path,
|
|
|
|
off_t startbyte, off_t bytecount, char *iso_rr_path, int flag);
|
|
|
|
|
2008-03-22 13:00:38 +00:00
|
|
|
struct SplitparT;
|
|
|
|
|
2008-03-29 16:44:39 +00:00
|
|
|
/* @param flag bit0= in_node is valid, do not resolve iso_adr
|
|
|
|
*/
|
2008-03-22 13:00:38 +00:00
|
|
|
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
|
2008-03-29 16:44:39 +00:00
|
|
|
void *in_node,
|
2008-03-25 17:07:58 +00:00
|
|
|
struct SplitparT **parts, int *count,
|
|
|
|
struct stat *total_stbuf, int flag);
|
2008-03-22 13:00:38 +00:00
|
|
|
|
2008-01-10 11:45:53 +00:00
|
|
|
#endif /* Xorrisoburn_includeD */
|
|
|
|
|