X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/ff12cc94790de2e87e78ee7aa378f21fa415d73c..56f84dedf7532478b524aa3cdfca5175b20442fd:/ircd/cache.c diff --git a/ircd/cache.c b/ircd/cache.c index 88dab60d..3b267170 100644 --- a/ircd/cache.c +++ b/ircd/cache.c @@ -28,8 +28,6 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: cache.c 25119 2008-03-13 16:57:05Z androsyn $ */ #include "stdinc.h" @@ -39,7 +37,7 @@ #include "client.h" #include "hash.h" #include "cache.h" -#include "irc_dictionary.h" +#include "rb_dictionary.h" #include "numeric.h" #include "send.h" @@ -71,8 +69,8 @@ init_cache(void) oper_motd = cache_file(OPATH, "opers.motd", 0); memset(&links_cache_list, 0, sizeof(links_cache_list)); - help_dict_oper = irc_dictionary_create(strcasecmp); - help_dict_user = irc_dictionary_create(strcasecmp); + help_dict_oper = rb_dictionary_create("oper help", strcasecmp); + help_dict_user = rb_dictionary_create("user help", strcasecmp); } /* @@ -188,7 +186,7 @@ cache_links(void *unused) /* if the below is ever modified, change LINKSLINELEN */ links_line = rb_malloc(LINKSLINELEN); - rb_snprintf(links_line, LINKSLINELEN, "%s %s :1 %s", + snprintf(links_line, LINKSLINELEN, "%s %s :1 %s", target_p->name, me.name, target_p->info[0] ? target_p->info : "(Unknown Location)"); @@ -245,14 +243,14 @@ load_help(void) struct stat sb; #endif - DICTIONARY_FOREACH(cacheptr, &iter, help_dict_oper) + RB_DICTIONARY_FOREACH(cacheptr, &iter, help_dict_oper) { - irc_dictionary_delete(help_dict_oper, cacheptr->name); + rb_dictionary_delete(help_dict_oper, cacheptr->name); free_cachefile(cacheptr); } - DICTIONARY_FOREACH(cacheptr, &iter, help_dict_user) + RB_DICTIONARY_FOREACH(cacheptr, &iter, help_dict_user) { - irc_dictionary_delete(help_dict_user, cacheptr->name); + rb_dictionary_delete(help_dict_user, cacheptr->name); free_cachefile(cacheptr); } @@ -265,9 +263,9 @@ load_help(void) { if(ldirent->d_name[0] == '.') continue; - rb_snprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name); + 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); + rb_dictionary_add(help_dict_oper, cacheptr->name, cacheptr); } closedir(helpfile_dir); @@ -280,7 +278,7 @@ load_help(void) { if(ldirent->d_name[0] == '.') continue; - rb_snprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name); + snprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name); #if defined(S_ISLNK) && defined(HAVE_LSTAT) if(lstat(filename, &sb) < 0) @@ -291,7 +289,7 @@ load_help(void) */ if(S_ISLNK(sb.st_mode)) { - cacheptr = irc_dictionary_retrieve(help_dict_oper, ldirent->d_name); + cacheptr = rb_dictionary_retrieve(help_dict_oper, ldirent->d_name); if(cacheptr != NULL) { @@ -302,7 +300,7 @@ load_help(void) #endif cacheptr = cache_file(filename, ldirent->d_name, HELP_USER); - irc_dictionary_add(help_dict_user, cacheptr->name, cacheptr); + rb_dictionary_add(help_dict_user, cacheptr->name, cacheptr); } closedir(helpfile_dir); @@ -350,7 +348,7 @@ cache_user_motd(void) if(local_tm != NULL) { - rb_snprintf(user_motd_changed, sizeof(user_motd_changed), + 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,