Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
srcpos.h File Reference
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  srcfile_state
 
struct  srcpos
 

Macros

#define YYLTYPE   struct srcpos
 
#define YYLLOC_DEFAULT(Current, Rhs, N)
 

Functions

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 srcpossrcpos_copy (struct srcpos *pos)
 
charsrcpos_string (struct srcpos *pos)
 
void srcpos_dump (struct srcpos *pos)
 
void srcpos_verror (struct srcpos *pos, char const *, va_list va) __attribute__((format(printf
 
void void srcpos_error (struct srcpos *pos, char const *,...) __attribute__((format(printf
 
void void void srcpos_warn (struct srcpos *pos, char const *,...) __attribute__((format(printf
 
void void void void srcpos_set_line (char *f, int l)
 

Variables

FILE * depfile
 
struct srcfile_statecurrent_srcfile
 
struct srcpos srcpos_empty
 

Macro Definition Documentation

#define YYLLOC_DEFAULT (   Current,
  Rhs,
  N 
)
Value:
do { \
if (N) { \
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC(Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
(Current).file = YYRHSLOC(Rhs, N).file; \
} else { \
(Current).first_line = (Current).last_line = \
YYRHSLOC(Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC(Rhs, 0).last_column; \
(Current).file = YYRHSLOC (Rhs, 0).file; \
} \
} while (0)

Definition at line 79 of file srcpos.h.

#define YYLTYPE   struct srcpos

Definition at line 77 of file srcpos.h.

Function Documentation

void srcfile_add_search_path ( const char dirname)

Add a new directory to the search path for input files

The new path is added at the end of the list.

Parameters
dirnameDirectory to add

Definition at line 183 of file srcpos.c.

int srcfile_pop ( void  )

Definition at line 162 of file srcpos.c.

void srcfile_push ( const char fname)

Definition at line 143 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
fnameFilename to search
fullnamepIf 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.

struct srcpos* srcpos_copy ( struct srcpos pos)
read

Definition at line 239 of file srcpos.c.

void srcpos_dump ( struct srcpos pos)

Definition at line 252 of file srcpos.c.

void void srcpos_error ( struct srcpos pos,
char const ,
  ... 
)
void void void void srcpos_set_line ( char f,
int  l 
)

Definition at line 332 of file srcpos.c.

char* srcpos_string ( struct srcpos pos)

Definition at line 265 of file srcpos.c.

void srcpos_update ( struct srcpos pos,
const char text,
int  len 
)

Definition at line 214 of file srcpos.c.

void srcpos_verror ( struct srcpos pos,
char const ,
va_list  va 
)
void void void srcpos_warn ( struct srcpos pos,
char const ,
  ... 
)

Variable Documentation

struct srcfile_state* current_srcfile

Definition at line 53 of file srcpos.c.

FILE* depfile

Definition at line 124 of file fixdep.c.

struct srcpos srcpos_empty

Definition at line 204 of file srcpos.c.