Inviz copies its input to its output, translating escape sequences
that are found. It will properly invert the output of
viz -t, thus recreating the original file. For example, typing
viz < infile | inviz > copy_of_infile
will create an exact copy of infile.
Inviz copies from
file (or from
stdin, if there is no
file given) and writes to
stdout. These escape sequences are of the form
It also specially treats lines that begin
which are lines containing text to convert to binary numbers
(chars, shorts, ints, longs, doubles, or floats).
are used to produce the
usual C escapes, with the addition of \@ translating to null.
The complete set of backslash escape sequences is:
\#146; -> #146;
\@ -> null
\% -> percent
\b -> backspace
\f -> formfeed
\n -> newline
\r -> return
\t -> tab
\nnn -> ascii character with this octal value
\Innn... -> ascii character with this hex value
Embedded newlines are discarded; to produce a newline
in the output, the escape sequence
\n must appear in the input.
Lines that begin
are to be translated into binary numbers.
datatype is one of
and means, respectively, that the text on the rest of the line is
to be translated into chars, shorts, ints, longs, floats, or doubles.
The rest of the line is made up of the usual sort
of text representations of numbers, separated by whitespace.
When the datavalue is an integer
value (whether char, short, int, or long)
may be expressed in octal
0Xnnn), or decimal. If the value is octal or hex, the corresponding output value
will be unsigned.
If decimal, the type is unsigned unless the number begins with
+ or -, in which case a signed number is output.
In all cases, sscanf(3) is initially
used to convert the text to a long int or double value,
so any restrictions that apply to sscanf(3) conversions also apply
1. To output the two integers 234 (hex) and 2345 (decimal),
followed by the float value 6.4, the input text could be:
\#I 0x234 2345
2. To output a form feed followed by the integers 5 and 124,
the short -16, and finally a string "456abc%" on a new line, use
\#I 5 124