X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fuserlist.c;h=0e7e3fbfd92cf651eaf78f4d12302d25bee5b43d;hb=1e656d277fe91b7c4f5d73eab4a0dd0b7a173145;hp=00534037d1a976634ae2fbc7586c05a321149917;hpb=c7209f051c44912da2e367e984a8c8660b9139d2;p=citadel.git diff --git a/citadel/userlist.c b/citadel/userlist.c index 00534037d..0e7e3fbfd 100644 --- a/citadel/userlist.c +++ b/citadel/userlist.c @@ -21,10 +21,11 @@ # endif #endif +#include #include "citadel.h" #include #include "citadel_ipc.h" -#include "tools.h" +#include "citadel_dirs.h" void logoff(int code) { @@ -39,7 +40,7 @@ void userlist(CtdlIPC *ipc) { char *listing = NULL; int r; - r = CtdlIPCUserListing(ipc, &listing, buf); + r = CtdlIPCUserListing(ipc, "", &listing, buf); if (r / 100 != 1) { printf("%s\n", buf); return; @@ -47,11 +48,11 @@ void userlist(CtdlIPC *ipc) { printf(" User Name Num L LastCall Calls Posts\n"); printf("------------------------- ----- - ---------- ----- -----\n"); while (strlen(listing) > 0) { - extract_token(buf, listing, 0, '\n'); + extract_token(buf, listing, 0, '\n', sizeof buf); remove_token(listing, 0, '\n'); - extract(fl,buf,0); + extract_token(fl, buf, 0, '|', sizeof fl); printf("%-25s ",fl); - printf("%5ld %d ",extract_long(buf,2), + printf("%5ld %d ", extract_long(buf,2), extract_int(buf,1)); lc = extract_long(buf,3); localtime_r(&lc, &tmbuf); @@ -71,6 +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; + + CtdlInitBase64Table(); + calc_dirs_n_files(relh, home, relhome, ctdldir, 0); ipc = CtdlIPC_new(argc, argv, hostbuf, portbuf); CtdlIPC_chat_recv(ipc, buf);