diff options
Diffstat (limited to 'src/libndb/ndbhf.h')
-rw-r--r-- | src/libndb/ndbhf.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libndb/ndbhf.h b/src/libndb/ndbhf.h new file mode 100644 index 00000000..4505d13b --- /dev/null +++ b/src/libndb/ndbhf.h @@ -0,0 +1,27 @@ +/* a hash file */ +struct Ndbhf +{ + Ndbhf *next; + + int fd; + ulong dbmtime; /* mtime of data base */ + int hlen; /* length (in entries) of hash table */ + char attr[Ndbalen]; /* attribute hashed */ + + uchar buf[256]; /* hash file buffer */ + long off; /* offset of first byte of buffer */ + int len; /* length of valid data in buffer */ +}; + +char* _ndbparsetuple(char*, Ndbtuple**); +Ndbtuple* _ndbparseline(char*); + +#define ISWHITE(x) ((x) == ' ' || (x) == '\t' || (x) == '\r') +#define EATWHITE(x) while(ISWHITE(*(x)))(x)++ + +extern Ndbtuple *_ndbtfree; + +/* caches */ +void _ndbcacheflush(Ndb *db); +int _ndbcachesearch(Ndb *db, Ndbs *s, char *attr, char *val, Ndbtuple **t); +Ndbtuple* _ndbcacheadd(Ndb *db, Ndbs *s, char *attr, char *val, Ndbtuple *t); |