Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/compat Add strcasecmp



details:   https://anonhg.NetBSD.org/src/rev/49d26f910075
branches:  trunk
changeset: 834378:49d26f910075
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 11 16:24:59 2018 +0000

description:
Add strcasecmp

diffstat:

 tools/compat/Makefile           |   4 ++--
 tools/compat/compat_defs.h      |   5 ++++-
 tools/compat/configure          |  15 ++++++++++++++-
 tools/compat/configure.ac       |   6 +++---
 tools/compat/nbtool_config.h.in |   9 ++++++++-
 5 files changed, 31 insertions(+), 8 deletions(-)

diffs (128 lines):

diff -r e0ed3eb79869 -r 49d26f910075 tools/compat/Makefile
--- a/tools/compat/Makefile     Sat Aug 11 16:03:37 2018 +0000
+++ b/tools/compat/Makefile     Sat Aug 11 16:24:59 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.83 2018/05/01 19:59:46 christos Exp $
+#      $NetBSD: Makefile,v 1.84 2018/08/11 16:24:59 christos Exp $
 
 HOSTLIB=       nbcompat
 
@@ -19,7 +19,7 @@
                setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
                sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
                stat_flags.c strlcat.c strlcpy.c strmode.c \
-               strndup.c strnlen.c \
+               strcasecmp.c strndup.c strnlen.c \
                strsep.c strsuftoll.c strtoll.c \
                strtoi.c strtou.c \
                unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
diff -r e0ed3eb79869 -r 49d26f910075 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Sat Aug 11 16:03:37 2018 +0000
+++ b/tools/compat/compat_defs.h        Sat Aug 11 16:24:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.112 2018/06/13 04:17:43 maya Exp $   */
+/*     $NetBSD: compat_defs.h,v 1.113 2018/08/11 16:24:59 christos Exp $       */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -494,6 +494,9 @@
 #if !HAVE_DECL_STRNLEN
 size_t         strnlen(const char *, size_t);
 #endif
+#if !HAVE_DECL_STRCASECMP
+int            strcasecmp(const char *, const char *);
+#endif
 #if !HAVE_DECL_LCHFLAGS
 int            lchflags(const char *, unsigned long);
 #endif
diff -r e0ed3eb79869 -r 49d26f910075 tools/compat/configure
--- a/tools/compat/configure    Sat Aug 11 16:03:37 2018 +0000
+++ b/tools/compat/configure    Sat Aug 11 16:24:59 2018 +0000
@@ -5160,7 +5160,7 @@
        pwrite raise_default_signal random reallocarr setenv \
        setgroupent setprogname setpassent \
        snprintb_m snprintf strlcat strlcpy strmode \
-       strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+       strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
        user_from_uid uid_from_user vasprintf vasnprintf vsnprintf
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -5254,6 +5254,19 @@
 #define HAVE_DECL_PWCACHE_GROUPDB $ac_have_decl
 _ACEOF
 
+ac_fn_c_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "
+#include <string.h>
+
+"
+if test "x$ac_cv_have_decl_strcasecmp" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRCASECMP $ac_have_decl
+_ACEOF
 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "
 #include <string.h>
 
diff -r e0ed3eb79869 -r 49d26f910075 tools/compat/configure.ac
--- a/tools/compat/configure.ac Sat Aug 11 16:03:37 2018 +0000
+++ b/tools/compat/configure.ac Sat Aug 11 16:24:59 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.91 2018/06/13 04:17:43 maya Exp $
+#      $NetBSD: configure.ac,v 1.92 2018/08/11 16:24:59 christos Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -192,7 +192,7 @@
        pwrite raise_default_signal random reallocarr setenv \
        setgroupent setprogname setpassent \
        snprintb_m snprintf strlcat strlcpy strmode \
-       strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+       strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
        user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
 
 AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
@@ -201,7 +201,7 @@
 AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
 #include <grp.h>
 ])
-AC_CHECK_DECLS([strlcpy, strlcat, strndup, strnlen, strsep],,,[
+AC_CHECK_DECLS([strcasecmp, strlcpy, strlcat, strndup, strnlen, strsep],,,[
 #include <string.h>
 ])
 AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include <stdlib.h>])
diff -r e0ed3eb79869 -r 49d26f910075 tools/compat/nbtool_config.h.in
--- a/tools/compat/nbtool_config.h.in   Sat Aug 11 16:03:37 2018 +0000
+++ b/tools/compat/nbtool_config.h.in   Sat Aug 11 16:24:59 2018 +0000
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*      $NetBSD: nbtool_config.h.in,v 1.44 2018/06/13 04:17:43 maya Exp $    */
+/*      $NetBSD: nbtool_config.h.in,v 1.45 2018/08/11 16:24:59 christos Exp $    */
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -310,6 +310,10 @@
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
+/* Define to 1 if you have the declaration of `strcasecmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRCASECMP
+
 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
    don't. */
 #undef HAVE_DECL_STRLCAT
@@ -634,6 +638,9 @@
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 



Home | Main Index | Thread Index | Old Index