/* this file is automatically generated by pl_config.c */
#define NB_OF_STACKS 		4

#define Trail_Stack       	(pl_stk_tbl[0].stack)
#define Trail_Size        	(pl_stk_tbl[0].size)
#define Trail_Offset(adr) 	((WamWord *)(adr) - Trail_Stack)
#define Trail_Used_Size   	Trail_Offset(TR)

#define Cstr_Stack       	(pl_stk_tbl[1].stack)
#define Cstr_Size        	(pl_stk_tbl[1].size)
#define Cstr_Offset(adr) 	((WamWord *)(adr) - Cstr_Stack)
#define Cstr_Used_Size   	Cstr_Offset(CS)

#define Global_Stack       	(pl_stk_tbl[2].stack)
#define Global_Size        	(pl_stk_tbl[2].size)
#define Global_Offset(adr) 	((WamWord *)(adr) - Global_Stack)
#define Global_Used_Size   	Global_Offset(H)

#define Local_Stack       	(pl_stk_tbl[3].stack)
#define Local_Size        	(pl_stk_tbl[3].size)
#define Local_Offset(adr) 	((WamWord *)(adr) - Local_Stack)
#define Local_Used_Size   	Local_Offset(Local_Top)


#define Stack_Top(s)       	(((s) == 0) ? TR : ((s) == 1) ? CS : ((s) == 2) ? H : Local_Top)

typedef struct
{
  char *name;
  char *desc;
  char *env_var_name;
  PlLong *p_def_size;	/* used for fixed_sizes */
  int default_size; 	/* in WamWords */
  int size;         	/* in WamWords */
  WamWord *stack;
}InfStack;


#ifdef ENGINE_FILE

    /* these variables can be overwritten by top_comp.c (see stack size file) */
PlLong pl_def_trail_size;
PlLong pl_def_cstr_size;
PlLong pl_def_global_size;
PlLong pl_def_local_size;
PlLong pl_fixed_sizes;

InfStack pl_stk_tbl[] =
{
 { "trail", "Trail Stack (undo)", "TRAILSZ", &pl_def_trail_size, 2097152, 0, NULL },
 { "cstr", "Cstr Stack (constraints)", "CSTRSZ", &pl_def_cstr_size, 2097152, 0, NULL },
 { "global", "Global Stack (heap)", "GLOBALSZ", &pl_def_global_size, 4194304, 0, NULL },
 { "local", "Local Stack (control)", "LOCALSZ", &pl_def_local_size, 2097152, 0, NULL }
};

#else

extern PlLong pl_def_trail_size;
extern PlLong pl_def_cstr_size;
extern PlLong pl_def_global_size;
extern PlLong pl_def_local_size;
extern PlLong pl_fixed_sizes;


extern InfStack pl_stk_tbl[];

#endif
