from coreutils
authorJim Meyering <jim@meyering.net>
Fri, 16 Dec 2005 15:06:54 +0000 (15:06 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 16 Dec 2005 15:06:54 +0000 (15:06 +0000)
lib/fprintftime.c [new file with mode: 0644]
lib/fprintftime.h [new file with mode: 0644]

diff --git a/lib/fprintftime.c b/lib/fprintftime.c
new file mode 100644 (file)
index 0000000..879726b
--- /dev/null
@@ -0,0 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "fprintftime.h"
+#define FPRINTFTIME 1
+#include "strftime.c"
diff --git a/lib/fprintftime.h b/lib/fprintftime.h
new file mode 100644 (file)
index 0000000..38fef43
--- /dev/null
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <time.h>
+
+/* A cross between fprintf and nstrftime, that prints directly
+   to the output stream, without the need for the potentially
+   large buffer that nstrftime would require.
+
+   Output to stream FP the result of formatting (according to the
+   nstrftime format string, FMT) the time data, *TM, and the UTC
+   and NANOSECONDS values.  */
+size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
+                   int utc, int nanoseconds);