
*******************************************************************************
*******              Wiimms ISO Toolset v3.04a - 2022-03-07             *******
*******************************************************************************

Wiimms ISO Toolset (WIT) is a command line tool set for linux and for other
unix like operating systems including cygwin. The tools manage WBFS partitions
and ISO Images. WWT cotains the following tools:

The both main tools are:
  wit      : Wiimms ISO Tool manage ISO files.
  wwt      : Wiimms WBFS Tool manage WBFS partitions.

And these are special WDF and CISO tools:
  wdf-cat  : a 'cat' like programm with special handling of WDF files.
  wdf-dump : dump the data structure of a WDF file.

The software is developed under the GPL 2.0 license. See file gpl-2.0.txt
or URI http://www.gnu.org/licenses/gpl-2.0.txt for details.

The most current source is available under:
  https://wit.wiimm.de/r/viewvc/
The source of this revision (8427) is available under:
  https://wit.wiimm.de/r/viewvc/?pathrev=8427
You can also checkout the SVN repository:
  http://opensvn.wiimm.de/wii/trunk/wiimms-iso-tools//

See https://wit.wiimm.de/ for announcements and discussions.

This files describes the main tool 'wit'.


*******************************************************************************
*******                     Content of all documents                  *********
*******************************************************************************

The documentation is divided into several files:

  DOCUMENTATION.txt : General overview.
  FAQ.txt           : FAQ of all tools.
  HISTORY.txt       : Complete development history.

  wit.txt           : Documentation about the tool 'wit'.
  wwt.txt           : Documentation about the tool 'wwt'.

  WDF.txt           : Definition of a WDF file.
  WBFS.txt          : Interesting things about WBFS



*******************************************************************************
*******                    Overview about this document               *********
*******************************************************************************

Contents:

    Output of 'wit --help'
    @file
    Commands in detail
    Processing --source and --recurse
    Processing ISO files
    Processing ID6 parameters
    Processing exclude options
    Processing title db
    Processing split options
    Processing size options
    Selecting files with --files=rules
    Some options in detail
    Hidden options (for testing)
    Some options in detail
    Environment variables
    Signals


*******************************************************************************
*******                      Output of 'wit --help'                   *********
*******************************************************************************
wit: Wiimms ISO Tool v3.04a r8427 linux - Dirk Clemens - 2022-03-07

wit : Wiimms ISO Tool : It can list, analyze, verify, convert, split, join,
      patch, mix, extract, compose, rename and compare Wii and GameCube images.
      It also can create and dump different other Wii file formats.

Syntax: wit [option]... command [option|parameter|file]...


Commands:

  VERSION           : Print program name and version and exit.
  HELP      | H     : Print help and exit. If the first non option is a valid
                      command name, then a help for the given command is
                      printed.
  INFO              : Print some internal information about the keywords. If
                      the keyword ALL is set or no keyword is entered, then all
                      informations are printed. Possible keywords are:
                      IMAGE-FORMAT and ALL.
  TEST              : Test options: All options are allowed, some are printed.
  ERROR     | ERR   : Translate an exit code to a message name. If no exit code
                      is entered, print a table with all error messages.
  COMPR             : Scan compression modes and print the normalized names.
                      See option --compression for syntax details. If no mode
                      is given than print a table with all available
                      compression modes and alternative mode names.
  FEATURES          : Check, if the requested features are available. All
                      keywords are possible. If no keyword is used, all
                      supported features are printed. The exit status is 0 for
                      'all features supported', 1 for 'some features supported'
                      and 2 for 'no feature supported'.
  ANAID             : Analyze the entered IDs and print one line for each ID
                      with 3 columns: HEX_ID, ASCII_ID, Game title.
  EXCLUDE           : Dump the internal exclude database to standard output
                      (stdout).
  TITLES            : Dump the internal title database to standard output
                      (stdout).
  GETTITLES         : Call the script 'load-titles.sh' in the share folder to
                      update the title database.
  CERT              : Collect certificates and eliminate multiple entires of
                      the same certificate. Dump all collected certificates to
                      standard output (stdout) and/or write the certificate to
                      a new binary cert file. The optional parameters are
                      handled like parameters of option --cert.
  CREATE            : Create a system file (TICKET or TMD).
  DOLPATCH          : Patch a dol file. A sub-command is either (upper case are
                      keywords) 'XML=filname' or 'NEW=type,addr,size' or
                      'NEW=type,AUTO ' or 'LOAD=addr,filename' or
                      'addr=patch[#cond]', and 'type' is either 'TEXT' or
                      'DATA'. Read https://wit.wiimm.de/cmd/wit/dolpatch for
                      more details.

  FILELIST  | FLIST : List all source files in a table.
  FILETYPE  | FTYPE : Print a status line for each source file.
  ISOSIZE   | SIZE  : Print a status line with size infos for each source file.

  DUMP      | D     : Dump the data structure and content of Wii and GameCube
                      ISO files, cert.bin, ticket.bin, tmd.bin, header.bin,
                      boot.bin, fst.bin and of DOL-files. The file type is
                      detected automatically by analyzing the content.
  ID6       | ID    : Print ID6 of all found ISO files as simple list.
  ID8               : Print ID6 + 2 next bytes as disc and version number of
                      all found ISO files as simple list.
  FRAGMENTS         : Print the image fragments and, if possible, their file
                      system mapping and fragments. If option --brief is set,
                      only the fragment counts are printed. The Mac version can
                      only detect the file system mapping for WBFS partitions.
  LIST      | LS    : List all found ISO files.
  LIST-L    | LL    : List all found ISO files with size and region. 'LIST-L'
                      is a shortcut for 'LIST --long'.
  LIST-LL   | LLL   : List all found ISO files with date, size and region.
                      'LIST-LL' is a shortcut for 'LIST --long --long'.
  LIST-LLL  | LLLL  : List all found ISO files with date, size and region and
                      add a second status line with more info. 'LIST-LLL' is a
                      shortcut for 'LIST --long --long --long'.

  FILES     | F     : List all files of all discs.
  FILES-L   | FL    : List all files of all discs. 'FILES-L' is a shortcut for
                      'FILES --long'.
  FILES-LL  | FLL   : List all files of all discs. 'FILES-LL' is a shortcut for
                      'FILES --long --long'.

  DIFF      | CMP   : DIFF compares ISO images in scrubbed or raw mode or on
                      file level. Images, WBFS partitions and directories are
                      accepted as source. DIFF works like COPY but comparing
                      source and destination.
  FDIFF     | FCMP  : FDIFF compares ISO images on file level. Images, WBFS
                      partitions and directories are accepted as source.
                      'FDIFF' is a shortcut for 'DIFF --files +'.
  EXTRACT   | X     : Extract all files of each source to new directory
                      structures. Images, WBFS partitions and directories are
                      accepted as source.
  COPY      | CP    : Copy, scrub, convert, join, split, compose, extract,
                      patch, encrypt and decrypt Wii and GameCube disc images.
                      Images, WBFS partitions and directories are accepted as
                      source.
  CONVERT   | CV    : Convert, scrub, join, split, compose, extract, patch,
                      encrypt and decrypt Wii and GameCube disc images and
                      replace the source with the result. Images, WBFS
                      partitions and directories are accepted as source. The
                      former command name was SCRUB.
                        'wit CONVERT' is like 'wit COPY' but removes the source
                      and replace it with the new file if copying is
                      successful. It have been implemented as replacement of
                      the SCRUB command of other tools. 'wit CONVERT' does more
                      than only scrubbing and therefor it was renamed from
                      'SCRUB' to 'CONVERT', but the old command name is still
                      allowed.
  EDIT      | ED    : Edit an existing Wii and GameCube ISO image and patch
                      some values. Images, WBFS partitions and directories are
                      accepted as source.
  IMGFILES  | IF    : Print a list of all image files including their
                      associated split files. Each file is printed on a
                      separate line for further batch processing.
  REMOVE    | RM    : Remove images including their associated split files.
  MOVE      | MV    : Move and rename Wii and GameCube ISO images. Images, WBFS
                      partitions and directories are accepted as source.
  RENAME    | REN   : Rename the ID6 of discs. Disc title can also be set.
  SETTITLE  | ST    : Set the disc title of discs.

  VERIFY    | V     : Verify ISO images (calculate and compare SHA1 checksums)
                      to find bad dumps.
  SKELETON  | SKEL  : Create very small skeletons of ISO images. A skeleton
                      contains only disc and partition headers for further
                      analysis and is not playable because all files are
                      zeroed. Read https://wit.wiimm.de/cmd/wit/skel for more
                      details.
  MIX               : Mix the partitions from different sources into one new
                      Wii or GameCube disc.

