aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/dtc-src/srcpos.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/dtc-src/srcpos.h')
-rw-r--r--arch/powerpc/boot/dtc-src/srcpos.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/powerpc/boot/dtc-src/srcpos.h b/arch/powerpc/boot/dtc-src/srcpos.h
index ce7ab5ba5b46..e17c7c04db8e 100644
--- a/arch/powerpc/boot/dtc-src/srcpos.h
+++ b/arch/powerpc/boot/dtc-src/srcpos.h
@@ -22,13 +22,21 @@
22 * array of all opened filenames. 22 * array of all opened filenames.
23 */ 23 */
24 24
25#include <stdio.h>
26
27struct dtc_file {
28 char *dir;
29 const char *name;
30 FILE *file;
31};
32
25#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED) 33#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
26typedef struct YYLTYPE { 34typedef struct YYLTYPE {
27 int first_line; 35 int first_line;
28 int first_column; 36 int first_column;
29 int last_line; 37 int last_line;
30 int last_column; 38 int last_column;
31 int filenum; 39 struct dtc_file *file;
32} YYLTYPE; 40} YYLTYPE;
33 41
34#define YYLTYPE_IS_DECLARED 1 42#define YYLTYPE_IS_DECLARED 1
@@ -48,7 +56,7 @@ typedef struct YYLTYPE {
48 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 56 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
49 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 57 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
50 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 58 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
51 (Current).filenum = YYRHSLOC (Rhs, N).filenum; \ 59 (Current).file = YYRHSLOC (Rhs, N).file; \
52 } \ 60 } \
53 else \ 61 else \
54 { \ 62 { \
@@ -56,20 +64,22 @@ typedef struct YYLTYPE {
56 YYRHSLOC (Rhs, 0).last_line; \ 64 YYRHSLOC (Rhs, 0).last_line; \
57 (Current).first_column = (Current).last_column = \ 65 (Current).first_column = (Current).last_column = \
58 YYRHSLOC (Rhs, 0).last_column; \ 66 YYRHSLOC (Rhs, 0).last_column; \
59 (Current).filenum = YYRHSLOC (Rhs, 0).filenum; \ 67 (Current).file = YYRHSLOC (Rhs, 0).file; \
60 } \ 68 } \
61 while (YYID (0)) 69 while (YYID (0))
62 70
63 71
64 72
65extern void yyerror(char const *); 73extern void yyerror(char const *);
74extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
66 75
67extern int srcpos_filenum; 76extern struct dtc_file *srcpos_file;
68 77
69extern int push_input_file(const char *filename); 78struct search_path {
70extern int pop_input_file(void); 79 const char *dir; /* NULL for current directory */
80 struct search_path *prev, *next;
81};
71 82
72extern FILE *dtc_open_file(const char *fname); 83extern struct dtc_file *dtc_open_file(const char *fname,
73extern int lookup_file_name(const char *fname, int add_it); 84 const struct search_path *search);
74extern const char *srcpos_filename_for_num(int filenum); 85extern void dtc_close_file(struct dtc_file *file);
75const char *srcpos_get_filename(void);