summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 16:03:11 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-21 16:03:11 -0700
commit0b4873ce55e3afe2e1716ef4a21cd94a7ae96e64 (patch)
treeb2b3c1eef0028a03e34dbde691c84ddbc00990b9 /utils.c
parente26102f28f08e5432b1ad44bbaef7f32aff199f6 (diff)
Assume target platforms have strcasecmp, strncasecmp, & strdup now
All have been required since Unix98/SUSv2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/merge_requests/23>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/utils.c b/utils.c
index deb96ea..2dcb994 100644
--- a/utils.c
+++ b/utils.c
@@ -262,71 +262,3 @@ uFinishUp(void)
fprintf(errorFile, "%s\n", postMsg);
return;
}
-
-/***====================================================================***/
-
-#ifndef HAVE_STRDUP
-char *
-uStringDup(const char *str)
-{
- char *rtrn;
-
- if (str == NULL)
- return NULL;
- rtrn = malloc(strlen(str) + 1);
- strcpy(rtrn, str);
- return rtrn;
-}
-#endif
-
-#ifndef HAVE_STRCASECMP
-int
-uStrCaseCmp(const char *str1, const char *str2)
-{
- char buf1[512], buf2[512];
- char c, *s;
- int n;
-
- for (n = 0, s = buf1; (c = *str1++); n++)
- {
- if (isupper(c))
- c = tolower(c);
- if (n > 510)
- break;
- *s++ = c;
- }
- *s = '\0';
- for (n = 0, s = buf2; (c = *str2++); n++)
- {
- if (isupper(c))
- c = tolower(c);
- if (n > 510)
- break;
- *s++ = c;
- }
- *s = '\0';
- return (strcmp(buf1, buf2));
-}
-
-int
-uStrCasePrefix(const char *my_prefix, const char *str)
-{
- char c1;
- char c2;
- while (((c1 = *my_prefix) != '\0') && ((c2 = *str) != '\0'))
- {
- if (isupper(c1))
- c1 = tolower(c1);
- if (isupper(c2))
- c2 = tolower(c2);
- if (c1 != c2)
- return 0;
- my_prefix++;
- str++;
- }
- if (c1 != '\0')
- return 0;
- return 1;
-}
-
-#endif