Type 'wit HELP command' to get command specific help.

Global options:

  -V --version       Stop parsing the command line, print a version info and
                     exit.
  -h --help          Stop parsing the command line, print a help message and
                     exit.
     --xhelp         Stop parsing the command line and print a help message
                     with all commands included. Exit after printing.
     --width width   Define the width (number of columns) for help and some
                     other messages and disable the automatic detection of the
                     terminal width.
  -q --quiet         Be quiet and print only error messages.
  -v --verbose       Be verbose and print more progress information. Multiple
                     usage is possible: Progress counter is enabled if set at
                     least two times. Extended logging is enabled if set at
                     least four times. The impact of the other verbose levels
                     are command dependent.
  -P --progress      Print progress counter. If --verbose is set at least
                     twice, printing is enabled too. If progress is enabled,
                     the default of --dsync is changed.
     --scan-progress Print a message for each found image while scanning the
                     file system.
  -L --logging       This debug option enables the logging of internal memory
                     maps. If set twice second level memory maps are printed
                     too.
  -E --esc char      Define an alternative escape character for destination
                     files. The default is '%'. For Windows (CYGWIN) it is a
                     good choice to set '-E$' to avoid conflicts with command
                     shell variables.
     --color=[=modus] 
                     Define the modus for colored text output. Allowed keywords
                     are: OFF or NO-COLORS to disable colors, AUTO (default)
                     for automatic detection, ON for automatic detection but
                     never OFF, 8-COLORS and 256-COLORS for 8 and 256 color
                     support. Without parameter, ON is used.
                       AUTO will enable colorized output only for terminals.
                     AUTO and ON use environment variable TERM to find the
                     correct color modus.
                       If a command is prefixed by 'C-', then --color=ON is
                     used implicitly as default.
     --256-colors    Short cut for --color=256-colors: Force colorized text
                     with 256 color support.
     --no-colors     Short cut for --color=off: Deactivate colorized text. This
                     is the default, if an output file is not a terminal.
     --io flags      Setup the IO mode for experiments. The standard file IO is
                     based on open() function. The value '1' defines that WBFS
                     IO is based on fopen() function. The value '2' defines the
                     same for ISO files and value '4' for WIA files. You can
                     combine the values by adding them.
  -f --force         Force operation.
     --dsync=[=mode] This option enables the usage of flag O_DSYNC when opening
                     a partition at a hard drive for writing. With activated
                     flag, writing an image is some percent slower, but the
                     progress counters are exact again.
                       Parameter MODE is optional. If set, it is one of OFF
                     (disable), ON (enable) or AUTO (default). With AUTO, DSYNC
                     is enabled if the progress counters are active.
                       This option has only impact, if compiler and operation
                     system support the flag O_DSYNC. Linux does.

  -T --titles file   Read file for disc titles. -T/ disables automatic search
                     for title files.
     --utf-8         Enables UTF-8 support for filenames (default).
     --no-utf-8      Disables UTF-8 support for filenames.
     --lang lang     Define the language for titles.
     --cert file     Scan a file for certificates and add them to the internal
                     certificate database. Valid sources are CERT, TICKET, TMD
                     and ISO files. All partitions of ISO images are scanned
                     for certificates. Files without certificates are ignored
                     without notification.

  -t --test          Run in test mode, modify nothing.
                     >>> USE THIS OPTION IF UNSURE! <<<

     --align-wdf [align][,minhole] 
                     Parameter align defines the aligning factor for new WDF
                     images. It must be a power of 2 and smaller or equal than
                     1 GiB. The default WDF alignment is 1 for WDF v1 and 4 for
                     WDF v2. Usual values are 1, 512, 4K and 32K.
                       The optional parameter minhole defines the minimal hole
                     size, before a new chunk is created. If NULL, an internal
                     value is used to minimize the total file size. minhole
                     can't be smaller than align.
     --gcz-zip       If creating a GCZ image, a blockwise z-compression is
                     tried. If the compressed data is larger than 98.5%, the
                     uncompressed data is stored. Encrypted blocks are stored
                     directly as uncompressed data, because the 98.5% test
                     fails all the time.
                       Option --gcz-zip disables this optimization for
                     encrypted data and makes the creation process slower.
     --gcz-block size 
                     The value defines the block size, if creating a GCZ image.
                     The default is 16K (also Dolphins default). Smaller values
                     enlarge the managment data and reduce the compression
                     ratio. Use the option with caution!
     --allow-fst=[=mode] 
                     Enable the usage of extracted images.MODE is either OFF,
                     AUTO (default) or ON. Without value, ON is used. If mode
                     is AUTO, extracted images are usually enabled.
     --allow-nkit=[=mode] 
                     Enable the detection of NKIT images.MODE is either OFF,
                     AUTO (default) or ON. Without value, ON is used. If mode
                     is AUTO, the NKIT detection is enabled only for a few
                     analytic commands.
                       Anyway, NKIT images are not supported yet, but detected
                     to print warnings.

     --sh            Dump info using SH syntax. Use '--var name' as prefix.
     --bash          Dump info using BASH syntax. Use '--var name' as prefix.
     --json          Dump info using JSON syntax. Options --var and --array are
                     ignored.
     --php           Dump infos using PHP syntax. Use '--var name' as variable
                     name of the resulting object.
     --makedoc       Dump infos using MakeDoc syntax. Use '--var name' as
                     variable name of the resulting map.
     --var varname   Use VARNAME as variable name or prefix on script output.
                     The default variabe name is 'res'.
     --array         Use an array on script output if possible. If arrays are
                     not supported, then append a '_#' suffix with an zero
                     based index to the variable name defined by '--var name'.
                     In this case, only one output file is created.
     --avar varname  Shortcut for: '--array --var name'

