Lines Matching full:file
1 /* dirname.c -- return all but the last element in a file name
29 /* Return the length of `dirname (FILE)', or zero if FILE is
33 dir_len (char const *file)
35 size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
39 for (length = base_name (file) - file; prefix_length < length; length--)
40 if (! ISSLASH (file[length - 1]))
44 return prefix_length + ISSLASH (file[prefix_length]);
47 /* Return the leading directories part of FILE,
53 dir_name (char const *file)
55 size_t length = dir_len (file);
56 bool append_dot = (length == FILE_SYSTEM_PREFIX_LEN (file));
58 memcpy (dir, file, length);
111 char file[MAX_BUFF_LEN];
114 sscanf (buff, "%s %s", file, expected_result);
115 result = dir_name (file);
117 printf ("%s: got %s, expected %s\n", file, result, expected_result);