+ /**** Time zone individual files override */
+ if (isICUData && isTimeZoneFile(name, type)) {
+ const char *tzFilesDir = u_getTimeZoneFilesDirectory(pErrorCode);
+ if (tzFilesDir[0] != 0) {
+#ifdef UDATA_DEBUG
+ fprintf(stderr, "Trying Time Zone Files directory = %s\n", tzFilesDir);
+#endif
+#ifdef UDATA_TZFILES_DEBUG
+ fprintf(stderr, "# dOC U_TIMEZONE_FILES_DIR: %s\n", U_TIMEZONE_FILES_DIR);
+#endif
+
+#if defined(U_TIMEZONE_PACKAGE)
+ // make tztocEntryName, like tocEntryName but with our package name
+ UErrorCode tzpkgErrorCode = U_ZERO_ERROR;
+ CharString tztocPkgPath;
+ tztocPkgPath.append(tzFilesDir, tzpkgErrorCode);
+ tztocPkgPath.append(U_FILE_SEP_CHAR, tzpkgErrorCode).append(U_TIMEZONE_PACKAGE, tzpkgErrorCode);
+ CharString tztocEntryName;
+ tztocEntryName.append(U_TIMEZONE_PACKAGE, tzpkgErrorCode);
+ if(!treeName.isEmpty()) {
+ tztocEntryName.append(U_TREE_ENTRY_SEP_CHAR, tzpkgErrorCode).append(treeName, tzpkgErrorCode);
+ }
+ tztocEntryName.append(U_TREE_ENTRY_SEP_CHAR, tzpkgErrorCode).append(name, tzpkgErrorCode);
+ if(type!=NULL && *type!=0) {
+ tztocEntryName.append(".", tzpkgErrorCode).append(type, tzpkgErrorCode);
+ }
+#ifdef UDATA_TZFILES_DEBUG
+ fprintf(stderr, "# dOC tz pkg, doLoadFromCommonData start; U_TIMEZONE_PACKAGE: %s, tztocPkgPath.data(): %s, tztocEntryName.data(): %s, name: %s\n",
+ U_TIMEZONE_PACKAGE, tztocPkgPath.data(), tztocEntryName.data(), name);
+#endif
+ retVal = doLoadFromCommonData(FALSE, "" /*ignored*/, "" /*ignored*/, "" /*ignored*/,
+ tztocEntryName.data(), // tocEntryName, like icutz44/zoneinfo64.res
+ tztocPkgPath.data(), // path = path to pkg, like /usr/share/icu/icutz44l
+ type, name, isAcceptable, context, &subErrorCode, &tzpkgErrorCode);
+#ifdef UDATA_TZFILES_DEBUG
+ fprintf(stderr, "# dOC tz pkg, doLoadFromCommonData end; status %d, retVal %p\n", tzpkgErrorCode, retVal);
+#endif
+ if(U_SUCCESS(tzpkgErrorCode) && retVal != NULL) {
+ return retVal;
+ }
+#endif /* defined(U_TIMEZONE_PACKAGE) */
+ // The following assumes any timezone resources in tzFilesDir are in individual .res files
+#ifdef UDATA_TZFILES_DEBUG
+ fprintf(stderr, "# dOC tz files, doLoadFromIndividualFiles start; tzFilesDir: %s, tocEntryPathSuffix: %s, name: %s\n",
+ tzFilesDir, tocEntryPathSuffix, name);
+#endif
+ retVal = doLoadFromIndividualFiles(/* pkgName.data() */ "", tzFilesDir, tocEntryPathSuffix,
+ /* path */ "", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
+#ifdef UDATA_TZFILES_DEBUG
+ fprintf(stderr, "# dOC tz files, doLoadFromIndividualFiles end; status %d, retVal %p\n", *pErrorCode, retVal);
+#endif
+ if((retVal != NULL) || U_FAILURE(*pErrorCode)) {
+ return retVal;
+ }
+ }
+ }
+