]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - nick/nickalloc.c
TRUSTS: require sqlite
[irc/quakenet/newserv.git] / nick / nickalloc.c
... / ...
CommitLineData
1/* nick/host/realname/authname allocator */
2
3#include "nick.h"
4#include "../core/nsmalloc.h"
5
6#include <assert.h>
7#include <stdlib.h>
8
9/* Hosts and realname structures are the same size */
10/* This assumption is checked in initnickalloc(); */
11
12realname *newrealname() {
13 return (realname *)newhost();
14}
15
16void freerealname(realname *rn) {
17 freehost((host *)rn);
18}
19
20nick *newnick() {
21 return nsmalloc(POOL_NICK, sizeof(nick));
22}
23
24void freenick(nick *np) {
25 nsfree(POOL_NICK, np);
26}
27
28host *newhost() {
29 return nsmalloc(POOL_NICK, sizeof(host));
30}
31
32void freehost(host *hp) {
33 nsfree(POOL_NICK, hp);
34}
35