21#ifndef LIBDPKG_STRING_H
22#define LIBDPKG_STRING_H
41str_is_unset(
const char *str)
43 return str ==
DPKG_NULL || str[0] ==
'\0';
50str_is_set(
const char *str)
52 return str !=
DPKG_NULL && str[0] !=
'\0';
#define DPKG_BEGIN_DECLS
Definition macros.h:164
#define DPKG_NULL
A null pointer constant that works on C or C++.
Definition macros.h:180
#define DPKG_ATTR_PRINTF(n)
Definition macros.h:117
#define DPKG_END_DECLS
Definition macros.h:165
#define DPKG_ATTR_SENTINEL
Definition macros.h:136
char * str_concat(char *dst,...) DPKG_ATTR_SENTINEL
Definition string.c:32
char * str_escape_fmt(char *dest, const char *src, size_t n)
Escape format characters from a string.
Definition string.c:103
char * str_quote_meta(const char *src)
Quote shell metacharacters in a string.
Definition string.c:138
char * str_fmt(const char *fmt,...) DPKG_ATTR_PRINTF(1)
Print formatted output to an allocated string.
Definition string.c:81
bool str_match_end(const char *str, const char *end)
Match the end of a string.
Definition string.c:60
char * str_rtrim_spaces(const char *str, char *str_end)
Trim possible ending spaces in string.
Definition string.c:189
char * str_strip_quotes(char *str)
Check and strip possible surrounding quotes in string.
Definition string.c:164
void str_gen_crop(const char *str, int max_width, struct str_crop_info *crop)
Generate the crop values for a string given a maximum screen width.
Definition strwide.c:94
int str_width(const char *str)
Compute the screen width of a string.
Definition strwide.c:43
unsigned int str_fnv_hash(const char *str)
Fowler/Noll/Vo – FNV-1a simple string hash.
Definition strhash.c:39
int str_bytes
Definition string.h:67
int max_bytes
Definition string.h:68