More help is available at https://wit.wiimm.de/wit



*******************************************************************************
*******                             @file                               *******
*******************************************************************************

If a parameter beginns with '@' the text behind that '@' is a filename.
Each line of the file is taken as a parameter (not option, not command).
Each line may terminate with LF or CR+LF. Handling of '@' is *not* recurse.

The special filename '-' means: read from standard input (stdin).


*******************************************************************************
*******                        Commands in detail                       *******
*******************************************************************************

The tool 'wit' processes the --source and the --recurse options to built an
internal ISO database (any ISO formats like WDF and FST included). Most of the
follwing commands works with the files of this ISO database (like 'wwt' do it
with a WBFS). The options --source and --recurse atre described in the section
"Processing --source and --recurse" in detail.

Command abbreviations are allowed as long as they are unique. The commands
are listed in alphabetic order:


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------

 The command DIFF compares all given sources agains a destination (directory).
 If the option --dest is not set the last parameter is used as destination.
 If exact one source file is given the destination can be a file name. If two
 or more source files given the destination must be a directory. Option --DEST
 is like --dest, but the directory path is created automaticaly.

 Each source is candidate for comparing. Non ISO files are ignored with a warning.
 The option --ignore suppresses this warning.

 If option --long is set, the first failed position is printed. If option --long
 is set two or more times all falied positions are printed, but only the first
 position of each ISO block. The size of an ISO block is 0x8000 = 32768 bytes.

 In file mode (--files=) the rules are changed. The ISO images are compared on
 file level. System areas like disc and aprtiton headers are also served as
 files. Only files that matches the defined filters will be compared. In --quiet
 mode the comparing is done silently. Otherwise all non equal or missing files
 are reported.


 DESTINATION FILENAME

    The destination filenames are scanned for escape sequences beginning with
    the escape character '%'. The accepted format is:

        '%cX'  or  '%mcX'  or  '%n-mcX'

    'n' is the number of skipped characters of the field.

    'm' is the zero based index of the last copied character.

    'c' is an optional character. If c is 'u' then the source will be
    converted into upper case and if c is 'l' into lower case.

    'X' selects the source and is one of (ignoring case):
        'I' : ID6
        'N' : Disc name
        'T' : Title of title db. If no title found the disc name is used.
        'E' : The default extension ('wdf', 'iso', 'ciso' or 'wbfs')
        'P' : The path (all upto the last '/') of the source file
        'F' : The filename (start behind the last '/') of the source file
        'X' : Extended filename: A shortcut for '%T [%I].%E'
        'Y' : Extended filename: A shortcut for '%T [%I]' (no file extension)
        '+' : The default filename: WBFS='%I.%E', all other='%X'

    To use the '%' sign itself just type '%%'.

    Examples:
        '%4I.%E'    : Store the disc with ID4 as name.
        '%1uT/%X'   : Store the disc into a subdirectory named with the
                      first character (upper case) of the title.
        '%3-4lI/%X' : Store the disc into aa subdirectory named with the
                      language code of the ID using the lower case letter.
        '%P/%X'     : Store the disc into the directory of the source
                      with the extended filename.

    Instead of '%' an alternative escape character can be used. It is defined
    by the option --esc= (-E). This makes live easier if using the cygwin
    version together with the windows shell 'cmd'. Define the environment
    variables 'WIT_OPT' and/or 'WWT_OPT' for a new default definition.
     Example for Unix bash: export WIT_OPT="--esc=$"
     Example for Windows:   set WIT_OPT=--esc=$


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    DIFFER              : At least one file pair differ.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.
    WRITE ERROR         : error while writing a file.
    CANT OPEN           : Can't open file.


