osprey-gcc/libcpp/files.c File Reference

#include "config.h"
#include "system.h"
#include "cpplib.h"
#include "internal.h"
#include "mkdeps.h"
#include "hashtab.h"
#include "md5.h"
#include <dirent.h>

Include dependency graph for files.c:

Go to the source code of this file.

Data Types

type  _cpp_file
type  file_hash_entry
type  pchf_data
type  pchf_data::pchf_entry
type  pchf_compare_data

Defines

#define STAT_SIZE_RELIABLE(ST)   true
#define set_stdin_to_binary_mode()

Functions/Subroutines

static bool open_file (_cpp_file *file)
static bool pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
static bool read_file_guts (cpp_reader *pfile, _cpp_file *file)
static bool read_file (cpp_reader *pfile, _cpp_file *file)
static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import)
static struct cpp_dirsearch_path_head (cpp_reader *, const char *fname, int angle_brackets, enum include_type)
static const char * dir_name_of_file (_cpp_file *file)
static void open_file_failed (cpp_reader *pfile, _cpp_file *file)
static struct file_hash_entrysearch_cache (struct file_hash_entry *head, const cpp_dir *start_dir)
static _cpp_filemake_cpp_file (cpp_reader *, cpp_dir *, const char *fname)
static void destroy_cpp_file (_cpp_file *)
static cpp_dirmake_cpp_dir (cpp_reader *, const char *dir_name, int sysp)
static void allocate_file_hash_entries (cpp_reader *pfile)
static struct file_hash_entrynew_file_hash_entry (cpp_reader *pfile)
static int report_missing_guard (void **slot, void *b)
static hashval_t file_hash_hash (const void *p)
static int file_hash_eq (const void *p, const void *q)
static char * read_filename_string (int ch, FILE *f)
static void read_name_map (cpp_dir *dir)
static char * remap_filename (cpp_reader *pfile, _cpp_file *file)
static char * append_file_to_dir (const char *fname, cpp_dir *dir)
static bool validate_pch (cpp_reader *, _cpp_file *file, const char *pchname)
static int pchf_save_compare (const void *e1, const void *e2)
static int pchf_compare (const void *d_p, const void *e_p)
static bool check_file_against_entries (cpp_reader *, _cpp_file *, bool)
static bool search_path_exhausted (cpp_reader *pfile, const char *header, _cpp_file *file)
bool _cpp_find_failed (_cpp_file *file)
_cpp_file_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake)
bool _cpp_stack_file (cpp_reader *pfile, _cpp_file *file, bool import)
void _cpp_mark_file_once_only (cpp_reader *pfile, _cpp_file *file)
bool _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets, enum include_type type)
bool cpp_included (cpp_reader *pfile, const char *fname)
void _cpp_init_files (cpp_reader *pfile)
void _cpp_cleanup_files (cpp_reader *pfile)
void _cpp_fake_include (cpp_reader *pfile, const char *fname)
void cpp_make_system_header (cpp_reader *pfile, int syshdr, int externc)
void cpp_change_file (cpp_reader *pfile, enum lc_reason reason, const char *new_name)
void _cpp_report_missing_guards (cpp_reader *pfile)
int _cpp_compare_file_date (cpp_reader *pfile, const char *fname, int angle_brackets)
bool cpp_push_include (cpp_reader *pfile, const char *fname)
void _cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file)
void cpp_set_include_chains (cpp_reader *pfile, cpp_dir *quote, cpp_dir *bracket, int quote_ignores_source_dir)
const char * cpp_get_path (struct _cpp_file *f)
cpp_dircpp_get_dir (struct _cpp_file *f)
cpp_buffercpp_get_buffer (cpp_reader *pfile)
_cpp_filecpp_get_file (cpp_buffer *b)
cpp_buffercpp_get_prev (cpp_buffer *b)
bool _cpp_save_file_entries (cpp_reader *pfile, FILE *fp)
bool _cpp_read_file_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, FILE *f)
static bool check_file_against_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, _cpp_file *f, bool check_included)

