tor  0.4.2.0-alpha-dev
Macros | Functions
smartlist_split.h File Reference

Go to the source code of this file.

Macros

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

Functions

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(), dir_split_resource_into_fingerprint_pairs(), format_recommended_version_list(), get_bindaddr_from_transport_listen_line(), get_options_from_transport_options_line(), get_transport_in_state_by_name(), nodefamily_canonicalize(), parse_addr_policy(), parse_dir_fallback_line(), rend_parse_service_authorization(), rend_service_parse_port_config(), routerset_parse(), state_transport_line_is_valid(), and string_is_valid_nonrfc_hostname().