-------------------------------------------------------------------------------

 DUMP will dumps the data structure of all ISO files. If the option --long is
 set an additional memory map for each partition is printed. If the option
 --long is set twice or more an additional memory map for the whole ISO file
 is printed at the end. Failures (overlapped areas) are marked with '!'. If
 the option --long is set three times or more a total memory is appended at
 the end of the dump.

 If the option --files= is set than a file list is included into the dump.
 The rules define which files are listet. To list all files use "--files=+".
 The section "Selecting files with --files=rules" dicuss more details.
 The options --psel= and --raw are only used to make a pre selection of
 the partitions for the file list.


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while read a file given by option --part.


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------

 The command ERROR translate an exit code to a text message. Without parameters
 print all error names and error messages. With a given 'error_code' the error
 message that belongs the number is printed to stdout and the program exits
 with exit status is 0 (success). If the error_code is unknown or invalid the
 error message is '?' and the program exits with exit status is 1 (failure).

 Without 'error_code' a list of all error codes is printed. The output
 contains three columns separated with colons. The format is:

    error code ':' error name ':' error messages

 If the option --sections is set, then the layout is completly changed to a
 sections base output. This output is machine readable. The output looks like:

	[error-CODE]
	code=ERROR_NUMBER
	name=ERROR_NAME
	text=ERROR_TEXT


 Usual ERROR/EXIT CODES:

    0 == OK        : all done.
    SYNTAX ERROR   : at least one syntax error in command line found.
    SEMANTIC ERROR : unkown error_code given.


-------------------------------------------------------------------------------

 The command 'EXCLUDE' builts the exclude data base and prints the result to
 stdout. The handling of the additional files works like the --exclude option.
 The section "Processing exclude options" explains the options in detail.


 Usual ERROR/EXIT CODES:

    0 == OK        : all done.
    SYNTAX ERROR   : at least one syntax error in command line found.


-------------------------------------------------------------------------------

 ** no documentation yet **


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.
    WRITE ERROR         : error while writing a file.
    CANT CREATE         : Can't create output file.


-------------------------------------------------------------------------------

COMMAND:
    FDIFF | FCMP ...

 'FDIFF' is a synonym for 'DIFF --files +'.
 See command 'DIFF' for options and details.


-------------------------------------------------------------------------------

 The filename of each file in the internal file list is printed as one line.
 If no source is given, the current working directory is used as source.


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

 ** no documentation yet **


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

COMMANDS:
    FILES-L   | FL    [source]...
    FILES-LL  | FLL   [source]...

 'FILES-L'   is a synonym for 'FILES --long'.
 'FILES-LL'  is a synonym for 'FILES --long --long'.
 See command 'FILES' for options and details.


-------------------------------------------------------------------------------

 The command 'FILETYPE' prints for each file in the internal file database
 (build by the options --source and --recurse) one status line like:
    FILETYPE ID6 SIZE_MIB REGION filename
 Column 'ID6' is only printed if option --long is set. For non ISO images
 the ID6 is '-'. Columns 'SIZE_MIB' and 'REGION' are only printed if option
 --long is set at least two times.

 If neither --source nor --recurse is used and no other source is defined then
 the default directory is searched for ISO files.

 'SIZE_MIB' is the calculatet size of a scrubbed ISO image. For this all used
 sectors of a ISO image are counted. The usage depends of the options --psel
 and --raw.

 Filetypes are:
    NO-FILE  : No file found
    DIR      : Not a file but a directory
    WBFS     : A WBFS
    WBFS/    : A WBFS used like directory with id6 or index or pos
    WDF+WBFS : A WBFS shrinked with WDF (this make no sense expect transporting)
    ISO      : A ISO image.
    WDF+ISO  : A ISO image shrinked with WDF.
    WDF      : Any other WDF file (not WBFS or ISO)
    WIA      : A ISO image packed with WIA.
    GCZ      : Dolphins GameCup-Zip images.
    OTHER    : Any other file


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.


