Utility Functions

March 26, 2020 Contributors
Name Description
binding_address_family_matches Validate that the binding in question matches the address family provided
ec_gethostname lowercase gethostname() replacement
ec_hex_decode decodes bytes from ASCII hex characters
ec_hex_encode encodes bytes into ASCII hex characters
ec_parse_url parses an RFC 3986 URI
ec_ucs4_from_utf8 Decodes a single code point from a utf8 buffer
ec_util_power_2 Round input to next highest power of 2 if it is not a power of 2
get_now Populates a struct timeval pointer with current data
get_now_ts Get the current time
get_scheduler_pid Get the Process ID (PID) of the master scheduler thread
getopt_long2 a thread safe, re-entrant, getopt_long
is_valid_IP Determines whether or not string is a valid IP address
is_valid_email Determines whether emailaddr is a valid email address
isfinite indicates if a number has a finite value
lookuptable_add2 Adds a message to the lookuptable, and calls dns_get_MXs if the domain wasn’t in the lookuptable already
mid_to_string format a message_id as a human readable string
nearbyint return the integral value nearest to x according to the prevailing rounding mode
nearbyintf return the integral value nearest to x according to the prevailing rounding mode
protocol_string_uc Returns a protocol string in uppercase
round return the integral value nearest to x rounding half-way cases away from zero, regardless of the current rounding direction
rs_getlist Returns the address of the tail node in the RSplayTree
rs_next Move to the next node in the RSplayTree and return the data

This chapter lists a number of utility APIs.