]>
jfr.im git - solanum.git/blob - libcharybdis/tools.c
2 * ircd-ratbox: A slightly useful ircd.
3 * tools.c: Various functions needed here and there.
5 * Copyright (C) 1996-2002 Hybrid Development Team
6 * Copyright (C) 2002-2005 ircd-ratbox development team
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * $Id: tools.c 3201 2007-02-04 01:59:38Z jilles $
25 * Here is the original header:
27 * Useful stuff, ripped from places ..
28 * adrian chadd <adrian@creative.net.au>
30 * When you update these functions make sure you update the ones in tools.h
42 * frob some memory. debugging time.
46 mem_frob(void *data
, int len
)
48 unsigned long x
= 0xdeadbeef;
49 unsigned char *b
= (unsigned char *)&x
;
52 for (i
= 0; i
< len
; i
++)
64 extern BlockHeap
*dnode_heap
;
66 init_dlink_nodes(void)
68 dnode_heap
= BlockHeapCreate(sizeof(dlink_node
), DNODE_HEAP_SIZE
);
69 if(dnode_heap
== NULL
)
77 * output - pointer to new dlink_node
83 return(BlockHeapAlloc(dnode_heap
));
89 * inputs - pointer to dlink_node
91 * side effects - free given dlink_node
94 free_dlink_node(dlink_node
* ptr
)
98 BlockHeapFree(dnode_heap
, ptr
);