4 ISAMB isamb_open (const char *name, ISAMC_M method)
6 ISAMB isamb = xmalloc (sizeof(*isamb));
10 int isamb_insert (ISAMB is, ISAMB_pos *pos, const void *data)
12 void *decodeClientData;
17 *pos = isamb_alloc_block (is, isamb->block_size[0], &page);
18 isamb_page_set_leaf (page);
19 isamb_page_set_no (page, 0);
21 else /* find leaf ... */
30 isamb_get_block (is, *pos, &page);
31 if (isamb_page_isleaf (page))
33 src = isamb_page_datalist (page);
34 no = isamb_page_get_no (page);
35 decodeClientData = (*is->method->code_start)(ISAMC_DECODE);
37 isamb_read_subptr (&subptr, &src);
38 for (i = 0; i<no; i++)
40 const char *src0 = src;
42 (*is->method->code_item)(ISAMC_DECODE, decodeClientData,
44 if ((*is->method->compare_item)(data, dst) < 0)
47 isamb_read_subptr (&subptr, src);
50 (*is->method->code_stop)(ISAMC_DECODE, decodeClientData);
52 src = isamb_page_datalist (page);
53 no = isamb_page_get_no (page);
54 decodeClientData = (*is->method->code_start)(ISAMC_DECODE);
56 for (i = 0; i<no; i++)
59 (*is->method->code_item)(ISAMC_DECODE, decodeClientData,
61 diff = (*is->method->compare_item)(data, dst);
68 src = isamb_page_datalist (page);
69 page2 = isamb_page_dup (is, page);
70 dst2 = isamb_page_datalist (page2);
72 for (j = 0; j <= no; j++)
75 (*is->method->code_item)(ISAMC_ENCODE, encodeClientData,
80 (*is->method->code_item)(ISAMC_DECODE, decodeClientData,
82 (*is->method->code_item)(ISAMC_ENCODE, encodeClientData,