diff options
Diffstat (limited to 'scripts/dtc/srcpos.h')
-rw-r--r-- | scripts/dtc/srcpos.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/dtc/srcpos.h b/scripts/dtc/srcpos.h index ce980cafe588..93a27123c2e9 100644 --- a/scripts/dtc/srcpos.h +++ b/scripts/dtc/srcpos.h | |||
@@ -33,10 +33,39 @@ struct srcfile_state { | |||
33 | extern FILE *depfile; /* = NULL */ | 33 | extern FILE *depfile; /* = NULL */ |
34 | extern struct srcfile_state *current_srcfile; /* = NULL */ | 34 | extern struct srcfile_state *current_srcfile; /* = NULL */ |
35 | 35 | ||
36 | /** | ||
37 | * Open a source file. | ||
38 | * | ||
39 | * If the source file is a relative pathname, then it is searched for in the | ||
40 | * current directory (the directory of the last source file read) and after | ||
41 | * that in the search path. | ||
42 | * | ||
43 | * We work through the search path in order from the first path specified to | ||
44 | * the last. | ||
45 | * | ||
46 | * If the file is not found, then this function does not return, but calls | ||
47 | * die(). | ||
48 | * | ||
49 | * @param fname Filename to search | ||
50 | * @param fullnamep If non-NULL, it is set to the allocated filename of the | ||
51 | * file that was opened. The caller is then responsible | ||
52 | * for freeing the pointer. | ||
53 | * @return pointer to opened FILE | ||
54 | */ | ||
36 | FILE *srcfile_relative_open(const char *fname, char **fullnamep); | 55 | FILE *srcfile_relative_open(const char *fname, char **fullnamep); |
56 | |||
37 | void srcfile_push(const char *fname); | 57 | void srcfile_push(const char *fname); |
38 | int srcfile_pop(void); | 58 | int srcfile_pop(void); |
39 | 59 | ||
60 | /** | ||
61 | * Add a new directory to the search path for input files | ||
62 | * | ||
63 | * The new path is added at the end of the list. | ||
64 | * | ||
65 | * @param dirname Directory to add | ||
66 | */ | ||
67 | void srcfile_add_search_path(const char *dirname); | ||
68 | |||
40 | struct srcpos { | 69 | struct srcpos { |
41 | int first_line; | 70 | int first_line; |
42 | int first_column; | 71 | int first_column; |
@@ -84,4 +113,6 @@ extern void srcpos_error(struct srcpos *pos, char const *, ...) | |||
84 | extern void srcpos_warn(struct srcpos *pos, char const *, ...) | 113 | extern void srcpos_warn(struct srcpos *pos, char const *, ...) |
85 | __attribute__((format(printf, 2, 3))); | 114 | __attribute__((format(printf, 2, 3))); |
86 | 115 | ||
116 | extern void srcpos_set_line(char *f, int l); | ||
117 | |||
87 | #endif /* _SRCPOS_H_ */ | 118 | #endif /* _SRCPOS_H_ */ |