home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boldly Go Collection
/
version40.iso
/
TS
/
17A
/
DRWIN101.ZIP
/
SYMBOL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-15
|
2KB
|
42 lines
#ifndef _SYMBOL_INCLUDED_
#define _SYMBOL_INCLUDED_
#ifndef BYTE
#define BYTE unsigned char
#endif
#define MAXHASH 0x20 /*number of hash entries*/
typedef struct symrecst {
struct symrecst *prv; /*pointer to previous*/
struct symrecst *nxt; /*pointer to next symbol*/
BYTE rec[1]; /*name (actually entire user's record)*/
} symrec;
typedef int (*symcmpf)(void *s1,void *s2);
typedef struct symtabst {
int siz; /*size of each record*/
int num; /*number of records entered so far*/
symcmpf cmp; /*compare function (1>,0=,-1<)*/
symrec *sym; /*pointer to first symbol*/
symrec *cur; /*pointer to current symbol*/
} symtab;
symtab *symopen(int sz,symcmpf cf); /*opens symbol table*/
void symclose(symtab *st); /*closes symbol table*/
void *symfind(symtab *st,void *rec); /*finds symbol in table*/
void *symins(symtab *st,void *rec); /*inserts symbol into the table*/
void *symdel(symtab *st,void *rec); /*deletes symbol from table*/
void *symfirst(symtab *st); /*returns first symbol record*/
void *symcurr(symtab *st); /*returns current symbol pointer*/
void *symnext(symtab *st); /*returns next symbol record*/
void *symprev(symtab *st); /*returns previous symbol record*/
void *symlast(symtab *st); /*returns pointer to last record*/
void *symsucc(symtab *st,void *rec); /*returns pointer to successor of rec*/
void *sympred(symtab *st,void *rec); /*returns pointer to rec's predecessor*/
int symnum(symtab* st); /*returns number of recs in table*/
#endif /*if symbol.h not already included*/