~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« 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: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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