Rizin
unix-like reverse engineering framework and cli tools
|
#include "rz_types.h"
#include "rz_util.h"
#include "rz_cons.h"
#include "rz_bin.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
Go to the source code of this file.
Functions | |
RZ_API void | rz_str_trim_path (char *s) |
RZ_API char * | rz_str_trim_lines (char *str) |
RZ_API char * | rz_str_trim_dup (const char *str) |
RZ_API const char * | rz_str_trim_head_ro (const char *str) |
RZ_API const char * | rz_str_trim_head_wp (const char *str) |
RZ_API void | rz_str_trim_head (RZ_NONNULL char *str) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string. The string is changed in place. More... | |
RZ_API RZ_BORROW char * | rz_str_trim_tail (RZ_NONNULL char *str) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string and replaces them with '\0' characters. The string is changed in place. More... | |
RZ_API void | rz_str_trim_head_char (RZ_NONNULL RZ_INOUT char *str, const char c) |
Removes the the character c from the beginning of a string. More... | |
RZ_API void | rz_str_trim_tail_char (RZ_NONNULL RZ_INOUT char *str, const char c) |
Removes the the character c from the end of a string. More... | |
RZ_API void | rz_str_trim_char (RZ_NONNULL RZ_INOUT char *str, const char c) |
Removes the character c from the beginning and end of a string. More... | |
RZ_API void | rz_str_trim (RZ_NONNULL RZ_INOUT char *str) |
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string. More... | |
RZ_API char * | rz_str_trim_nc (char *str) |
RZ_API int | rz_str_ansi_trim (char *str, int str_len, int n) |
Definition at line 204 of file str_trim.c.
References i, len, n, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by rz_strpool_ansi_chop().
RZ_API void rz_str_trim | ( | RZ_NONNULL RZ_INOUT char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
str | The string to trim. |
Definition at line 190 of file str_trim.c.
References rz_str_trim_head(), rz_str_trim_tail(), and cmd_descs_generate::str.
Referenced by __op_refs(), __refs(), __reg_read(), addVar(), assign_reg(), cmd_print_pv(), disasm_strings(), do_handle_substitution_cmd(), ds_print_comments_right(), ds_print_dwarf(), exprmatchreg(), filter_item_name(), function_print_to_json(), get_body(), get_long_object(), getpcfromstack(), handleHints(), interact_commands(), parse(), prim(), print_fcn_arg(), rz_analysis_cc_set(), rz_asm_massemble(), rz_bin_addr2text(), rz_bin_elf_get_compiler(), rz_cons_grep_parsecmd(), rz_cons_grep_strip(), rz_core_asm_strsearch(), rz_core_cmd_subst_i(), rz_core_rtr_add(), rz_core_visual_cmd(), rz_name_filter(), rz_str_trim_dup(), rz_str_trim_lines(), rz_str_version(), rz_syscmd_cat(), rz_syscmd_head(), rz_syscmd_join(), rz_syscmd_mkdir(), rz_syscmd_sort(), rz_syscmd_tail(), rz_syscmd_uniq(), rz_test_load_asm_test_file(), rz_test_load_json_test_file(), rz_test_run_asm_test(), rz_time_stamp_to_str(), rz_w32_add_winmsg_breakpoint(), socket_http_answer(), str_split_list_common(), and str_split_list_common_regex().
RZ_API void rz_str_trim_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the character c
from the beginning and end of a string.
str | The string to trim. |
c | The character to remove. |
Definition at line 179 of file str_trim.c.
References c, rz_str_trim_head_char(), rz_str_trim_tail_char(), and cmd_descs_generate::str.
Referenced by ds_build_op_str().
Definition at line 78 of file str_trim.c.
References a, rz_str_trim(), cmd_descs_generate::str, and strdup().
Referenced by capture_filter_keywords(), get_corefile_name(), rz_cmd_remote(), rz_cmd_search(), rz_config_eval(), rz_core_asm_strsearch(), rz_core_cmd_foreach3(), rz_regs_fpu_handler(), and rz_remote_mode_enable_handler().
RZ_API void rz_str_trim_head | ( | RZ_NONNULL char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string. The string is changed in place.
str | The string to trim. |
Definition at line 110 of file str_trim.c.
References p, rz_str_trim_head_ro(), and cmd_descs_generate::str.
Referenced by parse(), rz_core_cmd_pipe_old(), rz_core_cmd_subst_i(), and rz_str_trim().
RZ_API void rz_str_trim_head_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the the character c
from the beginning of a string.
str | The string. |
c | The character to be removed. |
Definition at line 144 of file str_trim.c.
References c, p, rz_return_if_fail, and cmd_descs_generate::str.
Referenced by rz_str_trim_char().
Definition at line 86 of file str_trim.c.
References IS_WHITECHAR, NULL, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by __system(), autocomplete_file(), autocomplete_sdb(), autocompleteFilename(), cmd_analysis_esil(), cmd_debug_pid(), cmd_print_format(), cmd_print_pv(), cmd_pxr(), cmp(), core_cmd_tsrzcmd(), do_analysis_search(), encode_const_pool16_ut8(), encode_ut8x2(), find_autocomplete(), flag_to_flag(), gdb_to_rz_profile(), get_section_name(), is_macro_command(), java_assembler(), lua53_assembly(), lua54_assembly(), lua_load_next_arg_start(), old_transform_op(), prompt_offset_and_seek(), prompt_offset_and_seek_file(), rz_analysis_noreturn_drop(), rz_asn1_print_padded(), rz_cmd_analysis(), rz_cmd_debug(), rz_cmd_debug_dmi(), rz_cmd_help(), rz_cmd_print(), rz_cmd_search(), rz_cons_hud_path(), rz_cons_pal_list(), rz_core_agraph_print(), rz_core_analysis_function_rename(), rz_core_autocomplete(), rz_core_cmd_subst(), rz_core_cmd_subst_i(), rz_core_graph_print(), rz_core_rtr_add(), rz_core_rtr_cmd(), rz_core_rtr_gdb_run(), rz_core_visual_view_rop(), rz_core_visual_xrefs(), rz_equal_H_handler_old(), rz_plugins_load_handler(), rz_plugins_unload_handler(), rz_print_json_indent(), rz_reg_arena_set_bytes(), rz_str_trim_head(), rz_str_trim_nc(), rz_str_version(), rz_str_wrap(), rz_syscmd_ls(), rz_syscmd_mkdir(), rz_table_query(), step_until_inst(), subvar(), tokens_new(), and types_cc_print().
Definition at line 95 of file str_trim.c.
References IS_WHITESPACE, NULL, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by find_autocomplete(), and tokens_new().
RZ_API char* rz_str_trim_lines | ( | char * | str | ) |
Definition at line 60 of file str_trim.c.
References free(), list(), NULL, rz_list_free(), rz_str_ansi_filter(), rz_str_split_list(), rz_str_trim(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), s, sb, and cmd_descs_generate::str.
Referenced by get_body().
RZ_API char* rz_str_trim_nc | ( | char * | str | ) |
Definition at line 197 of file str_trim.c.
References rz_str_trim_head_ro(), rz_str_trim_tail(), s, and cmd_descs_generate::str.
Referenced by rz_core_cmd_subst_i().
RZ_API void rz_str_trim_path | ( | char * | s | ) |
Definition at line 15 of file str_trim.c.
RZ_API RZ_BORROW char* rz_str_trim_tail | ( | RZ_NONNULL char * | str | ) |
Removes whitespace characters (space, tab, newline etc.) from the end of a string and replaces them with '\0' characters. The string is changed in place.
str | The string to trim. |
Definition at line 125 of file str_trim.c.
References IS_WHITECHAR, length, rz_return_val_if_fail, and cmd_descs_generate::str.
Referenced by ar_parse_header(), arm_opcode_parse(), get_section_name(), getstr(), rz_analysis_xrefs_to_graph_cmd_handler(), rz_base_type_as_format(), rz_cons_canvas_print_region(), rz_cons_fgets(), rz_core_analysis_function_set_signature(), rz_core_analysis_hasrefs_to_depth(), rz_core_bin_fields_print(), rz_core_cmd_subst(), rz_core_cmd_subst_i(), rz_il_validate_effect(), rz_il_validate_pure(), rz_line_hist_load(), rz_str_trim(), rz_str_trim_nc(), and rz_type_as_format_pair().
RZ_API void rz_str_trim_tail_char | ( | RZ_NONNULL RZ_INOUT char * | str, |
const char | c | ||
) |
Removes the the character c
from the end of a string.
str | The string. |
c | The character to be removed. |
Definition at line 161 of file str_trim.c.
References c, length, rz_return_if_fail, and cmd_descs_generate::str.
Referenced by rz_str_trim_char().