diff options
Diffstat (limited to 'internet_time/timezone.h')
-rw-r--r-- | internet_time/timezone.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/internet_time/timezone.h b/internet_time/timezone.h new file mode 100644 index 0000000..d1997c5 --- /dev/null +++ b/internet_time/timezone.h @@ -0,0 +1,47 @@ +#ifndef _TIMEZONE_H
+#define _TIMEZONE_H
+
+#define TZREG "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"
+#define TZREG_9X "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones"
+//#define TZREG2 "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"
+#define MAX_SIZE 512
+
+#include <vector>
+#include <algorithm>
+
+#include <wchar.h>
+
+struct REG_TZI {
+ long Bias;
+ long StandardBias;
+ long DaylightBias;
+ SYSTEMTIME StandardDate;
+ SYSTEMTIME DaylightDate;
+};
+
+
+struct LS_TZREG {
+ TCHAR tcName[MAX_SIZE];
+ TCHAR tcDisp[MAX_SIZE];
+ TCHAR tcDLT[MAX_SIZE];
+ TCHAR tcSTD[MAX_SIZE];
+ TCHAR MapID[MAX_SIZE];
+ DWORD Index;
+ DWORD ActiveTimeBias;
+ //TIME_ZONE_INFORMATION TZI;
+ REG_TZI TZI;
+
+ unsigned int list_index;
+
+ bool operator<(const LS_TZREG &other);
+};
+
+typedef std::vector< LS_TZREG > TimeList;
+
+extern TimeList timezone_list, geo_timezone_list;
+bool build_timezone_list();
+
+bool get_reg_tzi_for_gmt(REG_TZI ®_tzi);
+bool get_reg_tzi_for_central_european(REG_TZI ®_tzi);
+
+#endif
|