/**
	\file "grouter/grouteInt.h"
	Internal routines for grouter module.
	$Id: grouteInt.h,v 1.2 2006/02/08 03:46:45 fang Exp $
 */

#ifndef	__GROUTER_GROUTEINT_H__
#define	__GROUTER_GROUTEINT_H__

#include "misc/magic.h"
#include "gcr/gcr_types.h"
#include "database/database_types.h"
#include "grouter/groute_types.h"

/* in no particular order */

#if 0
typedef	GlPoint* (*GlRouteProcType)();
typedef	void (*GlMarkProcType)();
#else
/* more precise */
typedef	GlPoint* (*GlRouteProcType)(GlPoint*, NLTermLoc*, int, ClientData);
typedef	void (*GlMarkProcType)(CellUse*, GlPoint*, NetId*, ClientData);
#endif
typedef int (*GlCrossEnumProcType)(GlPoint*, Tile*, GCRPin*, ClientData);
typedef int (*GlPenEnumCrossProcType)(CZone*, GCRPin*, GCRPin*, ClientData);


extern void glDensInit(register DensMap[2], GCRChannel*);
extern bool glDensAdjust(register DensMap[2], GCRPin*, GCRPin*, NetId);
extern void glChanFreeMap(void);
extern void glChanBlockDens(register GCRChannel *ch);
extern void glChanBuildMap(GCRChannel*); 
extern void GlInit(void);	/* called by grouteMain.c */
extern void glShowCross(GCRPin *pin, NetId netId, int kind);
				/* used in grouteCrss.c */
extern void glStatsInit(void);
extern void glPenCompute(GCRChannel*, NLNetList*);
extern void glCrossUnreserve(NLNet*);
extern void glPenSetPerChan(NLNet*);
extern int glMultiSteiner(CellUse*, NLNet*, GlRouteProcType, GlMarkProcType,
	ClientData, ClientData);
extern void glListAdd(register GlPoint**, GCRPin*, int);
extern int glMultiStemCost(register NLTermLoc*);
extern void glPathFreePerm(GlPoint*);
extern void glPathFreeTemp(void);
extern void glMultiAddStart(GlPoint*, GlPoint**);
extern void glPenClearPerChan(NLNet*);
extern void glStatsDone(int, int);
extern void glDMAlloc(register DensMap*, int, int);
extern void glDMCopy(register DensMap*, register DensMap*);
extern void glDMFree(DensMap*);
extern void glCrossScalePenalties(void);
extern void glListToHeap(GlPoint*, Point*);
extern void glMazeResetCost(GlPage*, int);
extern void glHistoAdd(int, int, int);
extern int glCrossEnum(register GlPoint*, Tile*, 
	GlCrossEnumProcType, ClientData);
extern int glDMMaxInRange(DensMap*, int, int);
extern int glPenEnumCross(register CZone*, register GlPoint*,
	GlPenEnumCrossProcType, ClientData);

#endif	/* __GROUTER_GROUTEINT_H__ */

