--- ray/src/meta/segment.c 2003/02/22 02:07:26 1.1 +++ ray/src/meta/segment.c 2003/11/15 02:13:37 1.2 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: segment.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; +static const char RCSid[] = "$Id: segment.c,v 1.2 2003/11/15 02:13:37 schorsch Exp $"; #endif /* * Routines for segment storage and inclusion for meta-files @@ -7,7 +7,9 @@ static const char RCSid[] = "$Id: segment.c,v 1.1 2003 * 12/18/84 */ +#include +#include "rtio.h" #include "meta.h" @@ -32,14 +34,16 @@ static int dectop = 0; /* top of declaration table */ static int curdec = NODEC; /* current declaration */ +static int hash(register char *s); +static int lookup(register char *name); static int -hash(s) /* hash a string */ +hash( /* hash a string */ + register char *s +) -register char *s; - { register int hval = 0; @@ -54,10 +58,10 @@ register char *s; static int -lookup(name) /* find name in declaration table */ +lookup( /* find name in declaration table */ + register char *name +) -register char *name; - { register int curd; @@ -73,9 +77,9 @@ register char *name; +int +inseg(void) /* return TRUE if currently in a segment */ -inseg() /* return TRUE if currently in a segment */ - { return(curdec != NODEC); @@ -83,11 +87,11 @@ inseg() /* return TRUE if currently in a segment */ +void +openseg( /* open a new segment */ + char *name +) -openseg(name) /* open a new segment */ - -char *name; - { register int olddec; @@ -108,11 +112,11 @@ char *name; +void +segprim( /* store primitive in current segment */ + register PRIMITIVE *p +) -segprim(p) /* store primitive in current segment */ - -register PRIMITIVE *p; - { register PRIMITIVE *newp; @@ -145,9 +149,9 @@ register PRIMITIVE *p; } +void +closeseg(void) /* close the current segment */ -closeseg() /* close the current segment */ - { register int i; @@ -167,16 +171,16 @@ closeseg() /* close the current segment */ hashtabl[i] = curdec; /* return context */ curdec = dectabl[curdec].context; - } +void +segment( /* expand segment p */ + PRIMITIVE *p, + void (*funcp)(PRIMITIVE *p) +) -segment(p, funcp) /* expand segment p */ -PRIMITIVE *p; -int (*funcp)(); - { int decln; PRIMITIVE curp; @@ -242,11 +246,11 @@ int (*funcp)(); int -xlate(extrema, p, px) /* return extrema from p through px */ - -short extrema; -PRIMITIVE *p; -register PRIMITIVE *px; +xlate( /* return extrema from p through px */ + short extrema, + PRIMITIVE *p, + register PRIMITIVE *px +) { short oldex;