Debian Codegraph @

src/common/queue.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1998,1999 Ross Combs ([email protected])
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18 #ifndef INCLUDED_QUEUE_TYPES
19 #define INCLUDED_QUEUE_TYPES
20
21 #ifdef QUEUE_INTERNAL_ACCESS
22 #ifdef JUST_NEED_TYPES
23 # include "common/packet.h"
24 #else
25 # define JUST_NEED_TYPES
26 # include "common/packet.h"
27 # undef JUST_NEED_TYPES
28 #endif
29 #endif
30
31 namespace pvpgn
32 {
33
34 typedef struct queue
35 #ifdef QUEUE_INTERNAL_ACCESS
36 {
37 unsigned ulen, alen;
38 t_packet ** ring;
39 unsigned head, tail;
40 }
41 #endif
42 t_queue;
43
44 }
45
46 #endif
47
48
49 /*****/
50 #ifndef JUST_NEED_TYPES
51 #ifndef INCLUDED_QUEUE_PROTOS
52 #define INCLUDED_QUEUE_PROTOS
53
54 #define JUST_NEED_TYPES
55 #include "common/packet.h"
56 #undef JUST_NEED_TYPES
57
58 namespace pvpgn
59 {
60
61 extern t_packet * queue_pull_packet(t_queue * * queue);
62 extern t_packet * queue_peek_packet(t_queue const * const * queue);
63 extern void queue_push_packet(t_queue * * queue, t_packet * packet);
64 extern int queue_get_length(t_queue const * const * queue);
65 extern void queue_clear(t_queue * * queue);
66
67 }
68 #endif
69 #endif