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