-------------------------------------------------------------------------------

 The command 'ID' lists the ID6 of all discs in the internal ISO database, one
 ID per row. The internal ISO database is build under control of the options
 --source, --recurse, --include, --include-path, --exclude and --exclude-path.
 See section "Processing --source and --recurse" for details.

 If neither --source nor --recurse is used and no other source is defined then
 the default directory is searched for ISO files.

 If --uniqe is set each game disc with same ID6, name, size and region is only
 printed once. To determine doube entries the list is sorted by ID.

 The output sort order can be set by the --sort option. Sort=none means, that
 the ID will be shown in order of the WBFS partition. The default sort order
 is 'ID'.


 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

 The command 'ISOSIZE' prints for each file in the internal file database
 (build by the options --source and --recurse) one status line like:

    ISO_BLOCKS  SIZE_IN_MIB  WBFS_FILESIZE  SIZE_IN_500G_WBFS  filename

 The size is calculated for a scrubbed ISO image. For this all used sectors
 of a ISO image are counted. The usage depends of the options --psel and --raw.

 ISO_BLOCKS
    The number of used ISO blocks. Each ISO block has a size of 32K.

 SIZE_IN_MIB
    The number of used ISO blocks in MiB. It's a rounded value ISO_BLOCKS.
    Column SIZE_IN_MIB is only shown if the option --long is set.

 WBFS_FILESIZE
    The total size of a wbfs file that contains only 1 disc. The calculation
    is made under the assumption that the WBFS blocks size is 2 MiB. Column
    WBFS_FILESIZE is only shown if the option --long is set at least twice.

 SIZE_IN_500G_WBFS
    The size of a ISO image as part of a WBFS with about 500g total space.
    The calculation is made under the assumption that the WBFS blocks size
    is 8 MiB. Column SIZE_IN_500G_WBFS is only shown if the option --long
    is set at least twice.

 If neither --source nor --recurse is used and no other source is defined then
 the default directory is searched for ISO files.

 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

 The command 'LIST' lists infos of all discs in the internal ISO database.
 The internal ISO database is build under control of the options --source,
 --recurse, --include, --include-path, --exclude and --exclude-path.
 See section "Processing --source and --recurse" for details.

 Without --long the ID and the name are printed. With option --long the ID,
 size, region and the name are printed.  The option --no-header suppress the
 output of header and footer.

 Printing of timestamps is enabled by the options --time, --itime, --mtime
 --ctime, --atime or when --long is set at least twice. --time=off disables
 time printing. All time options (not --long) supersede the previous options.
 The option --time take a comma separated list of the following keywords:

    OFF    : Disable time printing. All other option enable time printing.
    ON     : Enable time printing.

    SINGLE : Print only a single column (last time specified.
    MULTI  : Print columns for all specified times. (default)

    I      : Use itime (insertion time) for processing.
    M      : Use mtime (last modicifaction time) for processing. (default)
    C      : Use ctime (last staus change time) for processing.
    A      : Use atime (last access time) for processing.

    NONE   : Disable all 4 times above
    ALL    : Enable all 4 times above
    
    DATE   : Print time in format 'YYYY-MM-DD'. (default)
    TIME   : Print time in format 'YYYY-MM-DD HH:MM'.
    MIN    : Alternative keyword for 'TIME'.
    SEC    : Print time in format 'YYYY-MM-DD HH:MM:SS'.

    *DATE  : Short cut for '*,DATE'. '*' is one of 'I', 'M', 'C' or 'A'.
    *TIME  : Short cut for '*,TIME'. '*' is one of 'I', 'M', 'C' or 'A'.
    *MIN   : Alternative keywords for '*TIME'.
    *SEC   : Short cut for '*,SEC'.  '*' is one of 'I', 'M', 'C' or 'A'.

 If the option --long is given three or more times a second line with the
 number of partitions, the file type ('ISO', 'WDF', ...) and the file path is
 printed. If the option --long is given three times the real path is printed.

 If the option --sections is set, then the layout is completly changed to a
 sections base output. This output is machine readable. The output looks like:

	[section_name-index]
	parameter=value
	parameter=value
	...

 If available the name of the title database is used. use the option -T0 to
 disable database titles.

 If --unique is set each game disc identified by ID6 is only printet once.
 The sort order can be set by the --sort option. Sort=none means, that the ID
 will be shown in order of scanning. The default sort order is 'TITLE'.

 If neither --source nor --recurse is used and no other source is defined then
 the default directory is searched for ISO files.

 Usual ERROR/EXIT CODES:

    0 == OK             : all done without errors.
    SYNTAX ERROR        : at least one syntax error in command line found.
    READ ERROR          : error while reading a file.


-------------------------------------------------------------------------------

COMMANDS:
    LIST-L   | LL    [source]...
    LIST-LL  | LLL   [source]...
    LIST-LLL | LLLL  [source]...

 'LIST-L'   is a synonym for 'LIST --long'.
 'LIST-LL'  is a synonym for 'LIST --long --long'.
 'LIST-LLL' is a synonym for 'LIST --long --long --long'.
 See command 'LIST' for options and details.


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------

 This command 'RENAME' may change the ID6 and/or the title of discs. The
 alternative command 'SETTITLE' modifies only titles. The advantage of
 'SETTITLE' is, that it can modify all titles with 1 sub command.

 The syntax of a sub command is: id6=[new_id6][,new_title]
    'id6' is the ID of the disc to change.
    The optional 'new_id6' is the new ID of the disc.
    The optional 'new_title' is the new title of the disc.

 Processing the new title:

    The title string is parsed for escape sequences beginning with the escape
    character '%'. The accepted format is:

        '%cX'  or  '%mcX'  or  '%n-mcX'

    'n' is the number of skipped characters of the field.

    'm' is the zero based index of the last copied character.

    'c' is an optional character. If c is 'u' then the source will be
        converted to uppercase and if c is 'l' to lower case.

    'X' selects the source and is one of:

        'i' : the (new) ID6
        'I' : the (new) ID6
        'j' : The previous ID stored in the WBFS inode.
        'J' : The previous ID stored in the ISO header.

        'n' : The previous disc title stored in the WBFS inode.
        'N' : The previous disc title stored in the ISO ehader.

        't' : The title from the title database based on the new ID or, if not
              changed, on the ID of the WBFS inode. If no title found the disc
              name stored in the WBFS inode is used.
        'T' : Same as 't'
        'p' : The title from the title database based on the previous ID stored
              in the WBFS inode. If no title found the disc name stored in the
              WBFS inode is used.
        'P' : The title from the title database based on the previous ID stored
              in the ISO header. If no title found the disc name stored in the
              ISO header is used.

        If the object to change is not a WBFS then the ISO data is used instead
        of the WBFS inode data ('j', 'n', and 'p' conversions).

    To use the '%' sign itself just type '%%'.

    Instead of '%' an alternative escape character can be used. It is defined
    by the option --esc. This makes live easier if using the cygwin version
    together with the windows shell 'cmd'. Define the environment variables
    'WIT_OPT' and/or 'WWT_OPT' for a new default definition.

 Usual ERROR/EXIT CODES:

    0 == OK        : all done.
    SYNTAX ERROR   : at least one syntax error in command line found.


-------------------------------------------------------------------------------

 This command 'SETTITLE' may change the title of discs. The alternative
 command 'RENAME' can also change the ID of discs.

 The syntax of a sub command is: id6=new_title
    'id6' is the ID of the disc to change. If using '+' all discs are changed.
    The 'new_title' is the new title of the disc.

 Processing the new title:

    The title string is parsed for escape sequences beginning with the escape
    character '%'. The accepted format is:

        '%cX'  or  '%mcX'  or  '%n-mcX'

    'n' is the number of skipped characters of the field.

    'm' is the zero based index of the last copied character.

    'c' is an optional character. If c is 'u' then the source will be
        converted to uppercase and if c is 'l' to lower case.

    'X' selects the source and is one of:

        'i' : the (new) ID6
        'I' : the (new) ID6
        'j' : The previous ID stored in the WBFS inode.
        'J' : The previous ID stored in the ISO header.

        'n' : The previous disc title stored in the WBFS inode.
        'N' : The previous disc title stored in the ISO ehader.

        't' : The title from the title database based on the new ID or, if not
              changed, on the ID of the WBFS inode. If no title found the disc
              name stored in the WBFS inode is used.
        'T' : Same as 't'
        'p' : The title from the title database based on the previous ID stored
              in the WBFS inode. If no title found the disc name stored in the
              WBFS inode is used.
        'P' : The title from the title database based on the previous ID stored
              in the ISO header. If no title found the disc name stored in the
              ISO header is used.

        If the object to change is not a WBFS then the ISO data is used instead
        of the WBFS inode data ('j', 'n', and 'p' conversions).

    To use the '%' sign itself just type '%%'.

    Instead of '%' an alternative escape character can be used. It is defined
    by the option --esc. This makes live easier if using the cygwin version
    together with the windows shell 'cmd'. Define the environment variables
    'WIT_OPT' and/or 'WWT_OPT' for a new default definition.


 Usual ERROR/EXIT CODES:

    0 == OK        : all done.
    SYNTAX ERROR   : at least one syntax error in command line found.


-------------------------------------------------------------------------------

 The command 'TITLES' builts the title data base and prints the result to
 stdout. The handling of the additional files works like the --title option.
 The section "Processing title db" explains the options in detail.


 Usual ERROR/EXIT CODES:

    0 == OK        : all done.
    SYNTAX ERROR   : at least one syntax error in command line found.


-------------------------------------------------------------------------------


-------------------------------------------------------------------------------

 The command VERSION prints out the program version to standard out (stdout)
 and exit with status 0 (OK).

 The ouput line looks like:

 With option --sections the output is printed in a machine readable format:
    [version]
    prog=wit
    name=Wiimms ISO Tool
    version=3.04a
    beta=0
    revision=8427
    system=linux
    posix_c_source=200809L
    endian=1234 little
    have_stattime_nsec=1
    author=Dirk Clemens
    date=2022-03-07
    url=https://wit.wiimm.de/wit
    


 Usual ERROR/EXIT CODES:

    0 == OK : all done without errors.


*******************************************************************************
*******               Processing --source and --recurse                 *******
*******************************************************************************

The tool 'wit' processes the --source and the --recurse options to built an
internal ISO database (ISO, WDF, WIA, FST and more ISO files included). All
operations are then done with the files of this ISO database (like 'wwt' do it
with a WBFS).

 Options:
    -s --source  path
    -r --recurse path
       --rdepth  depth

Both options work similar and both option can be used multiple times. If 'path'
is a non existing file an error message is printed. If 'path' is an plain file,
it is opened and analyzed. If that files is an ISO file in any supported format
than it is added to the internal ISO database.

The options --source and --recurse differ only if 'path' is an directory.
Option --source searches that directory but not subdirectories for ISO files.
Option --recurse searches that directory and all subdirectories (recurse, max
depth is set by --rlevel, default=10) for ISO files. Subdirectories beginning
with a dot ('.') are ignored.

The implementation is optimized so that a directory is only searched once.
The option --recurse is processed before option --source.


///////////////////////////////////////////////////////////////////////////////
///////////////                Processing ISO files             ///////////////
///////////////////////////////////////////////////////////////////////////////

Commands like "wwt ADD" or "wit COPY" uses ISO files as input. They accept
plain ISO files and ISO files in WDF, CISO and WBFS containers and FST
directories. In detail:

 /path/to/PLAIN_ISO:
    A PLAIN ISO file is a 1:1 copy of a Wii disc, may be scrubbed. It is not
    compressed and not part of any container. The standard extension is ".iso".

 /path/to/WDF_ISO:
    This is an ISO packed in a WDF container. WDF container may be used for
    any files and not only for ISO images. The standard extension is ".wdf".

 /path/to/CISO:
    This is an ISO packed in a CISO container. CISO container may be used for
    any files and not only for ISO images. The standard extensions are
    ".ciso" (default) and ".wbi".

 /path/to/WBFS_FILE
    An WBFS file/device is also accepted like a list of ISO files. The standard
    extension for WBFS files is ".wbfs".

 /path/to/WBFS_FILE/SELECTOR
    This is a special construct. The ISO image of the WBFS_FILE selected
    by SELECTOR is used as source. The selector may be one of:

     - 'ABCDEF' : ID6 of a disc (exact 6 characters)

     - index    : The zero based index of the disc. The range goes from zero
                  up to the number of discs in the WBFS minus 1.
                  (decimal number, but not 6 digits)

     - '#' slot : The decimal slot number within the WBFS. The range goes from
                  zero up to the maximal number of possible discs in the WBFS
                  minus 1.

    Examples:
      .../a.wbfs/rmcp01 : use "Mario Kart" from 'a.wbfs' as source.
      .../a.wbfs/5      : use the image with index #5 from 'a.wbfs' as source.
      .../a.wbfs/#5     : use the image at slot #5 from 'a.wbfs' as source.

 /path/do/FST_directory
    If the path is a directory and the directory contains a valid FST (File
    SysTem) structure then the directory structure is used to build an internal
    virtual ISO image. Most commands can use this virtual ISO image like a
    real image.


When writing ISO files the option --wdf, --iso, --ciso, --wbfs and --fst
control the output format. If writing a WBFS file this WBFS is truncated and
contains exactly one ISO image. The default file name of this WBFS is
'<ID6>.wbfs'. If none of --wdf, --iso, --ciso, --wbfs or --fst is set, the
destination filename will be analyzed. If the extension (ignoring case) is
".wdf", ".iso", ".ciso", ".wbi" (an alternative for ".ciso") or ".wbfs",
the specific output format is used. The default is WDF if all other fails.



*******************************************************************************
*******                    Processing ID6 parameters                    *******
*******************************************************************************

Discs in a WBFS partition are addressed by its ID6. Therfor commands like
EXTRACT and REMOVE needs as parameters an ID6 tag. And EXTRACT needs also
the name of the destination file. This section describes the processing
of ID6 parameters.

First all control characters (ASCII <32) will be replaced by a space. Spaces
at the beginning and a the end are removed. Multiples spaces will be replaced
by a single space.

In the second step each parameter will be processed by the following rules.
If one rule matches the processing terminates. ID6 are words that contains
exactly 6 characters in the range a-z, A-Z and 0-9. All other characters are
word separators. ID6 is converted into upper case.

The rules as overview:
    '*' | '+'
    ID4
    ID6
    ID6 = name
    name [ID6]
    ID6 anything


1.) '*' | '+'

    Both characters has the same meaning: Use all ID6 will be found on the
    given WFS partitions. The parameter will be replaced by the complete ID6
    list. A destination filename is not defined.

	Only the first occurrence will be processed. All other are ignord.

    Note: '*' is the natural 'all' placeholder but must be escaped in most
          shells. Therefor the additional '+' is possible.

