not build it.
Linux build fixes.
*/
time_t dateparse(const char *s);
+#if 0
struct tm *xgetdate(const char *string,
const char *const *template);
+#endif
int xgetdate_r(const char *string,
struct tm *tp,
const char *const *template);
#include "dateparse.h"
static void check_date(time_t when,
- const char *format,
+ const char *fmt,
struct tm *(*convert)(const time_t *)) {
char buffer[128];
time_t parsed;
- strftime(buffer, sizeof buffer, format, convert(&when));
+ strftime(buffer, sizeof buffer, fmt, convert(&when));
parsed = dateparse(buffer);
check_integer(parsed, when);
if(parsed != when)
- fprintf(stderr, "format=%s formatted=%s\n", format, buffer);
+ fprintf(stderr, "format=%s formatted=%s\n", fmt, buffer);
}
static void test_dateparse(void) {
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE 1 /* to expose strptime */
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
8 invalid input specification Example: February 31 or a time is
specified that can not be represented in a time_t (representing
the time in seconds since 00:00:00 UTC, January 1, 1970) */
-int xgetdate_err;
+/*int xgetdate_err;*/
/* Returns the first weekday WDAY of month MON in the year YEAR. */
}
-
+#if 0
struct tm *
xgetdate (const char *string, const char *const *template)
{
if (errval != 0)
{
- getdate_err = errval;
+ xgetdate_err = errval;
return NULL;
}
return &tmbuf;
}
+#endif