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
00078 int daysinmonth(int year, int month);
00079
00081 int daysinyear(int year);
00082
00089 void easter(int year, int* month, int* day);
00090
00095 void lowerbound(const int* src, int* dst);
00096
00101 void lowerbound(int* val);
00102
00107 void upperbound(const int* src, int* dst);
00108
00113 void upperbound(int* val);
00114
00134 void normalise(int* res);
00135
00143 long long int secondsfrom(int year, const int* val);
00144
00150 long long int duration(const int* begin, const int* end);
00151
00157 void mergetime(const int* date, const int* time, int* dst);
00158
00164 void mergetime(int* date, const int* time);
00165
00169 void totm(const int* src, struct tm* dst);
00170
00175 void fromtm(const struct tm& src, int* dst, int count = 6);
00176
00180 std::string tostring(const int* val);
00181
00182 }
00183
00187 namespace dtime {
00188
00193 void lowerbound(const int* src, int* dst);
00194
00199 void lowerbound(int* val);
00200
00205 int lowerbound_sec(const int* src);
00206
00207
00212 void upperbound(const int* src, int* dst);
00213
00218 void upperbound(int* val);
00219
00224 int upperbound_sec(const int* src);
00225
00232 int duration(const int* begin, const int* end);
00233
00237 std::string tostring(const int* val);
00238
00242 std::string tostring(int val);
00243
00244 }
00245
00246 }
00247 }
00248
00249
00250 #endif