[project @ 1998-02-02 17:27:26 by simonm]
[ghc-hetmet.git] / ghc / lib / cbits / showTime.lc
diff --git a/ghc/lib/cbits/showTime.lc b/ghc/lib/cbits/showTime.lc
deleted file mode 100644 (file)
index 08adcd5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-%
-% (c) The GRASP/AQUA Project, Glasgow University, 1995
-%
-\subsection[showTime.lc]{ClockTime.showsPrec Runtime Support}
-
-\begin{code}
-
-#include "rtsdefs.h"
-#include "stgio.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
-
-StgAddr
-showTime(I_ size, StgByteArray d, StgByteArray buf)
-{
-    time_t t;
-    struct tm *tm;
-
-    switch(size) {
-       default:
-            return (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: out of range");
-       case 0:
-           t = 0;
-           break;
-       case -1:
-           t = - (time_t) ((StgInt *)d)[0];
-           if (t > 0) 
-                return
- (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: out of range");
-           break;
-       case 1:
-           t = (time_t) ((StgInt *)d)[0];
-           if (t < 0) 
-               return (StgAddr) strcpy(buf, "ClockTime.show{LibTime}: out of range");
-           break;
-       }
-    tm = localtime(&t);
-    if (tm != NULL && strftime(buf, 32 /*Magic number*/, "%a %b %d %T %Z %Y", tm) > 0)
-       return (StgAddr)buf;
-    return (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: internal error");
-}
-\end{code}