2.) ID4

    If the parameter contains exactly one ID4 and nothing else the ID4 is
    used. Only for some commands/options a pure ID4 is allowd.

3.) ID6

    If the parameter contains exactly one ID6 and nothing else the ID6 is
    used. A destination filename is not defined.

4.) ID6 = name

    Use this format to set an ID6 and an destination filename. Blanks before
    and behind '=' are ignored. The name is used as the destination filename.

5.) name [ID6]

    The line is searched for an ID6 which is directly included in square
    bracktes. If more than 1 '[ID6]' is found the last one will be used.
    The whole parameter is used as the destination filename.

6.) ID6 anything

    This is the table support. The ID6 is taken and the remaining is ignored.
    A destination filename is not defined.

If the option --unique is supported and set then repeated parameters with the
same ID6 are eliminated. The last non empty destination filename is used.

If a destination filename is needed but none is set than the a name from the
title database or an internal name of the game will be used. Before creating
an ISO image the destination filename is post processed to eliminate unusal
characters. Only single spaces, A-Z, a-z, 0-9 and _+-='"$%&,.!()[]{}<> are
allowed.


*******************************************************************************
*******             Processing include and exclude options              *******
*******************************************************************************

The user may define ID inclusion and exclusion lists. Each element represents
an ID4 or an ID6. Discs with an ID in the exclusion list are ignored (not
added, extracted, removed or listed). If --include or --include-path is used,
only discs in the include list are processed.

