Lines Matching refs:fname
47 static void set_initial_path(char *fname) in set_initial_path() argument
49 int i, len = strlen(fname); in set_initial_path()
51 xasprintf(&initial_path, "%s", fname); in set_initial_path()
58 static char *shorten_to_initial_path(char *fname) in shorten_to_initial_path() argument
63 for (p1 = fname, p2 = initial_path; *p1 && *p2; p1++, p2++) { in shorten_to_initial_path()
74 int restlen = strlen(fname) - (p1 - fname); in shorten_to_initial_path()
100 static char *try_open(const char *dirname, const char *fname, FILE **fp) in try_open() argument
104 if (!dirname || fname[0] == '/') in try_open()
105 fullname = xstrdup(fname); in try_open()
107 fullname = join_path(dirname, fname); in try_open()
127 static char *fopen_any_on_path(const char *fname, FILE **fp) in fopen_any_on_path() argument
137 fullname = try_open(cur_dir, fname, fp); in fopen_any_on_path()
141 fullname = try_open(node->dirname, fname, fp); in fopen_any_on_path()
146 FILE *srcfile_relative_open(const char *fname, char **fullnamep) in srcfile_relative_open() argument
151 if (streq(fname, "-")) { in srcfile_relative_open()
155 fullname = fopen_any_on_path(fname, &f); in srcfile_relative_open()
157 die("Couldn't open \"%s\": %s\n", fname, in srcfile_relative_open()
172 void srcfile_push(const char *fname) in srcfile_push() argument
181 srcfile->f = srcfile_relative_open(fname, &srcfile->name); in srcfile_push()
289 const char *fname = "<no-file>"; in srcpos_string() local
293 fname = pos->file->name; in srcpos_string()
297 xasprintf(&pos_str, "%s:%d.%d-%d.%d", fname, in srcpos_string()
301 xasprintf(&pos_str, "%s:%d.%d-%d", fname, in srcpos_string()
305 xasprintf(&pos_str, "%s:%d.%d", fname, in srcpos_string()
314 char *pos_str, *fname, *first, *rest; in srcpos_string_comment() local
327 fname = "<no-file>"; in srcpos_string_comment()
329 fname = "<no-filename>"; in srcpos_string_comment()
331 fname = pos->file->name; in srcpos_string_comment()
333 fname = shorten_to_initial_path(pos->file->name); in srcpos_string_comment()
334 if (fname) in srcpos_string_comment()
337 fname = pos->file->name; in srcpos_string_comment()
341 xasprintf(&first, "%s:%d:%d-%d:%d", fname, in srcpos_string_comment()
345 xasprintf(&first, "%s:%d", fname, in srcpos_string_comment()
349 free(fname); in srcpos_string_comment()