/*=====================*/
/*  preqcc beta v1.01  */
/*=====================*/
written by: John Cook (cookj@yallara.cs.rmit.edu.au)
            http://minyos.its.rmit.edu.au/~cookj

What is preqcc?
---------------

It's a precompiler for quakeC code, designed to 
be ran before you run the normal compiler (usually qcc).

It's a 32-bit win95 console app, optimized for Pentium processors.

Why us it?
----------

'cause you can't compile the TeamFortress code without it.
AND
it lets you use the following commands inside your code:

#define
#include

#includelist	// kinda like #include, but a list instead
#endlist

#ifdef
#ifndef
#endif

#pragma  		// used to set compiler options

they work just like they do in C, kind of. But with a few changes.

======================================================================
list of precompiler commands
==============================

--------
#define
--------
format:
#define <constantname> [value to define it to]

it lets you define a constant value
example:

#define MAX_PIPEBOMBS 5

or

#define SECRET_PASSWORD "bob"

Your code to use them would look something like:

    if (number_of_pipebombs_in_world > #MAX_PIPEBOMBS)
                                       ^^^^^^^^^^^^^^
                                    note the # in front of the constant
                                    name. very important.

or

    if (self.netname == #SECRET_PASSWORD)
                        ^^^^^ 
                      again, note the #

The reason it needs the # in front of constant names is just for faster
searching (roughly 5x speed difference).

You can also refer constants to other constants, example:

#define MAX_AMMO    #MAX_SHELLS + #MAX_NAILS + #MAX_CELLS + #MAX_ROCKETS

or 

#define STARTING_WEAPONS     #IT_AXE | #IT_SHOTGUN


Why use this instead of floats? Because it compiles to smaller and faster code.
(don't quote me on that though)
							  

--------
#include
--------
format:
#include <filename>

this is a little different to the C version, because the file is included
_after_ the current file. I couldn't do it any other way without making
the code impossible to debug. sorry.

example:
#include DEFS.QC
#include "WEAPONS.QC"

it doesn't matter whether or not you put quotes around the filename.

----------------------
#includelist, #endlist
-----------------------
format:
#includelist [filename] 
[filename]
[filename]
[more filenames]
#endlist

You can include as many filenames as you want. I put this in just for ease of
use.

example:

#includelist
defs.qc
client.qc
weapons.qc
player.qc
#endlist

-----------------------
#ifdef, #ifndef, #endif
------------------------
format:
#ifdef <constantname>
	...
#endif

The lines of code between the #ifdef and the #endif are only compiled
if constantname has been defined.

#ifndef <constantname>
   ...
#endif

#ifndef is much the same as #ifdef, but only compiles the code if constantname
hasn't been defined.

example:

#ifndef INTERNET_SERVER

    ...
	// do something really tricky which would cause
	// too much lag on a net server
	....

#endif 

#ifdef INTERNET_SERVER
	... 
	// do something really lame in place of the thing
	// you really wanted to do.
	...
#endif


---------
#pragma
---------
format:
#pragma <option>


A pragma lets you specify non-compiler specific settings. The
following pragmas are supported by preqcc:

--
#pragma DONT_COMPILE_THIS FILE

This pragma specifies that the current file is not to be compiled by
qcc. 

--
#pragma COMPILE_THIS_FILE

This pragma specifies that the current file is to be compiled by qcc. This
is the default.

--
#pragma PROGS_DAT <filename>

where <filename> is the file you want to be the output of qcc.

--
#pragma PROGS_SRC <filename>

where <filename> is the name of the makefile qcc uses.

--
#pragma KEEP_NEWLINES < ON | OFF >

turns newline keeping on/off. Default: ON

--
#pragma CHECK_REDEFINES < ON | OFF >

if CHECK_REDEFINES is ON, an error is issued if a #define is defined
again.


===================================================
	In the future
===================

I plan on adding in:
#if
#else

and maybe a few other things.





