#include "config.h"#include "system.h"#include "intl.h"#include "cppdefault.h"#include <setjmp.h>#include <signal.h>#include "version.h"#include "getopt.h"

Go to the source code of this file.
Data Types | |
| type | string_list |
| type | hash_table_entry_struct |
| type | file_info_struct |
| type | f_list_chain_item_struct |
| type | def_dec_info_struct |
Defines | |
| #define | IS_SAME_PATH_CHAR(a, b) ((a) == (b)) |
| #define | IS_SAME_PATH(a, b) (strcmp (a, b) == 0) |
| #define | AUX_INFO_SUFFIX ".X" |
| #define | SAVE_SUFFIX ".save" |
| #define | CPLUS_FILE_SUFFIX "C" |
| #define | NONCONST |
| #define | STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/" |
| #define | HASH_TABLE_SIZE (1 << 9) |
| #define | ddip _info._ddip |
| #define | fip _info._fip |
Typedefs | |
| typedef struct unexpansion_struct | unexpansion |
| typedef struct hash_table_entry_struct | hash_table_entry |
| typedef struct def_dec_info_struct | def_dec_info |
| typedef struct file_info_struct | file_info |
| typedef struct f_list_chain_item_struct | f_list_chain_item |
| typedef hash_table_entry | hash_table [HASH_TABLE_SIZE] |
Functions/Subroutines | |
| static void usage | PARAMS ((void)) |
| static struct string_list *string_list_cons | PARAMS ((const char *, struct string_list *)) |
| static int is_syscalls_file | PARAMS ((const file_info *)) |
| static void rename_c_file | PARAMS ((const hash_table_entry *)) |
| static const def_dec_info *find_extern_def | PARAMS ((const def_dec_info *, const def_dec_info *)) |
| static const def_dec_info *find_static_definition | PARAMS ((const def_dec_info *)) |
| static void add_local_decl | PARAMS ((const def_dec_info *, const char *)) |
| static void add_global_decls | PARAMS ((const file_info *, const char *)) |
| static void visit_each_hash_node | PARAMS ((const hash_table_entry *, void(*)(const hash_table_entry *))) |
| static hash_table_entry *add_symbol | PARAMS ((hash_table_entry *, const char *)) |
| static void free_def_dec | PARAMS ((def_dec_info *)) |
| static file_info *find_file | PARAMS ((const char *, int)) |
| static int edit_formals_lists | PARAMS ((const char *, unsigned int, const def_dec_info *)) |
| static void notice | VPARAMS ((const char *msgid,...)) |
| static char * | savestring (char *input, unsigned int size) const |
| void | fancy_abort () |
| static char * | dupnstr (char *s, size_t n) const |
| static const char * | substr (char *s1, const char *const s2) const |
| static int | safe_read (int desc, PTR ptr, int len) |
| static void | safe_write (int desc, PTR ptr, int len, const char *out_fname) |
| static void | save_pointers () |
| static void | restore_pointers () |
| static int | is_id_char (int ch) |
| static void | usage () |
| static int | in_system_include_dir (char *path) const |
| static int | is_syscalls_file (file_info *fi_p) const |
| static int | needs_to_be_converted (file_info *file_p) const |
| static int | directory_specified_p (char *name) const |
| static int | file_excluded_p (char *name) const |
| static struct string_list * | string_list_cons (char *string, struct string_list *rest) const |
| static void | visit_each_hash_node (hash_table_entry *hash_tab_p, func) const |
| static hash_table_entry * | add_symbol (hash_table_entry *p, const char *s) |
| static hash_table_entry * | lookup (hash_table_entry *hash_tab_p, const char *search_symbol) |
| static void | free_def_dec (def_dec_info *p) |
| static char * | unexpand_if_needed (char *aux_info_line) const |
| static int | is_abspath (char *path) const |
| static char * | abspath (char *cwd, const char *rel_filename) const |
| static const char * | shortpath (char *cwd, const char *filename) const |
| static file_info * | find_file (char *filename, int do_not_stat) const |
| static void | aux_info_corrupted () |
| static void | check_aux_info (int cond) |
| static const char * | find_corresponding_lparen (char *p) const |
| static int | referenced_file_is_newer (char *l, time_t aux_info_mtime) const |
| static void | save_def_or_dec (char *l, int is_syscalls) const |
| static void | munge_compile_params (char *params_list) const |
| static int | gen_aux_info_file (char *base_filename) const |
| static void | process_aux_info_file (char *base_source_filename, int keep_it, int is_syscalls) const |
| static void | rename_c_file (hash_table_entry *hp) const |
| static void | reverse_def_dec_list (hash_table_entry *hp) const |
| static const def_dec_info * | find_extern_def (def_dec_info *head, const def_dec_info *user) const |
| static const def_dec_info * | find_static_definition (def_dec_info *user) const |
| static void | connect_defs_and_decs (hash_table_entry *hp) const |
| static int | identify_lineno (char *clean_p) const |
| static void | declare_source_confusing (char *clean_p) const |
| static void | check_source (int cond, const char *clean_p) |
| static const char * | seek_to_line (int n) |
| static const char * | forward_to_next_token_char (char *ptr) const |
| static void | output_bytes (char *str, size_t len) const |
| static void | output_string (char *str) const |
| static void | output_up_to (char *p) const |
| static int | other_variable_style_function (char *ansi_header) const |
| static void | edit_fn_declaration (def_dec_info *def_dec_p, const char *volatile clean_text_p) const |
| static int | edit_formals_lists (char *end_formals, unsigned int f_list_count, const def_dec_info *def_dec_p) const |
| static const char * | find_rightmost_formals_list (char *clean_text_p) const |
| static void | add_local_decl (def_dec_info *def_dec_p, const char *clean_text_p) const |
| static void | add_global_decls (file_info *file_p, const char *clean_text_p) const |
| static void | edit_fn_definition (def_dec_info *def_dec_p, const char *clean_text_p) const |
| static void | do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit) |
| static const char * | careful_find_l_paren (char *p) const |
| static void | scan_for_missed_items (file_info *file_p) const |
| static void | edit_file (hash_table_entry *hp) const |
| static void | do_processing () |
| int main | PARAMS ((int, char **const)) |
| int | main (int argc, char **const argv) |
Variables | |
| static const unexpansion | unexpansions [] |
| static const int | hash_mask = (HASH_TABLE_SIZE - 1) |
| struct string_list * | directory_list |
| struct string_list * | exclude_list |
| static const char *const | other_var_style = "varargs" |
| static const char * | varargs_style_indicator = STRINGX (va_alist) |
| static const char * | pname |
| static int | errors = 0 |
| static const char * | compiler_file_name = "gcc" |
| static int | version_flag = 0 |
| static int | quiet_flag = 0 |
| static int | nochange_flag = 0 |
| static int | nosave_flag = 0 |
| static int | keep_flag = 0 |
| static const char ** | compile_params = 0 |
| static int | local_flag = 0 |
| static int | global_flag = 0 |
| static int | cplusplus_flag = 0 |
| static const char * | nondefault_syscalls_dir = 0 |
| static int | input_file_name_index = 0 |
| static int | aux_info_file_name_index = 0 |
| static int | n_base_source_files = 0 |
| static const char ** | base_source_filenames |
| static int | current_aux_info_lineno |
| static const char * | convert_filename |
| static const char * | invocation_filename |
| static const char * | orig_text_base |
| static const char * | orig_text_limit |
| static const char * | clean_text_base |
| static const char * | clean_text_limit |
| static const char * | clean_read_ptr |
| static char * | repl_text_base |
| static char * | repl_text_limit |
| static char * | repl_write_ptr |
| static const char * | last_known_line_start |
| static int | last_known_line_number |
| static hash_table | filename_primary |
| static hash_table | function_name_primary |
| static jmp_buf | source_confusion_recovery |
| static char * | cwd_buffer |
| static const char * | saved_clean_read_ptr |
| static char * | saved_repl_write_ptr |
| static struct option | longopts [] |
| #define AUX_INFO_SUFFIX ".X" |
Definition at line 59 of file protoize.c.
| #define CPLUS_FILE_SUFFIX "C" |
Definition at line 73 of file protoize.c.
| #define ddip _info._ddip |
Definition at line 294 of file protoize.c.
| #define fip _info._fip |
| #define HASH_TABLE_SIZE (1 << 9) |
Definition at line 188 of file protoize.c.
| #define NONCONST |
Referenced by add_global_decls(), connect_defs_and_decs(), edit_fn_definition(), find_extern_def(), free_def_dec(), and save_def_or_dec().
| #define SAVE_SUFFIX ".save" |
Definition at line 66 of file protoize.c.
| #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/" |
| typedef struct def_dec_info_struct def_dec_info |
Definition at line 245 of file protoize.c.
Definition at line 247 of file protoize.c.
| typedef struct file_info_struct file_info |
Definition at line 246 of file protoize.c.
| typedef hash_table_entry hash_table[HASH_TABLE_SIZE] |
Definition at line 299 of file protoize.c.
Definition at line 241 of file protoize.c.
| typedef struct unexpansion_struct unexpansion |
Definition at line 170 of file protoize.c.
| static char* abspath | ( | char * | cwd, | |
| const char * | rel_filename | |||
| ) | const [static] |
Definition at line 1142 of file protoize.c.
References alloca, DIR_SEPARATOR, exit(), FATAL_EXIT_CODE, inp, is_abspath(), IS_DIR_SEPARATOR, notice(), outp, savestring(), and strlen().
Referenced by main(), referenced_file_is_newer(), save_def_or_dec(), and shortpath().
Definition at line 3546 of file protoize.c.
References def_dec_info_struct::ansi_decl, check_source(), def_dec_info_struct::definition, def_dec_info_struct::file, find_rightmost_formals_list(), def_dec_info_struct::is_implicit, ISSPACE, def_dec_info_struct::next_in_file, NONCONST, notice(), NULL, output_string(), output_up_to(), restore_pointers(), save_pointers(), setjmp(), shortpath(), and def_dec_info_struct::written.
Referenced by edit_file().
| static void add_local_decl | ( | def_dec_info * | def_dec_p, | |
| const char * | clean_text_p | |||
| ) | const [static] |
Definition at line 3439 of file protoize.c.
References check_source(), forward_to_next_token_char(), ISSPACE, notice(), output_bytes(), output_string(), output_up_to(), restore_pointers(), save_pointers(), setjmp(), and sp.
Referenced by edit_file().
| static hash_table_entry* add_symbol | ( | hash_table_entry * | p, | |
| const char * | s | |||
| ) | [static] |
Definition at line 1393 of file protoize.c.
References exit(), FATAL_EXIT_CODE, and notice().
Referenced by check_aux_info().
| static const char* careful_find_l_paren | ( | char * | p | ) | const [static] |
Definition at line 3887 of file protoize.c.
References check_source(), and q.
Referenced by scan_for_missed_items().
| static void check_aux_info | ( | int | cond | ) | [static] |
Definition at line 1404 of file protoize.c.
References aux_info_corrupted().
Referenced by referenced_file_is_newer(), and save_def_or_dec().
| static void check_source | ( | int | cond, | |
| const char * | clean_p | |||
| ) | [static] |
Definition at line 2830 of file protoize.c.
References declare_source_confusing().
Referenced by add_global_decls(), add_local_decl(), careful_find_l_paren(), edit_fn_declaration(), edit_fn_definition(), edit_formals_lists(), find_rightmost_formals_list(), forward_to_next_token_char(), scan_for_missed_items(), and seek_to_line().
| static void connect_defs_and_decs | ( | hash_table_entry * | hp | ) | const [static] |
Definition at line 2669 of file protoize.c.
References def_dec_info_struct::definition, def_dec_info_struct::file, find_extern_def(), find_static_definition(), def_dec_info_struct::is_func_def, def_dec_info_struct::is_static, def_dec_info_struct::next_for_func, NONCONST, NULL, and def_dec_info_struct::prototyped.
Referenced by do_processing().
| static void declare_source_confusing | ( | char * | clean_p | ) | const [static] |
Definition at line 2809 of file protoize.c.
References identify_lineno(), longjmp(), notice(), NULL, and shortpath().
Referenced by check_source().
| static int directory_specified_p | ( | char * | name | ) | const [static] |
Definition at line 878 of file protoize.c.
References IS_DIR_SEPARATOR, string_list::name, string_list::next, p, q, strlen(), and strncmp().
Referenced by edit_file().
| static void do_cleaning | ( | char * | new_clean_text_base, | |
| const char * | new_clean_text_limit | |||
| ) | [static] |
Definition at line 3781 of file protoize.c.
References abort, and ISSPACE.
Referenced by edit_file().
Definition at line 4382 of file protoize.c.
References connect_defs_and_decs(), DIR_SEPARATOR, edit_file(), GET_ENVIRONMENT, IS_DIR_SEPARATOR, process_aux_info_file(), rename_c_file(), reverse_def_dec_list(), strcat(), strcpy, strlen(), visit_each_hash_node(), and xmalloc().
Referenced by main().
| static char* dupnstr | ( | char * | s, | |
| size_t | n | |||
| ) | const [static] |
Definition at line 550 of file protoize.c.
References strncpy(), and xmalloc().
Referenced by edit_formals_lists(), munge_compile_params(), and save_def_or_dec().
| static void edit_file | ( | hash_table_entry * | hp | ) | const [static] |
Definition at line 4042 of file protoize.c.
References access, add_global_decls(), add_local_decl(), alloca, chmod(), close, creat, def_dec_info_struct::definition, directory_specified_p(), do_cleaning(), edit_fn_declaration(), edit_fn_definition(), ENOENT, errno, F_OK, fflush(), def_dec_info_struct::file, file_excluded_p(), free(), in_system_include_dir(), def_dec_info_struct::is_func_def, def_dec_info_struct::is_implicit, def_dec_info_struct::line, memcpy, needs_to_be_converted(), def_dec_info_struct::next_in_file, notice(), NULL, O_BINARY, O_RDONLY, open, output_up_to(), def_dec_info_struct::prototyped, rename(), safe_read(), safe_write(), scan_for_missed_items(), seek_to_line(), setmode(), shortpath(), stat::st_mode, stat::st_size, strcat(), strcpy, strlen(), unlink, xmalloc(), and xstrerror().
Referenced by do_processing().
| static void edit_fn_declaration | ( | def_dec_info * | def_dec_p, | |
| const char *volatile | clean_text_p | |||
| ) | const [static] |
Definition at line 2994 of file protoize.c.
References def_dec_info_struct::ansi_decl, f_list_chain_item_struct::chain_next, check_source(), def_dec_info_struct::f_list_chain, f_list_chain_item_struct::formals_list, forward_to_next_token_char(), is_id_char(), notice(), NULL, other_variable_style_function(), output_string(), output_up_to(), restore_pointers(), save_pointers(), setjmp(), shortpath(), strlen(), and strncmp().
Referenced by edit_file().
| static void edit_fn_definition | ( | def_dec_info * | def_dec_p, | |
| const char * | clean_text_p | |||
| ) | const [static] |
Definition at line 3637 of file protoize.c.
References check_source(), edit_formals_lists(), find_rightmost_formals_list(), identify_lineno(), ISSPACE, NONCONST, notice(), NULL, other_variable_style_function(), output_bytes(), output_string(), output_up_to(), restore_pointers(), save_pointers(), scan(), setjmp(), shortpath(), and strlen().
Referenced by edit_file().
| static int edit_formals_lists | ( | char * | end_formals, | |
| unsigned int | f_list_count, | |||
| const def_dec_info * | def_dec_p | |||
| ) | const [static] |
Definition at line 3210 of file protoize.c.
References f_list_chain_item_struct::chain_next, check_source(), dupnstr(), def_dec_info_struct::f_list_chain, def_dec_info_struct::file, f_list_chain_item_struct::formals_list, def_dec_info_struct::hash_entry, identify_lineno(), is_id_char(), ISSPACE, notice(), NULL, output_string(), output_up_to(), shortpath(), strlen(), strncmp(), and hash_table_entry_struct::symbol.
Referenced by edit_fn_definition(), and edit_formals_lists().
| static int file_excluded_p | ( | char * | name | ) | const [static] |
Definition at line 905 of file protoize.c.
References IS_DIR_SEPARATOR, len, string_list::name, string_list::next, p, strcmp(), and strlen().
Referenced by edit_file().
| static const char* find_corresponding_lparen | ( | char * | p | ) | const [static] |
| static const def_dec_info* find_extern_def | ( | def_dec_info * | head, | |
| const def_dec_info * | user | |||
| ) | const [static] |
Definition at line 2456 of file protoize.c.
References alloca, def_dec_info_struct::ansi_decl, def_dec_info_struct::file, fprintf(), def_dec_info_struct::hash_entry, in_system_include_dir(), def_dec_info_struct::is_func_def, def_dec_info_struct::is_static, is_syscalls_file(), def_dec_info_struct::line, def_dec_info_struct::next_for_func, NONCONST, notice(), NULL, p, def_dec_info_struct::prototyped, shortpath(), strcpy, strlen(), substr(), and hash_table_entry_struct::symbol.
Referenced by connect_defs_and_decs().
| static file_info* find_file | ( | char * | filename, | |
| int | do_not_stat | |||
| ) | const [static] |
Definition at line 1350 of file protoize.c.
References errno, lookup(), notice(), NULL, shortpath(), stat::st_mtime, xmalloc(), and xstrerror().
Referenced by do_spec_1(), do_spec_2(), main(), referenced_file_is_newer(), and save_def_or_dec().
| static const char* find_rightmost_formals_list | ( | char * | clean_text_p | ) | const [static] |
Definition at line 3321 of file protoize.c.
References check_source(), forward_to_next_token_char(), ISALPHA, and ISSPACE.
Referenced by add_global_decls(), and edit_fn_definition().
| static const def_dec_info* find_static_definition | ( | def_dec_info * | user | ) | const [static] |
Definition at line 2619 of file protoize.c.
References def_dec_info_struct::file, def_dec_info_struct::hash_entry, def_dec_info_struct::is_func_def, def_dec_info_struct::is_static, def_dec_info_struct::next_for_func, notice(), NULL, shortpath(), and hash_table_entry_struct::symbol.
Referenced by connect_defs_and_decs().
| static const char* forward_to_next_token_char | ( | char * | ptr | ) | const [static] |
Definition at line 2874 of file protoize.c.
References check_source(), and ISSPACE.
Referenced by add_local_decl(), edit_fn_declaration(), and find_rightmost_formals_list().
| static void free_def_dec | ( | def_dec_info * | p | ) | [static] |
Definition at line 1018 of file protoize.c.
References f_list_chain_item_struct::chain_next, free(), next, and NONCONST.
Referenced by save_def_or_dec().
| static int gen_aux_info_file | ( | char * | base_filename | ) | const [static] |
Definition at line 1976 of file protoize.c.
References abort, concat(), errno, fprintf(), munge_compile_params(), notice(), NULL, pexecute(), PEXECUTE_FIRST, PEXECUTE_LAST, PEXECUTE_SEARCH, pid, pwait(), shortpath(), WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG, and xstrerror().
Referenced by process_aux_info_file().
| static int identify_lineno | ( | char * | clean_p | ) | const [static] |
Definition at line 2794 of file protoize.c.
Referenced by declare_source_confusing(), edit_fn_definition(), edit_formals_lists(), and scan_for_missed_items().
| static int in_system_include_dir | ( | char * | path | ) | const [static] |
Definition at line 692 of file protoize.c.
References abort, cpp_include_defaults, default_include::fname, is_abspath(), IS_DIR_SEPARATOR, p, strlen(), and strncmp().
Referenced by edit_file(), and find_extern_def().
| static int is_abspath | ( | char * | path | ) | const [static] |
Definition at line 1120 of file protoize.c.
References HAVE_DOS_BASED_FILE_SYSTEM, and IS_DIR_SEPARATOR.
Referenced by abspath(), in_system_include_dir(), and process_aux_info_file().
| static int is_id_char | ( | int | ch | ) | [static] |
Definition at line 665 of file protoize.c.
References ISIDNUM.
Referenced by edit_fn_declaration(), edit_formals_lists(), other_variable_style_function(), save_def_or_dec(), scan_for_missed_items(), and unexpand_if_needed().
| static int is_syscalls_file | ( | file_info * | fi_p | ) | const [static] |
Definition at line 819 of file protoize.c.
References f, strcmp(), and strlen().
Referenced by find_extern_def(), and needs_to_be_converted().
| static hash_table_entry* lookup | ( | hash_table_entry * | hash_tab_p, | |
| const char * | search_symbol | |||
| ) | [static] |
Definition at line 985 of file protoize.c.
References add_symbol(), hash_table_entry_struct::hash_next, p, strcmp(), hash_table_entry_struct::symbol, and xmalloc().
| int main | ( | int argc | , | |
| char **const | argv | |||
| ) |
Definition at line 4510 of file protoize.c.
References abspath(), c, DIR_SEPARATOR, DIR_SEPARATOR_2, do_processing(), EOF, errno, FATAL_EXIT_CODE, fprintf(), gcc_init_libintl, getopt_long(), getpwd(), ISIDNUM, len, munge_compile_params(), notice(), NULL, optarg, optind, savestring(), shortpath(), signal(), string_list_cons(), strlen(), strrchr(), SUCCESS_EXIT_CODE, usage(), version_string, xmalloc(), and xstrerror().
| static void munge_compile_params | ( | char * | params_list | ) | const [static] |
Definition at line 1890 of file protoize.c.
References access, alloca, dupnstr(), HOST_BIT_BUCKET, ISSPACE, memcpy, NULL, S_ISDIR, stat::st_mode, strlen(), W_OK, and xmalloc().
Referenced by gen_aux_info_file(), and main().
| static int needs_to_be_converted | ( | file_info * | file_p | ) | const [static] |
Definition at line 839 of file protoize.c.
References def_dec_info_struct::definition, def_dec_info_struct::is_func_def, is_syscalls_file(), def_dec_info_struct::next_in_file, and def_dec_info_struct::prototyped.
Referenced by edit_file().
| static int other_variable_style_function | ( | char * | ansi_header | ) | const [static] |
Definition at line 2955 of file protoize.c.
References is_id_char(), len, p, strlen(), and substr().
Referenced by edit_fn_declaration(), and edit_fn_definition().
Definition at line 2888 of file protoize.c.
References memcpy, and xrealloc().
Referenced by add_local_decl(), edit_fn_definition(), output_string(), and output_up_to().
| static void output_string | ( | char * | str | ) | const [static] |
Definition at line 2909 of file protoize.c.
References output_bytes(), and strlen().
Referenced by add_global_decls(), add_local_decl(), IF_CONVERTOR::Convert_Candidates(), edit_fn_declaration(), edit_fn_definition(), and edit_formals_lists().
| static void output_up_to | ( | char * | p | ) | const [static] |
Definition at line 2935 of file protoize.c.
References output_bytes().
Referenced by add_global_decls(), add_local_decl(), edit_file(), edit_fn_declaration(), edit_fn_definition(), and edit_formals_lists().
| int main PARAMS | ( | (int, char **const) | ) |
| static int edit_formals_lists PARAMS | ( | (const char *, unsigned int, const def_dec_info *) | ) | [static] |
| static file_info* find_file PARAMS | ( | (const char *, int) | ) | [static] |
| static void free_def_dec PARAMS | ( | (def_dec_info *) | ) | [static] |
| static hash_table_entry* add_symbol PARAMS | ( | (hash_table_entry *, const char *) | ) | [static] |
| static void visit_each_hash_node PARAMS | ( | (const hash_table_entry *, void(*)(const hash_table_entry *)) | ) | [static] |
| static void add_local_decl PARAMS | ( | (const def_dec_info *, const char *) | ) | [static] |
| static const def_dec_info* find_static_definition PARAMS | ( | (const def_dec_info *) | ) | [static] |
| static const def_dec_info* find_extern_def PARAMS | ( | (const def_dec_info *, const def_dec_info *) | ) | [static] |
| static void rename_c_file PARAMS | ( | (const hash_table_entry *) | ) | [static] |
| static int is_syscalls_file PARAMS | ( | (const file_info *) | ) | [static] |
| static struct string_list* string_list_cons PARAMS | ( | (const char *, struct string_list *) | ) | [static, read] |
Definition at line 76 of file protoize.c.
| static void process_aux_info_file | ( | char * | base_source_filename, | |
| int | keep_it, | |||
| int | is_syscalls | |||
| ) | const [static] |
Definition at line 2039 of file protoize.c.
References access, alloca, aux_info_file, aux_info_file_name, close, DIR_SEPARATOR, DIR_SEPARATOR_2, ENOENT, errno, free(), gen_aux_info_file(), HAVE_DOS_BASED_FILE_SYSTEM, is_abspath(), IS_DIR_SEPARATOR, notice(), NULL, O_BINARY, O_RDONLY, open, p, R_OK, referenced_file_is_newer(), safe_read(), save_def_or_dec(), shortpath(), stat::st_mtime, stat::st_size, stat, strcat(), strcpy, strlen(), strrchr(), unexpand_if_needed(), unlink, xmalloc(), and xstrerror().
Referenced by do_processing().
| static int referenced_file_is_newer | ( | char * | l, | |
| time_t | aux_info_mtime | |||
| ) | const [static] |
Definition at line 1443 of file protoize.c.
References abspath(), alloca, check_aux_info(), filename, find_file(), HAVE_DOS_BASED_FILE_SYSTEM, IS_DIR_SEPARATOR, p, and strncpy().
Referenced by process_aux_info_file().
| static void rename_c_file | ( | hash_table_entry * | hp | ) | const [static] |
Definition at line 2371 of file protoize.c.
References alloca, errno, filename, IS_SAME_PATH, notice(), NULL, rename(), shortpath(), strcpy, strlen(), and xstrerror().
Referenced by do_processing().
Definition at line 656 of file protoize.c.
Referenced by add_global_decls(), add_local_decl(), edit_fn_declaration(), and edit_fn_definition().
| static void reverse_def_dec_list | ( | hash_table_entry * | hp | ) | const [static] |
Definition at line 2414 of file protoize.c.
References if(), next, def_dec_info_struct::next_in_file, NULL, and prev.
Referenced by do_processing().
| static int safe_read | ( | int | desc, | |
| PTR | ptr, | |||
| int | len | |||
| ) | [static] |
Definition at line 618 of file protoize.c.
References errno, notice(), NULL, shortpath(), write, and xstrerror().
Referenced by edit_file().
| static void save_def_or_dec | ( | char * | l, | |
| int | is_syscalls | |||
| ) | const [static] |
Definition at line 1495 of file protoize.c.
References abspath(), alloca, def_dec_info_struct::ansi_decl, atoi(), f_list_chain_item_struct::chain_next, check_aux_info(), def_dec_info_struct::definition, dupnstr(), exit(), def_dec_info_struct::f_list_chain, def_dec_info_struct::f_list_count, FATAL_EXIT_CODE, def_dec_info_struct::file, filename, find_corresponding_lparen(), find_file(), f_list_chain_item_struct::formals_list, free_def_dec(), def_dec_info_struct::hash_entry, HAVE_DOS_BASED_FILE_SYSTEM, IS_DIR_SEPARATOR, def_dec_info_struct::is_func_def, is_id_char(), def_dec_info_struct::is_implicit, def_dec_info_struct::is_static, def_dec_info_struct::line, line_number, lookup(), next, def_dec_info_struct::next_for_func, def_dec_info_struct::next_in_file, NONCONST, notice(), NULL, p, prev, def_dec_info_struct::prototyped, strcmp(), strncmp(), strncpy(), hash_table_entry_struct::symbol, def_dec_info_struct::written, and xmalloc().
Referenced by process_aux_info_file().
Definition at line 646 of file protoize.c.
Referenced by add_global_decls(), add_local_decl(), edit_fn_declaration(), and edit_fn_definition().
| static char* savestring | ( | char * | input, | |
| unsigned int | size | |||
| ) | const [static] |
Definition at line 527 of file protoize.c.
References strcpy, and xmalloc().
Referenced by abspath(), main(), and unexpand_if_needed().
Definition at line 3926 of file protoize.c.
References alloca, careful_find_l_paren(), check_source(), func_name, identify_lineno(), def_dec_info_struct::is_func_def, is_id_char(), ISALPHA, ISSPACE, def_dec_info_struct::line, lineno, def_dec_info_struct::next_in_file, notice(), NULL, setjmp(), shortpath(), strcmp(), and strncpy().
Referenced by edit_file().
| static const char* seek_to_line | ( | int | n | ) | [static] |
Definition at line 2854 of file protoize.c.
References abort, and check_source().
Referenced by edit_file().
| static const char* shortpath | ( | char * | cwd, | |
| const char * | filename | |||
| ) | const [static] |
Definition at line 1261 of file protoize.c.
References abspath(), DIR_SEPARATOR, IS_DIR_SEPARATOR, IS_SAME_PATH_CHAR, strlen(), and xmalloc().
Referenced by add_global_decls(), declare_source_confusing(), edit_file(), edit_fn_declaration(), edit_fn_definition(), edit_formals_lists(), find_extern_def(), find_file(), find_static_definition(), gen_aux_info_file(), main(), process_aux_info_file(), rename_c_file(), safe_write(), and scan_for_missed_items().
| static struct string_list* string_list_cons | ( | char * | string, | |
| struct string_list * | rest | |||
| ) | const [static, read] |
Definition at line 923 of file protoize.c.
References string_list::name, string_list::next, and xmalloc().
Referenced by main().
| static const char* substr | ( | char * | s1, | |
| const char *const | s2 | |||
| ) | const [static] |
Definition at line 565 of file protoize.c.
Referenced by find_extern_def(), and other_variable_style_function().
| static char* unexpand_if_needed | ( | char * | aux_info_line | ) | const [static] |
Definition at line 1045 of file protoize.c.
References is_id_char(), len, line_buf, offset, s, savestring(), size, strcpy, strlen(), strncmp(), xmalloc(), and xrealloc().
Referenced by process_aux_info_file().
| static void visit_each_hash_node | ( | hash_table_entry * | hash_tab_p, | |
| func | ||||
| ) | const [static] |
Definition at line 945 of file protoize.c.
References hash_table_entry_struct::hash_next, HASH_TABLE_SIZE, second(), and hash_table_entry_struct::symbol.
Referenced by do_processing().
Definition at line 514 of file protoize.c.
References _, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and vfprintf().
int aux_info_file_name_index = 0 [static] |
Definition at line 405 of file protoize.c.
const char** base_source_filenames [static] |
Definition at line 414 of file protoize.c.
const char* clean_read_ptr [static] |
Definition at line 455 of file protoize.c.
const char* clean_text_base [static] |
Definition at line 445 of file protoize.c.
const char* clean_text_limit [static] |
Definition at line 450 of file protoize.c.
const char** compile_params = 0 [static] |
Definition at line 385 of file protoize.c.
const char* compiler_file_name = "gcc" [static] |
Definition at line 377 of file protoize.c.
const char* convert_filename [static] |
int cplusplus_flag = 0 [static] |
Definition at line 392 of file protoize.c.
int current_aux_info_lineno [static] |
Definition at line 420 of file protoize.c.
char* cwd_buffer [static] |
Definition at line 207 of file protoize.c.
int errors = 0 [static] |
Definition at line 369 of file protoize.c.
Definition at line 213 of file protoize.c.
hash_table filename_primary [static] |
Definition at line 487 of file protoize.c.
hash_table function_name_primary [static] |
Definition at line 491 of file protoize.c.
int global_flag = 0 [static] |
Definition at line 391 of file protoize.c.
const int hash_mask = (HASH_TABLE_SIZE - 1) [static] |
Definition at line 192 of file protoize.c.
int input_file_name_index = 0 [static] |
Definition at line 401 of file protoize.c.
const char* invocation_filename [static] |
Definition at line 430 of file protoize.c.
int keep_flag = 0 [static] |
Definition at line 384 of file protoize.c.
int last_known_line_number [static] |
Definition at line 483 of file protoize.c.
const char* last_known_line_start [static] |
Definition at line 477 of file protoize.c.
int local_flag = 0 [static] |
Definition at line 390 of file protoize.c.
Initial value:
{
{"version", 0, 0, 'V'},
{"file_name", 0, 0, 'p'},
{"quiet", 0, 0, 'q'},
{"silent", 0, 0, 'q'},
{"force", 0, 0, 'f'},
{"keep", 0, 0, 'k'},
{"nosave", 0, 0, 'N'},
{"nochange", 0, 0, 'n'},
{"compiler-options", 1, 0, 'c'},
{"exclude", 1, 0, 'x'},
{"directory", 1, 0, 'd'},
{"local", 0, 0, 'l'},
{"global", 0, 0, 'g'},
{"c++", 0, 0, 'C'},
{"syscalls-dir", 1, 0, 'B'},
{0, 0, 0, 0}
}
Definition at line 4483 of file protoize.c.
Referenced by parse_args().
int n_base_source_files = 0 [static] |
Definition at line 409 of file protoize.c.
int nochange_flag = 0 [static] |
Definition at line 381 of file protoize.c.
const char* nondefault_syscalls_dir = 0 [static] |
Definition at line 393 of file protoize.c.
int nosave_flag = 0 [static] |
Definition at line 383 of file protoize.c.
const char* orig_text_base [static] |
const char* orig_text_limit [static] |
Definition at line 440 of file protoize.c.
const char* const other_var_style = "varargs" [static] |
Definition at line 227 of file protoize.c.
const char* pname [static] |
Definition at line 364 of file protoize.c.
Referenced by _stat(), EH_Build_PIC_Type(), EKAPI_RegInfo4Name(), expand_builtin_va_arg(), mpw_fopen(), print_insn(), print_operand(), PU_Profile_Handle::PU_Profile_Handle(), and utime().
int quiet_flag = 0 [static] |
Definition at line 380 of file protoize.c.
char* repl_text_base [static] |
Definition at line 460 of file protoize.c.
char* repl_text_limit [static] |
Definition at line 465 of file protoize.c.
char* repl_write_ptr [static] |
Definition at line 471 of file protoize.c.
const char* saved_clean_read_ptr [static] |
Definition at line 505 of file protoize.c.
char* saved_repl_write_ptr [static] |
Definition at line 510 of file protoize.c.
jmp_buf source_confusion_recovery [static] |
Definition at line 496 of file protoize.c.
const unexpansion unexpansions[] [static] |
const char* varargs_style_indicator = STRINGX (va_alist) [static] |
Definition at line 230 of file protoize.c.
int version_flag = 0 [static] |
1.5.6