219 lines
5.6 KiB
C
219 lines
5.6 KiB
C
|
|
/* Command line oriented batch and dialog tool which creates, loads,
|
|
manipulates and burns ISO 9660 filesystem images.
|
|
|
|
Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net>
|
|
|
|
Provided under GPL version 2.
|
|
|
|
This file contains the inner description of xorriso.
|
|
*/
|
|
|
|
|
|
/* For now, #ifdef Xorriso_is_xorriso_selF has no meaning.
|
|
But it is already now to be set only by the xorriso.c module.
|
|
*/
|
|
|
|
#ifndef Xorriso_private_includeD
|
|
#define Xorriso_private_includeD yes
|
|
|
|
|
|
/* Because regex_t is mentioned in struct XorrisO */
|
|
#ifdef Xorriso_with_regeX
|
|
#include <regex.h>
|
|
#endif /* Xorriso_with_regeX */
|
|
|
|
|
|
#define Smem_malloC malloc
|
|
#define Smem_freE free
|
|
#define SfileadrL 4096
|
|
|
|
/* <<< ??? */
|
|
typedef int (*Cleanup_app_handler_T)();
|
|
|
|
|
|
|
|
/* maximum number of history lines to be reported with -status:long_history */
|
|
#define Xorriso_status_history_maX 100
|
|
|
|
/* <<< ??? */
|
|
/* try to catch signals and ignore them during abort handling */
|
|
#define Xorriso_abort_handler_defaulT (1|(2<<4))
|
|
|
|
|
|
/** The list of startup file names */
|
|
#define Xorriso_rc_nuM 4
|
|
|
|
|
|
struct XorrisO { /* the global context of xorriso */
|
|
|
|
int libs_are_started;
|
|
|
|
/* source */
|
|
char progname[SfileadrL];
|
|
char initial_wdx[SfileadrL];
|
|
int no_rc;
|
|
|
|
/** List of startupfiles */
|
|
char rc_filenames[Xorriso_rc_nuM][SfileadrL];
|
|
int rc_filename_count;
|
|
|
|
char wdi[SfileadrL];
|
|
char wdx[SfileadrL];
|
|
int did_something_useful;
|
|
|
|
|
|
/* >>> put libisofs aspects here <<< */
|
|
|
|
int do_joliet;
|
|
int do_follow_links;
|
|
int do_global_uid;
|
|
uid_t global_uid;
|
|
int do_global_gid;
|
|
gid_t global_gid;
|
|
|
|
int do_overwrite; /* 0=off, 1=on, 2=nondir */
|
|
int do_reassure; /* 0=off, 1=on, 2=tree */
|
|
|
|
char volid[SfileadrL];
|
|
|
|
/* >>> put libburn/isoburn aspects here */
|
|
|
|
char indev[SfileadrL];
|
|
void *in_drive_handle; /* interpreted only by xorrisoburn.c */
|
|
void *in_volset_handle; /* interpreted only by xorrisoburn.c */
|
|
|
|
int volset_change_pending; /* whether -commit would make sense */
|
|
|
|
char outdev[SfileadrL];
|
|
void *out_drive_handle; /* interpreted only by xorrisoburn.c */
|
|
|
|
int ban_stdio_write;
|
|
int do_dummy;
|
|
int do_close;
|
|
int speed; /* in libburn units : 1000 bytes/second , 0 = Max, -1 = Min */
|
|
int fs; /* fifo size in 2048 byte chunks : at most 1 GB */
|
|
|
|
/* XORRISO options */
|
|
int allow_graft_points;
|
|
|
|
int dialog;
|
|
|
|
|
|
/* Pattern matching facility. It still carries legacy from scdbackup/askme.c
|
|
but is fully functional for xorriso.
|
|
*/
|
|
int search_mode;
|
|
/* 0= start text
|
|
1= fgrep ,
|
|
2= regular expression
|
|
3= (eventually structured) shell parser expression
|
|
4= shell parser expression for leaf name
|
|
*/
|
|
int structured_search;
|
|
/* 0= flat text search
|
|
1= '/' is a significant separator that cannot be matched by wildcards
|
|
( 2= like 1 : but report only occurence in tree, no payload, no location )
|
|
( 3= like 2 : but report first content level of matching directories )
|
|
4= actually not structured but unique find mode (with search_mode 4)
|
|
*/
|
|
|
|
int temp_mem_limit;
|
|
|
|
int use_stdin; /* use raw stdin even if readline support is compiled */
|
|
int result_page_length;
|
|
int result_page_width;
|
|
char mark_text[SfileadrL]; /* ( stdout+stderr, M: ) */
|
|
int packet_output;
|
|
char logfile[4][SfileadrL];
|
|
int status_history_max; /* for -status long_history */
|
|
|
|
char report_about_text[20];
|
|
int report_about_severity;
|
|
int library_msg_direct_print;
|
|
char abort_on_text[20];
|
|
int abort_on_severity; /* A severity rank number as threshold */
|
|
int problem_status; /* Severity rank number. 0= no abort condition present */
|
|
char problem_status_text[20];
|
|
|
|
/* temporary search facilities */
|
|
#ifdef Xorriso_with_regeX
|
|
regex_t *re;
|
|
regmatch_t match[1];
|
|
#endif /* Xorriso_with_regeX */
|
|
char **re_constants;
|
|
int re_count;
|
|
int re_fill;
|
|
char reg_expr[2*SfileadrL];
|
|
|
|
/* run state */
|
|
int is_dialog;
|
|
int bar_is_fresh;
|
|
char pending_option[SfileadrL]; /* eventual option entered at page prompt */
|
|
int request_to_abort; /* abort a single operation like -ls, not the program */
|
|
int request_not_to_ask; /* suppress reassure and pager */
|
|
double idle_time;
|
|
int re_failed_at; /* mismatch position with structured_search */
|
|
int prepended_wd;
|
|
double insert_count;
|
|
double insert_bytes;
|
|
double error_count; /* double will not roll over */
|
|
|
|
/* result (stdout, R: ) */
|
|
char result_line[5*SfileadrL];
|
|
int result_line_counter;
|
|
int result_page_counter;
|
|
int result_open_line_len;
|
|
|
|
|
|
/* info (stderr, I:) */
|
|
char info_text[10*SfileadrL];
|
|
|
|
};
|
|
|
|
|
|
int Xorriso_destroy(struct XorrisO **xorriso, int flag);
|
|
|
|
int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag);
|
|
|
|
int Xorriso_result(struct XorrisO *xorriso, int flag);
|
|
|
|
int Xorriso_info(struct XorrisO *xorriso, int flag);
|
|
|
|
int Xorriso_request_confirmation(struct XorrisO *xorriso, int flag);
|
|
|
|
int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv,
|
|
int flag);
|
|
|
|
int Xorriso_execute_option(struct XorrisO *xorriso, char *line, int flag);
|
|
|
|
int Xorriso_regexec(struct XorrisO *xorriso, char *to_match, int *failed_at,
|
|
int flag);
|
|
|
|
int Sfile_str(char target[SfileadrL], char *source, int flag);
|
|
|
|
double Sfile_microtime(int flag);
|
|
|
|
int Sfile_add_to_path(char path[SfileadrL], char *addon, int flag);
|
|
|
|
int Sfile_scale(double value, char *result, int siz, double thresh, int flag);
|
|
|
|
int Sfile_destroy_argv(int *argc, char ***argv, int flag);
|
|
|
|
char *Text_shellsafe(char *in_text, char *out_text, int flag);
|
|
|
|
int Sort_argv(int argc, char **argv, int flag);
|
|
|
|
struct DirseQ;
|
|
|
|
int Dirseq_new(struct DirseQ **o, char *dir, int flag);
|
|
|
|
int Dirseq_destroy(struct DirseQ **o, int flag);
|
|
|
|
int Dirseq_next_adr(struct DirseQ *o, char reply[SfileadrL], int flag);
|
|
|
|
|
|
|
|
#endif /* Xorriso_private_includeD */
|
|
|