OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * | 3 * |
4 * Copyright (C) 1997-2014, International Business Machines | 4 * Copyright (C) 1997-2014, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ****************************************************************************** | 7 ****************************************************************************** |
8 * | 8 * |
9 * FILE NAME : putil.c (previously putil.cpp and ptypes.cpp) | 9 * FILE NAME : putil.c (previously putil.cpp and ptypes.cpp) |
10 * | 10 * |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 875 |
876 if (sizeFile != tzInfo->defaultTZFileSize) { | 876 if (sizeFile != tzInfo->defaultTZFileSize) { |
877 result = FALSE; | 877 result = FALSE; |
878 } else { | 878 } else { |
879 /* Store the data from the files in seperate buffers and | 879 /* Store the data from the files in seperate buffers and |
880 * compare each byte to determine equality. | 880 * compare each byte to determine equality. |
881 */ | 881 */ |
882 if (tzInfo->defaultTZBuffer == NULL) { | 882 if (tzInfo->defaultTZBuffer == NULL) { |
883 rewind(tzInfo->defaultTZFilePtr); | 883 rewind(tzInfo->defaultTZFilePtr); |
884 tzInfo->defaultTZBuffer = (char*)uprv_malloc(sizeof(char) * tzIn
fo->defaultTZFileSize); | 884 tzInfo->defaultTZBuffer = (char*)uprv_malloc(sizeof(char) * tzIn
fo->defaultTZFileSize); |
885 fread(tzInfo->defaultTZBuffer, 1, tzInfo->defaultTZFileSize, tzI
nfo->defaultTZFilePtr); | 885 sizeFileRead = fread(tzInfo->defaultTZBuffer, 1, tzInfo->default
TZFileSize, tzInfo->defaultTZFilePtr); |
886 } | 886 } |
887 rewind(file); | 887 rewind(file); |
888 while(sizeFileLeft > 0) { | 888 while(sizeFileLeft > 0) { |
889 uprv_memset(bufferFile, 0, MAX_READ_SIZE); | 889 uprv_memset(bufferFile, 0, MAX_READ_SIZE); |
890 sizeFileToRead = sizeFileLeft < MAX_READ_SIZE ? sizeFileLeft : M
AX_READ_SIZE; | 890 sizeFileToRead = sizeFileLeft < MAX_READ_SIZE ? sizeFileLeft : M
AX_READ_SIZE; |
891 | 891 |
892 sizeFileRead = fread(bufferFile, 1, sizeFileToRead, file); | 892 sizeFileRead = fread(bufferFile, 1, sizeFileToRead, file); |
893 if (memcmp(tzInfo->defaultTZBuffer + tzInfo->defaultTZPosition,
bufferFile, sizeFileRead) != 0) { | 893 if (memcmp(tzInfo->defaultTZBuffer + tzInfo->defaultTZPosition,
bufferFile, sizeFileRead) != 0) { |
894 result = FALSE; | 894 result = FALSE; |
895 break; | 895 break; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 /* Get out after the first one found. */ | 963 /* Get out after the first one found. */ |
964 break; | 964 break; |
965 } | 965 } |
966 } | 966 } |
967 } | 967 } |
968 } | 968 } |
969 closedir(dirp); | 969 closedir(dirp); |
970 return result; | 970 return result; |
971 } | 971 } |
972 #endif | 972 #endif |
973 | |
974 U_CAPI void U_EXPORT2 | |
975 uprv_tzname_clear_cache() | |
976 { | |
977 #if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK) | |
978 gTimeZoneBufferPtr = NULL; | |
979 #endif | |
980 } | |
981 | |
982 U_CAPI const char* U_EXPORT2 | 973 U_CAPI const char* U_EXPORT2 |
983 uprv_tzname(int n) | 974 uprv_tzname(int n) |
984 { | 975 { |
985 const char *tzid = NULL; | 976 const char *tzid = NULL; |
986 #if U_PLATFORM_USES_ONLY_WIN32_API | 977 #if U_PLATFORM_USES_ONLY_WIN32_API |
987 tzid = uprv_detectWindowsTimeZone(); | 978 tzid = uprv_detectWindowsTimeZone(); |
988 | 979 |
989 if (tzid != NULL) { | 980 if (tzid != NULL) { |
990 return tzid; | 981 return tzid; |
991 } | 982 } |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 #endif /* U_ENABLE_DYLOAD */ | 2212 #endif /* U_ENABLE_DYLOAD */ |
2222 | 2213 |
2223 /* | 2214 /* |
2224 * Hey, Emacs, please set the following: | 2215 * Hey, Emacs, please set the following: |
2225 * | 2216 * |
2226 * Local Variables: | 2217 * Local Variables: |
2227 * indent-tabs-mode: nil | 2218 * indent-tabs-mode: nil |
2228 * End: | 2219 * End: |
2229 * | 2220 * |
2230 */ | 2221 */ |
OLD | NEW |