Source-Changes-HG archive

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

[src/trunk]: src/tools/compat add strncasecmp



details:   https://anonhg.NetBSD.org/src/rev/d5cc5d70bdd0
branches:  trunk
changeset: 365468:d5cc5d70bdd0
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 16 12:03:36 2018 +0000

description:
add strncasecmp

diffstat:

 tools/compat/Makefile           |   4 ++--
 tools/compat/configure          |  16 +++++++++++++++-
 tools/compat/configure.ac       |  11 +++++++----
 tools/compat/nbtool_config.h.in |   9 ++++++++-
 4 files changed, 32 insertions(+), 8 deletions(-)

diffs (122 lines):

diff -r 7854eac3c603 -r d5cc5d70bdd0 tools/compat/Makefile
--- a/tools/compat/Makefile     Thu Aug 16 12:03:10 2018 +0000
+++ b/tools/compat/Makefile     Thu Aug 16 12:03:36 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.84 2018/08/11 16:24:59 christos Exp $
+#      $NetBSD: Makefile,v 1.85 2018/08/16 12:03:36 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 \
-               strcasecmp.c strndup.c strnlen.c \
+               strcasecmp.c strncasecmp.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 7854eac3c603 -r d5cc5d70bdd0 tools/compat/configure
--- a/tools/compat/configure    Thu Aug 16 12:03:10 2018 +0000
+++ b/tools/compat/configure    Thu Aug 16 12:03:36 2018 +0000
@@ -5160,7 +5160,8 @@
        pwrite raise_default_signal random reallocarr setenv \
        setgroupent setprogname setpassent \
        snprintb_m snprintf strlcat strlcpy strmode \
-       strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+       strcasecmp strncasecmp 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`
@@ -5267,6 +5268,19 @@
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_STRCASECMP $ac_have_decl
 _ACEOF
+ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "
+#include <string.h>
+
+"
+if test "x$ac_cv_have_decl_strncasecmp" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCASECMP $ac_have_decl
+_ACEOF
 ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "
 #include <string.h>
 
diff -r 7854eac3c603 -r d5cc5d70bdd0 tools/compat/configure.ac
--- a/tools/compat/configure.ac Thu Aug 16 12:03:10 2018 +0000
+++ b/tools/compat/configure.ac Thu Aug 16 12:03:36 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.92 2018/08/11 16:24:59 christos Exp $
+#      $NetBSD: configure.ac,v 1.93 2018/08/16 12:03:36 christos Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -192,7 +192,8 @@
        pwrite raise_default_signal random reallocarr setenv \
        setgroupent setprogname setpassent \
        snprintb_m snprintf strlcat strlcpy strmode \
-       strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \
+       strcasecmp strncasecmp 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 +202,8 @@
 AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
 #include <grp.h>
 ])
-AC_CHECK_DECLS([strcasecmp, strlcpy, strlcat, strndup, strnlen, strsep],,,[
+AC_CHECK_DECLS([strcasecmp, strncasecmp, strlcpy, strlcat, strndup,
+               strnlen, strsep],,,[
 #include <string.h>
 ])
 AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include <stdlib.h>])
@@ -210,7 +212,8 @@
 #include <unistd.h>
 ])
 
-AC_CHECK_DECLS([err, errc, errx, verrc, verrx, warn, warnc, warnx, vwarnc, vwarnx],,, [
+AC_CHECK_DECLS([err, errc, errx, verrc, verrx, warn, warnc, warnx, vwarnc,
+               vwarnx],,,[
 #ifdef HAVE_ERR_H
 #include <err.h>
 #endif
diff -r 7854eac3c603 -r d5cc5d70bdd0 tools/compat/nbtool_config.h.in
--- a/tools/compat/nbtool_config.h.in   Thu Aug 16 12:03:10 2018 +0000
+++ b/tools/compat/nbtool_config.h.in   Thu Aug 16 12:03:36 2018 +0000
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*      $NetBSD: nbtool_config.h.in,v 1.45 2018/08/11 16:24:59 christos Exp $    */
+/*      $NetBSD: nbtool_config.h.in,v 1.46 2018/08/16 12:03:36 christos Exp $    */
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -326,6 +326,10 @@
    don't. */
 #undef HAVE_DECL_STRMODE
 
+/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRNCASECMP
+
 /* Define to 1 if you have the declaration of `strndup', and to 0 if you
    don't. */
 #undef HAVE_DECL_STRNDUP
@@ -656,6 +660,9 @@
 /* Define to 1 if you have the `strmode' function. */
 #undef HAVE_STRMODE
 
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
 /* Define to 1 if you have the `strndup' function. */
 #undef HAVE_STRNDUP
 



Home | Main Index | Thread Index | Old Index