Lines Matching +full:dlclose +full:- +full:skip
6 * Copyright (C) 1997-2016, International Business Machines
18 * for assumed case. Non-UNIX platforms must be
19 * special-cased. Rewrote numeric methods dealing
84 #error U_COMMON_IMPLEMENTATION not set - must be set for all ICU source files in common/ - see http…
110 # include <qliept.h> /* EPT_CALL macro - this include must be after all other "QSYSINCs" */
173 /* floating point implementations ------------------------------------------- */
186 /*---------------------------------------------------------------------------
189 are non-POSIX must declare themselves so. The default POSIX implementation
190 will sometimes work for non-POSIX platforms as well (e.g., the NaN-related
192 ---------------------------------------------------------------------------*/
211 return (char*)(d + 1) - n; in u_topNBytesOfDouble()
219 return (char*)(d + 1) - n; in u_bottomNBytesOfDouble()
233 hiByte = *(((uint8_t *)&d) + sizeof(double) - 1); in u_signBit()
246 UDate fakeClock_dt = 0; /** Offset (fake time - real time) **/
263 fakeClock_dt = fakeClock_t0 - real; in getUTCtime_fake()
292 /*---------------------------------------------------------------------------
297 ---------------------------------------------------------------------------*/
317 return (UDate)((winTime.int64 - EPOCH_BIAS) / HECTONANOSECOND_PER_MILLISECOND); in uprv_getRawUTCtime()
333 /*-----------------------------------------------------------------------------
338 If this doesn't work on your platform, you have non-IEEE floating-point, and
341 ---------------------------------------------------------------------------*/
500 /* check for -0 and 0*/ in uprv_fmax()
518 /* check for -0 and 0*/ in uprv_fmin()
552 * trunc(3.3) = 3.0, trunc (-3.3) = -3.0
554 * floor(3.3) = 3, floor(-3.3) = -4
555 * ceil(3.3) = 4, ceil(-3.3) = -3
567 if(u_signBit(d)) /* Signbit() picks up -0.0; d<0 does not. */ in uprv_trunc()
585 return pow(2.0, DBL_MANT_DIG + 1.0) - 1.0; in uprv_maxMantissa()
607 * non-TERASPACE. If it is TERASPACE it is 2GB - 4k(header information). in uprv_maximumPtr()
610 * each pointer type (TERASPACE and non-TERASPACE) in uprv_maximumPtr()
616 /* if it is a TERASPACE pointer the max is 2GB - 4k */ in uprv_maximumPtr()
617 return ((void *)(((char *)base)-((uint32_t)(base))+((uint32_t)0x7fffefff))); in uprv_maximumPtr()
620 return ((void *)(((char *)base)-((uint32_t)(base))+((uint32_t)0xffefff))); in uprv_maximumPtr()
627 /*---------------------------------------------------------------------------
628 Platform-specific Implementations
631 ---------------------------------------------------------------------------*/
633 /* Generic time zone layer -------------------------------------------------- */
664 tdiff = t2 - t1; in uprv_timezone()
716 #define TZFILE_SKIP "posixrules" /* tz file to skip when searching. */
736 or AST4ADT (non-Olson ID) */ in isValidOlsonID()
749 The timezone is sometimes set to "CST-7CDT", "CST6CDT5,J129,J131/19:30", in isValidOlsonID()
759 /* On some Unix-like OS, 'posix' subdirectory in
760 /usr/share/zoneinfo replicates the top-level contents. 'right'
762 are different from those in the top-level directory or 'posix'
769 timezone id ('America/New_York' is). So, we have to skip
785 …int32_t daylightType; /* 0=U_DAYLIGHT_NONE, 1=daylight in June-U_DAYLIGHT_JUNE, 2=daylight in Dece…
803 {-45900, 2, "CHAST", "CHADT", "Pacific/Chatham"},
804 {-43200, 1, "PETT", "PETST", "Asia/Kamchatka"},
805 {-43200, 2, "NZST", "NZDT", "Pacific/Auckland"},
806 {-43200, 1, "ANAT", "ANAST", "Asia/Anadyr"},
807 {-39600, 1, "MAGT", "MAGST", "Asia/Magadan"},
808 {-37800, 2, "LHST", "LHST", "Australia/Lord_Howe"},
809 {-36000, 2, "EST", "EST", "Australia/Sydney"},
810 {-36000, 1, "SAKT", "SAKST", "Asia/Sakhalin"},
811 {-36000, 1, "VLAT", "VLAST", "Asia/Vladivostok"},
812 {-34200, 2, "CST", "CST", "Australia/South"},
813 {-32400, 1, "YAKT", "YAKST", "Asia/Yakutsk"},
814 {-32400, 1, "CHOT", "CHOST", "Asia/Choibalsan"},
815 {-31500, 2, "CWST", "CWST", "Australia/Eucla"},
816 {-28800, 1, "IRKT", "IRKST", "Asia/Irkutsk"},
817 {-28800, 1, "ULAT", "ULAST", "Asia/Ulaanbaatar"},
818 {-28800, 2, "WST", "WST", "Australia/West"},
819 {-25200, 1, "HOVT", "HOVST", "Asia/Hovd"},
820 {-25200, 1, "KRAT", "KRAST", "Asia/Krasnoyarsk"},
821 {-21600, 1, "NOVT", "NOVST", "Asia/Novosibirsk"},
822 {-21600, 1, "OMST", "OMSST", "Asia/Omsk"},
823 {-18000, 1, "YEKT", "YEKST", "Asia/Yekaterinburg"},
824 {-14400, 1, "SAMT", "SAMST", "Europe/Samara"},
825 {-14400, 1, "AMT", "AMST", "Asia/Yerevan"},
826 {-14400, 1, "AZT", "AZST", "Asia/Baku"},
827 {-10800, 1, "AST", "ADT", "Asia/Baghdad"},
828 {-10800, 1, "MSK", "MSD", "Europe/Moscow"},
829 {-10800, 1, "VOLT", "VOLST", "Europe/Volgograd"},
830 {-7200, 0, "EET", "CEST", "Africa/Tripoli"},
831 {-7200, 1, "EET", "EEST", "Europe/Athens"}, /* Conflicts with Africa/Cairo */
832 {-7200, 1, "IST", "IDT", "Asia/Jerusalem"},
833 {-3600, 0, "CET", "WEST", "Africa/Algiers"},
834 {-3600, 2, "WAT", "WAST", "Africa/Windhoek"},
910 if (tzInfo->defaultTZFilePtr == NULL) { in compareBinaryFiles()
911 tzInfo->defaultTZFilePtr = fopen(defaultTZFileName, "r"); in compareBinaryFiles()
915 tzInfo->defaultTZPosition = 0; /* reset position to begin search */ in compareBinaryFiles()
917 if (file != NULL && tzInfo->defaultTZFilePtr != NULL) { in compareBinaryFiles()
919 if (tzInfo->defaultTZFileSize == 0) { in compareBinaryFiles()
920 fseek(tzInfo->defaultTZFilePtr, 0, SEEK_END); in compareBinaryFiles()
921 tzInfo->defaultTZFileSize = ftell(tzInfo->defaultTZFilePtr); in compareBinaryFiles()
927 if (sizeFile != tzInfo->defaultTZFileSize) { in compareBinaryFiles()
933 if (tzInfo->defaultTZBuffer == NULL) { in compareBinaryFiles()
934 rewind(tzInfo->defaultTZFilePtr); in compareBinaryFiles()
935 … tzInfo->defaultTZBuffer = (char*)uprv_malloc(sizeof(char) * tzInfo->defaultTZFileSize); in compareBinaryFiles()
936 …sizeFileRead = fread(tzInfo->defaultTZBuffer, 1, tzInfo->defaultTZFileSize, tzInfo->defaultTZFileP… in compareBinaryFiles()
944 … if (memcmp(tzInfo->defaultTZBuffer + tzInfo->defaultTZPosition, bufferFile, sizeFileRead) != 0) { in compareBinaryFiles()
948 sizeFileLeft -= sizeFileRead; in compareBinaryFiles()
949 tzInfo->defaultTZPosition += sizeFileRead; in compareBinaryFiles()
972 * This function is not thread safe - it uses a global, gSearchTZFileResult, to hold its results.
981 CharString curpath(path, -1, status); in searchForTZFile()
1001 const char* dirName = dirEntry->d_name; in searchForTZFile()
1006 newpath.append(dirName, -1, status); in searchForTZFile()
1022 and return the first match in the top-level directory in searchForTZFile()
1023 if there's a match in the top-level. If not, this function in searchForTZFile()
1032 int32_t amountToSkip = sizeof(TZZONEINFO) - 1; in searchForTZFile()
1038 gSearchTZFileResult->clear(); in searchForTZFile()
1039 gSearchTZFileResult->append(zoneid, -1, status); in searchForTZFile()
1043 result = gSearchTZFileResult->data(); in searchForTZFile()
1102 dlclose(libc); in uprv_tzname_clear_cache()
1174 int32_t ret = (int32_t)readlink(TZDEFAULT, gTimeZoneBuffer, sizeof(gTimeZoneBuffer)-1); in uprv_tzname()
1189 tzInfo->defaultTZBuffer = NULL; in uprv_tzname()
1190 tzInfo->defaultTZFileSize = 0; in uprv_tzname()
1191 tzInfo->defaultTZFilePtr = NULL; in uprv_tzname()
1192 tzInfo->defaultTZstatus = false; in uprv_tzname()
1193 tzInfo->defaultTZPosition = 0; in uprv_tzname()
1198 if (tzInfo->defaultTZBuffer != NULL) { in uprv_tzname()
1199 uprv_free(tzInfo->defaultTZBuffer); in uprv_tzname()
1201 if (tzInfo->defaultTZFilePtr != NULL) { in uprv_tzname()
1202 fclose(tzInfo->defaultTZFilePtr); in uprv_tzname()
1226 U_TZNAME is usually a non-unique abbreviation, which isn't normally usable. in uprv_tzname()
1236 static const time_t juneSolstice=1182478260; /*2007-06-21 18:11 UT*/ in uprv_tzname()
1237 static const time_t decemberSolstice=1198332540; /*2007-12-22 06:09 UT*/ in uprv_tzname()
1261 /* Get and set the ICU data directory --------------------------------------- */
1387 if ((length > 0) && (length < (UPRV_LENGTHOF(windowsPath) - 1))) { in getIcuDataDirectoryUnderWindowsDirectory()
1388 // Convert UTF-16 to a UTF-8 string. in getIcuDataDirectoryUnderWindowsDirectory()
1392 &windowsPathUtf8Len, reinterpret_cast<const UChar*>(windowsPath), -1, &status); in getIcuDataDirectoryUnderWindowsDirectory()
1395 (windowsPathUtf8Len < (UPRV_LENGTHOF(windowsPathUtf8) - 1))) { in getIcuDataDirectoryUnderWindowsDirectory()
1397 if (windowsPathUtf8[windowsPathUtf8Len - 1] != U_FILE_SEP_CHAR) { in getIcuDataDirectoryUnderWindowsDirectory()
1499 gTimeZoneFilesDirectory->clear(); in setTimeZoneFilesDir()
1500 gTimeZoneFilesDirectory->append(path, status); in setTimeZoneFilesDir()
1502 char *p = gTimeZoneFilesDirectory->data(); in setTimeZoneFilesDir()
1568 return U_SUCCESS(*status) ? gTimeZoneFilesDirectory->data() : ""; in u_getTimeZoneFilesDirectory()
1616 /* Solaris speaks POSIX - See IEEE Std 1003.1-2008
1639 // Note: this test will not catch 'C.UTF-8',
1681 LC_ALL ----> default_loc codepage
1682 --------------------------------------------------------
1684 ab@CD ab__CD -
1694 _CD@GH _CD_GH -
1714 // Over-allocate in case we replace "C" with "en_US_POSIX" (+10), + null termination
1748 …uprv_strcat(correctedPOSIXLocale, "__"); /* aa@b -> aa__b (note this can make the new locale 1 cha…
1751 uprv_strcat(correctedPOSIXLocale, "_"); /* aa_CC@b -> aa_CC_b */
1757 int32_t len = (int32_t)(uprv_strlen(correctedPOSIXLocale) + (q-p));
1758 uprv_strncat(correctedPOSIXLocale, p, q-p); // do not include charset
1766 /* Should there be a map from 'no@nynorsk' -> no_NO_NY here?
1767 * How about 'russian' -> 'ru'?
1781 if (correctedPOSIXLocale != nullptr) { /* Was already set - clean up. */
1804 // First we need to go from UTF-16 to char (and also convert from _ to - while we're at it.)
1812 modifiedWindowsLocale[i] = '-';
1829 modifiedWindowsLocale[UPRV_LENGTHOF(modifiedWindowsLocale) - 1] = '\0';
1852 // If unable to find a locale we can agree upon, use en-US by default
1895 * QLGPGCMA_4 means UTF-32
1896 * QLGPGCMA_8 means UTF-8
1916 if (correctedLocale[LocaleLen - 2] == '_' &&
1917 correctedLocale[LocaleLen - 1] == 'E')
1922 /* If using Lotus-based locale then convert to
1925 else if (correctedLocale[LocaleLen - 2] == '_' &&
1926 correctedLocale[LocaleLen - 1] == 'L')
1928 correctedLocale[LocaleLen - 2] = 0;
1972 if (uprv_strcmp(name, "IBM-943") == 0) {
1973 /* Use the ASCII compatible ibm-943 */
1974 name = "Shift-JIS";
1976 else if (uprv_strcmp(name, "IBM-1252") == 0) {
1977 /* Use the windows-1252 that contains the Euro */
1978 name = "IBM-5348";
1984 name = "EUC-CN";
1987 name = "EUC-TW";
1990 name = "EUC-KR";
1995 ibm-954 is the best match.
1996 ibm-33722 is the default for eucJP (similar to Windows).
2003 * ISO-8859-1 instead of US-ASCII(646).
2005 name = "ISO-8859-1";
2012 Mac OS X uses UTF-8 by default (especially the locale data and console).
2014 name = "UTF-8";
2018 name = "EUC-KR";
2020 …else if (locale != NULL && uprv_strcmp(locale, "en_US_POSIX") != 0 && uprv_strcmp(name, "US-ASCII"…
2022 * For non C/POSIX locale, default the code page to UTF-8 instead of US-ASCII.
2024 name = "UTF-8";
2029 name = "EUC-KR";
2033 /* HP decided to extend big5 as hkbig5 even though it's not compatible :-( */
2039 ibm-1350 is the best match, but unavailable.
2040 ibm-954 is mostly a superset of ibm-1350.
2041 ibm-33722 is the default for eucJP (similar to Windows).
2049 name = "EUC-KR";
2058 ibm-1350 is the best match, but unavailable.
2059 ibm-954 is mostly a superset of ibm-1350.
2060 ibm-33722 is the default for eucJP (similar to Windows).
2065 (uprv_strcmp(name, "ANSI_X3.4-1968") == 0 || uprv_strcmp(name, "US-ASCII") == 0)) {
2067 * For non C/POSIX locale, default the code page to UTF-8 instead of US-ASCII.
2069 name = "UTF-8";
2072 * Linux returns ANSI_X3.4-1968 for C/POSIX, but the call site takes care of
2073 * it by falling back to 'US-ASCII' when NULL is returned from this
2092 size_t localeCapacity = uprv_min(sizeof(localeBuf), (name-localeName)+1);
2094 localeBuf[localeCapacity-1] = 0; /* ensure NULL termination */
2096 buffer[buffCapacity-1] = 0; /* ensure NULL termination */
2110 uint32_t ccsid = 37; /* Default to ibm-37 */
2127 sprintf(codepage,"ibm-%d", ccsid);
2133 strncpy(codepage, nl_langinfo(CODESET),63-strlen(UCNV_SWAP_LFNL_OPTION_STRING));
2154 // Special case for UTF-8
2157 return "UTF-8";
2159 // Windows codepages can look like windows-1252, so format the found number
2160 // the numbers are eclectic, however all valid system code pages, besides UTF-8
2164 sprintf(codepage, "windows-%ld", codepageNumber);
2167 // If the codepage number call failed then return UTF-8
2168 return "UTF-8";
2188 * On Linux and MacOSX, ensure that default codepage for non C/POSIX locale is UTF-8
2201 codesetName[sizeof(codesetName)-1] = 0;
2220 (void)uprv_strcpy(codesetName, "US-ASCII");
2224 return "US-ASCII";
2243 /* end of platform-specific implementation -------------- */
2245 /* version handling --------------------------------------------------------- */
2300 for(count=4; count>0 && versionArray[count-1]==0; --count) {
2338 /* NUL-terminate */
2380 dlclose(lib);
2488 * indent-tabs-mode: nil