#include "ircd_defs.h"
#include "common.h"
#include "s_conf.h"
-#include "tools.h"
#include "client.h"
-#include "memory.h"
-#include "balloc.h"
-#include "event.h"
#include "hash.h"
#include "cache.h"
#include "sprintf_irc.h"
#include "irc_dictionary.h"
+#include "numeric.h"
static BlockHeap *cachefile_heap = NULL;
static BlockHeap *cacheline_heap = NULL;
local_tm = localtime(&sb.st_mtime);
if(local_tm != NULL)
- ircsnprintf(user_motd_changed, sizeof(user_motd_changed),
+ rb_snprintf(user_motd_changed, sizeof(user_motd_changed),
"%d/%d/%d %d:%d",
local_tm->tm_mday, local_tm->tm_mon + 1,
1900 + local_tm->tm_year, local_tm->tm_hour,
strlcpy(lineptr->data, " ", sizeof(lineptr->data));
else
strlcpy(lineptr->data, line, sizeof(lineptr->data));
- dlinkAddTail(lineptr, &lineptr->linenode, &cacheptr->contents);
+ rb_dlinkAddTail(lineptr, &lineptr->linenode, &cacheptr->contents);
}
fclose(in);
void
free_cachefile(struct cachefile *cacheptr)
{
- dlink_node *ptr;
- dlink_node *next_ptr;
+ rb_dlink_node *ptr;
+ rb_dlink_node *next_ptr;
if(cacheptr == NULL)
return;
- DLINK_FOREACH_SAFE(ptr, next_ptr, cacheptr->contents.head)
+ RB_DLINK_FOREACH_SAFE(ptr, next_ptr, cacheptr->contents.head)
{
BlockHeapFree(cacheline_heap, ptr->data);
}
while((ldirent = readdir(helpfile_dir)) != NULL)
{
- ircsnprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name);
+ rb_snprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name);
cacheptr = cache_file(filename, ldirent->d_name, HELP_OPER);
irc_dictionary_add(help_dict_oper, cacheptr->name, cacheptr);
}
while((ldirent = readdir(helpfile_dir)) != NULL)
{
- ircsnprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name);
+ rb_snprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name);
cacheptr = cache_file(filename, ldirent->d_name, HELP_USER);
irc_dictionary_add(help_dict_user, cacheptr->name, cacheptr);
send_user_motd(struct Client *source_p)
{
struct cacheline *lineptr;
- dlink_node *ptr;
+ rb_dlink_node *ptr;
const char *myname = get_id(&me, source_p);
const char *nick = get_id(source_p, source_p);
- if(user_motd == NULL || dlink_list_length(&user_motd->contents) == 0)
+ if(user_motd == NULL || rb_dlink_list_length(&user_motd->contents) == 0)
{
sendto_one(source_p, form_str(ERR_NOMOTD), myname, nick);
return;
sendto_one(source_p, form_str(RPL_MOTDSTART), myname, nick, me.name);
- DLINK_FOREACH(ptr, user_motd->contents.head)
+ RB_DLINK_FOREACH(ptr, user_motd->contents.head)
{
lineptr = ptr->data;
sendto_one(source_p, form_str(RPL_MOTD), myname, nick, lineptr->data);
send_oper_motd(struct Client *source_p)
{
struct cacheline *lineptr;
- dlink_node *ptr;
+ rb_dlink_node *ptr;
- if(oper_motd == NULL || dlink_list_length(&oper_motd->contents) == 0)
+ if(oper_motd == NULL || rb_dlink_list_length(&oper_motd->contents) == 0)
return;
sendto_one(source_p, form_str(RPL_OMOTDSTART),
me.name, source_p->name);
- DLINK_FOREACH(ptr, oper_motd->contents.head)
+ RB_DLINK_FOREACH(ptr, oper_motd->contents.head)
{
lineptr = ptr->data;
sendto_one(source_p, form_str(RPL_OMOTD),