#ifndef _PDB_H_
#define _PDB_H_

typedef struct param {
	struct param *next;

#define PDB_NONE	  0x000000
#define PDB_DOUBLE	  0x000001
#define PDB_INTEGER	  0x000002
#define PDB_STRING	  0x000004
#define PDB_SET	  	  0x000010
	int type;

#define PDB_CONSTRUCTED	  0x100000
#define PDB_DECLARED	  0x200000
	int flags;
	char *name;
	union {
	   double d;
	   int i;
	   char *s;
	   struct paramSet *set;
	  } val;
	int lineno;
} PdbPar;

typedef struct paramSet {
	int len;
	int code;
	struct param* list;
} PdbSet;

#define IS_DOUBLE_VECTOR(p)	\
	(  (p)->type == PDB_SET && \
	 !((p)->val.set->code & ~(PDB_DOUBLE|PDB_INTEGER)))

#define IS_INTEGER_VECTOR(p)	\
	((p)->type == PDB_SET && !((p)->val.set->code & ~PDB_INTEGER))

typedef struct paramListSpec {
	char* name;
#define PSF_OPTIONAL	0x80000000
	int flags;
	void* var;
	int len;
	  } PARAMSPEC;

PdbSet *pdbParse();
float* pdbBuildVecF();
double* pdbBuildVecD();
int* pdbBuildVecI();
float* pdbSetVecF();
double* pdbSetVecD();
int* pdbSetVecI();

char *pdbTypeStr();

#endif
