#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/utsname.h>#include <time.h>#include <unistd.h>#include <errno.h>#include "phases.h"#include "lang_defs.h"#include "string_utils.h"#include "file_names.h"#include "file_utils.h"#include "errors.h"#include "opt_actions.h"#include "option_seen.h"#include "option_names.h"#include "run.h"#include "version.h"

Go to the source code of this file.
Defines | |
| #define | DEFAULT_TMPDIR "/tmp" |
Functions/Subroutines | |
| char * | get_object_file (char *src) |
| char * | create_temp_file_name (char *suffix) |
| char * | construct_name (char *src, char *suffix) |
| char * | construct_given_name (char *src, char *suffix, boolean keep) |
| void | mark_saved_object_for_cleanup (void) |
| char * | construct_file_with_extension (char *src, char *ext) |
| void | init_temp_files (void) |
| void | init_count_files (void) |
| void | init_crash_reporting (void) |
| if (mkstemp(report_file)==-1) | |
| static int | save_cpp_output (char *path) |
| void | cleanup (void) |
| void | mark_for_cleanup (char *s) |
| void | cleanup_temp_objects () |
Variables | |
| int | errno |
| boolean | keep_flag = FALSE |
| string_list_t * | count_files = NULL |
| static string_list_t * | temp_files = NULL |
| static char * | tmpdir |
| static char * | saved_object = NULL |
| static string_pair_list_t * | temp_obj_files = NULL |
| static char * | report_file |
| bail | __pad0__ |
| static int | save_count |
| #define DEFAULT_TMPDIR "/tmp" |
Definition at line 82 of file file_names.c.
Definition at line 523 of file file_names.c.
References debug, ENOENT, errno, fprintf(), string_list_rec::head, internal_error(), internal_error_occurred, string_item_rec::name, string_item_rec::next, NULL, p, perror(), printf(), program_name, save_cpp_output(), string_list_rec::tail, and unlink.
| void cleanup_temp_objects | ( | ) |
Definition at line 567 of file file_names.c.
References ENOENT, errno, FOREACH_STRING_PAIR, internal_error(), p, perror(), program_name, s, STRING_PAIR_VAL, and unlink.
Referenced by if().
| char* construct_file_with_extension | ( | char * | src, | |
| char * | ext | |||
| ) |
Definition at line 266 of file file_names.c.
References change_suffix(), and drop_path().
Referenced by add_file_args(), and run_compiler().
| char* construct_given_name | ( | char * | src, | |
| char * | suffix, | |||
| boolean | keep | |||
| ) |
Definition at line 244 of file file_names.c.
References add_string_if_new(), change_suffix(), current_phase, drop_path(), remember_last_phase, s, and string_copy().
Referenced by add_file_args(), run_ld(), and run_phase().
| char* construct_name | ( | char * | src, | |
| char * | suffix | |||
| ) |
Definition at line 223 of file file_names.c.
References change_suffix(), create_temp_file_name(), current_phase, drop_path(), get_suffix(), keep_flag, option_was_seen(), outfile, and remember_last_phase.
Referenced by add_file_args().
| char* create_temp_file_name | ( | char * | suffix | ) |
Definition at line 179 of file file_names.c.
References add_string(), buf, fd, string_list_rec::head, internal_error(), mkstemp(), mktemp, string_item_rec::name, string_item_rec::next, NULL, p, s, sprintf(), strchr, string_copy(), strlen(), strncmp(), and tmpdir.
Referenced by add_command_line_arg(), add_file_args(), construct_name(), find_full_path_of_gcc_file(), init_crt_paths(), and init_stdc_plus_plus_path().
| char* get_object_file | ( | char * | src | ) |
Definition at line 128 of file file_names.c.
References add_string_pair(), buf, change_suffix(), drop_path(), FOREACH_STRING_PAIR, keep_flag, option_was_seen(), p, P_any_as, remember_last_phase, sprintf(), strcmp(), STRING_PAIR_KEY, STRING_PAIR_VAL, tempnam, tmpdir, and TRUE.
Referenced by add_file_args(), check_makedepend_flags(), if(), and main().
| if | ( | mkstemp(report_file) | = = -1 |
) |
Definition at line 317 of file file_names.c.
References asprintf(), getenv(), NULL, and tmpdir.
Referenced by main().
Definition at line 272 of file file_names.c.
References buf, DEFAULT_TMPDIR, directory_is_writable(), error(), getenv(), init_string_list(), init_string_pair_list(), is_dir_separator, is_directory(), NULL, string_copy(), strlen(), and tmpdir.
Referenced by main().
| void mark_for_cleanup | ( | char * | s | ) |
Definition at line 561 of file file_names.c.
References add_string_if_new().
Referenced by add_file_args().
Definition at line 258 of file file_names.c.
References add_string_if_new(), NULL, and saved_object.
Referenced by run_ld().
| static int save_cpp_output | ( | char * | path | ) | [static] |
Definition at line 349 of file file_names.c.
References ABI_N32, asprintf(), buf, build_date, build_host, build_root, build_user, compiler_version, cset_id, ctime(), drop_path(), errno, error_list, fclose(), fgets(), fopen, FOREACH_STRING, fprintf(), fputs(), fread, fwrite, getenv(), len, mkdir(), mkstemp(), newline, NULL, program_name, putc(), quote_shell_arg(), rename(), saved_argc, saved_argv, stat::st_size, stat, strcmp(), strerror(), string_list_size(), STRING_NAME, strlen(), strncmp(), time, tmpdir, and uname().
Referenced by cleanup().
| bail __pad0__ |
Definition at line 343 of file file_names.c.
| string_list_t* count_files = NULL |
Definition at line 73 of file file_names.c.
Referenced by add_file_args(), if(), and Process_fbuse().
| int errno |
Definition at line 71 of file file_names.c.
Referenced by add_file_args(), add_special_options(), construct_name(), get_object_file(), prescan_options(), and run_ld().
char* report_file [static] |
Definition at line 314 of file file_names.c.
int save_count [static] |
Definition at line 346 of file file_names.c.
char* saved_object = NULL [static] |
string_list_t* temp_files = NULL [static] |
Definition at line 74 of file file_names.c.
string_pair_list_t* temp_obj_files = NULL [static] |
Definition at line 123 of file file_names.c.
char* tmpdir [static] |
Definition at line 78 of file file_names.c.
1.5.6