1 // compatibility routines, non reentrant ....
6 struct tm* localtime_r(const time_t* t, struct tm* r) {
9 memcpy(r,temp,sizeof(struct tm));
13 struct tm* gmtime_r(const time_t* t, struct tm* r) {
16 memcpy(r,temp,sizeof(struct tm));
20 char* ctime_r (const time_t* t, char* buf) {
22 temp = asctime(localtime(t));
29 Points to the string from which to extract tokens.
32 Points to a null-terminated set of delimiter characters.
35 Is a value-return parameter used by strtok_r() to record its progress through s1.
39 char * strtok_r (char *s, const char *delim, char **save_ptr) {
42 if (s == NULL) s = *save_ptr;
44 /* Scan leading delimiters. */
45 s += strspn(s, delim);
52 /* Find the end of the token. */
54 s = strpbrk (token, delim);
56 /* This token finishes the string. */
58 while (**save_ptr != '\0') (*save_ptr)++;
61 /* Terminate the token and make *SAVE_PTR point past it. */