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);
231const uint8_t *
ws_memrchr(const
void *haystack,
int ch,
size_t n);
303char *
ws_escape_csv(
wmem_allocator_t *alloc, const
char *
string,
bool add_quotes,
char quote_char,
bool double_quote,
bool escape_whitespace);
349#define FORMAT_SIZE_PREFIX_SI (1 << 0)
350#define FORMAT_SIZE_PREFIX_IEC (1 << 1)
398#define format_size(size, unit, flags) \
399 format_size_wmem(NULL, size, unit, flags)
426WS_DLL_PUBLIC WS_RETNONNULL
518 const char *
string,
size_t len,
char chr);
601#define HEXDUMP_ASCII_MASK (0x0003U)
609#define HEXDUMP_ASCII_OPTION(option) ((option) & HEXDUMP_ASCII_MASK)
617#define HEXDUMP_ASCII_INCLUDE (0x0000U)
624#define HEXDUMP_ASCII_DELIMIT (0x0001U)
631#define HEXDUMP_ASCII_EXCLUDE (0x0002U)
652bool hex_dump_buffer(
bool (*print_line)(
void *,
const char *),
void *fp,
653 const unsigned char *cp,
unsigned length,
655 unsigned ascii_option);
667#define plurality(d,s,p) ((d) == 1 ? (s) : (p))
675#define true_or_false(val) ((val) ? "TRUE" : "FALSE")
683#define string_or_null(val) ((val) ? (val) : "[NULL]")
WS_DLL_PUBLIC char * wmem_strjoin(wmem_allocator_t *allocator, const char *separator, const char *first,...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED
Join multiple strings using a separator into a single newly allocated string.
Definition str_util.c:79
WS_DLL_PUBLIC const uint8_t * ws_memrchr(const void *haystack, int ch, size_t n)
Definition str_util.c:367
WS_DLL_PUBLIC char * format_text_string(wmem_allocator_t *allocator, const char *string)
Definition str_util.c:1234
WS_DLL_PUBLIC bool isprint_string(const char *str)
Check if an entire string consists of printable characters.
Definition str_util.c:287
WS_DLL_PUBLIC char * ws_escape_string_len(wmem_allocator_t *alloc, const char *string, ssize_t len, bool add_quotes)
Escape a string of specified length for safe display or output.
Definition str_util.c:767
WS_DLL_PUBLIC char * ws_utf8_truncate(char *string, size_t len)
Definition str_util.c:1311
WS_DLL_PUBLIC bool isprint_utf8_string(const char *str, const unsigned length)
Definition str_util.c:305
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:795
hex_dump_enc
Character encoding types supported by hex dump formatting.
Definition str_util.h:589
@ HEXDUMP_ENC_EBCDIC
Definition str_util.h:591
@ HEXDUMP_ENC_ASCII
Definition str_util.h:590
WS_DLL_PUBLIC char * ascii_strup_inplace(char *str)
In-place converstion of lower-case ASCII letters to upper-case.
Definition str_util.c:274
format_size_units_e
Unit types used by format_size_wmem() for formatting size values.
Definition str_util.h:327
@ FORMAT_SIZE_UNIT_BITS_S
Definition str_util.h:337
@ FORMAT_SIZE_UNIT_EVENTS
Definition str_util.h:341
@ FORMAT_SIZE_UNIT_BYTES
Definition str_util.h:335
@ FORMAT_SIZE_UNIT_PACKETS
Definition str_util.h:339
@ FORMAT_SIZE_UNIT_BYTES_S
Definition str_util.h:338
@ FORMAT_SIZE_UNIT_SECONDS
Definition str_util.h:345
@ FORMAT_SIZE_UNIT_NONE
Definition str_util.h:328
@ FORMAT_SIZE_UNIT_FIELDS
Definition str_util.h:343
@ FORMAT_SIZE_UNIT_EVENTS_S
Definition str_util.h:342
@ FORMAT_SIZE_UNIT_ERLANGS
Definition str_util.h:346
@ FORMAT_SIZE_UNIT_PACKETS_S
Definition str_util.h:340
@ FORMAT_SIZE_UNIT_BITS
Definition str_util.h:336
WS_DLL_PUBLIC char * ascii_strdown_inplace(char *str)
In-place converstion of upper-case ASCII letters to lower-case.
Definition str_util.c:261
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:1433
WS_DLL_PUBLIC char * format_text_chr(wmem_allocator_t *allocator, const char *string, size_t len, char chr)
Definition str_util.c:1263
WS_DLL_PUBLIC char * ws_escape_csv(wmem_allocator_t *alloc, const char *string, bool add_quotes, char quote_char, bool double_quote, bool escape_whitespace)
Escape as in a number of CSV dialects.
Definition str_util.c:786
WS_DLL_PUBLIC char * format_text_wsp(wmem_allocator_t *allocator, const char *line, size_t len)
Definition str_util.c:1246
WS_DLL_PUBLIC int ws_xton(char ch)
Convert a hexadecimal character to its numeric value.
Definition str_util.c:236
WS_DLL_PUBLIC bool isdigit_string(const char *str)
Check if an entire string consists of digits.
Definition str_util.c:330
WS_DLL_PUBLIC const char * ws_ascii_strcasestr(const char *haystack, const char *needle)
Definition str_util.c:347
WS_DLL_PUBLIC char ** wmem_strsplit(wmem_allocator_t *allocator, const char *src, const char *delimiter, int max_tokens)
Splits a string into a maximum of max_tokens pieces, using the given delimiter.
Definition str_util.c:161
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:1462
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:809
WS_DLL_PUBLIC char * format_text(wmem_allocator_t *allocator, const char *string, size_t len)
Definition str_util.c:1209
WS_DLL_PUBLIC char * format_char(wmem_allocator_t *allocator, char c)
Definition str_util.c:1283
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:598
WS_DLL_PUBLIC char * wmem_strjoinv(wmem_allocator_t *allocator, const char *separator, char **str_array) G_GNUC_MALLOC
Joins a number of strings together to form one long string, with the optional separator inserted betw...
Definition str_util.c:119
WS_DLL_PUBLIC char * wmem_ascii_strdown(wmem_allocator_t *allocator, const char *str, ssize_t len)
Converts all upper case ASCII letters to lower case ASCII letters.
Definition str_util.c:219
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:1420
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:662
WS_DLL_PUBLIC char * ws_escape_null(wmem_allocator_t *alloc, const char *string, size_t len, bool add_quotes)
Escape null bytes in a string for safe display or logging.
Definition str_util.c:778
WS_DLL_PUBLIC char * ws_escape_string(wmem_allocator_t *alloc, const char *string, bool add_quotes)
Escape a null-terminated string for safe display or output.
Definition str_util.c:773
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34