-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime.h
52 lines (43 loc) · 1.57 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
/* -----------------------------------------------------------
Copyright (C) 2016 Cheng Lyeec. All rights reserved.
This software may be distributed and modified under the terms of the GNU
General Public License version 2 (GPL2) as published by the Free Software
Foundation and appearing in the file GPL2.TXT included in the packaging of
this file. Please note that GPL2 Section 2[b] requires that all works based
on this software must also be made publicly available under the terms of
the GPL2 ("Copyleft").
Contact information
-------------------
Cheng Lyeec
Web : http://lyeec.me
e-mail : [email protected]
--------------------------------------------------------------*/
#ifndef __USER_H__
#define __USER_H__
typedef struct {
short year;
char month;
char day;
char hour;
char minute;
char second;
} timeTypeDef;
typedef void(*timeModifyType)(timeTypeDef* t);
void timeSet(timeTypeDef* t, short y, char mon, char d, char h, char m, char s);
void timeTransferOutput(const timeTypeDef* t, unsigned char mode, unsigned char* displayData);
char isLeapYear(char year);
void incSecond(timeTypeDef* t);
void incMinute(timeTypeDef* t);
void incHour(timeTypeDef* t);
void incDay(timeTypeDef* t);
void incMonth(timeTypeDef* t);
void incYear(timeTypeDef* t);
void setSecondZero(timeTypeDef* t);
void decMinute(timeTypeDef* t);
void decHour(timeTypeDef* t);
void decDay(timeTypeDef* t);
void decMonth(timeTypeDef* t);
void decYear(timeTypeDef* t);
void timeInc(timeTypeDef* t, unsigned char modifyTypeIndex);
void timeDec(timeTypeDef* t, unsigned char modifyTypeIndex);
#endif