|
Tor 0.4.9.8
|
Split a string into a smartlist_t of substrings. More...
#include "lib/smartlist_core/smartlist_core.h"#include "lib/smartlist_core/smartlist_split.h"#include "lib/err/torerr.h"#include "lib/string/util_string.h"#include "lib/string/compat_ctype.h"#include "lib/malloc/malloc.h"#include <string.h>Go to the source code of this file.
Functions | |
| int | smartlist_split_string (smartlist_t *sl, const char *str, const char *sep, int flags, int max) |
Split a string into a smartlist_t of substrings.
Definition in file smartlist_split.c.
| int smartlist_split_string | ( | smartlist_t * | sl, |
| const char * | str, | ||
| const char * | sep, | ||
| int | flags, | ||
| int | max ) |
Split a string str along all occurrences of sep, appending the (newly allocated) split strings, in order, to sl. Return the number of strings added to sl.
If flags&SPLIT_SKIP_SPACE is true, remove initial and trailing space from each entry. If flags&SPLIT_IGNORE_BLANK is true, remove any entries of length 0. If flags&SPLIT_STRIP_SPACE is true, strip spaces from each split string.
If max>0, divide the string into no more than max pieces. If sep is NULL, split on any sequence of horizontal space.
Definition at line 37 of file smartlist_split.c.
Referenced by accounting_parse_options(), add_onion_helper_keyarg(), circuit_build_times_parse_state(), config_register_addressmaps(), consdiff_get_digests(), consensus_cache_entry_get_voter_id_digests(), control_cmd_parse_args(), decode_auth_type(), decode_create2_list(), decode_intro_points(), dir_split_resource_into_fingerprint_pairs(), dir_split_resource_into_fingerprints(), dirauth_options_validate(), dirserv_generate_networkstatus_vote_obj(), disk_state_parse_commits(), disk_state_parse_srv(), format_recommended_version_list(), get_bindaddr_from_transport_listen_line(), get_my_declared_family(), get_options_from_transport_options_line(), get_transport_in_state_by_name(), handle_control_add_onion(), handle_control_extendcircuit(), handle_control_onion_client_auth_add(), hs_parse_port_config(), metrics_parse_ports(), microdesc_parse_fields(), networkstatus_compute_consensus(), nodefamily_canonicalize(), normalize_nickname_list(), options_init_logs(), parse_accept_encoding_header(), parse_addr_policy(), parse_auth_file_content(), parse_authorized_client(), parse_bridge_line(), parse_dir_authority_line(), parse_dir_fallback_line(), parse_from_state_set_vals(), parse_http_response(), parse_log_severity_config(), parse_method_line_helper(), parse_or_diff_from_header(), parse_private_key_from_control_port(), parse_tcp_proxy_line(), port_parse_config(), pt_parse_transport_line(), rep_hist_load_mtbf_data(), routerset_parse(), state_transport_line_is_valid(), string_is_valid_nonrfc_hostname(), tor_inet_aton(), and tor_version_is_obsolete().