WADEXT2(6) WADEXT2(6) NAME wadext2 - dump the lumps of a wad to files SYNOPSIS wadext2 --help wadext2 --version wadext2 [-nv] [-o fmt] file DESCRIPTION wadext2 extracts all the lumps of a wad to separate files. It does not perform any conversion on the contents of the lumps; it just dumps them byte for byte. wadext2 does with wad files what tar -x does with tar archives. The advantage of this program over wadext(6) is that the latter can only extract one lump at a time. deutex(6), although it is more sophisticated than wadext2, is less suitable for certain tasks. Because it doesn't try to understand how the wad is structured, wadext2 works well with any wad. It does not need the wad to contain a PNAMES and a PLAYPAL. It doesn't reorder the directory or lose duplicate lumps. Each lump is written to a separate file whose name is obtained by expanding the format string. The default for mat string is "%04n_%l.lmp". For the Doom iwad, that gives: 0000_playpal.lmp 0001_colormap.lmp 0002_endoom.lmp . . . 2303_comp01.lmp 2304_f2_end.lmp 2305_f_end.lmp The format string can be changed through the -o option. OPTIONS --help Print usage to stdout and exit successfully. -n Do everything as normal but don't actually write any output files. This is useful as a wad validity test. wadext2 -n my.wad || echo "my.wad is corrupt" -o fmt Use fmt to name the output files. See FORMAT STRING. The default format is "%04n_%l.lmp". -v Verbose. Print to stdout the name of each output file. Combined with -n, this turns wadext2 into a slower, but more flexible lswad(6). For example: wadext2 -nvo '%4n %HU06oh %6s %l' my.wad --version Print version number to stdout and exit success fully. FORMAT STRING The format string is somewhat like the one used by printf(3), but with substantial differences. It is made of ordinary characters (all characters other than \ and %) peppered with zero or more escape sequences and conversion specifications. Escape sequences The same as in C, except for \0 and \x which are still missing. \a Alarm (C \a, ASCII BEL) \b Backspace (C \b, ASCII BS) \f Form-feed (C \f, ASCII FF) \n Newline (C \n, ASCII LF unless translated by libc) \r Carriage return (C \r, ASCII CR) \t Tab (C \t, ASCII HT) \v Vertical tab (C \v, ASCII VT) \\ Backslash Escape sequence other than the above are considered fatal errors. Conversion specifications The general format of a conversion specification is %[flags][width][.precision]conversion To get a literal %, put %% in the format string. Flags There can be any number of flags. If there are conflict ing flags, the one that comes last overrides the others. - Align to the left. By default, conversions are aligned to the right of the width. 0 Pad with zeros. For numeric conversions, use 0 as the padding character. If the conversion is left aligned or is a string conversion, this flag is ignored and the conversion is padded with spaces. Flags 0 and _ are mutually exclusive. = Preserve case. For string conversions, explicitly prevent the conversion from changing the case of the characters, even when it does by default. Flags =, L and U are mutually exclusive. D For numeric conversions, use decimal. Flags D and H are mutually exclusive. H For numeric conversions, use hexadecimal. Flags D and H are mutually exclusive. L Lower case. For string conversions, convert all characters to lower case with tolower(3). For hex adecimal conversion, use digits a-f. Flags =, L and U are mutually exclusive. U Upper case. For string conversions, convert all characters to upper case with toupper(3). For hex adecimal conversion, use digits A-F. Flags =, L and U are mutually exclusive. _ Pad with underscores. Flags 0 and _ are mutually exclusive. Width The optional width field is an unsigned decimal integer. It causes the conversion to use at least width character. Precision If there is a dot, the unsigned decimal integer that fol lows is taken as the precision. For numeric conversions, the precision has no effect. For string conversions, the effect is to truncate to the first precision characters. A precision field stripped down to . is equivalent to .0. Conversion The following conversion characters are implemented: l The name of the lump, a string of up to 8 charac ters. If the conversion specification does not include any case flags, the name is converted as if the L flag was present. n The number of the lump, 0 being the first lump. o The offset of the lump in the wad. If the conver sion specification does not include any base flags, the offset is converted as if the H flag was pre sent. s The size of the lump in bytes. EXIT VALUE 0 OK >0 Errors occurred BUGS Strange characters in lump names could cause files with obnoxious names to be created or even prevent the lump from being extracted. %l should include a quoting mecha nism. In format, \[0-7] and \x not implemented yet. Reading from a non-seekable file such as /dev/stdin is not well supported. In particular, it will fail if the wad directory does not follow immediately the wad header or if the lumps in the directory are not in ascending offset order. There should be an option to extract or not labels. There should be an option to extract lumps by number or by name. Perhaps the program should accept more than one argument but then how would you know which output file belongs to which wad? There should be an inverse program. AUTHOR Andr Majorel http://www.teaser.fr/~amajorel/ LEGAL wadext2 is copyright Andr Majorel 2001. It is dis tributed under the terms of the GNU General Public License. SEE ALSO deutex(6), wadext(6), xwadtools(6). 2001-08-11