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

« 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: 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-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