1 |
/* |
2 |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
* list.c: Various assorted functions for various structures. |
4 |
* |
5 |
* Copyright (C) 2002 by the past and present ircd coders, and others. |
6 |
* |
7 |
* This program is free software; you can redistribute it and/or modify |
8 |
* it under the terms of the GNU General Public License as published by |
9 |
* the Free Software Foundation; either version 2 of the License, or |
10 |
* (at your option) any later version. |
11 |
* |
12 |
* This program is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this program; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
* USA |
21 |
* |
22 |
* $Id$ |
23 |
*/ |
24 |
|
25 |
#include "stdinc.h" |
26 |
#include "tools.h" |
27 |
#include "client.h" |
28 |
#include "list.h" |
29 |
#include "memory.h" |
30 |
#include "balloc.h" |
31 |
|
32 |
static BlockHeap *dnode_heap; |
33 |
|
34 |
|
35 |
/* init_dlink_nodes() |
36 |
* |
37 |
* inputs - NONE |
38 |
* output - NONE |
39 |
* side effects - initializes the dnode BlockHeap |
40 |
*/ |
41 |
void |
42 |
init_dlink_nodes(void) |
43 |
{ |
44 |
dnode_heap = BlockHeapCreate("dlink node", sizeof(dlink_node), DNODE_HEAP_SIZE); |
45 |
} |
46 |
|
47 |
/* make_dlink_node() |
48 |
* |
49 |
* inputs - NONE |
50 |
* output - pointer to new dlink_node |
51 |
* side effects - NONE |
52 |
*/ |
53 |
dlink_node * |
54 |
make_dlink_node(void) |
55 |
{ |
56 |
dlink_node *lp = BlockHeapAlloc(dnode_heap); |
57 |
|
58 |
return(lp); |
59 |
} |
60 |
|
61 |
/* free_dlink_node() |
62 |
* |
63 |
* inputs - pointer to dlink_node |
64 |
* output - NONE |
65 |
* side effects - free given dlink_node |
66 |
*/ |
67 |
void |
68 |
free_dlink_node(dlink_node *ptr) |
69 |
{ |
70 |
BlockHeapFree(dnode_heap, ptr); |
71 |
} |