]> jfr.im git - solanum.git/blobdiff - modules/m_stats.c
Get rid of ^M.
[solanum.git] / modules / m_stats.c
index 94b367f32e036031bc8ae539313b05967cc56477..7d9abc9fe276ec76ec866ae7c2bbabad492c446d 100644 (file)
@@ -443,17 +443,17 @@ stats_exempt(struct Client *source_p)
        }}
 
 
-static void\r
-stats_events_cb(char *str, void *ptr)\r
-{\r
-       sendto_one_numeric(ptr, RPL_STATSDEBUG, "E :%s", str);\r
-}\r
-\r
-static void\r
-stats_events (struct Client *source_p)\r
-{\r
-       rb_dump_events(stats_events_cb, source_p);\r
-       send_pop_queue(source_p);\r
+static void
+stats_events_cb(char *str, void *ptr)
+{
+       sendto_one_numeric(ptr, RPL_STATSDEBUG, "E :%s", str);
+}
+
+static void
+stats_events (struct Client *source_p)
+{
+       rb_dump_events(stats_events_cb, source_p);
+       send_pop_queue(source_p);
 }
 
 /* stats_pending_glines()
@@ -924,73 +924,10 @@ stats_usage (struct Client *source_p)
                           (int) rus.ru_nivcsw);
 }
 
-static void\r
-stats_tstats(struct Client *source_p)\r
-{\r
-       struct Client *target_p;\r
-       struct ServerStatistics sp;\r
-       rb_dlink_node *ptr;\r
-\r
-       memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));\r
-\r
-       RB_DLINK_FOREACH(ptr, serv_list.head)\r
-       {\r
-               target_p = ptr->data;\r
-\r
-               sp.is_sbs += target_p->localClient->sendB;\r
-               sp.is_sbr += target_p->localClient->receiveB;\r
-               sp.is_sti += rb_current_time() - target_p->localClient->firsttime;\r
-               sp.is_sv++;\r
-       }\r
-\r
-       RB_DLINK_FOREACH(ptr, lclient_list.head)\r
-       {\r
-               target_p = ptr->data;\r
-\r
-               sp.is_cbs += target_p->localClient->sendB;\r
-               sp.is_cbr += target_p->localClient->receiveB;\r
-               sp.is_cti += rb_current_time() - target_p->localClient->firsttime;\r
-               sp.is_cl++;\r
-       }\r
-\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :accepts %u refused %u", \r
-                               sp.is_ac, sp.is_ref);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :rejected %u delaying %lu", \r
-                               sp.is_rej, delay_exit_length());\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :nicks being delayed %lu", get_nd_count());\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :unknown commands %u prefixes %u",\r
-                               sp.is_unco, sp.is_unpf);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :nick collisions %u saves %u unknown closes %u",\r
-                               sp.is_kill, sp.is_save, sp.is_ni);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :wrong direction %u empty %u", \r
-                               sp.is_wrdi, sp.is_empt);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :numerics seen %u", \r
-                               sp.is_num);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :auth successes %u fails %u",\r
-                               sp.is_asuc, sp.is_abad);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :connected %u %u",\r
-                               sp.is_cl, sp.is_sv);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :bytes sent %lluK %lluK",\r
-                               sp.is_cbs / 1024, \r
-                               sp.is_sbs / 1024);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :bytes recv %lluK %lluK",\r
-                               sp.is_cbr / 1024, \r
-                               sp.is_sbr / 1024);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :time connected %lu %lu",\r
-                               sp.is_cti, sp.is_sti);\r
+static void
+stats_tstats (struct Client *source_p)
+{
+       tstats (source_p);
 }
 
 static void
@@ -1436,18 +1373,18 @@ stats_l_client(struct Client *source_p, struct Client *target_p,
        }
 }
 
-static void\r
-rb_dump_fd_callback(int fd, const char *desc, void *data)\r
-{\r
-       struct Client *source_p = data;\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG, "F :fd %-3d desc '%s'", fd, desc);\r
-}\r
-\r
-static void\r
-stats_comm(struct Client *source_p)\r
-{\r
-       rb_dump_fd(rb_dump_fd_callback, source_p);\r
-       send_pop_queue(source_p);\r
+static void
+rb_dump_fd_callback(int fd, const char *desc, void *data)
+{
+       struct Client *source_p = data;
+       sendto_one_numeric(source_p, RPL_STATSDEBUG, "F :fd %-3d desc '%s'", fd, desc);
+}
+
+static void
+stats_comm(struct Client *source_p)
+{
+       rb_dump_fd(rb_dump_fd_callback, source_p);
+       send_pop_queue(source_p);
 }
 
 /*