aboutsummaryrefslogtreecommitdiff
path: root/include/argot/symtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/argot/symtab.h')
-rw-r--r--include/argot/symtab.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/argot/symtab.h b/include/argot/symtab.h
new file mode 100644
index 0000000..b84f3b7
--- /dev/null
+++ b/include/argot/symtab.h
@@ -0,0 +1,53 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_SYMTAB_H
18#define _ARGOT_SYMTAB_H
19
20typedef struct argot_symtab *argot_symtab_ptr_t;
21typedef struct argot_syment *argot_syment_ptr_t;
22
23struct argot_syment {
24 char *name;
25};
26
27typedef int (*argot_symtab_enumerator_t)(void *sym, void *data);
28
29const char *argot_symtab_strerror(int rc);
30
31void *argot_symtab_lookup_or_install(argot_symtab_ptr_t st,
32 void *key, int *install);
33void argot_symtab_clear(argot_symtab_ptr_t st);
34argot_symtab_ptr_t argot_symtab_create(size_t elsize,
35 unsigned (*hash_fun)(void *, unsigned long),
36 int (*cmp_fun)(const void *, const void *),
37 int (*copy_fun)(void *, void *),
38 void *(*alloc_fun)(size_t),
39 void (*free_fun)(void *));
40argot_symtab_ptr_t argot_symtab_create_default(size_t elsize);
41
42void argot_symtab_free(argot_symtab_ptr_t pst);
43int argot_symtab_remove(argot_symtab_ptr_t st, void *elt);
44int argot_symtab_replace(argot_symtab_ptr_t st, void *ent, void **old_ent);
45int argot_symtab_enumerate(argot_symtab_ptr_t st,
46 argot_symtab_enumerator_t fun, void *data);
47
48size_t argot_symtab_count_entries(argot_symtab_ptr_t st);
49
50unsigned argot_hash_string(const char *name, unsigned long hashsize);
51unsigned argot_hash_string_ci(const char *name, unsigned long hashsize);
52
53#endif

Return to:

Send suggestions and report system problems to the System administrator.