"Fossies" - the Fresh Open Source Software Archive

Member "libisoburn-1.5.4/xorriso/xorriso_private.h" (8 Dec 2020, 34391 Bytes) of package /linux/misc/libisoburn-1.5.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "xorriso_private.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.5.0_vs_1.5.2.

    1 
    2 /* Command line oriented batch and dialog tool which creates, loads,
    3    manipulates and burns ISO 9660 filesystem images.
    4 
    5    Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
    6 
    7    Provided under GPL version 2 or later.
    8 
    9    This file contains inner declarations of xorriso.
   10    The public interface is in xorriso.h
   11 */
   12 
   13 
   14 /* For now, #ifdef Xorriso_is_xorriso_selF  has no meaning.
   15    But it is already now to be set only by the xorriso.c module.
   16 */
   17 
   18 #ifndef Xorriso_private_includeD
   19 #define Xorriso_private_includeD yes
   20 
   21 
   22 /* <<< Disable this to disable pthread_mutex locking on message and result
   23        output.
   24 */
   25 #define Xorriso_fetch_with_msg_queueS yes
   26 
   27 
   28 /* for uint32_t */
   29 #ifdef HAVE_STDINT_H
   30 #include <stdint.h>
   31 #else
   32 #ifdef HAVE_INTTYPES_H
   33 #include <inttypes.h>
   34 #endif
   35 #endif
   36 
   37 /* for pthread_mutex_t on OpenBSD */
   38 #include <pthread.h>
   39 
   40 
   41 /** The source code release timestamp */
   42 #include "xorriso_timestamp.h"
   43 #ifndef Xorriso_timestamP
   44 #define Xorriso_timestamP "-none-given-"
   45 #endif
   46 
   47 /** The binary build timestamp is to be set externally by the compiler
   48     or by a macro definition in xorriso_buildstamp.h.
   49 */
   50 #include "xorriso_buildstamp.h"
   51 #ifndef Xorriso_build_timestamP
   52 #define Xorriso_build_timestamP "-none-given-"
   53 #endif
   54 
   55 
   56 #include "sfile.h"
   57 #include "misc_funct.h"
   58 
   59 
   60 struct ExclusionS;        /* List of -not_* conditions */
   61 struct PermiteM;          /* Stack of temporarily altered access permissions */
   62 struct CheckmediajoB;     /* Parameters for Xorriso_check_media() */
   63 struct SectorbitmaP;      /* Distiniction between valid and invalid sectors */
   64 struct FindjoB;           /* Program and status of a find run */
   65 
   66 
   67 /* maximum number of history lines to be reported with -status:long_history */
   68 #define Xorriso_status_history_maX 100
   69 
   70 
   71 /** The list of startup file names */
   72 #define Xorriso_rc_nuM 4
   73 
   74 
   75 /* Default setting for the size limit of single data files:
   76    100 extents with 4 GB - 2 kB each = 400 GB - 200 kB
   77 */
   78 #define Xorriso_default_file_size_limiT \
   79         (((off_t) 400) * ((off_t) 1024*1024*1024) - (off_t) 204800)
   80 
   81 
   82 /* Maximum number of appended partitions. Effectively usable number depends
   83    on system area type.
   84 */
   85 #define Xorriso_max_appended_partitionS 8
   86 
   87 
   88 /*
   89   Maximum length of a disc label text plus 1.
   90 */
   91 #define Xorriso_disc_label_sizE 129
   92 
   93 
   94 struct XorrisO { /* the global context of xorriso */
   95 
   96  int libs_are_started;
   97 
   98  /* source */
   99  char progname[SfileadrL];
  100  char initial_wdx[SfileadrL];
  101  int no_rc;
  102 
  103  /* Command line argument emulations:
  104       0=xorriso mode
  105       1=mkisofs mode
  106       2=cdrecord mode
  107  */
  108  int argument_emulation;
  109 
  110  /** List of startupfiles */
  111  char rc_filenames[Xorriso_rc_nuM][SfileadrL];
  112  int rc_filename_count;
  113 
  114  int arrange_args;
  115 
  116  /* Whether .mkisofsrc has already been read */
  117  int mkisofsrc_done;
  118 
  119  char wdi[SfileadrL];
  120  char wdx[SfileadrL];
  121  int did_something_useful;
  122 
  123  int add_plainly;
  124  off_t split_size;
  125 
  126  char list_delimiter[81];
  127 
  128  /* >>> put libisofs aspects here <<< */
  129 
  130  int ino_behavior; /* bit0= at image load time:
  131                             Do not load PX inode numbers but generate new
  132                             unique ones for all loaded IsoNode.
  133                       bit1= at image generation time:
  134                             Do not consolidate suitable nodes to hardlinks.
  135                       bit2= at restore-to-disk time:
  136                             Do not consolidate suitable nodes to hardlinks.
  137                       bit3= with update:
  138                             Do not try to detect hardlink splits and joinings.
  139                       bit4= with extract:
  140                             Do not create or use hln arrays if sort_lba_on
  141                       bit5= with command -lsl
  142                             Do not create hln array for hard link count
  143                     */
  144 
  145  int iso_level;
  146  int iso_level_is_default;
  147  int do_joliet;
  148  int do_hfsplus;
  149  int do_fat;
  150  int do_rockridge;
  151  int do_iso1999;
  152  int ecma119_map;     /* 0=unmapped , 1=stripped , 2=uppercase , 3=lowercase */
  153  int joliet_map;      /* 0=unmapped , 1=stripped */
  154 
  155  int do_aaip; /* bit0= ACL in
  156                  bit1= ACL out
  157                  bit2= EA in
  158                  bit3= EA out
  159                  bit4= record dev,inode per node, isofs_st_out in root
  160                  bit5= check dev,inode,isofs_st_in
  161                  bit6= omit content check if bit5 check is conclusive
  162                  bit7= omit dev check with bit5
  163                  bit8= store output charset in xattr "isofs.cs"
  164                  bit9= set input charset from xattr "isofs.cs"
  165                 bit10= if bit2: import from local filesystem all xattr
  166                                 namespaces, not only "user."
  167                        if bit3: export to local filesystem all xattr
  168                                 namespaces, not only "user."
  169               */
  170 
  171  int do_md5;  /* bit0= read MD5 array
  172                  bit1= write session MD5
  173                  bit2= write MD5 for each data file
  174                  bit3= make file content stability check by double reading
  175                  bit4= use recorded MD5 as proxy of ISO file
  176                  bit5= with bit0: do not check tags of superblock,tree,session
  177                  bit6= during extraction verify file content by recorded MD5
  178                  bit7= with bit6: take lack of MD5 as error
  179                */
  180 
  181  int no_emul_toc; /* bit0= On overwritables: 
  182                            write first session to LBA 0 rather than 32.
  183                   */
  184 
  185  int do_old_empty; /* See -compliance old_empty
  186                       own data content: range [0,31]. The new way is to have
  187                       a dedicated block to which all such files will point.
  188                     */
  189 
  190  char scdbackup_tag_name[81];
  191  char scdbackup_tag_time[19];
  192  char scdbackup_tag_written[512];
  193  char scdbackup_tag_listname[SfileadrL];
  194 
  195  int relax_compliance;        /* opaque bitfield to be set by xorrisoburn */
  196  int allow_dir_id_ext_dflt; /* -compliance allow_dir_id_ext still on default */
  197  char rr_reloc_dir[256];
  198  int rr_reloc_flags;
  199  int untranslated_name_len;
  200  int do_follow_pattern;
  201  int do_follow_param;
  202  int do_follow_links;
  203  int follow_link_limit;
  204  int resolve_link_rec_count;
  205  int resolve_link_rec_limit;
  206  int do_follow_concat;
  207  int do_follow_mount;
  208  int do_global_uid;
  209  uid_t global_uid;
  210  int do_global_gid;
  211  gid_t global_gid;
  212  int do_global_mode;
  213  mode_t global_dir_mode;
  214  mode_t global_file_mode;
  215 
  216  int do_tao; /* 1= Use TAO or Incremental
  217                -1= Use SAO or DAO
  218                 0= let libburn choose */
  219 
  220  struct Xorriso_lsT *filters;
  221  int filter_list_closed;
  222 
  223  int zlib_level;
  224  int zlib_level_default;
  225  int zisofs_block_size;
  226  int zisofs_block_size_default;
  227  int zisofs_by_magic;
  228  int zisofs_v2_enabled;  /* 0=no, 1=as_needed, 2=force */
  229  uint64_t zisofs_max_total_blocks;
  230  uint64_t zisofs_max_total_blocks_default;
  231  uint64_t zisofs_max_file_blocks;
  232  uint64_t zisofs_max_file_blocks_default;
  233  int zisofs_v2_block_size;
  234  int zisofs_v2_block_size_default;
  235  int64_t zisofs_block_number_target;
  236  double zisofs_bpt_discard_free_ratio;
  237  double zisofs_bpt_discard_free_ratio_default;
  238  int zisofs_susp_z2;
  239  int zisofs_susp_z2_default;
  240 
  241  int do_overwrite; /* 0=off, 1=on, 2=nondir */
  242  int do_reassure;  /* 0=off, 1=on, 2=tree */
  243 
  244  uint32_t isofs_size;   /* Size of loaded ISO filesystem */
  245  int isofs_has_what;    /* bit0= hasRR
  246                            bit1= hasJoliet
  247                            bit2= hasIso1999
  248                            bit3= hasElTorito
  249                          */
  250  int tree_loaded;       /* 0= ISO 9660 , 1 = Joliet , 2 = ISO 9660:1999 */
  251  int rr_loaded;         /* 1= Rock Ridge information was used, 0= Not */
  252 
  253  char volid[33];
  254  int volid_default;
  255  char loaded_volid[33];
  256  char assert_volid[SfileadrL];
  257  char assert_volid_sev[80];
  258 
  259  char preparer_id[129];
  260 
  261  char publisher[129];
  262  char application_id[129];
  263  char system_id[33];
  264  char volset_id[129];
  265 
  266  char copyright_file[38];
  267  char biblio_file[38];
  268  char abstract_file[38];
  269 
  270  char application_use[SfileadrL];
  271 
  272  char session_logfile[SfileadrL];
  273  int session_lba;
  274  int session_blocks;
  275 
  276  /* >>> put libburn/isoburn aspects here */
  277 
  278  struct Xorriso_lsT *drive_blacklist;
  279  struct Xorriso_lsT *drive_greylist;
  280  struct Xorriso_lsT *drive_whitelist;
  281 
  282  int toc_emulation_flag; /* bit0= bit3 for isoburn_drive_aquire()
  283                                   scan -ROM profiles for ISO sessions
  284                             bit1= bit4 for isoburn_drive_aquire()
  285                                   do not emulate TOC on overwritable media
  286                             bit2= bit7 for isoburn_drive_aquire()
  287                                   pretend any media to be -ROM
  288                             bit3= bit9 for isoburn_drive_aquire()
  289                                   Ignore enclosing session at LBA 0
  290                          */
  291 
  292  int image_start_mode;  /* From what address to load the ISO image
  293                            bit0-15= addressing mode
  294                             0= automatic lba as deduced from media
  295                             1= value is session number
  296                             2= value is track number
  297                             3= value is lba
  298                            bit16= with mode 3 : value is possibly 16 too high.
  299                                   Let isoburn_set_msc1() adjust it.
  300                            bit30= interference with normal msc1 processing
  301                                   is enabled. Without this bit,
  302                                   isoburn_set_msc1() will not be called.
  303                            bit31= image loading has happened,
  304                                   setting is kept for rollback only.
  305                                   Always apply as 0=auto.
  306                         */
  307  char image_start_value[81]; /* value according image_start_mode */
  308 
  309  uint32_t displacement;
  310  int displacement_sign;
  311 
  312  int read_fs;            /* bit0=norock , bit1=nojoliet */
  313 
  314  int drives_exclusive;   /* burn_preset_device_open() param exclusive */
  315  int drives_access;      /* 0=readonly , 1=unrestricted */
  316 
  317  int linux_scsi_dev_family; /* 0= default, 1= sr, 2= scd, (3= st), 4= sg */
  318 
  319  int early_stdio_test;   /* For burn_allow_drive_role_4():
  320                             bit1= Test whether a stdio drive can be opened for
  321                                   read-write resp. read-only resp. write only.
  322                             bit2= Classify files which cannot be opened at all
  323                                   as role 0 : useless dummy.
  324                             bit3= Classify non-empty role 5 drives as
  325                                   BURN_DISC_APPENDABLE with NWA after the
  326                                   end of the file. It is nevertheless
  327                                   possible to change this address by call
  328                                   burn_write_opts_set_start_byte().
  329                           */
  330 
  331  int cache_num_tiles;     /* -data_cache_size */
  332  int cache_tile_blocks;
  333  int cache_default;       /* bit0= cache_num_tiles, bit1= cache_tile_blocks */
  334 
  335  int do_calm_drive;      /* bit0= calm down drive after acquiring it */
  336 
  337  char indev[SfileadrL];
  338  void *in_drive_handle;  /* interpreted only by libburnia oriented modules */
  339  void *in_volset_handle; /* interpreted only by libburnia oriented modules */
  340  char *in_charset;       /* The charset to interpret the filename bytes */
  341  int indev_is_exclusive;
  342  int indev_access;              /* see drives_access */
  343  char indev_off_adr[SfileadrL]; /* Result of burn_drive_convert_fs_adr(indev)
  344                                    when indev gets acquired. */
  345 
  346  time_t isofs_st_out;    /* A time point at least 1 second before image
  347                             composition began. To be stored with image as
  348                             xattr "isofs.st". */
  349  time_t isofs_st_in;     /* That time point as read from "isofs.st" of the
  350                             loaded image. */
  351 
  352  int volset_change_pending; /* whether -commit would make sense
  353                                0= no change pending
  354                                1= change pending
  355                                2= change pending, but -as misofs -print-size
  356                                   was performed on the changed image model
  357                                3= change pending, but the attempt to write it
  358                                   failed
  359                              */
  360  int no_volset_present;     /* set to 1 on first failure */
  361 
  362  struct CheckmediajoB *check_media_default;
  363  int check_media_bad_limit;      /* values defined as Xorriso_read_quality_* */
  364  struct SectorbitmaP *in_sector_map; /* eventual sector validity bitmap */
  365 
  366 
  367  char outdev[SfileadrL];
  368  void *out_drive_handle; /* interpreted only by xorrisoburn.c */
  369  char *out_charset;      /* The charset to produce the filename bytes for */
  370  int dev_fd_1; /* The fd which substitutes for /dev/fd/1 and is
  371                      connected to externaly perveived stdout.
  372                   */
  373  int outdev_is_exclusive;
  374  int outdev_access;              /* see drives_access */
  375  char outdev_off_adr[SfileadrL]; /* Result of burn_drive_convert_fs_adr(outdev)
  376                         when outdev gets acquired. */
  377 
  378  int grow_blindly_msc2; /* if >= 0 this causes growing from drive to drive.
  379                            The value is used as block address offset for
  380                            image generation. Like in: mkisofs -C msc1,msc2
  381                          */
  382 
  383  int ban_stdio_write;
  384  int do_dummy;
  385  int do_close;
  386  int auto_close;     /* Whether to let do_close depend on media state */
  387 
  388  int write_speed;    /* Write speed in libburn units : 1000 bytes/second ,
  389                                            0 = Max, -1 = Min, -2= do not set */
  390  int read_speed;     /* Read speed. See above */
  391  int read_speed_force;   /* >0 : use burn_nominal_slowdown() in
  392                                  Xorriso_check_interval() */
  393  int read_speed_corr;    /* parameter max_corr for burn_nominal_slowdown */
  394 
  395  int fs;        /* fifo size in 2048 byte chunks : at most 1 GB */
  396  int padding;   /* number of bytes to add after ISO 9660 image */
  397  int do_padding_by_libisofs; /* 0= by libburn , 1= by libisofs */
  398 
  399  int alignment; /* if > 0 : output size alignment in 2048 byte blocks.
  400                             This is always done by libburn, i.e. attached
  401                             outside the image. Eventual inner alignment of
  402                             the image end happens first.
  403                 */
  404 
  405  int do_stream_recording; /* 0=no, 1=yes, 2=for data, not for dir
  406                              >=16 means yes with number as start LBA  */
  407 
  408  int dvd_obs;                 /* DVD write chunk size: 0, 32k or 64k */
  409 
  410  int modesty_on_drive;        /* "enable" of burn_drive_set_buffer_waiting()
  411                                  0= disable , 1= enable waiting ,
  412                                  (-1 = do not change setting)
  413                                */
  414  int min_buffer_usec;         /* The other parameters for this function */
  415  int max_buffer_usec;
  416  int buffer_timeout_sec;
  417  int min_buffer_percent;
  418  int max_buffer_percent;
  419 
  420  int use_immed_bit;           /* 1= on , 0= default , -1 = off */
  421  int use_immed_bit_default;   /* 1= on , 0= yet undefined , -1 = off */
  422 
  423  int stdio_sync;              /* stdio fsync interval: -1, 0, >=32 */
  424  int stdio_sync_is_default;   /* 1= is still default , 0= has been set */
  425 
  426  int keep_boot_image;
  427  char boot_image_cat_path[SfileadrL];
  428  int boot_image_cat_hidden;   /* bit0= hidden in ISO/RR , bit1= in Joliet ,
  429                                  bit2= in HFS+ */
  430  int boot_count; /* number of already attached boot images */
  431 
  432  char boot_image_bin_path[SfileadrL];
  433  char boot_image_bin_form[16];
  434  int boot_platform_id; 
  435  int patch_isolinux_image; /* bit0= boot-info-table , bit1= not with EFI
  436                               bit2-7= Mentioning in isohybrid GPT
  437                                       1=EFI, 2=HFS+
  438                               bit8= Mention in isohybrid Apple Partition Map
  439                               bit9= GRUB2 boot provisions (patch at byte 1012)
  440                             */
  441  int boot_image_emul; /* 0=no emulation
  442                          1=emulation as hard disk
  443                          2=emulation as floppy
  444                       */
  445  int boot_emul_default;  /* 1= boot_image_emul is still default */
  446  off_t boot_image_load_size;
  447  int boot_img_size_default;  /* 1= boot_image_load_size is still default */
  448  int boot_img_full_size;  /* 1= override boot_image_load_size by image size */
  449  unsigned char boot_id_string[29];
  450  unsigned char boot_selection_crit[21];
  451 
  452  int boot_image_isohybrid; /* 0=off , deprecated: 1=auto , 2=on , 3=force */
  453 
  454  int boot_efi_default; /* 0= no effect ,
  455                           1= apply --efi-boot parameters when attaching to img
  456                         */
  457 
  458  char system_area_disk_path[SfileadrL];
  459  int system_area_clear_loaded;
  460  int system_area_options;             /* bit0= "GRUB protective msdos label"
  461                                                (a simple partition table)
  462                                          bit1= isohybrid boot image pointer
  463                                                and partition table
  464                                          bit2-7= System area type
  465                                                0= with bit0 or bit1: MBR
  466                                                   else: unspecified type 
  467                                                1= MIPS Big Endian Volume Header
  468                                                2= MIPS Little Endian Boot Block
  469                                                3= SUN Disk Label for SUN SPARC
  470                                                4= HP-PA PALO boot sector
  471                                                   header version 4
  472                                                5= HP-PA PALO boot sector
  473                                                   header version 5
  474                                          bit8-9= Only with System area type 0
  475                                                Cylinder alignment mode
  476                                                0 = auto (align if bit1)
  477                                                1 = always align
  478                                                2 = never align
  479                                                3 = align external partitions
  480                                          bit10-13= System area sub type
  481                                                With type 0 = MBR:
  482                                                Gets overridden by bit0 and bit1.
  483                                                0 = no particular sub type
  484                                                1 = CHRP: A single MBR partition
  485                                                    of type 0x96 covers the ISO
  486                                                    image. Not compatible with 
  487                                                    any other feature which
  488                                                    needs to have own MBR
  489                                                    partition entries.
  490                                                2 = generic MBR
  491                                          bit14= Only with System area type 0
  492                                                GRUB2 boot provisions:
  493                                                Patch system area at byte 92 to
  494                                                99 with 512-block address + 1
  495                                                of the first boot image file.
  496                                                Little-endian 8-byte.
  497                                                Should be combined with
  498                                                options bit0.
  499                                          bit15= Only with MBR:
  500                                                Enforce MBR "bootable/active"
  501                                                flag. In worst case by dummy
  502                                                partition of type 0x00 which
  503                                                occupies block 0.
  504                                        */
  505  int patch_system_area;               /* Bits as of system_area_options.
  506                                          to be applied to the loaded system
  507                                          area of the image, if no 
  508                                          system_area_disk_path and no
  509                                          system_area_options are set.
  510                                        */
  511 
  512  /* The number of unclaimed 2K blocks before start of partition 1 as of
  513     the MBR in system area.
  514     If not 0 this will cause double volume descriptor sets and double tree.
  515  */
  516  uint32_t partition_offset;
  517  /* Partition table parameter: 1 to 63, 0= disabled/default */
  518  int partition_secs_per_head;
  519  /* 1 to 255, 0= disabled/default */
  520  int partition_heads_per_cyl;
  521 
  522  /* Disk file paths of content of PreP partition and EFI system partition */
  523  char prep_partition[SfileadrL];
  524  char efi_boot_partition[SfileadrL];
  525 
  526  /* Path and type of image files to be appended as MBR partitions */
  527  char *appended_partitions[Xorriso_max_appended_partitionS];
  528  uint8_t appended_part_types[Xorriso_max_appended_partitionS];
  529  uint8_t appended_part_type_guids[Xorriso_max_appended_partitionS][16];
  530  /* Flags in case that appended partitions show up in GPT:
  531     bit0= appended_part_type_guids is valid
  532  */
  533  uint8_t appended_part_gpt_flags[Xorriso_max_appended_partitionS];
  534  /* If 1: With appended partitions: create protective MBR and mark by GPT */
  535  int appended_as_gpt;
  536  /* If 1: With appended partitions: mark by APM */
  537  int appended_as_apm;
  538 
  539  /* If 1: Apply isohybrid gestures to non-isohybrid situations */
  540  int part_like_isohybrid;
  541 
  542  /* MBR partition type of ISO filesystem partition or protective partition
  543     if not real GPT or CHRP.
  544  */
  545  int iso_mbr_part_type;
  546  uint8_t iso_gpt_type_guid[16];
  547  int iso_mbr_part_flag;
  548  /* Flags in case that the partition table is GPT:
  549     bit0= iso_gpt_type_guid is valid
  550  */
  551 
  552  /* See libisoburn.h isoburn_igopt_set_gpt_guid() */
  553  uint8_t gpt_guid[16];
  554  int gpt_guid_mode;
  555 
  556  /* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
  557  */
  558  char ascii_disc_label[Xorriso_disc_label_sizE];
  559 
  560  /* A data file of which the position and size shall be written after
  561     a SUN Disk Label.
  562  */
  563  char grub2_sparc_core[SfileadrL];
  564 
  565  /* HFS+ image serial number.
  566     00...00 means that it shall be generated by libisofs.
  567  */
  568  uint8_t hfsp_serial_number[8];
  569 
  570  /* Allocation block size of HFS+  and APM : 0= auto , 512, or 2048
  571  */
  572  int hfsp_block_size;
  573  int apm_block_size;
  574 
  575  /* User settable PVD time stamps */
  576  time_t vol_creation_time;
  577  time_t vol_modification_time;
  578  time_t vol_expiration_time;
  579  time_t vol_effective_time;
  580  /* To eventually override vol_modification_time by unconverted string
  581     and timezone 0 */
  582  char vol_uuid[17];
  583  /* To flatly set all file timestamps to the same value
  584     Special value: "set_to_mtime", see -find action "set_to_mtime"
  585   */
  586  char all_file_dates[80];
  587 
  588  /* Timestamp for ISO files which have no origin file on disk and thus
  589     normally get time(NULL) as timestamps
  590  */
  591  int do_override_now_time;
  592  time_t now_time_override;
  593 
  594 #ifdef Xorriso_with_libjtE
  595  /* Parameters and state of Jigdo Template Export environment */
  596  struct libjte_env *libjte_handle;
  597 #endif
  598 
  599  /* List of -jigdo parameters since the most recent -jigdo clear */
  600  struct Xorriso_lsT *jigdo_params;
  601  struct Xorriso_lsT *jigdo_values;
  602  int libjte_params_given; /* bits: 0= outfile , 1= verbosity , 2= template_path
  603                                    3= jigdo_path , 4= checksum_path
  604                                    5= min_size , 6= checksum_iso
  605                                    7= checksum_template , 8= compression
  606                                    9= exclude , 10= demand_checksum
  607                                   11= mapping , 12= checksum_algorithm
  608                           */
  609 
  610  /* LBA of boot image after image loading */
  611  int loaded_boot_bin_lba;
  612  /* Path of the catalog node after image loading */
  613  char loaded_boot_cat_path[SfileadrL];
  614 
  615  /* XORRISO options */
  616  int allow_graft_points;   /* if not zero: yes
  617                               special options:
  618                               bit1= unescape '\\' too,
  619                                     continue unescaping after first real '='
  620                             */
  621 
  622  int allow_restore; /* -2=disallowed until special mode "unblock"
  623                        -1=permanently disallowed
  624                         0=disallowed, 1=allowed, 2=device files allowed */
  625  int do_concat_split;  /* 1= restore complete split file directories as
  626                              regular files
  627                         */
  628  int do_auto_chmod;    /* 1= eventually temporarily open access permissions
  629                              of self-owned directories during restore
  630                         */
  631  int do_restore_sort_lba; /* 1= restore via node_array rather than via
  632                                 tree traversal. Better read performance,
  633                                 no directory mtime restore, needs do_auto_chmod
  634                            */
  635  int do_strict_acl;       /* bit0= do not tolerate inappropriate presence or
  636                                    absence of directory "default" ACL
  637                           */
  638 
  639  int mount_opts_flag; /* bit0= "shared" = not "exclusive"
  640                                Try to emit non-exclusive mount command.
  641                                Do not give up drives.
  642                                Linux: use loop device even on block devices
  643                                in order to circumvent the ban to mount a
  644                                device twice (with different sbsector=)
  645                                FreeBSD: ?
  646                        */
  647 
  648  int dialog;  /* 0=off , 1=single-line , 2=multi-line */
  649 
  650  struct Xorriso_lsT *buffered_dialog; /* If not NULL : read by dialog */
  651 
  652  int bsl_interpretation;
  653                      /* whether to run input through Sfile_bsl_interpreter():
  654                         bit0-1= dialog and quoted file reading
  655                           0= no interpretation, leave unchanged
  656                           1= only inside double quotes
  657                           2= outside single quotes
  658                           3= everywhere
  659                         bit2-3= reserved as future expansion of bit0-1
  660                         bit4= interpretation within program start arguments
  661                         bit5= perform backslash encoding with results
  662                         bit6= perform backslash encoding with info texts
  663                      */
  664 
  665  int sh_style_result; /* Whether not to wrap into quotation marks the file
  666                          addresses reported by:
  667                            pwd pwdx ls lsd lsl lsdl lsx lsdx lslx lsdlx
  668                            du dus dux dusx findx find
  669                          and to make du* numbers left adjusted,
  670                          and not to append "/" to pwd* 
  671                        */
  672 
  673  /* Pattern matching facility. It still carries legacy from scdbackup/askme.c
  674     but is fully functional for xorriso.
  675  */
  676  int search_mode;
  677  /* 0= start text
  678     1= fgrep , 
  679     2= regular expression
  680     3= (eventually structured) shell parser expression
  681     4= shell parser expression for leaf name
  682  */
  683 
  684  int structured_search;
  685  /* 0= flat text search
  686     1= '/' is a significant separator that cannot be matched by wildcards
  687     ( 2= like 1 : but report only occurrence in tree, no payload, no location )
  688     ( 3= like 2 : but report first content level of matching directories )
  689     4= actually not structured but unique find mode (with search_mode 4)
  690  */
  691 
  692  int do_iso_rr_pattern; /* 0=off, 1=on, 2=ls */
  693  int do_disk_pattern;   /* 0=off, 1=on, 2=ls */
  694 
  695  int temp_mem_limit;
  696 
  697  off_t file_size_limit;
  698  int file_name_limit;
  699 
  700  struct ExclusionS *disk_exclusions;
  701  int disk_excl_mode; /* bit0= on (else off)
  702                         bit1= parameter too (else recursion only)
  703                         bit2= whole subtree banned (else only exact path)
  704                         bit3= when comparing ignore excluded files rather
  705                               than to treat them as truly missing on disk
  706                      */
  707 
  708  struct ExclusionS *iso_rr_hidings;
  709  struct ExclusionS *joliet_hidings;
  710  struct ExclusionS *hfsplus_hidings;
  711 
  712  int use_stdin; /* use raw stdin even if readline support is compiled */
  713  int tolerate_stdin_eof;  /* Do not abort on EOF in Xorriso_dialog_input
  714                              but rather return -2. */
  715  int result_page_length;
  716  int result_page_width;
  717  char mark_text[SfileadrL]; /* ( stdout+stderr, M: ) */
  718  int packet_output;
  719  char logfile[4][SfileadrL];
  720  FILE *logfile_fp[4];
  721  FILE *pktlog_fp;
  722  FILE *stderr_fp;
  723  struct Xorriso_lsT *result_msglists[Xorriso_max_outlist_stacK];
  724  struct Xorriso_lsT *info_msglists[Xorriso_max_outlist_stacK];
  725  int msglist_flags[Xorriso_max_outlist_stacK]; /* bit0= result is redirected
  726                                                   bit1= info is redirected
  727                                                */
  728  int msglist_stackfill;
  729 
  730  int lib_msg_queue_lock_ini;
  731  int result_msglists_lock_ini;
  732  pthread_mutex_t lib_msg_queue_lock;
  733  pthread_mutex_t result_msglists_lock;
  734 
  735  int write_to_channel_lock_ini;
  736  pthread_mutex_t write_to_channel_lock;
  737 
  738  int msg_watcher_lock_ini;
  739  pthread_mutex_t msg_watcher_lock;
  740  int msg_watcher_state; /* 0= inactive
  741                            1= registered
  742                            2= started
  743                            3= request to end
  744                         */
  745  int (*msgw_result_handler)(void *handle, char *text);
  746  void *msgw_result_handle;
  747  int (*msgw_info_handler)(void *handle, char *text);
  748  void *msgw_info_handle;
  749  int msgw_stack_handle;
  750  int msgw_msg_pending; /* 0=no, 1=fetching(i.e. maybe) , 2=yes */
  751  int msgw_fetch_lock_ini;
  752  pthread_mutex_t msgw_fetch_lock;
  753 
  754  struct Xorriso_msg_sievE *msg_sieve;
  755  int msg_sieve_disabled;
  756 
  757  int status_history_max; /* for -status long_history */
  758  
  759  /* 0= no logging of SCSI commands, 1= to stderr */
  760  int scsi_log;
  761 
  762  char report_about_text[20];
  763  int report_about_severity;
  764  int library_msg_direct_print;
  765  char abort_on_text[20];
  766  int abort_on_severity; /* A severity rank number as threshold */
  767  int abort_on_is_default; /* will be set to 0 by first -abort_on */
  768  int problem_status; /* Severity rank number. 0= no abort condition present */
  769  char problem_status_text[20];
  770  int problem_status_lock_ini;
  771  pthread_mutex_t problem_status_lock;
  772 
  773  char errfile_log[SfileadrL]; /* for -errfile_log */
  774  int errfile_mode; /* bit0= marked */
  775  FILE *errfile_fp;
  776 
  777  int img_read_error_mode; /* 0=best_effort , 1=failure , 2=fatal */
  778  int extract_error_mode; /* 0=best_effort , 1=keep , 2=delete */
  779 
  780  char return_with_text[20];
  781  int return_with_severity;
  782  int return_with_value;
  783  int eternal_problem_status;
  784  char eternal_problem_status_text[20];
  785 
  786  /* temporary search facilities */
  787  regex_t *re;
  788  regmatch_t match[1]; 
  789  char **re_constants;
  790  int re_count;
  791  int re_fill;
  792  char reg_expr[2*SfileadrL];
  793 
  794  /* run state */
  795  int run_state; /* 0=preparing , 1=writing image */
  796  int is_dialog;
  797  int bar_is_fresh;
  798  char pending_option[SfileadrL]; /* eventual option entered at page prompt */
  799  int request_to_abort; /* abort a single operation like -ls, not the program */
  800  int request_not_to_ask; /* suppress reassure and pager */
  801  double idle_time;
  802  int re_failed_at; /* mismatch position with structured_search */
  803  int prepended_wd;
  804  double insert_count;
  805  double insert_bytes;
  806  double error_count; /* double will not roll over */
  807  int launch_frontend_banned;
  808 
  809  /* pacifiers */
  810  int pacifier_style; /* 0= xorriso, 1=mkisofs 2=cdrecord */
  811  double pacifier_interval;
  812  double start_time;
  813  double last_update_time;
  814  /* optional global counters for brain reduced callback functions */
  815  off_t pacifier_count;
  816  off_t pacifier_total;
  817  off_t pacifier_byte_count; /* auxiliary counter for data bytes */
  818  off_t pacifier_prev_count; /* internal counter for speed measurement */
  819 
  820  void *pacifier_fifo;
  821 
  822  int find_compare_result; /* 1=everything matches , 0=mismatch , -1=error */ 
  823  int find_check_md5_result; /* bit0= seen mismatch
  824                                bit1= seen error
  825                                bit2= seen data file without MD5
  826                                bit3= seen match
  827                              */
  828  int find_unique_trunc_result; /* 0= some names are not uniquely truncatable
  829                                   1= all names are uniquely truncatable
  830                                   2= no names need truncation
  831                                 */
  832 
  833  double last_abort_file_time; /* most recent check for aborting -check_md5 */
  834 
  835  /* Tree node collection and LBA sorting facility */
  836  int node_counter;
  837  int node_array_size;
  838  void **node_array;
  839  struct Xorriso_lsT *node_disk_prefixes;
  840  struct Xorriso_lsT *node_img_prefixes;
  841 
  842  /* Hardlink matching at restore time memorizes hardlink target paths.
  843     Array of nodes sorted by LBA. */
  844  int hln_count;
  845  void **hln_array;
  846  void **hln_targets;
  847  int hln_change_pending; /* whether a change was made since hln creation */
  848 
  849  /* >>> this should count all temp_mem and thus change its name */
  850  off_t node_targets_availmem;
  851 
  852  /* Hardlink matching at update time:
  853     Array of all nodes in the tree, sorted by disk dev,ino.
  854     Bitmap of nodes which possibly got new hardlink siblings.
  855     List of involved disk-iso path pairs. */
  856  int di_count;
  857  void **di_array;
  858  char *di_do_widen;
  859  struct Xorriso_lsT *di_disk_paths;
  860  struct Xorriso_lsT *di_iso_paths;
  861 
  862  struct PermiteM *perm_stack; /* Temporarily altered dir access permissions */
  863 
  864  /* bit0= update_merge active: mark all newly added nodes as visited+found
  865  */
  866  int update_flags;
  867 
  868  /* For find jobs show_hfs_cmd , show_hfs_as_mkisofs 
  869  */
  870  /* bit0= do not record but only count
  871     bit1= as_mkisofs mode
  872  */
  873  int show_hfs_cmd_flag;
  874  int show_hfs_cmd_count;
  875  char **show_hfs_cmds;
  876 
  877  /* Extraction to sparse files */
  878  off_t sparse_min_gap;
  879 
  880  /* result (stdout, R: ) */
  881  char result_line[10*SfileadrL];
  882  int result_line_counter;
  883  int result_page_counter;
  884  int result_open_line_len;
  885 
  886 
  887  /* info (stderr, I:) */
  888  char info_text[10*SfileadrL];
  889 
  890 };
  891 
  892 
  893 #include "base_obj.h"
  894 #include "aux_objects.h"
  895 #include "findjob.h"
  896 #include "check_media.h"
  897 #include "misc_funct.h"
  898 #include "text_io.h"
  899 #include "match.h"
  900 #include "emulators.h"
  901 #include "disk_ops.h"
  902 #include "cmp_update.h"
  903 #include "parse_exec.h"
  904 
  905 
  906 #endif /* Xorriso_private_includeD */
  907