Lines Matching refs:path

51    because the CF keys identifying the node span the entire absolute path
253 // Create a string that consists of path minus its last component.
254 // path must end with '/'
255 // The result will end in '/' (unless path itself is '/')
256 static CFStringRef copyParentOf(CFStringRef path)
263 searchRange = CFRangeMake(0, CFStringGetLength(path) - 1);
264 found = CFStringFindWithOptions(path, CFSTR("/"), searchRange,
268 return CFStringCreateWithSubstring(NULL, path, parentRange);
272 // Create a string that consists of path's last component.
273 // path must end with '/'
275 // The result will not start with '/' (unless path itself is '/')
276 static CFStringRef copyChildOf(CFStringRef path)
282 CFIndex length = CFStringGetLength(path);
285 found = CFStringFindWithOptions(path, CFSTR("/"), searchRange,
290 return CFStringCreateWithSubstring(NULL, path, childRange);
294 // Return the first three components of path, with leading and trailing '/'.
295 // If path does not have three components, return NULL.
296 // path must begin and end in '/'
297 static CFStringRef copyFirstThreeComponentsOf(CFStringRef path)
304 CFIndex length = CFStringGetLength(path);
307 found = CFStringFindWithOptions(path, CFSTR("/"), searchRange, 0,
313 found = CFStringFindWithOptions(path, CFSTR("/"), searchRange, 0,
319 found = CFStringFindWithOptions(path, CFSTR("/"), searchRange, 0,
324 prefix = CFStringCreateWithSubstring(NULL, path, prefixRange);
330 // Copy the CFPreferences key and value at the base of path's tree.
331 // path must end in '/'
333 // Returns NULL on error or if there is no tree for path in this file.
334 static void copyTreeForPath(CFStringRef path, CFStringRef name,
348 // Second-level file. Key must be the first three components of path.
349 key = copyFirstThreeComponentsOf(path);
366 // Find the node for path in the given tree.
367 // Returns NULL on error or if path doesn't have a node in this tree.
368 // path must end in '/'
369 static CFDictionaryRef copyNodeInTree(CFStringRef path, CFStringRef topKey,
375 p = CFStringCreateMutableCopy(NULL, 0, path);
384 // guaranteed to succeed because path must end in '/'
408 // Return a retained copy of the node at path from the given file.
409 // path must end in '/'
411 // returns NULL if the value for key "path" isn't a valid node.
412 static CFDictionaryRef copyNodeIfPresent(CFStringRef path, CFStringRef name,
419 copyTreeForPath(path, name, user, host, &topKey, &topValue);
422 result = copyNodeInTree(path, topKey, topValue);
430 // Create a new tree that would store path in the given file.
431 // Only the root of the tree is created, not all of the links leading to path.
433 static void createTreeForPath(CFStringRef path, CFStringRef name,
448 CFStringRef prefix = copyFirstThreeComponentsOf(path);
457 // Return a mutable copy of the tree containing path and the dict for
458 // path itself. *outTopKey and *outTopValue can be used to write the
463 copyMutableNode(CFStringRef path, CFStringRef name,
477 copyTreeForPath(path, name, user, host, &topKey, &oldTopValue);
479 createTreeForPath(path, name, user, host, &topKey, &topValue);
487 p = CFStringCreateMutableCopy(NULL, 0, path);
496 // guaranteed to succeed because path must end in '/'
537 CFStringRef path = toCF(env, jpath);
544 if (!path || !name) goto badparams;
546 node = copyNodeIfPresent(path, name, user, host);
558 node = copyMutableNode(path, name, user, host, &topKey, &topValue);
570 if (path) CFRelease(path);
582 CFStringRef path = toCF(env, jpath);
590 if (!path || !name) goto badparams;
592 parentName = copyParentOf(path);
594 childName = copyChildOf(path);
619 copyTreeForPath(path, name, user, host, &topKey, &topValue);
621 if (CFEqual(topKey, path)) {
638 if (path) CFRelease(path);
650 CFStringRef path = toCF(env, jpath);
661 if (!path || !child || !name) goto badparams;
667 parent = copyMutableNode(path, name, user, host, &topKey, &topValue);
684 if (path) CFRelease(path);
696 CFStringRef path = toCF(env, jpath);
703 if (!path || !child || !name) goto badparams;
705 constParent = copyNodeIfPresent(path, name, user, host);
711 parent = copyMutableNode(path, name, user, host, &topKey, &topValue);
725 if (path) CFRelease(path);
737 CFStringRef path = toCF(env, jpath);
747 if (!path || !key || !value || !name) goto badparams;
750 node = copyMutableNode(path, name, user, host, &topKey, &topValue);
762 if (path) CFRelease(path);
774 CFStringRef path = toCF(env, jpath);
781 if (!path || !key || !name) goto badparams;
783 constNode = copyNodeIfPresent(path, name, user, host);
789 node = copyMutableNode(path, name, user, host, &topKey, &topValue);
803 if (path) CFRelease(path);
809 // path must end in '/'
815 CFStringRef path = toCF(env, jpath);
824 if (!path || !key || !name) goto badparams;
826 node = copyNodeIfPresent(path, name, user, host);
850 if (path) CFRelease(path);
917 CFStringRef path = toCF(env, jpath);
925 if (!path || !name) goto badparams;
927 node = copyNodeIfPresent(path, name, user, host);
958 if (path) CFRelease(path);