Implement tzset(), gmtime(), localtime() and mktime() on top of ICU

* no longer keep a separate time-backend, since the implementation needs to
  access (data of) the locale backend anyway
* moved more stuff from localtime_fading_out.c to localtime.cpp
* added respective tests to locale_test
* added two more tests copied from glibc, test_time.c and tst-mktime.c


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38162 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-08-16 21:14:23 +00:00
parent 6e23be561a
commit 560b10ff88
31 changed files with 1002 additions and 355 deletions
@@ -1,32 +0,0 @@
/*
* Copyright 2010, Oliver Tappe, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _ICU_TIME_BACKEND_H
#define _ICU_TIME_BACKEND_H
#include <TimeBackend.h>
namespace BPrivate {
class ICUTimeBackend : public TimeBackend {
public:
ICUTimeBackend();
virtual ~ICUTimeBackend();
virtual const status_t TZSet();
virtual void Initialize(TimeDataBridge* dataBridge);
private:
TimeDataBridge fDataBridge;
};
} // namespace BPrivate
#endif // _ICU_TIME_BACKEND_H
@@ -1,43 +0,0 @@
/*
* Copyright 2010, Oliver Tappe, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _TIME_BACKEND_H
#define _TIME_BACKEND_H
#include <SupportDefs.h>
namespace BPrivate {
struct TimeDataBridge {
int* addrOfDaylight;
long* addrOfTimezone;
char** addrOfTZName;
TimeDataBridge();
};
class TimeBackend {
public:
TimeBackend();
virtual ~TimeBackend();
virtual const status_t TZSet() = 0;
virtual void Initialize(TimeDataBridge* dataBridge) = 0;
static status_t LoadBackend();
};
extern TimeBackend* gTimeBackend;
} // namespace BPrivate
#endif // _TIME_BACKEND_H
-30
View File
@@ -1,30 +0,0 @@
/*
* Copyright 2010, Oliver Tappe, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _LOCALTIME_H
#define _LOCALTIME_H
#include <SupportDefs.h>
namespace BPrivate {
static const char* skPosixTimeZoneInfoFile = "libroot_timezone_info";
static const int skTimeZoneInfoNameMax = 32;
// holds persistent info set by Time preflet
struct time_zone_info {
char short_std_name[skTimeZoneInfoNameMax];
char short_dst_name[skTimeZoneInfoNameMax];
uint32 offset_from_gmt;
bool uses_daylight_saving;
};
} // namespace BPrivate
#endif // _LOCALTIME_H