source: CIVL/include/headers/time.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[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
7typedef unsigned long int size_t;
8
9typedef double time_t;
10
11typedef double clock_t;
12
13struct 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*/
24char *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*/
29clock_t clock(void);
30
31/* Returns a string representing the localtime based on the argument timer.
32 */
33char *ctime(const time_t *timer);
34
35/*
36Returns the difference of seconds between time1 and time2 (time1-time2).
37*/
38double 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*/
44struct 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 */
56time_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*/
70time_t time(time_t *timer);
71
72#endif
Note: See TracBrowser for help on using the repository browser.