9440e989c65a2efde4f4de21df19e0ebe36565a2
[idzebra-moved-to-github.git] / include / zebra_strmap.h
1 /* $Id: zebra_strmap.h,v 1.2 2007-12-03 09:12:38 adam Exp $
2    Copyright (C) 1995-2007
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21 */
22
23 #ifndef ZEBRA_STRMAP_H
24 #define ZEBRA_STRMAP_H
25
26 #include <yaz/yconfig.h>
27 #include <stddef.h>
28 YAZ_BEGIN_CDECL
29
30 typedef struct zebra_strmap *zebra_strmap_t;
31 typedef struct zebra_strmap_it_s *zebra_strmap_it;
32
33 YAZ_EXPORT
34 zebra_strmap_t zebra_strmap_create(void);
35
36 YAZ_EXPORT
37 void zebra_strmap_destroy(zebra_strmap_t st);
38
39 YAZ_EXPORT
40 void zebra_strmap_add(zebra_strmap_t st, const char *name,
41                       void *data_buf, size_t data_len);
42
43 YAZ_EXPORT
44 void *zebra_strmap_lookup(zebra_strmap_t st, const char *name, int no,
45                           size_t *data_len);
46
47 YAZ_EXPORT
48 int zebra_strmap_remove(zebra_strmap_t st, const char *name);
49
50 YAZ_EXPORT
51 zebra_strmap_it zebra_strmap_it_create(zebra_strmap_t st);
52
53 YAZ_EXPORT
54 void zebra_strmap_it_destroy(zebra_strmap_it it);
55
56 YAZ_EXPORT
57 const char *zebra_strmap_it_next(zebra_strmap_it it, void **data_buf,
58                                  size_t *data_len);
59
60
61 YAZ_END_CDECL
62
63 #endif
64 /*
65  * Local variables:
66  * c-basic-offset: 4
67  * indent-tabs-mode: nil
68  * End:
69  * vim: shiftwidth=4 tabstop=8 expandtab
70  */
71