Archeus 0.0.0
A C library and game engine that focuses on documentation
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1#ifndef ARC_STD_TIME_H_
2#define ARC_STD_TIME_H_
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <time.h>
10
11/**
12 * @brief the ARC_Time data structre based on time.h (mainly added to avoid having to type `struct tm` every time)
13 *
14 * seconds == tm_sec [0,60]
15 * minutes == tm_min [0,59]
16 * hour == tm_hour [0,23]
17 *
18 * day == tm_yday Day of year [0,365]
19 * month == tm_mon Month of year [0,11]
20 * year == tm_year Years since 1900
21 *
22 * dayOfWeek == tm_wday Day of week [0,6] (Sunday =0)
23 * dayOfMonth == tm_mday Day of month [1,31]
24 *
25 * daylightSavingsFlag == tm_isdst Daylight Savings flag
26*/
27typedef struct ARC_Time {
28 uint8_t seconds;
29 uint8_t minutes;
30 uint8_t hour;
31
32 uint32_t day;
33 uint8_t month;
34 uint32_t year;
35
36 uint8_t dayOfWeek;
37 uint8_t dayOfMonth;
38
41
42/**
43 * @brief copies the contents of a tm struct pointer into the ARC_Time type
44 *
45 * @param time the struct tm type to copy
46 *
47 * @return the contents of a struct tm as an ARC_Time
48*/
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif // !ARC_STD_TIME_H_
the ARC_Time data structre based on time.h (mainly added to avoid having to type struct tm every time...
Definition time.h:27
uint32_t year
Definition time.h:34
uint8_t month
Definition time.h:33
uint32_t day
Definition time.h:32
uint8_t dayOfWeek
Definition time.h:36
uint8_t dayOfMonth
Definition time.h:37
uint8_t seconds
Definition time.h:28
uint8_t minutes
Definition time.h:29
uint8_t hour
Definition time.h:30
uint8_t daylightSavingsFlag
Definition time.h:39
ARC_Time ARC_Time_CopyFromStructTmPtr(struct tm *time)
copies the contents of a tm struct pointer into the ARC_Time type
struct ARC_Time ARC_Time
the ARC_Time data structre based on time.h (mainly added to avoid having to type struct tm every time...