diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-11-23 08:32:08 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-11-23 08:32:08 +0200 |
commit | 4ad615daf5a650359d4be4d7b317d0678040cd37 (patch) | |
tree | 3f82f40fd6a186b2925f3668a15d59f618789172 /rpmio | |
parent | 115d698252464f907a4932b4bfeb63d72a3098a2 (diff) | |
download | rpm-4ad615daf5a650359d4be4d7b317d0678040cd37.tar.gz rpm-4ad615daf5a650359d4be4d7b317d0678040cd37.tar.bz2 rpm-4ad615daf5a650359d4be4d7b317d0678040cd37.zip |
Move the xstr*() string variants from rpmio.h to rpmstring.h
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/macro.c | 1 | ||||
-rw-r--r-- | rpmio/rpmio.h | 39 | ||||
-rw-r--r-- | rpmio/rpmpgp.c | 3 | ||||
-rw-r--r-- | rpmio/rpmrpc.c | 1 | ||||
-rw-r--r-- | rpmio/rpmstring.c | 7 | ||||
-rw-r--r-- | rpmio/rpmstring.h | 39 | ||||
-rw-r--r-- | rpmio/strcasecmp.c | 2 |
7 files changed, 45 insertions, 47 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index 4e43acd38..aac05fe5d 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -13,6 +13,7 @@ #define STREQ(_t, _f, _fn) ((_fn) == (sizeof(_t)-1) && !strncmp((_t), (_f), (_fn))) #include <rpmio.h> +#include <rpmstring.h> #include <rpmurl.h> #include <rpmmessages.h> #include <rpmlog.h> diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h index 6d90d6539..ea0749a85 100644 --- a/rpmio/rpmio.h +++ b/rpmio/rpmio.h @@ -300,45 +300,6 @@ int ufdGetFile( FD_t sfd, FD_t tfd); */ int timedRead(FD_t fd, void * bufptr, int length); -static inline int xislower(int c) { - return (c >= 'a' && c <= 'z'); -} -static inline int xisupper(int c) { - return (c >= 'A' && c <= 'Z'); -} -static inline int xisalpha(int c) { - return (xislower(c) || xisupper(c)); -} -static inline int xisdigit(int c) { - return (c >= '0' && c <= '9'); -} -static inline int xisalnum(int c) { - return (xisalpha(c) || xisdigit(c)); -} -static inline int xisblank(int c) { - return (c == ' ' || c == '\t'); -} -static inline int xisspace(int c) { - return (xisblank(c) || c == '\n' || c == '\r' || c == '\f' || c == '\v'); -} - -static inline int xtolower(int c) { - return ((xisupper(c)) ? (c | ('a' - 'A')) : c); -} -static inline int xtoupper(int c) { - return ((xislower(c)) ? (c & ~('a' - 'A')) : c); -} - -/** \ingroup rpmio - * Locale insensitive strcasecmp(3). - */ -int xstrcasecmp(const char * s1, const char * s2) ; - -/** \ingroup rpmio - * Locale insensitive strncasecmp(3). - */ -int xstrncasecmp(const char *s1, const char * s2, size_t n) ; - #ifdef __cplusplus } #endif diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index 8adc55c87..ec06bce6c 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -6,6 +6,9 @@ #include "system.h" #include "digest.h" #include "rpmio_internal.h" /* XXX rpmioSlurp */ + +#include <rpmstring.h> + #include "debug.h" diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index f51c426cc..1f0434a95 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -9,6 +9,7 @@ #endif #include <rpmurl.h> +#include <rpmstring.h> #include "rpmio_internal.h" #include "ugid.h" diff --git a/rpmio/rpmstring.c b/rpmio/rpmstring.c index 45314bee5..3e747b12f 100644 --- a/rpmio/rpmstring.c +++ b/rpmio/rpmstring.c @@ -16,13 +16,6 @@ struct StringBufRec { int free; }; -/** - * Locale insensitive isspace(3). - */ -static inline int xisspace(int c) { - return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'); -} - char * stripTrailingChar(char * s, char c) { char * t; diff --git a/rpmio/rpmstring.h b/rpmio/rpmstring.h index a31957e77..ce265e1ad 100644 --- a/rpmio/rpmstring.h +++ b/rpmio/rpmstring.h @@ -9,6 +9,45 @@ extern "C" { #endif +static inline int xislower(int c) { + return (c >= 'a' && c <= 'z'); +} +static inline int xisupper(int c) { + return (c >= 'A' && c <= 'Z'); +} +static inline int xisalpha(int c) { + return (xislower(c) || xisupper(c)); +} +static inline int xisdigit(int c) { + return (c >= '0' && c <= '9'); +} +static inline int xisalnum(int c) { + return (xisalpha(c) || xisdigit(c)); +} +static inline int xisblank(int c) { + return (c == ' ' || c == '\t'); +} +static inline int xisspace(int c) { + return (xisblank(c) || c == '\n' || c == '\r' || c == '\f' || c == '\v'); +} + +static inline int xtolower(int c) { + return ((xisupper(c)) ? (c | ('a' - 'A')) : c); +} +static inline int xtoupper(int c) { + return ((xislower(c)) ? (c & ~('a' - 'A')) : c); +} + +/** \ingroup rpmio + * Locale insensitive strcasecmp(3). + */ +int xstrcasecmp(const char * s1, const char * s2) ; + +/** \ingroup rpmio + * Locale insensitive strncasecmp(3). + */ +int xstrncasecmp(const char *s1, const char * s2, size_t n) ; + /** * Split string into fields separated by a character. * @param str string diff --git a/rpmio/strcasecmp.c b/rpmio/strcasecmp.c index 35fdc46bd..686851d4c 100644 --- a/rpmio/strcasecmp.c +++ b/rpmio/strcasecmp.c @@ -3,7 +3,7 @@ */ #include "system.h" -#include <rpmio.h> +#include <rpmstring.h> #include "debug.h" int xstrcasecmp(const char * s1, const char * s2) |