Macros | Functions
smartlist_split.h File Reference

Header for smartlist_split.c. More...

Go to the source code of this file.


#define SPLIT_SKIP_SPACE   0x01
#define SPLIT_IGNORE_BLANK   0x02
#define SPLIT_STRIP_SPACE   0x04


int smartlist_split_string (smartlist_t *sl, const char *str, const char *sep, int flags, int max)

Detailed Description

Header for smartlist_split.c.

Definition in file smartlist_split.h.

Function Documentation

◆ smartlist_split_string()

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 add_onion_helper_keyarg(), config_register_addressmaps(), decode_auth_type(), decode_create2_list(), decode_intro_points(), dir_split_resource_into_fingerprint_pairs(), disk_state_parse_srv(), format_recommended_version_list(), get_bindaddr_from_transport_listen_line(), get_options_from_transport_options_line(), get_transport_in_state_by_name(), hs_parse_port_config(), metrics_parse_ports(), nodefamily_canonicalize(), normalize_nickname_list(), parse_addr_policy(), parse_auth_file_content(), parse_authorized_client(), parse_dir_fallback_line(), parse_from_state_set_vals(), parse_private_key_from_control_port(), parse_tcp_proxy_line(), routerset_parse(), state_transport_line_is_valid(), string_is_valid_nonrfc_hostname(), and tor_inet_aton().