/*
*******************************************************************************
*
-* Copyright (C) 1999-2005, International Business Machines
+* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include "cmemory.h"
#include "cstring.h"
#include "toolutil.h"
+#include "unicode/ucal.h"
#ifdef U_WINDOWS
# define VC_EXTRALEAN
#endif
#include <errno.h>
+static int32_t currentYear = -1;
+
+U_CAPI int32_t U_EXPORT2 getCurrentYear() {
+#if !UCONFIG_NO_FORMATTING
+ UErrorCode status=U_ZERO_ERROR;
+ UCalendar *cal = NULL;
+
+ if(currentYear == -1) {
+ cal = ucal_open(NULL, -1, NULL, UCAL_TRADITIONAL, &status);
+ ucal_setMillis(cal, ucal_getNow(), &status);
+ currentYear = ucal_get(cal, UCAL_YEAR, &status);
+ ucal_close(cal);
+ }
+ return currentYear;
+#else
+ return 2008;
+#endif
+}
+
+
U_CAPI const char * U_EXPORT2
getLongPathname(const char *pathname) {
#ifdef U_WINDOWS
/* anticipate problems with "short" pathnames */
static WIN32_FIND_DATA info;
- HANDLE file=FindFirstFile(pathname, &info);
+ HANDLE file=FindFirstFileA(pathname, &info);
if(file!=INVALID_HANDLE_VALUE) {
if(info.cAlternateFileName[0]!=0) {
/* this file has a short name, get and use the long one */