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

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/linklist_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-02-03   Paul McCullagh
20
 
 *
21
 
 * H&G2JCtL
22
 
 */
23
 
#ifndef __xt_linklist_h__
24
 
#define __xt_linklist_h__
25
 
 
26
 
#include "xt_defs.h"
27
 
 
28
 
struct XTThread;
29
 
 
30
 
typedef struct XTLinkedItem {
31
 
        struct XTLinkedItem             *li_prev;
32
 
        struct XTLinkedItem             *li_next;
33
 
} XTLinkedItemRec, *XTLinkedItemPtr;
34
 
 
35
 
typedef struct XTLinkedList {
36
 
        xt_mutex_type                   *ll_lock;
37
 
        xt_cond_type                    *ll_cond;                       /* Condition for wait for empty. */
38
 
        void                                    *ll_thunk;
39
 
        XTFreeFunc                              ll_free_func;
40
 
        u_int                                   ll_item_count;
41
 
        XTLinkedItemPtr                 ll_items;
42
 
} XTLinkedListRec, *XTLinkedListPtr;
43
 
 
44
 
XTLinkedListPtr         xt_new_linkedlist(struct XTThread *self, void *thunk, XTFreeFunc free_func, xtBool with_lock);
45
 
void                            xt_free_linkedlist(struct XTThread *self, XTLinkedListPtr ll);
46
 
 
47
 
void                            xt_ll_add(struct XTThread *self, XTLinkedListPtr ll, XTLinkedItemPtr li, xtBool lock);
48
 
void                            xt_ll_remove(struct XTThread *self, XTLinkedListPtr ll, XTLinkedItemPtr li, xtBool lock);
49
 
xtBool                          xt_ll_exists(struct XTThread *self, XTLinkedListPtr ll, XTLinkedItemPtr li, xtBool lock);
50
 
 
51
 
void                            xt_ll_lock(struct XTThread *self, XTLinkedListPtr ll);
52
 
void                            xt_ll_unlock(struct XTThread *self, XTLinkedListPtr ll);
53
 
 
54
 
void                            xt_ll_wait_till_empty(struct XTThread *self, XTLinkedListPtr ll);
55
 
 
56
 
XTLinkedItemPtr         xt_ll_first_item(struct XTThread *self, XTLinkedListPtr ll);
57
 
XTLinkedItemPtr         xt_ll_next_item(struct XTThread *self, XTLinkedItemPtr item);
58
 
u_int                           xt_ll_get_size(XTLinkedListPtr ll);
59
 
 
60
 
typedef struct XTLinkedQItem {
61
 
        struct XTLinkedQItem    *qi_next;
62
 
} XTLinkedQItemRec, *XTLinkedQItemPtr;
63
 
 
64
 
typedef struct XTLinkedQueue {
65
 
        size_t                                  lq_count;
66
 
        XTLinkedQItemPtr                lq_front;
67
 
        XTLinkedQItemPtr                lq_back;
68
 
} XTLinkedQueueRec, *XTLinkedQueuePtr;
69
 
 
70
 
void                            xt_init_linkedqueue(struct XTThread *self, XTLinkedQueuePtr lq);
71
 
void                            xt_exit_linkedqueue(struct XTThread *self, XTLinkedQueuePtr lq);
72
 
 
73
 
void                            xt_lq_add(struct XTThread *self, XTLinkedQueuePtr lq, XTLinkedQItemPtr qi);
74
 
XTLinkedQItemPtr        xt_lq_remove(struct XTThread *self, XTLinkedQueuePtr lq);
75
 
 
76
 
#endif
77