#include <stdio.h>#include <stdlib.h>#include <string.h>#include <malloc.h>#include "string_utils.h"

Go to the source code of this file.
| #define BLANK ' ' |
Definition at line 46 of file string_utils.c.
| #define DOT '.' |
Definition at line 47 of file string_utils.c.
| #define PERCENT '%' |
Definition at line 49 of file string_utils.c.
| #define SLASH '/' |
Definition at line 48 of file string_utils.c.
| void add_after_string | ( | string_list_t * | list, | |
| string_item_t * | item, | |||
| char * | s | |||
| ) |
Definition at line 180 of file string_utils.c.
References malloc, string_item_rec::name, string_item_rec::next, p, and string_list_rec::tail.
Referenced by postprocess_ld_args().
| static void add_existing_string | ( | string_list_t * | list, | |
| char * | s | |||
| ) | [static] |
Definition at line 164 of file string_utils.c.
References string_list_rec::head, malloc, string_item_rec::name, string_item_rec::next, NULL, p, and string_list_rec::tail.
Referenced by add_multi_strings(), and add_string().
| void add_multi_strings | ( | string_list_t * | list, | |
| char * | s | |||
| ) |
Definition at line 202 of file string_utils.c.
References add_existing_string(), BLANK, has_blank(), NIL, s, and string_copy().
Referenced by add_implied_string(), and add_ipl_cmd_string().
| void add_string | ( | string_list_t * | list, | |
| char * | s | |||
| ) |
Definition at line 194 of file string_utils.c.
References add_existing_string(), and string_copy().
Referenced by add_ar_objects(), add_arg(), add_command_line_arg(), add_file_args(), add_final_ld_args(), add_implied_string(), add_inc_path(), add_language_option(), add_library(), add_library_dir(), add_object(), add_string_if_new(), add_targ_options(), append_libraries_to_list(), create_temp_file_name(), do_f90_common_args(), main(), print_search_path(), Process_fbuse(), read_compiler_defaults(), run_ar(), run_ld(), run_phase(), save_ipl_commands(), set_f90_source_form(), set_library_paths(), specify_dyn_linker(), specify_ipa_dyn_linker(), and vlog_error().
| void add_string_if_new | ( | string_list_t * | list, | |
| char * | s | |||
| ) |
Definition at line 230 of file string_utils.c.
References add_string(), string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, p, and strcmp().
Referenced by construct_given_name(), mark_for_cleanup(), and mark_saved_object_for_cleanup().
| void add_string_pair | ( | string_pair_list_t * | list, | |
| char * | key, | |||
| char * | val | |||
| ) |
Definition at line 305 of file string_utils.c.
References string_pair_list_rec::head, string_pair_item_rec::key, malloc, string_pair_item_rec::next, NULL, p, string_copy(), string_pair_list_rec::tail, and string_pair_item_rec::val.
Referenced by get_object_file().
| void append_string_lists | ( | string_list_t * | a, | |
| string_list_t * | b | |||
| ) |
Definition at line 257 of file string_utils.c.
References string_list_rec::head, string_item_rec::next, NULL, and string_list_rec::tail.
Referenced by add_file_args(), append_ar_objects_to_list(), append_cxx_prelinker_objects_to_list(), and append_objects_to_list().
| char* change_suffix | ( | char * | s, | |
| char * | suffix | |||
| ) |
Definition at line 98 of file string_utils.c.
References concat_strings(), get_suffix(), NIL, NULL, p, strcpy, string_copy(), and strlen().
Referenced by add_implied_string(), check_makedepend_flags(), construct_file_with_extension(), construct_given_name(), construct_name(), and get_object_file().
| char* concat_strings | ( | const char * | a, | |
| const char * | b | |||
| ) |
Definition at line 75 of file string_utils.c.
References malloc, strcat(), strcpy, and strlen().
Referenced by add_command_line_arg(), add_file_args(), add_ipl_cmd_string(), add_library(), add_object(), add_special_options(), append_all_phase_dirs(), append_libraries_to_list(), append_open64_env_flags(), append_phase_dir(), change_phase_path(), change_suffix(), check_existence_of_phases(), concat_path(), directory_is_writable(), expand_template_string(), get_full_phase_name(), get_lang_name(), get_phase_name(), if(), init_stdc_plus_plus_path(), make_ii_file_name(), make_rii_file_name(), postprocess_ld_args(), prefix_all_phase_dirs(), print_search_path(), Process_Default_Group(), Process_Ofast(), run_ld(), run_pixie(), run_prof(), set_library_paths(), substitute_phase_dirs(), and update_instantiation_info_file().
| const char* ends_with | ( | const char * | s, | |
| const char * | sfx | |||
| ) |
Definition at line 282 of file string_utils.c.
References len, NULL, strcmp(), and strlen().
Referenced by print_magic_path().
| char* expand_template_string | ( | char * | template, | |
| char * | arg | |||
| ) |
Definition at line 142 of file string_utils.c.
References concat_strings(), NIL, NULL, percent, PERCENT, strchr, and string_copy().
Referenced by add_derived_option().
| char* get_suffix | ( | const char * | s | ) |
Definition at line 86 of file string_utils.c.
References DOT, NULL, and strrchr().
Referenced by add_file_args(), change_suffix(), construct_name(), get_executable_dir_from_path(), get_source_kind(), is_object_source_kind(), and print_magic_path().
| boolean has_blank | ( | char * | s | ) |
Definition at line 118 of file string_utils.c.
References BLANK, FALSE, NIL, p, and TRUE.
Referenced by add_multi_strings(), and option_has_blank().
| string_list_t* init_string_list | ( | void | ) |
Definition at line 154 of file string_utils.c.
References string_list_rec::head, malloc, NULL, p, and string_list_rec::tail.
Referenced by append_default_options(), init_count_files(), init_error_list(), init_objects(), init_temp_files(), main(), print_search_path(), run_ar(), run_compiler(), run_dsm_prelink(), run_ld(), run_pixie(), run_prof(), and save_ipl_commands().
| string_pair_list_t* init_string_pair_list | ( | void | ) |
Definition at line 295 of file string_utils.c.
References string_pair_list_rec::head, malloc, NULL, p, and string_pair_list_rec::tail.
Referenced by init_temp_files().
| void print_string_list | ( | FILE * | f, | |
| string_list_t * | list | |||
| ) |
Definition at line 272 of file string_utils.c.
References fprintf(), string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, and p.
Referenced by dump_objects(), and run_phase().
| void replace_string | ( | string_list_t * | list, | |
| char * | old, | |||
| char * | new | |||
| ) |
Definition at line 243 of file string_utils.c.
References string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, p, strcmp(), and string_copy().
Referenced by add_file_args(), remove_previous_mf(), and run_compiler().
| void replace_substring | ( | char * | base, | |
| char * | old_pattern, | |||
| char * | new_pattern | |||
| ) |
| char* string_copy | ( | char * | s | ) |
Definition at line 52 of file string_utils.c.
References malloc, NULL, strcpy, and strlen().
Referenced by add_file_args(), add_multi_strings(), add_new_option(), add_object(), add_string(), add_string_pair(), add_toggle_name(), append_default_options(), append_open64_env_flags(), change_suffix(), construct_given_name(), create_help_msg(), create_temp_file_name(), expand_template_string(), finalize_maybe_linker_options(), find_crt_path(), find_obj_path(), Get_Binary_Name(), get_cwd(), get_executable_dir(), get_executable_dir_from_path(), get_phase_dir(), get_phases_real_path(), init_phase_info(), init_temp_files(), main(), Process_fb_cdir(), Process_fb_create(), Process_fb_opt(), Process_fb_phase(), Process_fb_type(), Process_fb_xdir(), Process_fbexe(), replace_string(), run_phase(), run_pixie(), run_prof(), save_command_line(), save_name(), set_phase_dir(), and write_get_option().
| int string_list_size | ( | const string_list_t * | l | ) |
Definition at line 320 of file string_utils.c.
References FOREACH_STRING, i, and len.
Referenced by save_cpp_output().
| char* substring_copy | ( | char * | s, | |
| int | i, | |||
| int | len | |||
| ) |
Definition at line 63 of file string_utils.c.
References malloc, NULL, and strncpy().
Referenced by directory_path().
1.5.6