]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_resv.c
Remove some more references to parv[0] in comments.
[irc/rqf/shadowircd.git] / modules / m_resv.c
index 84a0183dfb1db57c44678de21b6942a5a6dcaaa8..5b35f2a581a7954a4bc2ca30219361fd21630b1c 100644 (file)
@@ -36,8 +36,7 @@
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "hash.h"
-#include "s_log.h"
-#include "sprintf_irc.h"
+#include "logger.h"
 
 static int mo_resv(struct Client *, struct Client *, int, const char **);
 static int ms_resv(struct Client *, struct Client *, int, const char **);
@@ -71,7 +70,6 @@ static int remove_resv_from_file(struct Client *source_p, const char *name);
 
 /*
  * mo_resv()
- *      parv[0] = sender prefix
  *      parv[1] = channel/nick to forbid
  *      parv[2] = reason
  */
@@ -141,7 +139,6 @@ mo_resv(struct Client *client_p, struct Client *source_p, int parc, const char *
 }
 
 /* ms_resv()
- *     parv[0] = sender prefix
  *     parv[1] = target server
  *     parv[2] = channel/nick to forbid
  *     parv[3] = reason
@@ -150,8 +147,8 @@ static int
 ms_resv(struct Client *client_p, struct Client *source_p,
        int parc, const char *parv[])
 {
-       /* parv[0]  parv[1]        parv[2]  parv[3]
-        * oper     target server  resv     reason
+       /* source_p  parv[1]        parv[2]  parv[3]
+        * oper      target server  resv     reason
         */
        propagate_resv(source_p, parv[1], 0, parv[2], parv[3]);
 
@@ -224,13 +221,13 @@ parse_resv(struct Client *source_p, const char *name,
                aconf = make_conf();
                aconf->status = CONF_RESV_CHANNEL;
                aconf->port = 0;
-               DupString(aconf->name, name);
-               DupString(aconf->passwd, reason);
+               aconf->name = rb_strdup(name);
+               aconf->passwd = rb_strdup(reason);
                add_to_resv_hash(aconf->name, aconf);
 
                if(temp_time > 0)
                {
-                       aconf->hold = CurrentTime + temp_time;
+                       aconf->hold = rb_current_time() + temp_time;
 
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "%s added temporary %d min. RESV for [%s] [%s]",
@@ -282,13 +279,13 @@ parse_resv(struct Client *source_p, const char *name,
                aconf = make_conf();
                aconf->status = CONF_RESV_NICK;
                aconf->port = 0;
-               DupString(aconf->name, name);
-               DupString(aconf->passwd, reason);
-               dlinkAddAlloc(aconf, &resv_conf_list);
+               aconf->name = rb_strdup(name);
+               aconf->passwd = rb_strdup(reason);
+               rb_dlinkAddAlloc(aconf, &resv_conf_list);
 
                if(temp_time > 0)
                {
-                       aconf->hold = CurrentTime + temp_time;
+                       aconf->hold = rb_current_time() + temp_time;
 
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                     "%s added temporary %d min. RESV for [%s] [%s]",
@@ -371,7 +368,6 @@ cluster_resv(struct Client *source_p, int temp_time, const char *name,
 
 /*
  * mo_unresv()
- *     parv[0] = sender prefix
  *     parv[1] = channel/nick to unforbid
  */
 static int
@@ -408,15 +404,14 @@ mo_unresv(struct Client *client_p, struct Client *source_p, int parc, const char
 }
 
 /* ms_unresv()
- *     parv[0] = sender prefix
  *     parv[1] = target server
  *     parv[2] = resv to remove
  */
 static int
 ms_unresv(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
-       /* parv[0]  parv[1]        parv[2]
-        * oper     target server  resv to remove
+       /* source_p  parv[1]        parv[2]
+        * oper      target server  resv to remove
         */
        propagate_generic(source_p, "UNRESV", parv[1], CAP_CLUSTER,
                        "%s", parv[2]);
@@ -516,7 +511,7 @@ remove_resv(struct Client *source_p, const char *name)
                        ilog(L_KLINE, "UR %s %s", get_oper_name(source_p), name);
                }
                /* already have ptr from the loop above.. */
-               dlinkDestroy(ptr, &resv_conf_list);
+               rb_dlinkDestroy(ptr, &resv_conf_list);
        }
        free_conf(aconf);
 
@@ -544,7 +539,7 @@ remove_resv_from_file(struct Client *source_p, const char *name)
        int error_on_write = 0;
        int found_resv = 0;
 
-       ircsprintf(temppath, "%s.tmp", ConfigFileEntry.resvfile);
+       rb_sprintf(temppath, "%s.tmp", ConfigFileEntry.resvfile);
        filename = get_conf_name(RESV_TYPE);
 
        if((in = fopen(filename, "r")) == NULL)
@@ -577,7 +572,7 @@ remove_resv_from_file(struct Client *source_p, const char *name)
                        break;
                }
 
-               strlcpy(buff, buf, sizeof(buff));
+               rb_strlcpy(buff, buf, sizeof(buff));
 
                if((p = strchr(buff, '\n')) != NULL)
                        *p = '\0';