-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtime.h
61 lines (49 loc) · 1.47 KB
/
time.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* NCSOCK & NESCA4
* Сделано от души 2023.
* Copyright (c) [2023] [lomaster]
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef NOTGNU_TIME_H
#define NOTGNU_TIME_H
#include <sys/time.h> /* linux header*/
#include "ngubits/types.h"
#include "ngusyst/cdefs.h"
#include "stddef.h"
#define CLOCKS_PER_SEC 128
#define TIME_UTC 1
typedef ___clock_t clock_t;
typedef ___time_t time_t ;
struct tm
{
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
};
/* fucking linux
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
*/
__BEGIN_DECLS
clock_t clock(void); /* done */
double difftime(time_t time1, time_t time0); /* done */
time_t mktime(struct tm* timeptr);
time_t time(time_t* timer); /* done */
int timespec_get(struct timespec* ts, int base);
char* asctime(const struct tm* timeptr);
char* ctime(const time_t* timer);
struct tm *gmtime(const time_t* timer);
struct tm *localtime(const time_t *timer);
size_t strftime(char* s, size_t maxsize, const char* format,
const struct tm* timeptr);
__END_DECLS
#endif