diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-03-18 09:10:13 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-03-18 09:10:13 +0200 |
commit | c908277be21c27a0894404821605134958521fd6 (patch) | |
tree | cf247a2a6753c527a7985aeeeb4b0dee3b4626b8 /lib | |
parent | 9df54a8622b6640e54288835e62c6c0d0b23c748 (diff) | |
download | rpm-c908277be21c27a0894404821605134958521fd6.tar.gz |
Minimal namespacing for locale-insensitive x*() string functions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/poptALL.c | 2 | ||||
-rw-r--r-- | lib/rpmds.c | 2 | ||||
-rw-r--r-- | lib/rpmrc.c | 34 | ||||
-rw-r--r-- | lib/rpmts.c | 2 | ||||
-rw-r--r-- | lib/rpmvercmp.c | 14 | ||||
-rw-r--r-- | lib/signature.c | 8 |
6 files changed, 31 insertions, 31 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c index 18b91ad1f..14cfd84af 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -120,7 +120,7 @@ static void rpmcliAllArgCallback( poptContext con, { char *s, *t; /* XXX Convert '-' in macro name to underscore, skip leading %. */ s = t = xstrdup(arg); - while (*t && !xisspace(*t)) { + while (*t && !risspace(*t)) { if (*t == '-') *t = '_'; t++; } diff --git a/lib/rpmds.c b/lib/rpmds.c index 9a03d7bce..403409cf8 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -777,7 +777,7 @@ void parseEVR(char * evr, char *s, *se; s = evr; - while (*s && xisdigit(*s)) s++; /* s points to epoch terminator */ + while (*s && risdigit(*s)) s++; /* s points to epoch terminator */ se = strrchr(s, '-'); /* se points to version terminator */ if (*s == ':') { diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 00f830d9a..61e8e2602 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -163,7 +163,7 @@ static void rpmRebuildTargetVars(const char **target, const char ** canontarget) static int optionCompare(const void * a, const void * b) { - return xstrcasecmp(((const struct rpmOption *) a)->name, + return rstrcasecmp(((const struct rpmOption *) a)->name, ((const struct rpmOption *) b)->name); } @@ -187,7 +187,7 @@ static int machCompatCacheAdd(char * name, const char * fn, int linenum, int delEntry = 0; int i; - while (*name && xisspace(*name)) name++; + while (*name && risspace(*name)) name++; chptr = name; while (*chptr && *chptr != ':') chptr++; @@ -200,10 +200,10 @@ static int machCompatCacheAdd(char * name, const char * fn, int linenum, return 1; } - while (*chptr == ':' || xisspace(*chptr)) chptr--; + while (*chptr == ':' || risspace(*chptr)) chptr--; *(++chptr) = '\0'; equivs = chptr + 1; - while (*equivs && xisspace(*equivs)) equivs++; + while (*equivs && risspace(*equivs)) equivs++; if (!*equivs) { delEntry = 1; } @@ -252,7 +252,7 @@ machEquivSearch(const machEquivTable table, const char * name) int i; for (i = 0; i < table->count; i++) - if (!xstrcasecmp(table->list[i].name, name)) + if (!rstrcasecmp(table->list[i].name, name)) return table->list + i; return NULL; @@ -541,18 +541,18 @@ static rpmRC doReadRC( FD_t fd, const char * urlfn) next = se; /* Trim leading spaces */ - while (*s && xisspace(*s)) s++; + while (*s && risspace(*s)) s++; /* We used to allow comments to begin anywhere, but not anymore. */ if (*s == '#' || *s == '\0') continue; /* Find end-of-keyword. */ se = (char *)s; - while (*se && !xisspace(*se) && *se != ':') se++; + while (*se && !risspace(*se) && *se != ':') se++; - if (xisspace(*se)) { + if (risspace(*se)) { *se++ = '\0'; - while (*se && xisspace(*se) && *se != ':') se++; + while (*se && risspace(*se) && *se != ':') se++; } if (*se != ':') { @@ -561,7 +561,7 @@ static rpmRC doReadRC( FD_t fd, const char * urlfn) return RPMRC_FAIL; } *se++ = '\0'; /* terminate keyword or option, point to value */ - while (*se && xisspace(*se)) se++; + while (*se && risspace(*se)) se++; /* Find keyword in table */ searchOption.name = s; @@ -584,7 +584,7 @@ static rpmRC doReadRC( FD_t fd, const char * urlfn) { FD_t fdinc; s = se; - while (*se && !xisspace(*se)) se++; + while (*se && !risspace(*se)) se++; if (*se != '\0') *se++ = '\0'; #if 0 /* XXX doesn't seem to do anything useful, only break things... */ @@ -617,7 +617,7 @@ static rpmRC doReadRC( FD_t fd, const char * urlfn) if (option->archSpecific) { arch = se; - while (*se && !xisspace(*se)) se++; + while (*se && !risspace(*se)) se++; if (*se == '\0') { rpmlog(RPMLOG_ERR, _("missing architecture for %s at %s:%d\n"), @@ -625,7 +625,7 @@ static rpmRC doReadRC( FD_t fd, const char * urlfn) return RPMRC_FAIL; } *se++ = '\0'; - while (*se && xisspace(*se)) se++; + while (*se && risspace(*se)) se++; if (*se == '\0') { rpmlog(RPMLOG_ERR, _("missing argument for %s at %s:%d\n"), @@ -1071,7 +1071,7 @@ static void defaultMachine(const char ** arch, for (fd = 0; (un.release[fd] != 0 && (fd < sizeof(un.release))); fd++) { - if (!xisdigit(un.release[fd]) && (un.release[fd] != '.')) { + if (!risdigit(un.release[fd]) && (un.release[fd] != '.')) { un.release[fd] = 0; break; } @@ -1481,7 +1481,7 @@ static void rpmRebuildTargetVars(const char ** target, const char ** canontarget if ((co = strrchr(c, '-')) == NULL) { co = c; } else { - if (!xstrcasecmp(co, "-gnu")) + if (!rstrcasecmp(co, "-gnu")) *co = '\0'; if ((co = strrchr(c, '-')) == NULL) co = c; @@ -1507,7 +1507,7 @@ static void rpmRebuildTargetVars(const char ** target, const char ** canontarget ca = (a) ? xstrdup(a) : NULL; } for (x = 0; ca[x] != '\0'; x++) - ca[x] = xtolower(ca[x]); + ca[x] = rtolower(ca[x]); if (co == NULL) { const char *o = NULL; @@ -1515,7 +1515,7 @@ static void rpmRebuildTargetVars(const char ** target, const char ** canontarget co = (o) ? xstrdup(o) : NULL; } for (x = 0; co[x] != '\0'; x++) - co[x] = xtolower(co[x]); + co[x] = rtolower(co[x]); /* XXX For now, set canonical target to arch-os */ if (ct == NULL) { diff --git a/lib/rpmts.c b/lib/rpmts.c index b1f539150..380028e62 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -209,7 +209,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, return NULL; } /* Parse explicit epoch. */ - for (se = s; *se && xisdigit(*se); se++) + for (se = s; *se && risdigit(*se); se++) {}; if (*se == ':') { /* XXX skip explicit epoch's (for now) */ diff --git a/lib/rpmvercmp.c b/lib/rpmvercmp.c index ba5c4720d..d3190c1b1 100644 --- a/lib/rpmvercmp.c +++ b/lib/rpmvercmp.c @@ -35,8 +35,8 @@ int rpmvercmp(const char * a, const char * b) /* loop through each version segment of str1 and str2 and compare them */ while (*one && *two) { - while (*one && !xisalnum(*one)) one++; - while (*two && !xisalnum(*two)) two++; + while (*one && !risalnum(*one)) one++; + while (*two && !risalnum(*two)) two++; /* If we ran to the end of either, we are finished with the loop */ if (!(*one && *two)) break; @@ -47,13 +47,13 @@ int rpmvercmp(const char * a, const char * b) /* grab first completely alpha or completely numeric segment */ /* leave one and two pointing to the start of the alpha or numeric */ /* segment and walk str1 and str2 to end of segment */ - if (xisdigit(*str1)) { - while (*str1 && xisdigit(*str1)) str1++; - while (*str2 && xisdigit(*str2)) str2++; + if (risdigit(*str1)) { + while (*str1 && risdigit(*str1)) str1++; + while (*str2 && risdigit(*str2)) str2++; isnum = 1; } else { - while (*str1 && xisalpha(*str1)) str1++; - while (*str2 && xisalpha(*str2)) str2++; + while (*str1 && risalpha(*str1)) str1++; + while (*str2 && risalpha(*str2)) str2++; isnum = 0; } diff --git a/lib/signature.c b/lib/signature.c index f0f6a58ff..6ad3d61da 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -44,13 +44,13 @@ int rpmLookupSignatureType(int action) { char *name = rpmExpand("%{?_signature}", NULL); if (!(name && *name != '\0')) rc = 0; - else if (!xstrcasecmp(name, "none")) + else if (!rstrcasecmp(name, "none")) rc = 0; - else if (!xstrcasecmp(name, "pgp")) + else if (!rstrcasecmp(name, "pgp")) rc = RPMSIGTAG_PGP; - else if (!xstrcasecmp(name, "pgp5")) /* XXX legacy */ + else if (!rstrcasecmp(name, "pgp5")) /* XXX legacy */ rc = RPMSIGTAG_PGP; - else if (!xstrcasecmp(name, "gpg")) + else if (!rstrcasecmp(name, "gpg")) rc = RPMSIGTAG_GPG; else rc = -1; /* Invalid %_signature spec in macro file */ |