| [aad342c] | 1 | /* The time.h header declare several functions that help you manipulate times.
|
|---|
| 2 | */
|
|---|
| 3 |
|
|---|
| 4 | #ifndef _TIME_
|
|---|
| 5 | #define _TIME_
|
|---|
| 6 | #pragma CIVL ACSL
|
|---|
| 7 | typedef unsigned long int size_t;
|
|---|
| 8 |
|
|---|
| 9 | typedef double time_t;
|
|---|
| 10 |
|
|---|
| 11 | typedef double clock_t;
|
|---|
| 12 |
|
|---|
| 13 | struct tm;
|
|---|
| 14 |
|
|---|
| 15 | #ifndef NULL
|
|---|
| 16 | #define NULL ((void*)0)
|
|---|
| 17 | #endif
|
|---|
| 18 |
|
|---|
| 19 | #define CLOCKS_PER_SEC 100
|
|---|
| 20 |
|
|---|
| 21 | /*
|
|---|
| 22 | * Returns a pointer to a string which represents the day and time of the structure timeptr.
|
|---|
| 23 | */
|
|---|
| 24 | char *asctime(const struct tm *timeptr);
|
|---|
| 25 |
|
|---|
| 26 | /*
|
|---|
| 27 | * Returns the processor clock time used since the beginning of an implementation-defined era (normally the beginning of the program).
|
|---|
| 28 | */
|
|---|
| 29 | clock_t clock(void);
|
|---|
| 30 |
|
|---|
| 31 | /* Returns a string representing the localtime based on the argument timer.
|
|---|
| 32 | */
|
|---|
| 33 | char *ctime(const time_t *timer);
|
|---|
| 34 |
|
|---|
| 35 | /*
|
|---|
| 36 | Returns the difference of seconds between time1 and time2 (time1-time2).
|
|---|
| 37 | */
|
|---|
| 38 | double difftime(time_t time1, time_t time2);
|
|---|
| 39 |
|
|---|
| 40 | /*
|
|---|
| 41 | * The value of timer is broken up into the structure tm and expressed
|
|---|
| 42 | * in Coordinated Universal Time (UTC) also known as Greenwich Mean Time (GMT).
|
|---|
| 43 | */
|
|---|
| 44 | struct tm *gmtime(const time_t *timer);
|
|---|
| 45 |
|
|---|
| 46 | /*
|
|---|
| 47 | * The value of timer is broken up into the structure tm and expressed in the local time zone.
|
|---|
| 48 | */
|
|---|
| 49 | /*@ depends_on \access(timer);
|
|---|
| 50 | @ executes_when \true;
|
|---|
| 51 | @*/
|
|---|
| 52 | $system struct tm *localtime(const time_t *timer);
|
|---|
| 53 |
|
|---|
| 54 | /* Converts the structure pointed to by timeptr into a time_t value according to the local time zone.
|
|---|
| 55 | */
|
|---|
| 56 | time_t mktime(struct tm *timeptr);
|
|---|
| 57 |
|
|---|
| 58 | /*
|
|---|
| 59 | * Formats the time represented in the structure timeptr according
|
|---|
| 60 | * to the formatting rules defined in format and stored into str.
|
|---|
| 61 | */
|
|---|
| 62 | /*@ depends_on \access(str, format, timeptr);
|
|---|
| 63 | @ executes_when \true;
|
|---|
| 64 | @*/
|
|---|
| 65 | $system size_t strftime(char *str, size_t maxsize, const char *format, const struct tm *timeptr);
|
|---|
| 66 |
|
|---|
| 67 | /*
|
|---|
| 68 | * Calculates the current calender time and encodes it into time_t format.
|
|---|
| 69 | */
|
|---|
| 70 | time_t time(time_t *timer);
|
|---|
| 71 |
|
|---|
| 72 | #endif
|
|---|