]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_bio.c
*** empty log message ***
[citadel.git] / citadel / serv_bio.c
index 18bf3b920db98fed23477d640eb58b89036d593d..186bb4bfabebbf47889f69eb73eb1ac5d7f9ce34 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include <time.h>
 #include "sysdep_decls.h"
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
 #include "control.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
 #include "room_ops.h"
 #include "user_ops.h"
 #include "policy.h"
@@ -50,7 +60,7 @@ void cmd_ebio(char *cmdbuf) {
                return;
        }
 
-       sprintf(buf,"./bio/%ld",CC->usersupp.usernum);
+       snprintf(buf, sizeof buf, "./bio/%ld",CC->user.usernum);
        fp = fopen(buf,"w");
        if (fp == NULL) {
                cprintf("%d Cannot create file\n",ERROR);
@@ -68,7 +78,7 @@ void cmd_ebio(char *cmdbuf) {
  */
 void cmd_rbio(char *cmdbuf)
 {
-       struct usersupp ruser;
+       struct user ruser;
        char buf[SIZ];
        FILE *fp;
 
@@ -77,11 +87,11 @@ void cmd_rbio(char *cmdbuf)
                cprintf("%d No such user.\n",ERROR+NO_SUCH_USER);
                return;
        }
-       sprintf(buf,"./bio/%ld",ruser.usernum);
+       snprintf(buf, sizeof buf, "./bio/%ld",ruser.usernum);
        
        cprintf("%d OK|%s|%ld|%d|%ld|%ld|%ld\n", LISTING_FOLLOWS,
                ruser.fullname, ruser.usernum, ruser.axlevel,
-               ruser.lastcall, ruser.timescalled, ruser.posted);
+               (long)ruser.lastcall, ruser.timescalled, ruser.posted);
        fp = fopen(buf,"r");
        if (fp == NULL)
                cprintf("%s has no bio on file.\n", ruser.fullname);
@@ -98,7 +108,7 @@ void cmd_rbio(char *cmdbuf)
 void cmd_lbio(char *cmdbuf) {
        char buf[SIZ];
        FILE *ls;
-       struct usersupp usbuf;
+       struct user usbuf;
 
        ls=popen("cd ./bio; ls","r");
        if (ls==NULL) {
@@ -117,7 +127,7 @@ void cmd_lbio(char *cmdbuf) {
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_bio_init(void)
 {
         CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio");
         CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio");