]> code.citadel.org Git - citadel.git/blobdiff - citadel/stats.c
* added RCS Id keyword strings to sources
[citadel.git] / citadel / stats.c
index b5615154d2509710a7d010f1f220a9134bcdbd3b..c88a166a29aa0224198063a917424e69c7a7a108 100644 (file)
@@ -1,4 +1,5 @@
 /* Citadel/UX call log stats program
+ * $Id$
  */
 #include <stdlib.h>
 #include <unistd.h>
@@ -7,7 +8,9 @@
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
+#include <limits.h>
 #include "citadel.h"
+#include "config.h"
 
 #define disply(x,y) printf("%20s            %4.1f    %4.1f    %4d\n",x,((float)y)/calls,((float)y)/days,y)
 
@@ -22,12 +25,9 @@ struct caller
     int Ctimescalled;
   };
 
-void get_config ();
-struct config config;
-
 
 void
-prompt ()
+prompt (void)
 {
   char buf[16];
   if (batch_mode == 0)
@@ -42,8 +42,8 @@ prompt ()
 }
 
 int
-halfhour (time)                        /* Returns half-hour time period of time */
-     long time;
+halfhour (time_t time)                 /* Returns half-hour time period of time */
+               
 {
   int a;
   struct tm *tm;
@@ -59,9 +59,7 @@ halfhour (time)                       /* Returns half-hour time period of time */
 
 
 void
-progress (curr, max)
-     long curr;
-     long max;
+progress (long int curr, long int max)
 {
   static int dots;
   int pos;
@@ -94,10 +92,8 @@ progress (curr, max)
 
 
 
-void
-main (argc, argv)
-     int argc;
-     char *argv[];
+int
+main (int argc, char **argv)
 {
   time_t LogTime;
   unsigned int LogType;
@@ -111,7 +107,7 @@ main (argc, argv)
   long cftime, cttime, aa;
   int calls, logins, newusers;
   int badpws, terms, drops, sleeps;
-  long from, to, tottime;
+  time_t from, to, tottime;
   int days, hours, minutes;
   char aaa[100];
   struct tm *tm;
@@ -144,8 +140,8 @@ main (argc, argv)
   if (!batch_mode)
     printf ("Scanning call log, please wait...\n\n\n\n");
 
-  from = 0L;
-  to = 0L;
+  from = 0;
+  to = 0;
   for (a = 0; a < 72; ++a)
     {
       timeon[a] = 0L;
@@ -349,7 +345,9 @@ main (argc, argv)
        }
       prompt ();
 
-    PC_ONLY_HERE:
+    PC_ONLY_HERE:; /* yes this semicolon is necessary; the DEC C compiler
+                     complains that a label must be followed by an actual
+                     statement. */
 
 
 /*
@@ -373,4 +371,5 @@ main (argc, argv)
       exit (0);
  */
     }
+    return 0;
 }