41 lines
1018 B
C
41 lines
1018 B
C
|
// Copyright (c) 2025, Zak Fenton
|
||
|
// Zak Fenton's libc is licensed under the Mulan PSL v2. You can use this
|
||
|
// software according to the terms and conditions of the Mulan PSL v2.
|
||
|
// You may obtain a copy of Mulan PSL v2 at:
|
||
|
// http://license.coscl.org.cn/MulanPSL2
|
||
|
// THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT warranties of
|
||
|
// any kind, either express or implied, including but not limited to
|
||
|
// non-infringement, merchantability or fit for a particular purpose.
|
||
|
// See the Mulan PSL v2 for more details.
|
||
|
|
||
|
#ifndef _LIBC_TIME_H
|
||
|
#define _LIBC_TIME_H
|
||
|
|
||
|
typedef long time_t;
|
||
|
|
||
|
char* ctime(const time_t* timevar);
|
||
|
time_t time(time_t* timevar);
|
||
|
|
||
|
/* TODO: This is not implemented on the current OS. */
|
||
|
struct tm {
|
||
|
int tm_sec;
|
||
|
int tm_min;
|
||
|
int tm_hour;
|
||
|
int tm_mday;
|
||
|
int tm_mon;
|
||
|
int tm_year;
|
||
|
int tm_wday;
|
||
|
int tm_yday;
|
||
|
int tm_isdst;
|
||
|
};
|
||
|
|
||
|
struct timespec {
|
||
|
int tv_sec;
|
||
|
long tv_nsec;
|
||
|
};
|
||
|
|
||
|
struct tm* localtime(const time_t* timep);
|
||
|
|
||
|
/* From ifndef at top of file: */
|
||
|
#endif
|