changeset 6495:6a800a02bf4c

from coreutils
author Jim Meyering <jim@meyering.net>
date Fri, 16 Dec 2005 15:06:54 +0000
parents 728bb76c34b6
children ac0db5adf976
files lib/fprintftime.c lib/fprintftime.h
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/lib/fprintftime.c
@@ -0,0 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "fprintftime.h"
+#define FPRINTFTIME 1
+#include "strftime.c"
new file mode 100644
--- /dev/null
+++ b/lib/fprintftime.h
@@ -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);