~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/hashtab_xt.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2011-03-15 10:41:18 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110315104118-eaf0hvlytjdl4zrf
Tags: 2011.03.13-0ubuntu1
* New upstream release.
* Added slave plugin.
* Removed archive, blackhole and blitzdb plugins.
* Moved location of libdrizzle headers.
* Removed drizzleadmin manpage patch.
* Add drizzle_safe_write_string to symbols.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH
2
 
 *
3
 
 * PrimeBase XT
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
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.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
 
 *
19
 
 * 2005-01-15   Paul McCullagh
20
 
 *
21
 
 * H&G2JCtL
22
 
 */
23
 
#ifndef __xt_hashtab_h__
24
 
#define __xt_hashtab_h__
25
 
 
26
 
#include "xt_defs.h"
27
 
 
28
 
struct XTThread;
29
 
 
30
 
#define xtHashValue                     u_int
31
 
 
32
 
typedef xtBool (*XTHTCompareFunc)(void *key, void *data);
33
 
typedef xtHashValue (*XTHTHashFunc)(xtBool is_key, void *key_data);
34
 
typedef void (*XTHTFreeFunc)(struct XTThread *self, void *item);
35
 
 
36
 
typedef struct XTHashItem {
37
 
        struct XTHashItem               *hi_next;
38
 
        xtHashValue                             hi_hash;
39
 
        void                                    *hi_data;
40
 
} XTHashItemRec, *XTHashItemPtr;
41
 
 
42
 
typedef struct XTHashTab {
43
 
        XTHTCompareFunc                 ht_comp_func;
44
 
        XTHTHashFunc                    ht_hash_func;
45
 
        XTHTFreeFunc                    ht_free_func;
46
 
        xt_mutex_type                   *ht_lock;
47
 
        xt_cond_type                    *ht_cond;
48
 
 
49
 
        xtHashValue                             ht_tab_size;
50
 
        XTHashItemPtr                   ht_items[XT_VAR_LENGTH];
51
 
} XTHashTabRec, *XTHashTabPtr;
52
 
 
53
 
typedef struct XTHashEnum {
54
 
        u_int                                   he_i;
55
 
        XTHashItemPtr                   he_item;
56
 
        XTHashTabPtr                    he_ht;
57
 
} XTHashEnumRec, *XTHashEnumPtr;
58
 
 
59
 
XTHashTabPtr    xt_new_hashtable(struct XTThread *self, XTHTCompareFunc comp_func, XTHTHashFunc hash_func, XTHTFreeFunc free_func, xtBool with_lock, xtBool with_cond);
60
 
void                    xt_free_hashtable(struct XTThread *self, XTHashTabPtr ht);
61
 
 
62
 
void                    xt_ht_put(struct XTThread *self, XTHashTabPtr ht, void *data);
63
 
void                    *xt_ht_get(struct XTThread *self, XTHashTabPtr ht, void *key);
64
 
xtBool                  xt_ht_del(struct XTThread *self, XTHashTabPtr ht, void *key);
65
 
 
66
 
xtHashValue             xt_ht_hash(char *s);
67
 
xtHashValue             xt_ht_casehash(char *s);
68
 
 
69
 
xtBool                  xt_ht_lock(struct XTThread *self, XTHashTabPtr ht);
70
 
void                    xt_ht_unlock(struct XTThread *self, XTHashTabPtr ht);
71
 
void                    xt_ht_wait(struct XTThread *self, XTHashTabPtr ht);
72
 
void                    xt_ht_timed_wait(struct XTThread *self, XTHashTabPtr ht, u_long milli_sec);
73
 
void                    xt_ht_signal(struct XTThread *self, XTHashTabPtr ht);
74
 
 
75
 
void                    xt_ht_enum(struct XTThread *self, XTHashTabPtr ht, XTHashEnumPtr en);
76
 
void                    *xt_ht_next(struct XTThread *self, XTHashEnumPtr en);
77
 
 
78
 
#endif