]> code.citadel.org Git - citadel.git/blobdiff - citadel/userlist.c
Create some directories to hold the source files for the utility
[citadel.git] / citadel / userlist.c
index f63f9a6c03d7cb7b1f4db5bfb79b106d4b8d269e..3f78cea6fb0e03b61aa2c852984de2864838a2d8 100644 (file)
 # endif
 #endif
 
+#include <libcitadel.h>
 #include "citadel.h"
 #include <unistd.h>
 #include "citadel_ipc.h"
-#include "tools.h"
+#include "citadel_dirs.h"
 
 void logoff(int code)
 {
@@ -44,8 +45,8 @@ void userlist(CtdlIPC *ipc) {
                printf("%s\n", buf);
                return;
        }
-       printf("       User Name           Num  L  LastCall  Calls Posts\n");
-       printf("------------------------- ----- - ---------- ----- -----\n");
+       printf("       User Name           Num  L Last Visit Logins Messages\n");
+       printf("------------------------- ----- - ---------- ------ --------\n");
        while (strlen(listing) > 0) {
                extract_token(buf, listing, 0, '\n', sizeof buf);
                remove_token(listing, 0, '\n');
@@ -59,7 +60,7 @@ void userlist(CtdlIPC *ipc) {
                        (tmbuf.tm_mon+1),
                        tmbuf.tm_mday,
                        (tmbuf.tm_year + 1900));
-               printf("%5ld %5ld\n",
+               printf("%6ld %8ld\n",
                        extract_long(buf,4),extract_long(buf,5));
        }
        printf("\n");
@@ -71,8 +72,13 @@ int main(int argc, char **argv)
        char buf[SIZ];
        char hostbuf[SIZ], portbuf[SIZ];
        CtdlIPC *ipc = NULL;
+       int relh=0;
+       int home=0;
+       char relhome[PATH_MAX]="";
+       char ctdldir[PATH_MAX]=CTDLDIR;
+
+       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
 
-       CtdlInitBase64Table();
        ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf);
        CtdlIPC_chat_recv(ipc, buf);
        if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
@@ -99,3 +105,11 @@ char *strerror(int e)
        return(buf);
 }
 #endif
+
+
+/*
+ * Stub function
+ */
+void stty_ctdl(int cmd) {
+}
+