| 1 |
/* internal cdb library declarations
|
| 2 |
*
|
| 3 |
* This file is a part of tinycdb package by Michael Tokarev, mjt@corpit.ru.
|
| 4 |
* Public domain.
|
| 5 |
*/
|
| 6 |
|
| 7 |
#include "common/setup_before.h"
|
| 8 |
#include "cdb.h"
|
| 9 |
#include <errno.h>
|
| 10 |
#ifdef HAVE_STRING_H
|
| 11 |
# include <string.h>
|
| 12 |
#else
|
| 13 |
# ifdef HAVE_STRINGS_H
|
| 14 |
# include <strings.h>
|
| 15 |
# endif
|
| 16 |
# ifdef HAVE_MEMORY_H
|
| 17 |
# include <memory.h>
|
| 18 |
# endif
|
| 19 |
#endif
|
| 20 |
#include "common/setup_after.h"
|
| 21 |
|
| 22 |
#ifndef EPROTO
|
| 23 |
# define EPROTO EINVAL
|
| 24 |
#endif
|
| 25 |
|
| 26 |
struct cdb_rec {
|
| 27 |
cdbi_t hval;
|
| 28 |
cdbi_t rpos;
|
| 29 |
};
|
| 30 |
|
| 31 |
struct cdb_rl {
|
| 32 |
struct cdb_rl *next;
|
| 33 |
cdbi_t cnt;
|
| 34 |
struct cdb_rec rec[254];
|
| 35 |
};
|
| 36 |
|
| 37 |
int _cdb_make_find(struct cdb_make *cdbmp,
|
| 38 |
const void *key, cdbi_t klen, cdbi_t hval,
|
| 39 |
struct cdb_rl **rlp);
|
| 40 |
int _cdb_make_write(struct cdb_make *cdbmp,
|
| 41 |
const char *ptr, cdbi_t len);
|