osprey-gcc-4.2.0/fixincludes/fixincl.c File Reference

#include "fixlib.h"
#include <sys/stat.h>
#include <sys/wait.h>
#include "server.h"
#include "fixincl.x"

Include dependency graph for fixincl.c:

Go to the source code of this file.

Defines

#define VLEVEL(l)   ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT   VLEVEL(VERB_FIXES)
#define S_IRALL   0644
#define S_DIRALL   0755

Enumerations

enum  te_verbose {
  VERB_SILENT = 0, VERB_FIXES, VERB_APPLIES, VERB_PROGRESS,
  VERB_TESTS, VERB_EVERYTHING, VERB_SILENT = 0, VERB_FIXES,
  VERB_APPLIES, VERB_PROGRESS, VERB_TESTS, VERB_EVERYTHING,
  VERB_SILENT = 0, VERB_FIXES, VERB_APPLIES, VERB_PROGRESS,
  VERB_TESTS, VERB_EVERYTHING
}

Functions/Subroutines

static void do_version (void)
void initialize (int argc, char **argv)
char * load_file (const char *fname)
static int machine_matches (tFixDesc *p_fixd)
void run_compiles (void)
static FILEcreate_file (void)
static int test_test (tTestDesc *p_test, char *pz_test_file)
static int egrep_test (char *pz_data, tTestDesc *p_test)
static int quoted_file_exists (const char *pz_src_path, const char *pz_file_path, const char *pz_file)
static void extract_quoted_files (char *pz_data, const char *pz_fixed_file, regmatch_t *p_re_match)
static int internal_fix (int read_fd, tFixDesc *p_fixd)
static int start_fixer (int read_fd, tFixDesc *p_fixd, char *pz_fix_file)
static t_bool fix_applies (tFixDesc *p_fixd)
static void write_replacement (tFixDesc *p_fixd)
static void test_for_changes (int read_fd)
void process (void)

Variables

static const char program_id [] = "fixincl version 1.1"
static const char z_std_preamble []
int find_base_len = 0
te_verbose verbose_level = VERB_PROGRESS
int have_tty = 0
pid_t process_chain_head = (pid_t) -1
char * pz_curr_file
char * pz_curr_data
char * pz_temp_file
t_bool curr_data_mapped
int data_map_fd
size_t data_map_size
size_t ttl_data_size = 0
const char incl_quote_pat [] = "^[ \t]*#[ \t]*include[ \t]*\"[^/]"
tSCC z_fork_err [] = "Error %d (%s) starting filter process for %s\n"
regex_t incl_quote_re


Define Documentation

#define NOT_SILENT   VLEVEL(VERB_FIXES)

Definition at line 69 of file fixincl.c.

#define S_DIRALL   0755

Definition at line 525 of file fixincl.c.

#define S_IRALL   0644

Definition at line 517 of file fixincl.c.

#define VLEVEL (  )     ((unsigned int) verbose_level >= (unsigned int) l)

Definition at line 68 of file fixincl.c.


Enumeration Type Documentation

enum te_verbose

Enumerator:
VERB_SILENT 
VERB_FIXES 
VERB_APPLIES 
VERB_PROGRESS 
VERB_TESTS 
VERB_EVERYTHING 
VERB_SILENT 
VERB_FIXES 
VERB_APPLIES 
VERB_PROGRESS 
VERB_TESTS 
VERB_EVERYTHING 
VERB_SILENT 
VERB_FIXES 
VERB_APPLIES 
VERB_PROGRESS 
VERB_TESTS 
VERB_EVERYTHING 

Definition at line 56 of file fixincl.c.


Function Documentation

static FILE* create_file ( void   )  [static]

static void do_version ( void   )  [static]

Definition at line 93 of file fixincl.c.

static int egrep_test ( char *  pz_data,
tTestDesc p_test 
) [static]

Definition at line 652 of file fixincl.c.

References APPLY_FIX, fprintf(), test_desc::p_test_regex, test_desc::pz_test_text, and SKIP_FIX.

static void extract_quoted_files ( char *  pz_data,
const char *  pz_fixed_file,
regmatch_t p_re_match 
) [static]

static t_bool fix_applies ( tFixDesc p_fixd  )  [static]

void initialize ( int  argc,
char **  argv 
)

static int internal_fix ( int  read_fd,
tFixDesc p_fixd 
) [static]

char* load_file ( const char *  fname  ) 

static int machine_matches ( tFixDesc p_fixd  )  [static]

void process ( void   ) 

static int quoted_file_exists ( const char *  pz_src_path,
const char *  pz_file_path,
const char *  pz_file 
) [static]

Definition at line 672 of file fixincl.c.

References ISGRAPH, MAXPATHLEN, S_ISREG, sprintf(), stat::st_mode, strlen(), and is::z.

void run_compiles ( void   ) 

static int start_fixer ( int  read_fd,
tFixDesc p_fixd,
char *  pz_fix_file 
) [static]

static void test_for_changes ( int  read_fd  )  [static]

static int test_test ( tTestDesc p_test,
char *  pz_test_file 
) [static]

Definition at line 598 of file fixincl.c.

References APPLY_FIX, fprintf(), free(), test_desc::pz_test_text, run_shell(), SKIP_FIX, sprintf(), and tSCC.

static void write_replacement ( tFixDesc p_fixd  )  [static]

Definition at line 1196 of file fixincl.c.

References create_file(), fclose(), fputc(), fwrite, NUL, fix_desc::patch_args, strlen(), and sz().


Variable Documentation

Definition at line 77 of file fixincl.c.

Definition at line 78 of file fixincl.c.

Definition at line 79 of file fixincl.c.

int find_base_len = 0

Definition at line 54 of file fixincl.c.

int have_tty = 0

Definition at line 66 of file fixincl.c.

const char incl_quote_pat[] = "^[ \t]*#[ \t]*include[ \t]*\"[^/]"

Definition at line 89 of file fixincl.c.

Definition at line 91 of file fixincl.c.

Definition at line 71 of file fixincl.c.

const char program_id[] = "fixincl version 1.1" [static]

Definition at line 43 of file fixincl.c.

char* pz_curr_data

Definition at line 74 of file fixincl.c.

char* pz_curr_file

Definition at line 73 of file fixincl.c.

char* pz_temp_file

Definition at line 75 of file fixincl.c.

Definition at line 80 of file fixincl.c.

te_verbose verbose_level = VERB_PROGRESS

Definition at line 65 of file fixincl.c.

tSCC z_fork_err[] = "Error %d (%s) starting filter process for %s\n"

Definition at line 90 of file fixincl.c.

const char z_std_preamble[] [static]

Initial value:

"/*  DO NOT EDIT THIS FILE.\n\n\
    It has been auto-edited by fixincludes from:\n\n\
\t\"%s/%s\"\n\n\
    This had to be done to correct non-standard usages in the\n\
    original, manufacturer supplied header file.  */\n\n"

Definition at line 47 of file fixincl.c.


Generated on Wed Apr 8 15:50:12 2009 for Open64 by  doxygen 1.5.6