]> code.citadel.org Git - citadel.git/blobdiff - citadel/routines.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / routines.c
index 1f967e278e5e222344201eee9add81efc9fefa63..6f3cd2106b62dbf391fb2b161238b540025d284c 100644 (file)
@@ -1,5 +1,9 @@
-/* Citadel/UX support routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Client-side support functions.
+ *
+ */
 
 #include "sysdep.h"
 #include <stdlib.h>
 #include <signal.h>
 #include <dirent.h>
 #include <errno.h>
-#include <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 <limits.h>
 #ifdef HAVE_UTMP_H
 #include <utmp.h>
@@ -77,16 +92,16 @@ void hit_any_key(void) {            /* hit any key to continue */
        sttybbs(1);
        if (b==NEXT_KEY) sigcaught = SIGINT;
        if (b==STOP_KEY) sigcaught = SIGQUIT;
-       }
+}
 
 /*
  * change a user's access level
  */
 void edituser(void)
 {
-       char buf[256];
-       char who[256];
-       char pass[256];
+       char buf[SIZ];
+       char who[SIZ];
+       char pass[SIZ];
        int flags;
        int timescalled;
        int posted;
@@ -114,7 +129,9 @@ void edituser(void)
        userpurge = extract_int(&buf[4], 8);
 
        val_user(who, 0); /* Display registration */
-       strprompt("Password", pass, 19);
+       if (boolprompt("Change password", 0)) {
+               strprompt("Password", pass, 19);
+       }
        axlevel = intprompt("Access level", axlevel, 0, 6);
        timescalled = intprompt("Times called", timescalled, 0, INT_MAX);
        posted = intprompt("Messages posted", posted, 0, INT_MAX);
@@ -204,7 +221,7 @@ void enter_config(int mode)
                "Enable color support",US_COLOR);
          }
        
-        filter = intprompt("Moderation filter level", filter, -63, 63);
+        /* filter = intprompt("Moderation filter level", filter, -63, 63); */
 
         }
 
@@ -366,7 +383,7 @@ void progress(long int curr, long int cmax)
 void locate_host(char *hbuf)
 {
 #ifndef HAVE_UTMP_H
-       char buf[256];
+       char buf[SIZ];
        FILE *who;
        int a,b;
 
@@ -375,7 +392,7 @@ void locate_host(char *hbuf)
                strcpy(hbuf,serv_info.serv_fqdn);
                return; 
                }
-       fgets(buf,256,who);
+       fgets(buf,sizeof buf,who);
        pclose(who);
 
        b = 0;
@@ -444,7 +461,7 @@ void locate_host(char *hbuf)
  * miscellaneous server commands (testing, etc.)
  */
 void misc_server_cmd(char *cmd) {
-       char buf[256];
+       char buf[SIZ];
 
        serv_puts(cmd);
        serv_gets(buf);
@@ -497,7 +514,7 @@ int nukedir(char *dirname)
 {
        DIR *dp;
        struct dirent *d;
-       char filename[256];
+       char filename[SIZ];
 
        dp = opendir(dirname);
        if (dp == NULL) {