xserver: Branch 'master'

Matthieu Herrb herrb at kemper.freedesktop.org
Sat Aug 9 14:52:09 PDT 2008


 dix/Makefile.am  |    4 ---
 dix/strcasecmp.c |   70 -------------------------------------------------------
 dix/strcasestr.c |   64 --------------------------------------------------
 os/Makefile.am   |    2 +
 os/strcasecmp.c  |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 os/strcasestr.c  |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 137 insertions(+), 137 deletions(-)

New commits:
commit 6e33e6f355f7f04e77a165eb67b1414724c1fba3
Author: Matthieu Herrb <matthieu.herrb at laas.fr>
Date:   Sat Aug 9 23:43:03 2008 +0200

    Move string comparaison functions to from dix/ to os/.

diff --git a/dix/Makefile.am b/dix/Makefile.am
index 45da45f..182311e 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -35,9 +35,7 @@ libdix_la_SOURCES = 	\
 	swaprep.c	\
 	swapreq.c	\
 	tables.c	\
-	window.c	\
-	strcasecmp.c	\
-	strcasestr.c
+	window.c
 
 EXTRA_DIST = buildatoms BuiltInAtoms CHANGES Xserver.d Xserver-dtrace.h.in
 
diff --git a/dix/strcasecmp.c b/dix/strcasecmp.c
deleted file mode 100644
index ca1051d..0000000
--- a/dix/strcasecmp.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1987, 1993
- *      The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <ctype.h>
-#include "dix.h"
-
-#ifdef NEED_STRCASECMP
-int
-xstrcasecmp(const char *str1, const char *str2)
-{
-    const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
-
-    while (tolower(*us1) == tolower(*us2)) {
-        if (*us1++ == '\0')
-            return (0);
-        us2++;
-    }
-
-    return (tolower(*us1) - tolower(*us2));
-}
-#endif
-
-#ifdef NEED_STRNCASECMP
-int
-xstrncasecmp(const char *s1, const char *s2, size_t n)
-{
-    if (n != 0) {
-        const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
-
-        do {
-            if (tolower(*us1) != tolower(*us2++))
-                return (tolower(*us1) - tolower(*--us2));
-            if (*us1++ == '\0')
-                break;
-        } while (--n != 0);
-    }
-
-    return 0;
-}
-#endif
diff --git a/dix/strcasestr.c b/dix/strcasestr.c
deleted file mode 100644
index b3d4549..0000000
--- a/dix/strcasestr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *      The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include "dix.h"
-
-/*
- * Find the first occurrence of find in s, ignore case.
- */
-#ifdef NEED_STRCASESTR
-char *
-xstrcasestr(const char *s, const char *find)
-{
-        char c, sc;
-        size_t len;
-
-        if ((c = *find++) != 0) {
-                c = tolower((unsigned char)c);
-                len = strlen(find);
-                do {
-                        do {
-                                if ((sc = *s++) == 0)
-                                        return (NULL);
-                        } while ((char)tolower((unsigned char)sc) != c);
-                } while (strncasecmp(s, find, len) != 0);
-                s--;
-        }
-        return ((char *)s);
-}
-#endif
diff --git a/os/Makefile.am b/os/Makefile.am
index 16e4bfa..16ecc15 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -18,6 +18,8 @@ libos_la_SOURCES = 	\
 	osdep.h		\
 	osinit.c	\
 	utils.c		\
+	strcasecmp.c	\
+	strcasestr.c	\
 	xdmauth.c	\
 	xstrans.c	\
 	xprintf.c	\
diff --git a/os/strcasecmp.c b/os/strcasecmp.c
new file mode 100644
index 0000000..ca1051d
--- /dev/null
+++ b/os/strcasecmp.c
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1987, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <ctype.h>
+#include "dix.h"
+
+#ifdef NEED_STRCASECMP
+int
+xstrcasecmp(const char *str1, const char *str2)
+{
+    const u_char *us1 = (const u_char *)str1, *us2 = (const u_char *)str2;
+
+    while (tolower(*us1) == tolower(*us2)) {
+        if (*us1++ == '\0')
+            return (0);
+        us2++;
+    }
+
+    return (tolower(*us1) - tolower(*us2));
+}
+#endif
+
+#ifdef NEED_STRNCASECMP
+int
+xstrncasecmp(const char *s1, const char *s2, size_t n)
+{
+    if (n != 0) {
+        const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2;
+
+        do {
+            if (tolower(*us1) != tolower(*us2++))
+                return (tolower(*us1) - tolower(*--us2));
+            if (*us1++ == '\0')
+                break;
+        } while (--n != 0);
+    }
+
+    return 0;
+}
+#endif
diff --git a/os/strcasestr.c b/os/strcasestr.c
new file mode 100644
index 0000000..b3d4549
--- /dev/null
+++ b/os/strcasestr.c
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 1990, 1993
+ *      The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <ctype.h>
+#include <string.h>
+#include "dix.h"
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+#ifdef NEED_STRCASESTR
+char *
+xstrcasestr(const char *s, const char *find)
+{
+        char c, sc;
+        size_t len;
+
+        if ((c = *find++) != 0) {
+                c = tolower((unsigned char)c);
+                len = strlen(find);
+                do {
+                        do {
+                                if ((sc = *s++) == 0)
+                                        return (NULL);
+                        } while ((char)tolower((unsigned char)sc) != c);
+                } while (strncasecmp(s, find, len) != 0);
+                s--;
+        }
+        return ((char *)s);
+}
+#endif


More information about the xorg-commit mailing list