home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
ASCENDER
/
ascendMar8.tar
/
UMass
/
Triangulate
/
include
/
table.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-13
|
2KB
|
75 lines
/* @(#)table.h 3.11 12/21/94 */
#ifndef table_h
#define table_h
#ifndef DATADEF
#define DATADEF
typedef char *DATA;
#endif
#include "rh_util.h"
#include "list.h"
typedef struct TABLEENTRY
{
DATA data;
struct TABLEENTRY *tbl_left, *tbl_right;
char tbl_leftleaf, tbl_rightleaf;
char tbl_BF;
} TABLE, TABLEENTRY;
#define tbl_forall(type,x,y) tbl_forinorder(type,x,y)
#define tbl_forinorder(type,x,y) \
{ \
register type x; \
register TABLEENTRY *tbl_cursor; \
for(tbl_cursor=tbl_firstentry(y); \
tbl_cursor?(x=(type)tbl_cursor->data,TRUE):FALSE; \
tbl_cursor=tbl_nextentry(tbl_cursor)) \
{
#define tbl_forbackwards(type,x,y) \
{ \
register type x; \
register TABLEENTRY *tbl_cursor; \
for(tbl_cursor=tbl_lastentry(y); \
tbl_cursor?(x=(type)tbl_cursor->data,TRUE):FALSE; \
tbl_cursor=tbl_preventry(tbl_cursor)) \
{
#define tbl_forallentries(tbl_cursor,y) \
{ \
register TABLEENTRY *tbl_cursor; \
for(tbl_cursor=tbl_firstentry(y); \
tbl_cursor; \
tbl_cursor=tbl_nextentry(tbl_cursor)) \
{
#define tbl_forpreorder(type,x,y) \
{ \
register type x; \
register TABLEENTRY *tbl_cursor; \
for(tbl_cursor=(y); \
tbl_cursor?(x=(type)tbl_cursor->data,TRUE):FALSE; \
tbl_cursor=tbl_nextpreorder(tbl_cursor)) \
{
#define tbl_endall }}
#define tbl_free(atable) \
{ \
tbl_forallentries (anentry, (atable)) \
free (anentry); \
tbl_endall \
atable = NULL; \
}
/*>>
External function definitions.
<<*/
#include "table.s"
#endif