Home | History | Annotate | Download | only in common

Lines Matching full:path

145 findBasename(const char *path) {
146 const char *basename=uprv_strrchr(path, U_FILE_SEP_CHAR);
148 return path;
156 packageNameFromPath(const char *path)
158 if((path == NULL) || (*path == 0)) {
162 path = findBasename(path);
164 if((path == NULL) || (*path == 0)) {
168 return path;
244 static UDataMemory *udata_findCachedData(const char *path)
251 baseName = findBasename(path); /* Cache remembers only the base name, not the full path. */
266 static UDataMemory *udata_cacheDataItem(const char *path, UDataMemory *item, UErrorCode *pErr) {
279 * and copy the supplied path and UDataMemoryItems into it.
293 baseName = findBasename(path);
308 oldValue = uhash_get(htable, path);
418 * Path management. Could be shared with other tools/etc if need be *
428 const char *path; /* working path (u_icudata_Dir) */
429 const char *nextPath; /* path following this one */
435 char *itemPath; /* path passed in with item name */
438 char *pathBuffer; /* output path for this it'ion */
447 * last 4 of path, then previous chars. */
456 * @param path The full pathname to be iterated over. If NULL, defaults to U_ICUDATA_NAME
458 * @param item Item to be searched for. Can include full path, such as /a/b/foo.dat
459 * @param suffix Optional item suffix, if not-null (ex. ".dat") then 'path' can contain 'item' explicitly.
463 static void udata_pathiter_init(UDataPathIterator *iter, const char *path, const char *pkg,
467 fprintf(stderr, "SUFFIX1=%s PATH=%s\n", suffix, path);
469 /** Path **/
470 if(path == NULL) {
471 iter->path = u_getDataDirectory();
473 iter->path = path;
504 /** Item path **/
508 iter->nextPath = iter->path;
537 /* pathBuffer will hold the output path strings returned by the this iterator
541 int32_t maxPathLen = (int32_t)(uprv_strlen(iter->path) + uprv_strlen(item) + uprv_strlen(iter->suffix) + iter->packageStubLen + 3);
547 iter->path = "";
553 fprintf(stderr, "%p: init %s -> [path=%s], [base=%s], [suff=%s], [itempath=%s], [nextpath=%s], [checklast4=%s]\n",
556 iter->path,
567 * Get the next path on the list.
570 * @param len If set, pointer to the length of the returned path, for convenience.
571 * @return Pointer to the next path segment, or NULL if there are no more.
575 const char *path = NULL;
585 path = iter->nextPath;
587 if(iter->nextPath == iter->itemPath) { /* we were processing item's path. */
588 iter->nextPath = iter->path; /* start with regular path next tm. */
589 pathLen = (int32_t)uprv_strlen(path);
592 iter->nextPath = uprv_strchr(path, U_PATH_SEP_CHAR);
594 /* segment: entire path */
595 pathLen = (int32_t)uprv_strlen(path);
598 pathLen = (int32_t)(iter->nextPath - path);
610 fprintf(stderr, "rest of path (IDD) = %s\n", path);
622 uprv_strncpy(iter->pathBuffer, path, pathLen);
635 fprintf(stderr, "Have %s file on the path: %s\n", iter->suffix, iter->pathBuffer);
640 { /* regular dir path */
685 } while(iter->path);
693 * Path Iterator Destructor. Clean up any allocated storage
734 openCommonData(const char *path, /* Path from OpenChoice? */
735 UBool isICUData, /* ICU Data true if path == NULL */
765 /* Find the base name portion of the supplied path. */
766 /* inBasename will be left pointing somewhere within the original path string. */
767 inBasename = findBasename(path);
773 /* no basename. This will happen if the original path was a directory name, */
776 fprintf(stderr, "ocd: no basename in %s, bailing.\n", path);
783 /* Note that the cache is keyed by the base name only. The rest of the path, */
793 * Hunt it down, trying all the path locations
796 udata_pathiter_init(&iter, u_getDataDirectory(), inBasename, path, ".dat", TRUE);
802 fprintf(stderr, "ocd: trying path %s - ", pathBuffer);
815 uprv_strncpy(ourPathBuffer, path, 1019);
952 udata_setAppData(const char *path, const void *data, UErrorCode *err)
967 udata_cacheDataItem(path, &udm, err);
991 /* trying to get data from fallback path. */
1025 const char *path, const char *type, const char *name,
1037 /* init path iterator for individual files */
1038 udata_pathiter_init(&iter, dataPath, pkgName, path, tocEntryPathSuffix, FALSE);
1089 const char *path, const char *type, const char *name,
1108 pCommonData=openCommonData(path, isICUData, subErrorCode); /** search for pkg **/
1180 doOpenChoice(const char *path, const char *type, const char *name,
1187 TinyString tocEntryPath; /* entry name in path format. ex: 'icudt28b\\coll\\ar.res' */
1205 /* Is this path ICU data? */
1206 if(path == NULL ||
1207 !strcmp(path, U_ICUDATA_ALIAS) || /* "ICUDATA" */
1208 !uprv_strncmp(path, U_ICUDATA_NAME U_TREE_SEPARATOR_STRING, /* "icudt26e-" */
1210 !uprv_strncmp(path, U_ICUDATA_ALIAS U_TREE_SEPARATOR_STRING, /* "ICUDATA-" */
1216 /* remap from alternate path char to the main one */
1218 if(path) {
1220 if((p=uprv_strchr(path,U_FILE_ALT_SEP_CHAR))) {
1221 TinyString_append(&altSepPath, path);
1226 fprintf(stderr, "Changed path from [%s] to [%s]\n", path, altSepPath.s);
1228 path = altSepPath.s;
1240 if(path==NULL) {
1245 pkg = uprv_strrchr(path, U_FILE_SEP_CHAR);
1246 first = uprv_strchr(path, U_FILE_SEP_CHAR);
1247 if(uprv_pathIsAbsolute(path) || (pkg != first)) { /* more than one slash in the path- not a tree name */
1248 /* see if this is an /absolute/path/to/package path */
1252 TinyString_append(&pkgName, path);
1255 treeChar = uprv_strchr(path, U_TREE_SEPARATOR);
1261 TinyString_appendn(&pkgName, path, (int32_t)(treeChar-path));
1264 This user data has no path, but there is a tree name.
1265 Look up the correct path from the data cache later.
1267 path = pkgName.s;
1274 TinyString_append(&pkgName, path);
1319 if(path == NULL) {
1320 path = COMMON_DATA_NAME; /* "icudt26e" */
1325 fprintf(stderr, "IND: inBasename = %s, pkg=%s\n", "(n/a)", packageNameFromPath(path));
1339 path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
1354 path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
1369 path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
1384 path, type, name, isAcceptable, context, &subErrorCode, pErrorCode);
1417 udata_open(const char *path, const char *type, const char *name,
1420 fprintf(stderr, "udata_open(): Opening: %s : %s . %s\n", (path?path:"NULL"), name, type);
1430 return doOpenChoice(path, type, name, NULL, NULL, pErrorCode);
1437 udata_openChoice(const char *path, const char *type, const char *name,
1441 fprintf(stderr, "udata_openChoice(): Opening: %s : %s . %s\n", (path?path:"NULL"), name, type);
1450 return doOpenChoice(path, type, name, isAcceptable, context, pErrorCode);