The include list is controlled by the to options --include and --include-path
and the exclude list by the options --exclude and --exclude-path. All four
options can be used multiple times. The exclude list ha a higher priority
as the include list.

 -n --include id     Include oly discs with given ID4 or ID6 from operation.
 -n --include @file  Read include list from file.

 -N --include-path file_or_dir
                     ISO file or base of directory tree -> scan their ID6

 -x --exclude id     Exclude discs with given ID4 or ID6 from operation.
 -x --exclude @file  Read exclude list from file.

 -X --exclude-path file_or_dir
                     ISO file or base of directory tree -> scan their ID6

The parameters of --include and --exclude are scanned for ID6. Th section
"Processing ID6 parameters" describes this scanning in detail.

The parameter of --include-path and --exclude-path is a filename or a
directory name. The given file or each file of the directory tree (recurse,
max depth=15) are scanned. Subdirectories beginning with a dot ('.') are
ignored. If a file exists and is an ISO file the ID6 is extracted and inserted
into the include or exclude data base.

Example:

 You want to make a backup from all new discs of 2 USB drives. The new
 backups should be stored info the sub directory 'new-backup'. The existing
 backups are stored in 'old-backup'. The file names of the old backups does
 not matter:

 # wwt extract -aA --dest new-backup --exclude-path old-backup

The command 'EXCLUDE' use the options --exclude and --exclude-path to builtd
the exclude data base and prints the result to stdout.


*******************************************************************************
*******                      Processing title db                        *******
*******************************************************************************

Title files without path specification are search in up to 4 directories:
  1.) In the program path.
  2.) If the program end with "/bin/" in "<PROGRAM_PATH>/../share/wit/".
  3.) In the directory "/usr/local/share/wit/"
  4.) In the current working directory "./"
If you want to search only in the current working directory prefix the file
name with './'. If setting option --verbose at least 4 times (e.g. -vvvv)
the search paths will be logged.

The titles are loaded first time they needed. At first the following three
files are searched in the search path:
  - titles.txt (comes with the distribution)
  - titles-<LANG>.txt (see below)
  - titles.local.txt (for local specificatons)
After that all files specified by the --titles options are scanned.

The idea: The file "titles.txt" is the main title database. It is a copy from
http://wiitdb.com/titles.txt. The file "titles-<LANG>.txt" may contain
language specific definitions. "<LANG>" are the first lower case letters of
the environment variable "LC_CTYPE". The file "titles.local.txt" may contain
local definitions for the user.

The option -T / --titles in detail:

  --titles=0 .. --titles=9
     Set the title mode to a value between 0 and 9.
      0: disable title lookup.
      1: Use titles instead of real disc names. (deault)
      2..9: reserved.

  --titles=/
     Remove all previous --title definitions an do not load the default
     title files.

  --titles=@file
     Use the given file as a list of filenames. Each non empty line is
     interpreted as a filename.

  --titles=@-
     Read standard input (stdin). Each non empty line is interpreted as
     a filename.

  --titles=-
     Read standard input (stdin) and scan it for titles.

  --titles=file
     This is a filename without '/': Read the given file and scan it for
     titles. The file is searched in the search path described above.

  --titles=path/file
     Read the given file and scan it for titles.

If setting option --verbose at least 3 times (e.g. -vvv) all successfull
loaded titles files will be logged. If setting --verbose at least 4 times
the search paths and all searched title files will be logged.

Each line of each title file is scanned for title definitions:
    ID4 = name
    ID6 = name

The title database is build with both ID-types. A later file overides the
settings of all previous files: If an ID4 is found, all ID4 and ID6
definitions of all previous files are removed. If an ID6 is found, only
the previous ID6 definition is removed.

For each database lookup first an ID6 entry is searched. Only if this fails
an ID4 entry is searched.

The titles are expected in UTF-8 coding. Non UTF-8 characters are converted
into UTF-8. If the options --no-utf-8 is set than the title database is
converted into ANSI and all output will also be printed in ANSI.

The command 'TITLES' builts the title data base and prints the result to
stdout.


*******************************************************************************
*******                    Processing split options                     *******
*******************************************************************************

Output files may be splittet into multiple files. The options --split and
--split-size controls the output splitting:

  -z --split            Enable output file splitting, default size = 4 gb.
                        4 gb means 4.000.000.000 bytes (4 billion bytes).
                        The default size for a WBFS is different. It is
                        4GiB-32KiB = 0xffff8000 = 4.294.934.528 bytes.

  -Z --split-size size  Enable output file splitting and set split size.
                        See section "Processing size options" for detailed
                        infos about the 'size' argument.

A new file is created every time when the previous one reached the split size.
Input split files are automatically detected. Only the last file of the input
split file may grow if opened in modify mode.

The split size always rounded down to a multiply of 512 (0x200), the hd sector
size. For a WBFS it is rounde down to a multiply of 32 KiB (32768, 0x8000),
the WII ISO sector size.

There are two naming schemas for the splitted files:

WBFS files are named like (defined by oggzee):
    - name.wbfs
    - name.wbf1
    - name.wbf2
      ...
    - name.wbf9
    - name.wbf10
      ...

All other files are named like:
    - name.ext
    - name.ext.1
    - name.ext.2
      ...
    - name.ext.9
    - name.ext.10
      ...

The WIT tools supports splitted WDF files *not* following the rules for
splitted WDF files. All files are splitted hard by breaking the files into
peaces. This is done by the file layer so that other layer including the WDF
layer don't see the split.

