24static inline int rislower(
int c) {
25 return (c >=
'a' && c <=
'z');
32static inline int risupper(
int c) {
33 return (c >=
'A' && c <=
'Z');
40static inline int risalpha(
int c) {
41 return (rislower(c) || risupper(c));
48static inline int risdigit(
int c) {
49 return (c >=
'0' && c <=
'9');
56static inline int risalnum(
int c) {
57 return (risalpha(c) || risdigit(c));
64static inline int risblank(
int c) {
65 return (c ==
' ' || c ==
'\t');
72static inline int risspace(
int c) {
73 return (risblank(c) || c ==
'\n' || c ==
'\r' || c ==
'\f' || c ==
'\v');
80static inline int rtolower(
int c) {
81 return ((risupper(c)) ? (c | (
'a' -
'A')) : c);
88static inline int rtoupper(
int c) {
89 return ((rislower(c)) ? (c & ~(
'a' -
'A')) : c);
98static inline unsigned char rnibble(
char c)
100 if (c >=
'0' && c <=
'9')
102 if (c >=
'a' && c <=
'f')
103 return (c -
'a') + 10;
104 if (c >=
'A' && c <=
'F')
105 return (c -
'A') + 10;
115static inline int rstreq(
const char *s1,
const char *s2)
117 return (strcmp(s1, s2) == 0);
127static inline int rstreqn(
const char *s1,
const char *s2,
size_t n)
129 return (strncmp(s1, s2, n) == 0);
147int rasprintf(
char **strp,
const char *fmt, ...) RPM_GNUC_PRINTF(2, 3);
168char *
rstrscat(
char **dest, const
char *arg, ...) RPM_GNUC_NULL_TERMINATED;
180size_t rstrlcpy(
char *dest, const
char *src,
size_t n);
196char *
rpmhex(const uint8_t *p,
size_t plen);
RPM_GNUC_PURE unsigned int rstrhash(const char *string)
char * rstrcat(char **dest, const char *src)
int int rvasprintf(char **strp, const char *fmt, va_list ap)
RPM_GNUC_PURE int rstrcasecmp(const char *s1, const char *s2)
size_t rstrlcpy(char *dest, const char *src, size_t n)
char * rpmhex(const uint8_t *p, size_t plen)
RPM_GNUC_PURE int rstrncasecmp(const char *s1, const char *s2, size_t n)
char * rstrscat(char **dest, const char *arg,...) RPM_GNUC_NULL_TERMINATED
int rasprintf(char **strp, const char *fmt,...) RPM_GNUC_PRINTF(2