version 1.25, 2011/12/16 12:07:45 |
version 1.27, 2011/12/20 21:41:11 |
Line 171 btree_read(const DBT *k, const DBT *v, |
|
Line 171 btree_read(const DBT *k, const DBT *v, |
|
const struct mchars *mc, |
const struct mchars *mc, |
struct db_val *dbv, char **buf) |
struct db_val *dbv, char **buf) |
{ |
{ |
const struct db_val *vp; |
struct db_val raw_dbv; |
|
|
/* Are our sizes sane? */ |
/* Are our sizes sane? */ |
if (k->size < 2 || sizeof(struct db_val) != v->size) |
if (k->size < 2 || sizeof(struct db_val) != v->size) |
Line 181 btree_read(const DBT *k, const DBT *v, |
|
Line 181 btree_read(const DBT *k, const DBT *v, |
|
if ('\0' != ((const char *)k->data)[(int)k->size - 1]) |
if ('\0' != ((const char *)k->data)[(int)k->size - 1]) |
return(0); |
return(0); |
|
|
vp = v->data; |
|
norm_string((const char *)k->data, mc, buf); |
norm_string((const char *)k->data, mc, buf); |
dbv->rec = betoh32(vp->rec); |
memcpy(&raw_dbv, v->data, v->size); |
dbv->mask = betoh64(vp->mask); |
dbv->rec = betoh32(raw_dbv.rec); |
|
dbv->mask = betoh64(raw_dbv.mask); |
return(1); |
return(1); |
} |
} |
|
|
Line 197 btree_read(const DBT *k, const DBT *v, |
|
Line 197 btree_read(const DBT *k, const DBT *v, |
|
static size_t |
static size_t |
norm_utf8(unsigned int cp, char out[7]) |
norm_utf8(unsigned int cp, char out[7]) |
{ |
{ |
size_t rc; |
int rc; |
|
|
rc = 0; |
rc = 0; |
|
|
Line 238 norm_utf8(unsigned int cp, char out[7]) |
|
Line 238 norm_utf8(unsigned int cp, char out[7]) |
|
return(0); |
return(0); |
|
|
out[rc] = '\0'; |
out[rc] = '\0'; |
return(rc); |
return((size_t)rc); |
} |
} |
|
|
/* |
/* |
Line 380 index_read(const DBT *key, const DBT *val, int index, |
|
Line 380 index_read(const DBT *key, const DBT *val, int index, |
|
return(0); |
return(0); |
|
|
cp = val->data; |
cp = val->data; |
rec->res.rec = *(recno_t *)key->data; |
assert(sizeof(recno_t) == key->size); |
|
memcpy(&rec->res.rec, key->data, key->size); |
rec->res.volume = index; |
rec->res.volume = index; |
|
|
if ('d' == (type = *cp++)) |
if ('d' == (type = *cp++)) |