/*
** XmgI.h for  in 
** 
** Made by vianney rancurel
** Login   <vianney@epita.fr>
** 
** Started on  Wed Aug 25 14:18:02 1999 vianney rancurel
** Last update Thu Oct 28 20:23:17 1999 
*/
#ifndef XMGI_H
#define XMGI_H	1

#include <X11/Intrinsic.h>
#include "mg.h"
#include "XmgErr.h"

#ifndef _Xconst
# define _Xconst
#endif

#ifdef DEBUG_MALLOC
# include "gdm.h"
# define XMG_ALLOC_ALGORITHM	gdm_alloc_algorithm
# define XMG_ALLOC_PROC		gdm_alloc
# define XMG_REALLOC_PROC	gdm_realloc
# define XMG_FREE_PROC		gdm_free
#else
# define XMG_ALLOC_ALGORITHM	alloc_algorithm_factor2
# define XMG_ALLOC_PROC		alloc_malloc
# define XMG_REALLOC_PROC	realloc_realloc
# define XMG_FREE_PROC		free_free
#endif

#define XMG_VEC_NEW(statusp)	vec_new(VEC_BASE,\
					FALSE,\
					XMG_ALLOC_ALGORITHM,\
					XMG_ALLOC_PROC,\
					XMG_REALLOC_PROC,\
					XMG_FREE_PROC,\
					"xmg_vec",\
					(statusp))

#define XMG_VEC_ONE_NEW(statusp)	vec_new(VEC_ONE_BASE,\
					FALSE,\
					XMG_ALLOC_ALGORITHM,\
					XMG_ALLOC_PROC,\
					XMG_REALLOC_PROC,\
					XMG_FREE_PROC,\
					"xmg_vec",\
					(statusp))

#define XMG_DICT_NEW(statusp)	dict_new(HASH_BASE,\
					 VEC_BASE,\
					 dict_hash_code_public,\
					 XMG_ALLOC_ALGORITHM,\
					 XMG_ALLOC_PROC,\
					 XMG_REALLOC_PROC,\
					 XMG_FREE_PROC,\
					 "xmg_dict",\
					 (statusp))

#define XMG_ONE_DICT_NEW(statusp)	dict_new(HASH_ONE_BASE,\
						 VEC_BASE,\
						 dict_hash_code_public,\
						 XMG_ALLOC_ALGORITHM,\
						 XMG_ALLOC_PROC,\
						 XMG_REALLOC_PROC,\
						 XMG_FREE_PROC,\
						 "xmg_one_dict",\
						 (statusp))

#define XMG_SMALL_DICT_NEW(statusp)	dict_new(HASH_SMALL_BASE,\
						 VEC_BASE,\
						 dict_hash_code_public,\
						 XMG_ALLOC_ALGORITHM,\
						 XMG_ALLOC_PROC,\
						 XMG_REALLOC_PROC,\
						 XMG_FREE_PROC,\
						 "xmg_small_dict",\
						 (statusp))

#define XMG_ID_NEW(statusp)	id_new(HASH_BASE,\
				       VEC_BASE,\
				       XMG_ALLOC_ALGORITHM,\
				       XMG_ALLOC_PROC,\
				       XMG_REALLOC_PROC,\
				       XMG_FREE_PROC,\
				       "xmg_id_new",\
				       (statusp))

#ifdef DEBUG
extern t_mask			xmg_verb_level;

#define VERB_XMG_MACRO		(1L<<0)
#define VERB_XMG_FANCY		(1L<<1)
#define VERB_XMG_CVT		(1L<<2)

# define XMG_VERB(level)	((xmg_verb_level != 0L)?\
				 (level) & xmg_verb_level:FALSE) 

#endif

/* PROTO XmgI.c */
/* include/XmgFancyI.h */
/* xmg_i.c */
void xmg_debug_init P((void));
#endif
