libisoburn/xorriso/xorriso.h

428 lines
16 KiB
C
Raw Normal View History

2007-10-12 20:39:29 +00:00
/* 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>
2007-10-12 20:39:29 +00:00
Provided under GPL version 2.
This file contains the public option interface of xorriso.
*/
#ifndef Xorriso_includeD
#define Xorriso_includeD yes
/** Opaque handle of the xorriso runtime context */
struct XorrisO;
/* --------------------- Fundamental Management ------------------- */
/* Create a new xorriso object and tell it the program name to be used
with messages.
*/
int Xorriso_new(struct XorrisO ** xorriso, char *progname, int flag);
/* Make global library initializations.
This must be done with the first xorriso object that gets created and
with the first xorriso object that gets created after Xorriso_destroy(,1).
*/
int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag);
/* Destroy xorriso object when it is no longer needed.
@param flag bit0= Make global librariy shutdown.
Use only with last xorriso object to be destroyed.
*/
int Xorriso_destroy(struct XorrisO **xorriso, int flag);
/* --------------------- Problem Status and Message API ------------------- */
/** Submit a problem message to the xorriso problem reporting and handling
system. This will eventually increase problem status rank, which may
at certain stages in the program be pardoned and reset to 0.
The pardon is governed by Xorriso_option_abort_on() and by the anger
of the affected program part. If no pardon has been given, then the problem
status reaches the caller of option functions.
Problem status should be inquired by Xorriso_eval_problem_status() and be
reset before next option execution by Xorriso_set_problem_status().
The problem status itself does not cause the failure of option functions.
But in case of failures for other reasons, a remnant overly severe problem
status can cause overly harsh program reactions.
@param xorriso The environment handle
@param error_code The unique error code of your message.
Submit 0 if you do not have reserved error codes within
the libburnia project.
@param msg_text Not more than 8196 characters of message text.
A final newline character gets appended automatically.
@param os_errno Eventual errno related to the message. Submit 0 if
the message is not related to a operating system error.
@param severity One of "ABORT", "FATAL", "SORRY", "WARNING", "HINT",
"NOTE", "UPDATE", "DEBUG". Defaults to "FATAL".
@param flag Bitfield for control purposes
bit0= use pager (as with result)
bit1= permission to suppress output
@return 1 if message was delivered, <=0 if failure
*/
int Xorriso_msgs_submit(struct XorrisO *xorriso,
int error_code, char msg_text[], int os_errno,
char severity[], int flag);
/** Evaluate an advise whether to abort or whether to go on with option
processing. This should be called after any option function was processed.
It updates the problem status by processing the library message queues
and then it uses this status and the submitted return value ot the
option function to evaluate the situation.
@param xorriso The environment handle
@param ret The return value of the previously called option function
2007-11-06 16:32:39 +00:00
@param flag bit0= do not issue own event messages
bit1= take xorriso->request_to_abort as reason for abort
@return Gives the advice:
2= pardon was given, go on
1= no problem, go on
0= function failed but xorriso would not abort, go on
<0= do abort
-1 = due to xorriso->problem_status
or due to ret<0
-2 = due to xorriso->request_to_abort
*/
int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag);
/** Set the current problem status of the xorriso handle.
@param xorriso The environment handle
@param severity A severity text. Empty text resets to "No Problem".
@param flag Unused yet. Submit 0.
@return <=0 failure (e.g. wrong severity text), 1 success.
*/
int Xorriso_set_problem_status(struct XorrisO *xorriso, char *severity,
int flag);
/* The next two functions are part of Xorriso_eval_problem_status().
You may use them to build an own advisor function or to drain the
library message queues more frequently.
*/
/** Obtain the current problem status of the xorriso handle.
@param xorriso The environment handle
@param severity The severity text matching the current problem status
@param flag Unused yet. Submit 0.
@return The severity rank number. 0= no problem occured.
*/
int Xorriso_get_problem_status(struct XorrisO *xorriso, char severity[80],
int flag);
/** Forward any pending messages from the library message queues to the
xorriso message system which puts out on info channel. This registers
the severity of the library events like the severity of a message submitted
via Xorriso_msgs_submit().
xorriso sets the message queues of the libraries to queuing "ALL".
So it is essential that they get drained regularly.
@param xorriso The environment handle
@param flag Unused yet. Submit 0.
@return 1 on success, <=0 if failure
*/
int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag);
2007-10-12 20:39:29 +00:00
/* ---------------------------- Options API ------------------------ */
/* See man 1 xorriso for explanation of the particular options */
/*
Before each call to an option function, there should happen:
Xorriso_set_problem_status() with empty severity text.
After each call to an option function, there should happen:
Xorriso_eval_problem_status()
One should follow its eventual advice to abort.
*/
2007-10-12 20:39:29 +00:00
/* Option -abort_on */
int Xorriso_option_abort_on(struct XorrisO *xorriso, char *severity, int flag);
/* Option -add */
/* @param flag bit0=do not report the added item
bit1=do not reset pacifier, no final pacifier message
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
2008-01-20 20:03:48 +00:00
/* Option -add_plainly "on"|"off" */
int Xorriso_option_add_plainly(struct XorrisO *xorriso, char *mode,
int flag);
/* Option -alter_date, alter_date_r */
/* @param flag bit0=recursive (-alter_date_r)
*/
int Xorriso_option_alter_date(struct XorrisO *xorriso,
char *time_type, char *timestring,
int argc, char **argv, int *idx, int flag);
2007-10-12 20:39:29 +00:00
/* Option -ban_stdio_write */
int Xorriso_option_ban_stdio_write(struct XorrisO *xorriso, int flag);
2007-10-19 20:41:34 +00:00
/* Option -blank and -format */
/* @param flag bit0= format rather than blank
@return <=0 error , 1 success, 2 revoked by -reassure
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag);
/* Option -boot_image */
int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
char *treatment, int flag);
2007-10-12 20:39:29 +00:00
/* Option -cd alias -cdi */
int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag);
/* Option -cdx */
int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag);
/* Option -chgrp alias -chgrpi , chgrp_r alias chgrpi */
/* @param flag bit0=recursive (-chgrp_r)
*/
int Xorriso_option_chgrpi(struct XorrisO *xorriso, char *gid,
2007-10-12 20:39:29 +00:00
int argc, char **argv, int *idx, int flag);
/* Option -chmod alias -chmodi , -chmod_r alias chmod_ri */
/* @param flag bit0=recursive (-chmod_r)
*/
int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode,
2007-10-12 20:39:29 +00:00
int argc, char **argv, int *idx, int flag);
/* Option -chown alias -chowni , chown_r alias chown_ri */
/* @param flag bit0=recursive (-chown_r)
*/
int Xorriso_option_chowni(struct XorrisO *xorriso, char *uid,
2007-10-12 20:39:29 +00:00
int argc, char **argv, int *idx, int flag);
/* Option -close "on"|"off" */
int Xorriso_option_close(struct XorrisO *xorriso, char *mode, int flag);
/* Option -commit */
2008-02-02 13:19:53 +00:00
/* @param flag bit0= leave indrive and outdrive aquired as they were,
i.e. do not aquire outdrive as new in-out-drive
bit1= do not perform eventual -reassure
@return <=0 error , 1 success, 2 revoked by -reassure
2008-02-02 13:19:53 +00:00
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_commit(struct XorrisO *xorriso, int flag);
2008-01-25 17:54:47 +00:00
/* Option -commit_eject */
/* @return <=0 error , 1 success, 2 revoked by -reassure
*/
2008-02-02 13:19:53 +00:00
int Xorriso_option_commit_eject(struct XorrisO *xorriso, char *which, int flag);
2008-01-25 17:54:47 +00:00
2007-12-25 16:02:06 +00:00
/* Option -cpr alias -cpri */
int Xorriso_option_cpri( struct XorrisO *xorriso, int argc, char **argv,
2007-10-12 20:39:29 +00:00
int *idx, int flag);
/* >>> not yet implemented
/ * Option -cut_out * /
int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path,
off_t startbyte, off_t bytecount, char *iso_rr_path, int flag);
*/
2007-10-12 20:39:29 +00:00
/* Options -dev , -indev, -outdev */
/* @param flag bit0=use as indev , bit1= use as outdev
@return <=0 error , 1 success, 2 revoked by -reassure
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_dev(struct XorrisO *xorriso, char *adr, int flag);
/* Option -devices */
/* @return <=0 error , 1 success, 2 revoked by -reassure
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_devices(struct XorrisO *xorriso, int flag);
/* Option -dialog "on"|"off" */
int Xorriso_option_dialog(struct XorrisO *xorriso, char *mode, int flag);
/* Option -disk_pattern "on"|"ls"|"off" */
int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag);
2007-10-12 20:39:29 +00:00
/* Option -dummy "on"|"off" */
int Xorriso_option_dummy(struct XorrisO *xorriso, char *mode, int flag);
/* Option -eject */
/* @param flag bit0=do not report toc of eventually remaining drives
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag);
2008-01-25 17:54:47 +00:00
/* Options -end , and -rollback_end */
/* @param flag bit0= discard pending changes
@return <=0 error , 1 success, 2 revoked by -reassure
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_end(struct XorrisO *xorriso, int flag);
/* Option -iso_rr_pattern "on"|"ls"|"off" */
int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,
int flag);
/* Option -follow */
int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag);
2007-10-12 20:39:29 +00:00
2007-12-22 14:39:12 +00:00
/* Option -find alias -findi, and -findx */
/* @param flag bit0= -findx rather than -findi
*/
int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv,
2007-12-21 13:16:49 +00:00
int *idx, int flag);
2007-10-12 20:39:29 +00:00
2007-10-19 20:41:34 +00:00
/* Option -fs */
int Xorriso_option_fs(struct XorrisO *xorriso, char *size, int flag);
2007-10-12 20:39:29 +00:00
/* Option -gid */
int Xorriso_option_gid(struct XorrisO *xorriso, char *gid, int flag);
/* Option -help and part of -prog_help */
int Xorriso_option_help(struct XorrisO *xorriso, int flag);
/* Option -history */
int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag);
/* Option -joliet "on"|"off" */
int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag);
2007-10-12 20:39:29 +00:00
2007-12-20 11:14:49 +00:00
/* Option -logfile */
int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel,
char *fileadr, int flag);
/* Options -ls alias -lsi and -lsl alias -lsli
and -lsd alias -lsdi and -lsdl alias -lsdli
and -du alias -dui and -dus alias -dusi
@param flag bit0= long format (-lsl , -du)
2007-11-01 19:11:56 +00:00
bit1= do not expand patterns but use literally
bit2= du rather than ls
2007-12-20 11:14:49 +00:00
bit3= list directories as themselves (ls -d)
2007-11-01 19:11:56 +00:00
*/
2007-10-31 10:34:52 +00:00
int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
2007-10-12 20:39:29 +00:00
2007-12-20 11:14:49 +00:00
/* Options -lsx, -lslx, -lsdx , -lsdlx , -dux , -dusx
@param flag bit0= long format (-lslx , -dux)
bit1= do not expand patterns but use literally
bit2= du rather than ls
2007-12-20 11:14:49 +00:00
bit3= list directories as themselves (ls -d)
*/
int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
2007-10-12 20:39:29 +00:00
/* Option -mark */
int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag);
/* Option -mkdir alias -mkdiri */
int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
/* Option -mv alias -mvi */
int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
/* Option -no_rc */
int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag);
/* Option -options_from_file*/
/* @return <=0 error , 1 = success , 3 = request to end program run */
int Xorriso_option_options_from_file(struct XorrisO *xorriso, char *adr,
int flag);
2007-11-06 16:32:39 +00:00
/* Option -overwrite "on"|"nondir"|"off" */
2007-10-12 20:39:29 +00:00
int Xorriso_option_overwrite(struct XorrisO *xorriso, char *mode, int flag);
2008-02-05 16:27:10 +00:00
/* Option -padding */
int Xorriso_option_padding(struct XorrisO *xorriso, char *size, int flag);
2007-10-12 20:39:29 +00:00
/* Option -page */
int Xorriso_option_page(struct XorrisO *xorriso, int len, int width, int flag);
/* Option -path-list */
int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag);
2008-02-05 16:27:10 +00:00
/* Option -pathspecs */
int Xorriso_option_pathspecs(struct XorrisO *xorriso, char *mode, int flag);
2007-10-12 20:39:29 +00:00
/* Option -pkt_output */
int Xorriso_option_pkt_output(struct XorrisO *xorriso, char *mode, int flag);
/* Option -print */
int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag);
/* Option -print-size */
int Xorriso_option_print_size(struct XorrisO *xorriso, int flag);
/* Option -prog */
int Xorriso_option_prog(struct XorrisO *xorriso, char *name, int flag);
/* Option -prog_help */
int Xorriso_option_prog_help(struct XorrisO *xorriso, char *name, int flag);
/* Option -pwd alias -pwdi */
int Xorriso_option_pwdi(struct XorrisO *xorriso, int flag);
/* Option -pwdx */
int Xorriso_option_pwdx(struct XorrisO *xorriso, int flag);
/* Option -report_about */
int Xorriso_option_report_about(struct XorrisO *xorriso, char *severity,
int flag);
2008-02-11 13:55:09 +00:00
/* Option -return_with */
int Xorriso_option_return_with(struct XorrisO *xorriso, char *severity,
int exit_value, int flag);
2007-11-07 12:37:19 +00:00
/* Option -reassure "on"|"tree"|"off" */
2007-10-12 20:39:29 +00:00
int Xorriso_option_reassure(struct XorrisO *xorriso, char *mode, int flag);
2007-11-07 15:01:20 +00:00
/* Options -rm alias -rmi , -rm_r alias -rm_ri , -rmdir alias -rmdiri */
/* @param flag bit0=recursive , bit2= remove empty directory: rmdir */
2007-10-12 20:39:29 +00:00
int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
/* Option -rollback */
/* @return <=0 error , 1 success, 2 revoked by -reassure
*/
2007-10-12 20:39:29 +00:00
int Xorriso_option_rollback(struct XorrisO *xorriso, int flag);
/* Option -speed */
int Xorriso_option_speed(struct XorrisO *xorriso, char *speed, int flag);
/* Option -status */
int Xorriso_option_status(struct XorrisO *xorriso, char *mode, int flag);
/* Option -status_history_max */
int Xorriso_option_status_history_max(struct XorrisO *xorriso, int num1,
int flag);
/* Option -tell_media_space */
int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag);
2007-10-31 10:34:52 +00:00
/* Option -temp_mem_limit */
int Xorriso_option_temp_mem_limit(struct XorrisO *xorriso, char *size,
int flag);
2007-10-12 20:39:29 +00:00
/* Option -toc */
int Xorriso_option_toc(struct XorrisO *xorriso, int flag);
/* Option -uid */
int Xorriso_option_use_readline(struct XorrisO *xorriso, char *uid, int flag);
/* Option -use_readline */
int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag);
/* Option -version */
int Xorriso_option_version(struct XorrisO *xorriso, int flag);
/* Option -volid */
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag);
2007-10-12 20:39:29 +00:00
#endif /* Xorriso_includeD */