/*                      QBCC Project

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

*/
#ifndef __STRUCTS_H__
#define __STRUCTS_H__

// Typedef's
typedef struct TYPE_S type_t;
typedef struct VAR_S var_t;
typedef struct FUNC_S func_t;
typedef struct DEFAULT_S default_t;
typedef struct SELECT_S select_t;

// Variable Structure
struct VAR_S {
	char name[81];		// Variable Name
	int type;			// Variable Type
	long size;			// Variable Size (strings)
	int flags;			// Flags

	char nametype[81];	// Awful hack which holds the type of variable name
	
	type_t *structtype; // Variable type structure if(type == USER_DEFINED)

	var_t *next;		// Next variable
	var_t *prev;		// Previous variable
};

// Function Structure
struct FUNC_S {
	char name[81];		// Function Name
	int ret;			// Function Return type
	int flags;			// Flags
	
	var_t *vars;		// Variables in function
	var_t *args;		// Arguments in function
	
	type_t *retstruct;	// Return structure if(ret == USER_DEFINED)

	func_t *next;		// Next function
	func_t *prev;		// Previous function
};

// Type Structure
struct TYPE_S {
	char name[81];		// Type name
	int nummembers;		// Number of members
	int Flags;			// Flags

	var_t *vars;		// Members

	type_t *next;		// Next type
	type_t *prev;		// Previous type
};

// Default Structure
struct DEFAULT_S {
	int DefaultType;
	char INTEGER[128];	// Default C type for 'INTEGER'
	char LONG[128];		// Default C type for 'LONG'
	char DOUBLE[128];	// Default C type for 'DOUBLE'
	char SINGLE[128];	// Default C type for 'SINGLE'
	char STRING[128];	// Default C type for 'STRING'
	char FILE[128];		// Default C type for 'FILE'
};

// Select Case Structure
struct SELECT_S {
	int VarType;		// Variable/Expression Type
	char expr[1024];	// Expression
	int InSelectBlock;	// Whether were in the select block
};


#endif  //  __STRUCTS_H__