37G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
55 const
char *separator, const
char *first, ...)
56G_GNUC_MALLOC G_GNUC_NULL_TERMINATED;
76 const
char *separator,
char **str_array)
95 const
char *delimiter,
int max_tokens);
113wmem_ascii_strdown(
wmem_allocator_t *allocator, const
char *str, ssize_t len);
134char *ascii_strdown_inplace(
char *str);
155char *ascii_strup_inplace(
char *str);
164bool isprint_string(const
char *str);
193bool isprint_utf8_string(const
char *str, const
unsigned length);
202bool isdigit_string(const
char *str);
220const
char *ws_ascii_strcasestr(const
char *haystack, const
char *needle);
231const uint8_t *ws_memrchr(const
void *haystack,
int ch,
size_t n);
242char *ws_strchrnul(const
char *str,
int ch);
257char *ws_escape_string(
wmem_allocator_t *alloc, const
char *
string,
bool add_quotes);
272char *ws_escape_string_len(
wmem_allocator_t *alloc, const
char *
string, ssize_t len,
bool add_quotes);
291char *ws_escape_null(
wmem_allocator_t *alloc, const
char *
string,
size_t len,
bool add_quotes);
314char *ws_escape_csv(
wmem_allocator_t *alloc, const
char *
string,
bool add_quotes,
char quote_char,
bool double_quote,
bool escape_whitespace);
333bool ws_csv_value_is_formula(const
char *
string);
378#define FORMAT_SIZE_PREFIX_SI (1 << 0)
379#define FORMAT_SIZE_PREFIX_IEC (1 << 1)
427#define format_size(size, unit, flags) \
428 format_size_wmem(NULL, size, unit, flags)
455WS_DLL_PUBLIC WS_RETNONNULL
547 const char *
string,
size_t len,
char chr);
630#define HEXDUMP_ASCII_MASK (0x0003U)
638#define HEXDUMP_ASCII_OPTION(option) ((option) & HEXDUMP_ASCII_MASK)
646#define HEXDUMP_ASCII_INCLUDE (0x0000U)
653#define HEXDUMP_ASCII_DELIMIT (0x0001U)
660#define HEXDUMP_ASCII_EXCLUDE (0x0002U)
681bool hex_dump_buffer(
bool (*print_line)(
void *,
const char *),
void *fp,
682 const unsigned char *cp,
unsigned length,
684 unsigned ascii_option);
696#define plurality(d,s,p) ((d) == 1 ? (s) : (p))
704#define true_or_false(val) ((val) ? "TRUE" : "FALSE")
712#define string_or_null(val) ((val) ? (val) : "[NULL]")
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
WS_DLL_PUBLIC char * format_text_string(wmem_allocator_t *allocator, const char *string)
Definition str_util.c:1320
WS_DLL_PUBLIC char * ws_utf8_truncate(char *string, size_t len)
Definition str_util.c:1397
WS_DLL_PUBLIC WS_RETNONNULL const char * ws_strerrorname_r(int errnum, char *buf, size_t buf_size)
Return the symbolic name of an error code.
Definition str_util.c:853
hex_dump_enc
Character encoding types supported by hex dump formatting.
Definition str_util.h:618
@ HEXDUMP_ENC_EBCDIC
Definition str_util.h:620
@ HEXDUMP_ENC_ASCII
Definition str_util.h:619
format_size_units_e
Unit types used by format_size_wmem() for formatting size values.
Definition str_util.h:357
@ FORMAT_SIZE_UNIT_BITS_S
Definition str_util.h:367
@ FORMAT_SIZE_UNIT_EVENTS
Definition str_util.h:371
@ FORMAT_SIZE_UNIT_BYTES
Definition str_util.h:365
@ FORMAT_SIZE_UNIT_PACKETS
Definition str_util.h:369
@ FORMAT_SIZE_UNIT_BYTES_S
Definition str_util.h:368
@ FORMAT_SIZE_UNIT_SECONDS
Definition str_util.h:374
@ FORMAT_SIZE_UNIT_NONE
Definition str_util.h:358
@ FORMAT_SIZE_UNIT_FIELDS
Definition str_util.h:373
@ FORMAT_SIZE_UNIT_EVENTS_S
Definition str_util.h:372
@ FORMAT_SIZE_UNIT_ERLANGS
Definition str_util.h:375
@ FORMAT_SIZE_UNIT_PACKETS_S
Definition str_util.h:370
@ FORMAT_SIZE_UNIT_BITS
Definition str_util.h:366
WS_DLL_PUBLIC uint8_t EBCDIC_to_ASCII1(uint8_t c)
Convert a single EBCDIC-encoded byte to its ASCII equivalent.
Definition str_util.c:1519
WS_DLL_PUBLIC char * format_text_chr(wmem_allocator_t *allocator, const char *string, size_t len, char chr)
Definition str_util.c:1349
WS_DLL_PUBLIC char * format_text_wsp(wmem_allocator_t *allocator, const char *line, size_t len)
Definition str_util.c:1332
WS_DLL_PUBLIC char * format_units(wmem_allocator_t *allocator, double size, format_size_units_e unit, uint16_t flags, int precision)
Definition str_util.c:485
WS_DLL_PUBLIC bool hex_dump_buffer(bool(*print_line)(void *, const char *), void *fp, const unsigned char *cp, unsigned length, hex_dump_enc encoding, unsigned ascii_option)
Generate a formatted hex dump of a byte buffer.
Definition str_util.c:1548
WS_DLL_PUBLIC char * ws_strdup_underline(wmem_allocator_t *allocator, long offset, size_t len)
Create a string of underscores for visual alignment or highlighting.
Definition str_util.c:867
WS_DLL_PUBLIC char * format_text(wmem_allocator_t *allocator, const char *string, size_t len)
Definition str_util.c:1295
WS_DLL_PUBLIC char * format_char(wmem_allocator_t *allocator, char c)
Definition str_util.c:1369
WS_DLL_PUBLIC char * format_size_wmem(wmem_allocator_t *allocator, int64_t size, format_size_units_e unit, uint16_t flags)
Definition str_util.c:630
WS_DLL_PUBLIC void EBCDIC_to_ASCII(uint8_t *buf, unsigned bytes)
Convert a buffer of EBCDIC-encoded bytes to ASCII in-place.
Definition str_util.c:1506
WS_DLL_PUBLIC char * wmem_strconcat(wmem_allocator_t *allocator, const char *first,...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED
Concatenate multiple strings into a single newly allocated string.
Definition str_util.c:48
WS_DLL_PUBLIC char printable_char_or_period(char c)
Return a printable character or '.' if non-printable.
Definition str_util.c:697