// QBCC Standard Basic File

#ifndef __STDQBCC_H__
#define __STDQBCC_H__

#define TRUE	-1
#define FALSE	0


// FOR loop macro
#define FOR(var,start,end,step)	\
	(var) = (start) - (step);		\
	while(1)								\
	{										\
		(var) += (step);				\
		if( (step) > 0)				\
		{									\
			if( (var) > (end) )		\
				break;					\
		}									\
		else								\
			if( (var) <= (end) )		\
				break;					\



// File Operations

// File Opening Modes
#define FL_APPEND	1
#define FL_BINARY	2
#define FL_INPUT	4
#define FL_OUTPUT	8


void FPRINT(char *fmt,...);
void INPUT(char *fmt,...);
int OPEN(string *filename, int ModeType, int *FileNumber);
void CLOSE(int *FileNumber);
int *FREEFILE(void);



// String Operations
typedef struct string {
	short length;
	char *ptr;
} string;


string *strVcpy(char *fmt, ...);
int strQcmp(string *s1, string *s2);
string NewString(void);
string *NewPTRString(void);

// Memory Operations
void *GetPointer(size_t size);
int AllocateMemBlock(int NumStr);
void FreeMemBlock(void);
string *GetPointer(void);
int *GetINTptr(int value);
int *GetSNGptr(int value);
int *GetDBLptr(int value);
int *GetLNGptr(int value);

// Initialization Routines
int STD_Initialize(void);
int STD_ShutDown(void);


#endif  //  __STDQBCC_H__