Removed test_binary_compatibility() from ctdlvisor.c because we don't do it that...
[citadel.git] / citadel / genstamp.c
index cbf89d4488c0364ab792a98cbb00d2dd1e5f9449..e8d5dd86bc3f3b4c4c3a64168e4bc00add8b8d9b 100644 (file)
@@ -1,8 +1,5 @@
 /*
- * $Id$
- *
  * Function to generate RFC822-compliant textual time/date stamp
- *
  */
 
 #include "sysdep.h"
@@ -10,21 +7,9 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.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 <time.h>
 #include "genstamp.h"
 
-
 static char *months[] = {
        "Jan", "Feb", "Mar", "Apr", "May", "Jun",
        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
@@ -34,12 +19,11 @@ static char *weekdays[] = {
        "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
 };
 
-
 /*
  * Supplied with a unix timestamp, generate an RFC822-compliant textual
  * time and date stamp.
  */
-void datestring(char *buf, size_t n, time_t xtime, int which_format) {
+long datestring(char *buf, size_t n, time_t xtime, int which_format) {
        struct tm t;
 
        long offset;
@@ -65,7 +49,9 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) {
        switch(which_format) {
 
                case DATESTRING_RFC822:
-                       snprintf(buf, n, "%s, %02d %s %04d %02d:%02d:%02d %c%04ld",
+                       return snprintf(
+                               buf, n,
+                               "%s, %02d %s %04d %02d:%02d:%02d %c%04ld",
                                weekdays[t.tm_wday],
                                t.tm_mday,
                                months[t.tm_mon],
@@ -78,7 +64,9 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) {
                break;
 
                case DATESTRING_IMAP:
-                       snprintf(buf, n, "%02d-%s-%04d %02d:%02d:%02d %c%04ld",
+                       return snprintf(
+                               buf, n,
+                               "%02d-%s-%04d %02d:%02d:%02d %c%04ld",
                                t.tm_mday,
                                months[t.tm_mon],
                                t.tm_year + 1900,
@@ -90,5 +78,5 @@ void datestring(char *buf, size_t n, time_t xtime, int which_format) {
                break;
 
        }
+       return 0;
 }
-