TextIt:
binary to text converter,
by Daniel Guerrero Miralles (daguer@geocities.com) 1998.


Introduction
------------

This little program converts binary files into a form readable for a C 
compiler. The main motivation for such a program was to allow Lcc-Win32 users 
to include custom resource files that LCCLNK and LRC do not understand as 
RCDATA resources.

I based it in my PCX to C converter, a program that I wrote a long time ago 
to create sprites for MS-DOS 16-bit compilers, but I have improved it to be 
"easier" to use.

The program itself is very simple, just read two bytes from the file into a 
16-bit integer (short int in the 32-bit compiler) and then wrote it to the 
text file with fprintf, until EOF is reached.

Because I expect nobody will care for the copyright of such a simple thing, 
the source code and executable (Win32 version) are released to the public 
domain. Do with it what you want (by the way, if you make something nice with 
it, and you mention me, I will be enormously pleased).


Usage
-----

To get a brief description of the parameters that the porgram accepts, just 
run it without parameters on the command line (a DOS box).

This is what will be displayed:
-----------------------------------------------------------------------------
TextIt, binary to text converter.
By Daniel Guerrero Miralles 1998. Public Domain.

Syntax: TextIt [/k] [/r] <input file 1> [<input file 2> ...]

<Input file x> : the name of the input file(s) (wildcards allowed).
     The output file is assumed to have the same name as the input file with
     .TXT extension.
/k : (optional) keep output files in the same directory as input files (by
     default, output files will be created in the current working directory).
/r : (optional) replace output files without prompting.
-----------------------------------------------------------------------------

TextIt allows you to specify file names and switches as parameters.

Switches can be preceded with "/" (DOS style) or "-" (UNIX style), what ever 
you like the most. They are not case sensitive, so -k and -K are the same.

A switch can appear in any place between file names, and any number of times. 
Any time TextIt finds a switch it "switches" its state. For example, the 
default behavior for TextIt is to prompt before replacing any output file.
The first time it finds a /r switch it will stop prompting, until a new /r 
switch is found; that will reset TextIt to the default (thus providing /r /r 
as the command line is the same as doing nothing).

Besides of this, you must keep in mind that TextIt reads the parameters left 
to right, that is, this command line:

TextIt foo.bin /r bar.bin

will prompt you before deleting foo.txt (if it exists), but bar.txt will be 
deleted without prompt.

Usually, my binary files are not in the same directory where the output files 
should go, so I move to the destination directory and convert all of them 
with a single call to TextIt. However, I provide the /k switch to allow you 
to override this behavior.

Finally, I have found that stopping the convfersion of multiple files just 
because one of them was not found is not a nice feature, so I wrote the 
program to simply skip files that could not be converted.

However, this may be dangerous, because if you are converting much files at 
the same time, and one file is skipped for some reason, you will have little 
chances of seeing the warning (or may be you are doing some other thing while 
the program is doing the conversion), so you can redirect the TextIt output 
to a file that you could read later (only progress messages and warnings will 
be stored in the file, the program identification message and prompt messages 
will not). In Win32 this is done like this:

TextIt *.bin > result.txt

This will create a file named "result.txt" with all the progress and warning 
messages.


Greetings
---------

Greetings go to Josef Planeta, who stimulated my mind to do this.

Well, I think that is all. Enjoy it.
