-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtime.h
25 lines (21 loc) · 791 Bytes
/
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
// time.h
// Copyright (C) 2022 iProgramInCpp
// The NanoShell Standard C Library
#ifndef _TIME___H
#define _TIME___H
#include <nanoshell/time_types.h>
double difftime(time_t a, time_t b);
time_t time(time_t* timer);
time_t mktime (struct tm * ptr);
struct tm* localtime_r(const time_t* timep, struct tm * result);
struct tm* localtime(const time_t* timep);
int gettimeofday(struct timeval * tv, struct timezone * tz);
int settimeofday(struct timeval * tv, struct timezone * tz);
// NanoShell specifics
TimeStruct* GetTime();
void StructTmToTimeStruct(TimeStruct* out, struct tm* in);
void TimeStructToStructTm(TimeStruct* in, struct tm* out);
int GetEpochTimeFromTimeStruct(TimeStruct* ts);
int GetEpochTime();
void GetHumanTimeFromEpoch(int utime, TimeStruct* pOut);
#endif//_TIME___H