]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_mrtg.c
mk_module_init.sh now tests to see if echo supports -e and -E
[citadel.git] / citadel / serv_mrtg.c
index 433039d824ec3b347c51ef124a01ece2667d31b5..12e09f0f0ec89c96c93b5b005ae21c4ae37627d4 100644 (file)
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "dynloader.h"
 #include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
@@ -49,6 +47,9 @@
 #include "tools.h"
 
 
+#include "ctdl_module.h"
+
+
 /*
  * Other functions call this one to output data in MRTG format
  */
@@ -110,9 +111,9 @@ void mrtg_messages(void) {
  * Fetch data for MRTG
  */
 void cmd_mrtg(char *argbuf) {
-       char which[SIZ];
+       char which[32];
 
-       extract(which, argbuf, 0);
+       extract_token(which, argbuf, 0, '|', sizeof which);
 
        if (!strcasecmp(which, "users")) {
                mrtg_users();
@@ -122,13 +123,15 @@ void cmd_mrtg(char *argbuf) {
        }
        else {
                cprintf("%d Unrecognized keyword '%s'\n",
-                       ERROR+ILLEGAL_VALUE, which);
+                       ERROR + ILLEGAL_VALUE, which);
        }
 }
 
 
-char *serv_mrtg_init(void)
+CTDL_MODULE_INIT(mrtg)
 {
         CtdlRegisterProtoHook(cmd_mrtg, "MRTG", "Supply stats to MRTG");
+
+       /* return our Subversion id for the Log */
         return "$Id$";
 }