node_t *node;
struct ChannelConf *item;
- item = xcalloc(sizeof *item);
+ item = xcalloc(sizeof(*item));
item->name = xstrdup("");
item->key = xstrdup("");
item->invite = xstrdup("");
node_t *node;
struct UserConf *item;
- item = xcalloc(sizeof *item);
+ item = xcalloc(sizeof(*item));
item->masks = list_create();
item->scanners = list_create();
node_t *node;
struct ScannerConf *item, *olditem;
- item = xcalloc(sizeof *item);
+ item = xcalloc(sizeof(*item));
/* Setup ScannerConf defaults */
item->name = xstrdup("undefined");
{
struct ProtocolConf *item;
struct ScannerConf *item2;
-
node_t *node;
- item = xcalloc(sizeof *item);
+ item = xcalloc(sizeof(*item));
item->type = $3;
item->port = $5;
node_t *node;
struct BlacklistConf *item;
- item = xcalloc(sizeof *item);
-
+ item = xcalloc(sizeof(*item));
item->name = xstrdup("");
item->kline = xstrdup("");
item->ban_unknown = 0;
struct BlacklistConf *blacklist = tmp;
node_t *node;
- item = xcalloc(sizeof *item);
-
+ item = xcalloc(sizeof(*item));
item->number = $1;
item->type = xstrdup($3);
config_init(void)
{
/* Init IRC block */
- IRCItem = xcalloc(sizeof *IRCItem);
+ IRCItem = xcalloc(sizeof(*IRCItem));
IRCItem->channels = list_create();
IRCItem->performs = list_create();
IRCItem->notices = list_create();
/* Init Options block */
- OptionsItem = xcalloc(sizeof *OptionsItem);
+ OptionsItem = xcalloc(sizeof(*OptionsItem));
/* Init OPM block */
- OpmItem = xcalloc(sizeof *OpmItem);
+ OpmItem = xcalloc(sizeof(*OpmItem));
OpmItem->blacklists = list_create();
/* Init list of User blocks */
ScannerItemList = list_create();
/* Init list of Exempts */
- ExemptItem = xcalloc(sizeof *ExemptItem);
+ ExemptItem = xcalloc(sizeof(*ExemptItem));
ExemptItem->masks = list_create();
}
extern char linebuf[512];
extern unsigned int linenum;
-extern void yyerror(const char *);
-extern void config_load(const char *);
-
-
struct IRCConf
{
char *nick;
extern list_t *UserItemList;
extern list_t *ScannerItemList;
+extern void yyerror(const char *);
+extern void config_load(const char *);
#endif /* CONFIG_H */
struct s_connection *s;
/* create new connection object */
- s = xcalloc(sizeof *s);
+ s = xcalloc(sizeof(*s));
/* verified by firedns_getresult() */
s->id[0] = rand() % 255;
return &result;
/* query found -- we remove in cleanup */
- l = recv(c->fd, &h,sizeof(struct s_header), 0);
+ l = recv(c->fd, &h, sizeof(struct s_header), 0);
result.info = c->info;
strlcpy(result.lookup, c->lookup, sizeof(result.lookup));
return;
if (ufds == NULL)
- ufds = xcalloc((sizeof *ufds) * OptionsItem->dns_fdlimit);
+ ufds = xcalloc(sizeof(*ufds) * OptionsItem->dns_fdlimit);
time(&timenow);
size = 0;
if (username == NULL || hostname == NULL)
return NULL;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
ret->irc_nick = xstrdup(nick);
ret->irc_username = xstrdup(username);
ret->irc_hostname = xstrdup(hostname);
/* Compile the regular expression if it has not been already */
if (preg == NULL)
{
- preg = xcalloc(sizeof *preg);
+ preg = xcalloc(sizeof(*preg));
if ((errnum = regcomp(preg, IRCItem->connregex, REG_ICASE | REG_EXTENDED)))
{
{
OPM_T *ret;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
ret->config = libopm_config_create();
ret->scans = libopm_list_create();
ret->queue = libopm_list_create();
{
OPM_REMOTE_T *ret;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
ret->ip = libopm_xstrdup(ip);
ret->protocols = libopm_list_create(); /* Setup protocol list */
static OPM_PROTOCOL_T *libopm_protocol_create(void)
{
OPM_PROTOCOL_T *ret;
- ret = xcalloc(sizeof(OPM_PROTOCOL_T));
+ ret = xcalloc(sizeof(*ret));
ret->type = 0;
ret->write_function = NULL;
{
OPM_PROTOCOL_CONFIG_T *ret;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
return ret;
}
OPM_CONNECTION_T *conn;
OPM_NODE_T *node, *p;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
ret->remote = remote;
ret->connections = libopm_list_create();
{
OPM_CONNECTION_T *ret;
- ret = xcalloc(sizeof *ret);
+ ret = xcalloc(sizeof(*ret));
ret->state = OPM_STATE_UNESTABLISHED;
return ret;
command_create(const struct OperCommandHash *tab, char *param, char *irc_nick,
const struct ChannelConf *target)
{
- struct Command *command = xcalloc(sizeof *command);
+ struct Command *command = xcalloc(sizeof(*command));
if (param)
command->param = xstrdup(param);
if (strcasecmp(command, tab->command) == 0)
{
/* Queue this command */
- struct Command *cs = command_create(tab, param, source_p->irc_nick, target);
+ struct Command *command = command_create(tab, param, source_p->irc_nick, target);
- list_add(COMMANDS, node_create(cs));
+ list_add(COMMANDS, node_create(command));
break;
}
}
LIST_FOREACH_SAFE(node, node_next, COMMANDS->head)
{
- struct Command *cs = node->data;
+ struct Command *command = node->data;
- if ((present - cs->added) > COMMANDTIMEOUT)
+ if ((present - command->added) > COMMANDTIMEOUT)
{
- command_free(cs);
+ command_free(command);
list_remove(COMMANDS, node);
node_free(node);
}
/* Find any queued commands that match this user */
LIST_FOREACH_SAFE(node, node_next, COMMANDS->head)
{
- struct Command *cs = node->data;
+ struct Command *command = node->data;
- if (strcmp(cs->irc_nick, reply) == 0)
+ if (strcmp(command->irc_nick, reply) == 0)
{
if (oper)
- cs->tab->handler(cs->param, cs->target);
+ command->tab->handler(command->param, command->target);
/* Cleanup the command */
- command_free(cs);
+ command_free(command);
list_remove(COMMANDS, node);
node_free(node);
}
LIST_FOREACH(p, ScannerItemList->head)
{
sc = p->data;
- scs = xcalloc(sizeof *scs);
+ scs = xcalloc(sizeof(*scs));
if (OPT_DEBUG)
log_printf("SCAN -> Setting up scanner [%s]", sc->name);
static struct scan_struct *
scan_create(const char *user[], const char *msg)
{
- struct scan_struct *const ss = xcalloc(sizeof *ss);
+ struct scan_struct *ss = xcalloc(sizeof(*ss));
ss->irc_nick = xstrdup(user[0]);
ss->irc_username = xstrdup(user[1]);
return;
}
- ss = xcalloc(sizeof *ss);
+ ss = xcalloc(sizeof(*ss));
ss->ip = xstrdup(ip);
ss->remote = opm_remote_create(ss->ip);
ss->remote->data = ss;