updated NEWS
[mala.git] / engine / stringbucket.h
blob3b21c0c2d47036676561f24866d378d7a1289cee
1 /*
2 stringbucket.h - MaLa stringbuckets
4 Copyright (C) 2004, 2005, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
20 #ifndef MALA_STRINGBUCKET_H
21 #define MALA_STRINGBUCKET_H
23 #include "mala_types.h"
26 * StringBucket
28 typedef int (*mala_string_cmp_fn) (const void*, const void*);
30 #define MALA_STRING_FWD (mala_string_cmp_fn) mala_string_compare
31 #define MALA_STRING_REV (mala_string_cmp_fn) mala_string_compare_rev
33 struct mala_stringbucket_struct
35 void * bucket;
36 mala_string_cmp_fn cmpfn;
37 void (*freefn)(void*);
38 int destroying;
41 #define MALA_STRINGBUCKET_STATIC(cmp_fn,free_fn) &(mala_stringbucket){NULL,cmp_fn,free_fn,0}
42 #define MALA_STRINGBUCKET_AUTO(cmp_fn,free_fn) {NULL,cmp_fn,free_fn,0}
45 void
46 mala_stringbucket_init (MalaStringBucket bucket,
47 mala_string_cmp_fn cmpfn, void (*freefn)(void*));
49 void
50 mala_stringbucket_erase (MalaStringBucket bucket);
52 int
53 mala_stringbucket_exists_cstr (MalaStringBucket bucket, const char* cstr);
55 MalaString
56 mala_stringbucket_string_remove (MalaString_ref s);
58 MalaString
59 mala_stringbucket_insert (MalaStringBucket bucket, MalaString_ref s);
64 #endif /* MALA_STRINGBUCKET */
67 // Local Variables:
68 // mode: C
69 // c-file-style: "gnu"
70 // End:
71 // arch-tag: 09e98f6d-4992-4014-a18f-a5e532bdeb27
72 // end_of_file