These are the rules for automatic detection of split files. The automatic
detection works only for plain files but not for other files types like
block devices or pipes:

 WBFS file:
    The last character of the filename is replaced by '1'. If a file with
    this new filename is available, the split file support is enabled.

 WDF file:
    The WDF header is read. If the current WDF files is to short and a file
    with same filename plus '.1' exists, the split file support is enabled.

 ISO file:
    If the file is smaller than 4 GiB and a file with same filename plus '.1'
    exists then then split file support is enabled.


*******************************************************************************
*******                    Processing size options                      *******
*******************************************************************************

The different programs using different options to setup size values. These
options are --size, --split-size, --hss and --wss. The processing of the
arguments are identical for all size options.

The argument syntax is: term [ sign term ]... [sign]
with term := float [factor]

 'float' is any C like floating point number like '12', '1.2' or '1e5'.
 'sign' is either the character '+' or the character '-'.

 'factor' is one of the following characters:

    'c' : char, numeric factor = 1
    'b' : byte, numeric factor = 1

    'k' : kilo, numeric factor = 1 kB = 1000
    'm' : mega, numeric factor = 1 MB = 1000*1000
    'g' : giga, numeric factor = 1 GB = 1000*1000*1000
    't' : tera, numeric factor = 1 TB = 1000*1000*1000*1000
    'p' : peta, numeric factor = 1 PB = 1000*1000*1000*1000*1000
    'e' : exa,  numeric factor = 1 EB = 1000*1000*1000*1000*1000*1000

    'K' : kilo, numeric factor = 1 KiB = 1024
    'M' : mega, numeric factor = 1 MiB = 1024*1024
    'G' : giga, numeric factor = 1 GiB = 1024*1024*1024
    'T' : tera, numeric factor = 1 TiB = 1024*1024*1024*1024
    'P' : peta, numeric factor = 1 PiB = 1024*1024*1024*1024*1024
    'E' : exa,  numeric factor = 1 EiB = 1024*1024*1024*1024*1024*1024

    'u' | 'U' : size of a GameCube disc        = 1 459 978 240
    'w' | 'W' : size of a singe layer Wii disc = 4 699 979 776

  Without 'factor' a default factor is used. This default factor is different
  for the first term and for the other terms. The default factors depends on
  the used option.

The terms are added together. If there is at the very end of the term 1 sign
it wil be interpreted as '-1' or '+1' (using the default factor for other terms).

Option --size
    Default factor for first term:     1G
    Default factors for other terms:   1
    Minimal value:                    10m

Option --split-size
    Default factor for first term:     1G
    Default factors for other terms: 512
    Value must be multiples of:      512
    Minimal value:                   100m

Option --hss
    Default factor for all terms:      1
    Value must be power of:            2
    Minimal value:                   512

Option --wss
    Default factor for all terms:      1
    Value must be power of:            2
    Minimal value:                  1024

Examples:
    --split-size 2g     -> split at 2.000.000.000 bytes.
    --split-size 1g     -> split at 1.000.000.000 bytes.
    --split-size 1G     -> split at 1.073.741.824 bytes = 1 GiB.
    --split-size 0.5g   -> split at   500.000.000 bytes.
    --split-size 2G-1K  -> split at 2 GiB - 1 KiB.
    --split-size 2G-1   -> split at 2 GiB - 512
    --split-size 2-1    -> split at 2 GiB - 512
    --split-size 2-     -> split at 2 GiB - 512
    -Z2-                -> split at 2 GiB - 512


*******************************************************************************
*******                      Some options in detail                     *******
*******************************************************************************

The option --sort defines the sort mode for output lists.

  Syntax: --sort sort_mode | -S sort_mode

'sort_mode' is a comma separated list of the following keywords:

    -  | NONE    : Do not sort

         ID      : Sort by id
    T  | TITLE   : Sort by title taken from title db
    N  | NAME    : Sort by name of disc
    F  | FILE    : Sort by file name
    SZ | SIZE    : Sort by size
    OF | OFFSET  : Sort by offset (or index)
    R  | REGION  : Sort by region
         WBFS    : Sort by wbfs file name
         NPART   : Sort by number of partitions

    IT | ITIME   : Sort by itime (insertion time)
    MT | MTIME   : Sort by mtime (last modification time)
    CT | CTIME   : Sort by ctime (last status change time)
    AT | ATIME   : Sort by atime (last access time)
    TI | TIME    : Sort by itime|mtime|atime|atime, decided by the time options.
    D  | DATE    : Alternative keyword for 'TIME'

      DEFAULT    : Use the default sort method for that output

      ASCENDING  : Sort in ascending order.
      DESCENDING : Sort in descending order (reverse).
      REVERSE    : Alternative keyword for 'DESCEND'.

The latest keyword supersedes the previous one of the same group.
'NONE' resets all. Abbreviations are allowed as long as they are unique.


*******************************************************************************
*******                   Hidden options (for testing)                  *******
*******************************************************************************

There are some hidden options implemented for testing:

 --io value

    wit and the other tools can handle files via open() (file mode) and via
    fopen() (stream mode). The option --io=value allows to control the method.
    Bit #0 is for opening WBFS and Bit #1 is for openening ISO images.
    ('ISO' includes ISO in all supported formats)

    --io=0 : WBFS=open()  ISO=open()  **default**
    --io=1 : WBFS=fopen() ISO=open()
    --io=2 : WBFS=open()  ISO=fopen()
    --io=3 : WBFS=fopen() ISO=fopen()


*******************************************************************************
*******                      Environment variables                      *******
*******************************************************************************

The user can define environment variables as additional way to submit options
to the tool. All options are accepted and used as default. 

See https://wit.wiimm.de/info/environ.html for details.


*******************************************************************************
*******                            Signals                              *******
*******************************************************************************

The WIT tools will handle the following signals:

 INT or TERM

    If catched first time the tool will finish after current job.
    If catched second time the tool will finish immediately with cleanup.
    If catched third time the tool will finish immediately without cleanup.

 USR1, USR2

    USR1 will decrease and USR2 increase the verbose level.
    The effect is delayed until beginning the next job.


*******************************************************************************
*******                              END                                *******
*******************************************************************************
