int init_upgrade(void) { u_udb_save_hooks = mowgli_list_create(); u_udb_load_hooks = mowgli_patricia_create(NULL); return 0; }
static struct a_network *net_create(const char *name) { struct a_network *net; net = mowgli_alloc(sizeof(*net)); if (net == NULL) return NULL; memset(net, 0, sizeof(*net)); net->name = mowgli_strdup(name); net->acct = NULL; net->host = NULL; net->port = 0; net->use_ssl = false; /* defaults */ net->nick = mowgli_strdup(DEFAULT_NICK); net->ident = mowgli_strdup(DEFAULT_IDENT); net->gecos = mowgli_strdup(DEFAULT_GECOS); net->nd.flags = 0; net->nd.flags |= NET_MOTD_EMPTY | NET_MOTD_LOCK; net->nd.nick = mowgli_strdup(DEFAULT_NICK); net->nd.ident = mowgli_strdup(DEFAULT_IDENT); net->nd.host = mowgli_strdup(""); net->nd.gecos = mowgli_strdup(DEFAULT_GECOS); net->nd.isupport = irc_isupport_create(); net->nd.motd = mowgli_string_create(); net->nd.chans = mowgli_patricia_create(NULL); /* TODO: casemap */ net->nd.users = mowgli_patricia_create(NULL); /* TODO: casemap */ net->state = NET_DISCONNECTED; net->linebuf = NULL; net->clients = mowgli_list_create(); return net; }
* * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. */ #include <atheme.h> // Imported by other modules/crypto/foo.so extern mowgli_list_t *crypto_conf_table; mowgli_list_t *crypto_conf_table = NULL; static void mod_init(struct module *const restrict m) { if (! (crypto_conf_table = mowgli_list_create())) { (void) slog(LG_ERROR, "%s: mowgli_list_create() failed (BUG?)", m->name); m->mflags |= MODFLAG_FAIL; return; } (void) add_subblock_top_conf("crypto", crypto_conf_table); } static void mod_deinit(const enum module_unload_intent ATHEME_VATTR_UNUSED intent) { (void) del_top_conf("crypto");