Variables

static struct pchf_datapchf


Define Documentation

 
#define set_stdin_to_binary_mode (  ) 

Definition at line 47 of file files.c.

Referenced by open_file().

#define STAT_SIZE_RELIABLE ( ST   )     true

Definition at line 39 of file files.c.

Referenced by read_file_guts().


Function Documentation

void _cpp_cleanup_files ( cpp_reader pfile  ) 

Definition at line 1012 of file files.c.

int _cpp_compare_file_date ( cpp_reader pfile,
const char *  fname,
int  angle_brackets 
)

Definition at line 1097 of file files.c.

void _cpp_fake_include ( cpp_reader pfile,
const char *  fname 
)

Definition at line 1020 of file files.c.

References _cpp_find_file(), cpp_reader::buffer, _cpp_file::dir, and cpp_buffer::file.

bool _cpp_find_failed ( _cpp_file file  ) 

Definition at line 373 of file files.c.

_cpp_file* _cpp_find_file ( cpp_reader pfile,
const char *  fname,
cpp_dir start_dir,
bool  fake 
)

void _cpp_init_files ( cpp_reader pfile  ) 

Definition at line 1001 of file files.c.

void _cpp_mark_file_once_only ( cpp_reader pfile,
_cpp_file file 
)

Definition at line 740 of file files.c.

Referenced by do_pragma_once(), and should_stack_file().

void _cpp_pop_file_buffer ( cpp_reader pfile,
_cpp_file file 
)

Definition at line 1131 of file files.c.

bool _cpp_read_file_entries ( cpp_reader *pfile  ATTRIBUTE_UNUSED,
FILE f 
)

Definition at line 1502 of file files.c.

References pchf_data::count, pchf_data::entries, fread, memcpy, and xmalloc().

Referenced by cpp_read_state().

void _cpp_report_missing_guards ( cpp_reader pfile  ) 

Definition at line 1086 of file files.c.

References cpp_reader::file_hash, htab_traverse(), and report_missing_guard().

bool _cpp_save_file_entries ( cpp_reader pfile,
FILE fp 
)

Definition at line 1435 of file files.c.

Referenced by cpp_write_pch_state().

bool _cpp_stack_file ( cpp_reader pfile,
_cpp_file file,
bool  import 
)

Definition at line 698 of file files.c.

Referenced by _cpp_stack_include().

bool _cpp_stack_include ( cpp_reader pfile,
const char *  fname,
int  angle_brackets,
enum include_type  type 
)

Definition at line 809 of file files.c.

Referenced by cpp_push_include(), and do_include_common().

static void allocate_file_hash_entries ( cpp_reader pfile  )  [static]

static char * append_file_to_dir ( const char *  fname,
cpp_dir dir 
) [static]

Definition at line 1173 of file files.c.

References cpp_dir::len, memcpy, cpp_dir::name, path, strlen(), and xmalloc().

Referenced by find_file_in_dir(), and read_name_map().

static bool check_file_against_entries ( cpp_reader *pfile  ATTRIBUTE_UNUSED,
_cpp_file f,
bool  check_included 
) [static]

static bool check_file_against_entries ( cpp_reader ,
_cpp_file ,
bool   
) [static]

Referenced by should_stack_file().

void cpp_change_file ( cpp_reader pfile,
enum lc_reason  reason,
const char *  new_name 
)

Definition at line 1047 of file files.c.

Referenced by finish_options(), push_command_line_include(), and read_scan_file().

cpp_buffer* cpp_get_buffer ( cpp_reader pfile  ) 

Definition at line 1373 of file files.c.

Referenced by _cpp_builtin_macro_text(), and find_subframework_header().

cpp_dir* cpp_get_dir ( struct _cpp_file f  ) 

Definition at line 1364 of file files.c.

Referenced by find_subframework_header().

_cpp_file* cpp_get_file ( cpp_buffer b  )  [read]

Definition at line 1381 of file files.c.

Referenced by _cpp_builtin_macro_text(), and find_subframework_header().

