osprey/kgccfe/gnu/fixinc/fixincl.c File Reference

#include "fixlib.h"
#include <signal.h>
#include "server.h"
#include "fixincl.x"

Include dependency graph for fixincl.c:

Go to the source code of this file.

Defines

#define _ENV_(v, m, n, t)   tCC* v = NULL;
#define VLEVEL(l)   ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT   VLEVEL(VERB_FIXES)
#define _ENV_(v, m, n, t)
#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 PARAMS ((void))
static void do_version ()
void initialize (int argc, char **argv)
char * load_file (char *fname) const
static int machine_matches PARAMS ((tFixDesc *))
static int machine_matches (tFixDesc *p_fixd)
void run_compiles ()
static FILEcreate_file ()
static int test_test PARAMS ((tTestDesc *, char *))
static int test_test (tTestDesc *p_test, char *pz_test_file)
static int egrep_test PARAMS ((char *, tTestDesc *))
static int egrep_test (char *pz_data, tTestDesc *p_test)
static int quoted_file_exists PARAMS ((const char *, const char *, const char *))
static int quoted_file_exists (char *pz_src_path, const char *pz_file_path, const char *pz_file) const
static void extract_quoted_files PARAMS ((char *, const char *, regmatch_t *))
static void extract_quoted_files (char *pz_data, const char *pz_fixed_file, regmatch_t *p_re_match)
static int internal_fix PARAMS ((int, tFixDesc *))
static int internal_fix (int read_fd, tFixDesc *p_fixd)
static int start_fixer PARAMS ((int, tFixDesc *, char *))
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 PARAMS ((int))
static void test_for_changes (int read_fd)
void process ()

Variables

static const char program_id [] = "fixincl version 1.1"
static const char z_std_preamble []
ENV_TABLE 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 _ENV_ ( v,
m,
n,
 ) 

Value:

{ tSCC var[] = n;  \
  v = getenv (var); if (m && (v == NULL)) { \
  fprintf (stderr, var_not_found, var);     \
  exit (EXIT_FAILURE); } }

Definition at line 55 of file fixincl.c.

#define _ENV_ ( v,
m,
n,
 )     tCC* v = NULL;

Definition at line 55 of file fixincl.c.

#define NOT_SILENT   VLEVEL(VERB_FIXES)

Definition at line 74 of file fixincl.c.

Referenced by create_file(), and load_file().

#define S_DIRALL   0755

Definition at line 557 of file fixincl.c.

Referenced by create_file().

#define S_IRALL   0644

Definition at line 549 of file fixincl.c.

Referenced by create_file().

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

Definition at line 73 of file fixincl.c.

Referenced by extract_quoted_files(), fix_applies(), and process().


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 61 of file fixincl.c.


Function Documentation

static FILE* create_file ( void   )  [static]

static void do_version ( void   )  [static]

Definition at line 195 of file fixincl.c.

References exit(), program_id, puts(), run_compiles(), run_shell(), sprintf(), strcmp(), and system().

Referenced by initialize().

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

Definition at line 684 of file fixincl.c.

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

Referenced by fix_applies().

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 ( char*  fname  )  const

static int machine_matches ( tFixDesc p_fixd  )  [static]

Definition at line 391 of file fixincl.c.

References BOOL_FALSE, BOOL_TRUE, FD_MACH_IFNOT, FD_SKIP_TEST, free(), run_shell(), skip, sprintf(), strlen(), strstr(), tCC, and tSCC.

Referenced by run_compiles().

static void test_for_changes PARAMS ( (int)   )  [static]

static int start_fixer PARAMS ( (int, tFixDesc *, char *)   )  [static]

static int internal_fix PARAMS ( (int, tFixDesc *)   )  [static]

static void extract_quoted_files PARAMS ( (char *, const char *, regmatch_t *)   )  [static]

static int quoted_file_exists PARAMS ( (const char *, const char *, const char *)   )  [static]

static int egrep_test PARAMS ( (char *, tTestDesc *)   )  [static]

static int test_test PARAMS ( (tTestDesc *, char *)   )  [static]

static int machine_matches PARAMS ( (tFixDesc *)   )  [static]

static void do_version PARAMS ( (void  )  [static]

Definition at line 98 of file fixincl.c.

void process ( void   ) 

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

Definition at line 707 of file fixincl.c.

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

Referenced by extract_quoted_files().

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]

Definition at line 1259 of file fixincl.c.

References close, create_file(), EOF, extract_quoted_files(), fclose(), fdopen, fwrite, getc(), putc(), pz_curr_data, pz_curr_file, and regexec.

Referenced by process().

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

Definition at line 628 of file fixincl.c.

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

Referenced by fix_applies().

static void write_replacement ( tFixDesc p_fixd  )  [static]

Definition at line 1232 of file fixincl.c.

References create_file(), fclose(), fputs(), and NUL.

Referenced by process().


Variable Documentation

Definition at line 82 of file fixincl.c.

Referenced by load_file().

Definition at line 83 of file fixincl.c.

Referenced by load_file().

Definition at line 84 of file fixincl.c.

Referenced by load_file(), and process().

ENV_TABLE int find_base_len = 0

Definition at line 59 of file fixincl.c.

Referenced by create_file(), and initialize().

int have_tty = 0

Definition at line 71 of file fixincl.c.

Referenced by process().

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

Definition at line 94 of file fixincl.c.

Referenced by run_compiles().

Definition at line 96 of file fixincl.c.

Definition at line 76 of file fixincl.c.

Referenced by process(), and start_fixer().

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

Definition at line 42 of file fixincl.c.

Referenced by do_version().

char* pz_curr_data

Definition at line 79 of file fixincl.c.

Referenced by fix_applies(), process(), and test_for_changes().

char* pz_curr_file

Definition at line 78 of file fixincl.c.

Referenced by create_file(), fix_applies(), internal_fix(), process(), and test_for_changes().

char* pz_temp_file

Definition at line 80 of file fixincl.c.

Referenced by initialize().

Definition at line 85 of file fixincl.c.

Referenced by load_file().

te_verbose verbose_level = VERB_PROGRESS

Definition at line 70 of file fixincl.c.

Referenced by initialize().

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

Definition at line 95 of file fixincl.c.

Referenced by internal_fix(), and start_fixer().

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 46 of file fixincl.c.

Referenced by create_file().


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