/*                      QBCC Project

This source file is licensed under the GNU Public Licence which should be 
included with the distribution of this source.

*/
#ifndef __QBCC_H__
#define __QBCC_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <time.h>
#include <direct.h>

#include "structures.h"


#define __ALPHA__
#define _DEV_				// Developer edition
//#define _DEVSUMMARY_		// Developer Summaries
//#define _DEVCOUTPUT_		// Developer C format summary

//////////////////////////////////////
// Structures
//////////////////////////////////////
extern func_t *curFUNC;			// QB Functions
extern type_t *curTYPE;			// QB Types
extern select_t *SelStruct;		// SELECT CASE struct

extern FILE *outfile;
extern FILE *infile;
extern char basfile[128];
extern char cfile[128];
extern char OrigName[128];

//////////////////////////////////////
// Coding Globals
//////////////////////////////////////
extern int Indent;
extern int IsCase;

//////////////////////////////////////
// LEX shared variables
//////////////////////////////////////
extern int VarType;
extern char *stringconst;
extern char *yytext;
extern FILE *yyin;

//////////////////////////////////////
// QBCC Constants
//////////////////////////////////////

// Miscellanous
#define VERSION         "0.01a"
#define TRUE            (-1)
#define FALSE           0
#define DEPTH				3

// Function Types
#define FN_SUB          0x001
#define FN_FUNCTION		0x002

// Variable Flags
#define VRF_ARRAY			1
#define VRF_DIMMED			2
#define VRF_POINTER			4
#define VRF_EXTERN			8

//////////////////////////////////////
// Macros
//////////////////////////////////////
#define ADD_DEPTH			Indent+=DEPTH;
#define SUB_DEPTH			Indent-=DEPTH;if(Indent<0)Indent=0;

//////////////////////////////////////
// Standard Prototypes
//////////////////////////////////////

//    main.c
int main(int argc, char *argv[]);
void ShowQBCCHeader(void);
int Initialize(void);
int ShutDown(void);
int CheckParameters(int argc, char *argv[]);
void RunPreProcessor(int argc, char *argv[]);

void ShowDevSummary(void);
//    misc.c
void AddStandard(void);
void PrintDepth(char *retstr);
void MyDupStr(char *text,char *text2,int start);

#endif  //  __QBCC_H__