00001
00002 #ifndef WIBBLE_GRCAL_GRCAL_H
00003 #define WIBBLE_GRCAL_GRCAL_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <string>
00026
00067 struct tm;
00068
00069 namespace wibble {
00070 namespace grcal {
00071
00075 namespace date {
00076
00080 void today(int* dst);
00081
00083 void now(int* dst);
00084
00086 int daysinmonth(int year, int month);
00087
00089 int daysinyear(int year);
00090
00097 void easter(int year, int* month, int* day);
00098
00103 void lowerbound(const int* src, int* dst);
00104
00109 void lowerbound(int* val);
00110
00115 void upperbound(const int* src, int* dst);
00116
00121 void upperbound(int* val);
00122
00142 void normalise(int* res);
00143
00151 long long int secondsfrom(int year, const int* val);
00152
00158 long long int duration(const int* begin, const int* end);
00159
00165 void mergetime(const int* date, const int* time, int* dst);
00166
00172 void mergetime(int* date, const int* time);
00173
00177 void totm(const int* src, struct tm* dst);
00178
00183 void fromtm(const struct tm& src, int* dst, int count = 6);
00184
00188 std::string tostring(const int* val);
00189
00190 }
00191
00195 namespace dtime {
00196
00201 void lowerbound(const int* src, int* dst);
00202
00207 void lowerbound(int* val);
00208
00213 int lowerbound_sec(const int* src);
00214
00215
00220 void upperbound(const int* src, int* dst);
00221
00226 void upperbound(int* val);
00227
00232 int upperbound_sec(const int* src);
00233
00240 int duration(const int* begin, const int* end);
00241
00245 std::string tostring(const int* val);
00246
00250 std::string tostring(int val);
00251
00252 }
00253
00254 }
00255 }
00256
00257
00258 #endif