#include <stdio.h>
#include "dtc.h"
#include "srcpos.h"
Go to the source code of this file.
|
FILE * | srcfile_relative_open (const char *fname, char **fullnamep) |
|
void | srcfile_push (const char *fname) |
|
int | srcfile_pop (void) |
|
void | srcfile_add_search_path (const char *dirname) |
|
void | srcpos_update (struct srcpos *pos, const char *text, int len) |
|
struct srcpos * | srcpos_copy (struct srcpos *pos) |
|
void | srcpos_dump (struct srcpos *pos) |
|
char * | srcpos_string (struct srcpos *pos) |
|
void | srcpos_verror (struct srcpos *pos, char const *fmt, va_list va) |
|
void | srcpos_error (struct srcpos *pos, char const *fmt,...) |
|
void | srcpos_warn (struct srcpos *pos, char const *fmt,...) |
|
void | srcpos_set_line (char *f, int l) |
|
#define MAX_SRCFILE_DEPTH (100) |
Add a new directory to the search path for input files
The new path is added at the end of the list.
- Parameters
-
Definition at line 183 of file srcpos.c.
FILE* srcfile_relative_open |
( |
const char * |
fname, |
|
|
char ** |
fullnamep |
|
) |
| |
Open a source file.
If the source file is a relative pathname, then it is searched for in the current directory (the directory of the last source file read) and after that in the search path.
We work through the search path in order from the first path specified to the last.
If the file is not found, then this function does not return, but calls die().
- Parameters
-
fname | Filename to search |
fullnamep | If non-NULL, it is set to the allocated filename of the file that was opened. The caller is then responsible for freeing the pointer. |
- Returns
- pointer to opened FILE
Definition at line 117 of file srcpos.c.
Initial value:= {
.first_line = 0,
.first_column = 0,
.last_line = 0,
.last_column = 0,
}
Definition at line 204 of file srcpos.c.