Lines Matching refs:fname

49 static void set_initial_path(char *fname)  in set_initial_path()  argument
51 int i, len = strlen(fname); in set_initial_path()
53 xasprintf(&initial_path, "%s", fname); in set_initial_path()
60 static char *shorten_to_initial_path(char *fname) in shorten_to_initial_path() argument
65 for (p1 = fname, p2 = initial_path; *p1 && *p2; p1++, p2++) { in shorten_to_initial_path()
76 int restlen = strlen(fname) - (p1 - fname); in shorten_to_initial_path()
102 static char *try_open(const char *dirname, const char *fname, FILE **fp) in try_open() argument
106 if (!dirname || fname[0] == '/') in try_open()
107 fullname = xstrdup(fname); in try_open()
109 fullname = join_path(dirname, fname); in try_open()
129 static char *fopen_any_on_path(const char *fname, FILE **fp) in fopen_any_on_path() argument
139 fullname = try_open(cur_dir, fname, fp); in fopen_any_on_path()
143 fullname = try_open(node->dirname, fname, fp); in fopen_any_on_path()
148 FILE *srcfile_relative_open(const char *fname, char **fullnamep) in srcfile_relative_open() argument
153 if (streq(fname, "-")) { in srcfile_relative_open()
157 fullname = fopen_any_on_path(fname, &f); in srcfile_relative_open()
159 die("Couldn't open \"%s\": %s\n", fname, in srcfile_relative_open()
174 void srcfile_push(const char *fname) in srcfile_push() argument
183 srcfile->f = srcfile_relative_open(fname, &srcfile->name); in srcfile_push()
291 const char *fname = "<no-file>"; in srcpos_string() local
295 fname = pos->file->name; in srcpos_string()
299 xasprintf(&pos_str, "%s:%d.%d-%d.%d", fname, in srcpos_string()
303 xasprintf(&pos_str, "%s:%d.%d-%d", fname, in srcpos_string()
307 xasprintf(&pos_str, "%s:%d.%d", fname, in srcpos_string()
317 const char *fname; in srcpos_string_comment() local
329 fname = "<no-file>"; in srcpos_string_comment()
331 fname = "<no-filename>"; in srcpos_string_comment()
333 fname = pos->file->name; in srcpos_string_comment()
337 fname = fresh_fname; in srcpos_string_comment()
339 fname = pos->file->name; in srcpos_string_comment()
343 xasprintf(&first, "%s:%d:%d-%d:%d", fname, in srcpos_string_comment()
347 xasprintf(&first, "%s:%d", fname, in srcpos_string_comment()