const char* cpp_get_path ( struct _cpp_file f  ) 

Definition at line 1356 of file files.c.

Referenced by find_subframework_header().

cpp_buffer* cpp_get_prev ( cpp_buffer b  ) 

Definition at line 1390 of file files.c.

Referenced by find_subframework_header().

bool cpp_included ( cpp_reader pfile,
const char *  fname 
)

void cpp_make_system_header ( cpp_reader pfile,
int  syshdr,
int  externc 
)

bool cpp_push_include ( cpp_reader pfile,
const char *  fname 
)

Definition at line 1123 of file files.c.

Referenced by finish_options(), and push_command_line_include().

void cpp_set_include_chains ( cpp_reader pfile,
cpp_dir quote,
cpp_dir bracket,
int  quote_ignores_source_dir 
)

Definition at line 1154 of file files.c.

Referenced by reader_init(), and register_include_chains().

static void destroy_cpp_file ( _cpp_file file  )  [static]

Definition at line 883 of file files.c.

References _cpp_file::buffer, free(), and _cpp_file::name.

Referenced by should_stack_file().

static const char * dir_name_of_file ( _cpp_file file  )  [static]

Definition at line 790 of file files.c.

References _cpp_file::dir_name, lbasename(), len, memcpy, _cpp_file::path, and xmalloc().

Referenced by search_path_head().

static int file_hash_eq ( const void p,
const void q 
) [static]

static hashval_t file_hash_hash ( const void p  )  [static]

static bool find_file_in_dir ( cpp_reader pfile,
_cpp_file file,
bool invalid_pch 
) [static]

static cpp_dir * make_cpp_dir ( cpp_reader pfile,
const char *  dir_name,
int  sysp 
) [static]

static _cpp_file * make_cpp_file ( cpp_reader pfile,
cpp_dir dir,
const char *  fname 
) [static]

static struct file_hash_entry * new_file_hash_entry ( cpp_reader pfile  )  [static, read]

static bool open_file ( _cpp_file file  )  [static]

static void open_file_failed ( cpp_reader pfile,
_cpp_file file 
) [static]

static bool pch_open_file ( cpp_reader pfile,
_cpp_file file,
bool invalid_pch 
) [static]

static int pchf_compare ( const void d_p,
const void e_p 
) [static]

static int pchf_save_compare ( const void e1,
const void e2 
) [static]

Definition at line 1427 of file files.c.

References memcmp.

Referenced by _cpp_save_file_entries().

static bool read_file ( cpp_reader pfile,
_cpp_file file 
) [static]

static bool read_file_guts ( cpp_reader pfile,
_cpp_file file 
) [static]

static char * read_filename_string ( int  ch,
FILE f 
) [static]

Definition at line 1192 of file files.c.

References EOF, getc(), is_space, len, ungetc(), xmalloc(), and xrealloc().

static void read_name_map ( cpp_dir dir  )  [static]

static char * remap_filename ( cpp_reader pfile,
_cpp_file file 
) [static]

static int report_missing_guard ( void **  slot,
void b 
) [static]

static struct file_hash_entry * search_cache ( struct file_hash_entry head,
const cpp_dir start_dir 
) [static, read]

Definition at line 858 of file files.c.

References file_hash_entry::next, and file_hash_entry::start_dir.

Referenced by _cpp_find_file().

static bool search_path_exhausted ( cpp_reader pfile,
const char *  header,
_cpp_file file 
) [static]

static struct cpp_dir * search_path_head ( cpp_reader pfile,
const char *  fname,
int  angle_brackets,
enum include_type  type 
) [static, read]

static bool should_stack_file ( cpp_reader pfile,
_cpp_file file,
bool  import 
) [static]

static bool validate_pch ( cpp_reader pfile,
_cpp_file file,
const char *  pchname 
) [static]


Variable Documentation

struct pchf_data* pchf [static]

Definition at line 1422 of file files.c.


Generated on Wed Apr 8 14:23:22 2009 for Open64 by  doxygen 1.5.6