Present  0.9
 All Classes Files Functions Variables Typedefs Friends Macros Pages
present.h
Go to the documentation of this file.
1 /*
2  * Present - Date/Time Library
3  *
4  * Header file that includes all structures and methods for:
5  * ClockTime, Date, DayDelta, MonthDelta, TimeDelta, Timestamp
6  *
7  * If this is being read by a C compiler, it will just have the struct
8  * definitions and C method declarations (no implementations). In this case,
9  * you may include the individual header files in "present/" instead of this
10  * file (but this approach is not recommended).
11  *
12  * If this is being read by a C++ compiler, it will also have the C++ inline
13  * method implementations. In this case, you must include this file, NOT the
14  * individual header files in "present/". (This is enforced at compile-time;
15  * for more, see "present/internal/cpp-guard.h").
16  *
17  * Licensed under the MIT License.
18  * For details, see LICENSE.
19  */
20 
21 #ifndef _PRESENT_H_
22 #define _PRESENT_H_
23 
24 
25 /*
26  * Definitions of the C++ classes / C structs;
27  * Declarations of the C functions
28  */
29 
30 /*
31  * Disable clang warning about "incomplete type could be incompatible with C"
32  * (we know this won't happen, since we declare all of our types as extern "C")
33  */
34 #ifdef __cplusplus
35 # ifdef __clang__
36 # ifndef __ICC
37 # pragma clang diagnostic push
38 # pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
39 # endif
40 # endif
41 #endif
42 
43 #include "present/clock-time.h"
44 #include "present/date.h"
45 #include "present/day-delta.h"
46 #include "present/month-delta.h"
47 #include "present/time-delta.h"
48 #include "present/timestamp.h"
49 
50 #ifdef __cplusplus
51 # ifdef __clang__
52 # ifndef __ICC
53 # pragma clang diagnostic pop
54 # endif
55 # endif
56 #endif
57 
58 
59 /*
60  * Shortcut macro for creating Present delta types
61  */
62 
63 #include "present/internal/delta-constructor-macros.h"
64 
100 #define present_delta(value, unit) \
101  present_delta_constructor_unit_ ## unit (value)
102 
103 
104 /*
105  * Implementations of the C++ methods (defined "inline")
106  */
107 
108 #ifdef __cplusplus
109 
110 #include "present/impl/clock-time.hpp"
111 #include "present/impl/date.hpp"
112 #include "present/impl/day-delta.hpp"
113 #include "present/impl/month-delta.hpp"
114 #include "present/impl/time-delta.hpp"
115 #include "present/impl/timestamp.hpp"
116 
117 #endif
118 
119 #endif /* _PRESENT_H_ */
120