Fixed bug #451: Sorted result set disappears .. NEW BEHAVIOR
[idzebra-moved-to-github.git] / index / orddict.c
1
2 #include <yaz/xmalloc.h>
3
4 #include "orddict.h"
5
6 struct zebra_ord_dict {
7     char *str;
8     size_t str_sz;
9     Dict dict;
10 };
11
12 Zebra_ord_dict zebra_ord_dict_open(Dict dict)
13 {
14     Zebra_ord_dict zod = xmalloc(sizeof(*zod));
15     zod->str_sz = 50;
16     zod->str = xmalloc(zod->str_sz);
17     zod->dict = dict;
18     return zod;
19 }
20
21 void zebra_ord_dict_close(Zebra_ord_dict zod)
22 {
23     if (!zod)
24         return;
25     dict_close(zod->dict);
26     xfree(zod->str);
27     xfree(zod);
28 }
29
30 char *zebra_ord_dict_lookup (Zebra_ord_dict zod, int ord, 
31                              const char *p)
32 {
33     return dict_lookup(zod->dict, p);
34 }
35