2 Copyright © 2008, The AROS Development Team. All rights reserved.
11 #define MATCHUINT(dest, value) \
12 if(sscanf(s, "%u%n", &val, &matched) != EOF) \
17 char *strptime(const char *s, const char *format, struct tm *tm)
22 if (format
== NULL
|| s
== NULL
|| tm
== NULL
)
37 matched
= (*s
== '%' ? 1 : EOF
);
41 MATCHUINT(tm
->tm_mday
, val
);
44 MATCHUINT(tm
->tm_hour
, val
);
47 MATCHUINT(tm
->tm_mon
, val
- 1);
50 MATCHUINT(tm
->tm_min
, val
);
53 MATCHUINT(tm
->tm_sec
, val
);
56 MATCHUINT(tm
->tm_wday
, val
);
59 MATCHUINT(tm
->tm_year
, val
);
62 MATCHUINT(tm
->tm_year
, val
- 1900);
68 /* FIXME: Implement remaining conversions */
76 /* whitespace matches zero or more whitespace characters */
84 /* compare characters directly */