Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jun 2018 21:18:21 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335341 - in head: share/man/man9 sys/contrib/libnv sys/sys
Message-ID:  <201806182118.w5ILILHm085167@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Mon Jun 18 21:18:20 2018
New Revision: 335341
URL: https://svnweb.freebsd.org/changeset/base/335341

Log:
  libnv: change name of cookie from cookiep to cookie.
  
  The name was inconsistent with rest of the library.
  No functional change intended.
  
  Pointed out by:	pjd@

Modified:
  head/share/man/man9/cnv.9
  head/sys/contrib/libnv/cnvlist.c
  head/sys/sys/cnv.h

Modified: head/share/man/man9/cnv.9
==============================================================================
--- head/share/man/man9/cnv.9	Mon Jun 18 20:42:53 2018	(r335340)
+++ head/share/man/man9/cnv.9	Mon Jun 18 21:18:20 2018	(r335341)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 18, 2018
+.Dd June 18, 2018
 .Dt CNV 9
 .Os
 .Sh NAME
@@ -38,80 +38,80 @@
 .Sh SYNOPSIS
 .In sys/cnv.h
 .Ft const char *
-.Fn cnvlist_name "void *cookiep"
+.Fn cnvlist_name "void *cookie"
 .Ft int
-.Fn cnvlist_type "void *cookiep"
+.Fn cnvlist_type "void *cookie"
 .\"
 .Ft bool
-.Fn cnvlist_get_bool "void *cookiep"
+.Fn cnvlist_get_bool "void *cookie"
 .Ft uint64_t
-.Fn cnvlist_get_number "void *cookiep"
+.Fn cnvlist_get_number "void *cookie"
 .Ft "const char *"
-.Fn cnvlist_get_string "void *cookiep"
+.Fn cnvlist_get_string "void *cookie"
 .Ft "const nvlist_t *"
-.Fn cnvlist_get_nvlist "void *cookiep"
+.Fn cnvlist_get_nvlist "void *cookie"
 .Ft "const void *"
-.Fn cnvlist_get_binary "void *cookiep" "size_t *sizep"
+.Fn cnvlist_get_binary "void *cookie" "size_t *sizep"
 .Ft "const bool *"
-.Fn cnvlist_get_bool_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp"
 .Ft "const uint64_t *"
-.Fn cnvlist_get_number_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp"
 .Ft "const char * const *"
-.Fn cnvlist_get_string_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp"
 .Ft "const nvlist_t * const *"
-.Fn cnvlist_get_nvlist_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp"
 .Ft int
-.Fn cnvlist_get_descriptor "void *cookiep"
+.Fn cnvlist_get_descriptor "void *cookie"
 .Ft "const int *"
-.Fn cnvlist_get_descriptor_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp"
 .\"
 .Ft bool
-.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie"
 .Ft uint64_t
-.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookie"
 .Ft "const char *"
-.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookie"
 .Ft "const nvlist_t *"
-.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookie"
 .Ft "const void *"
-.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookiep" "size_t *sizep"
+.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookie" "size_t *sizep"
 .Ft "const bool *"
-.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const uint64_t *"
-.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const char * const *"
-.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const nvlist_t * const *"
-.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft int
-.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookie"
 .Ft "const int *"
-.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .\"
 .Ft void
-.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookie"
 .Sh DESCRIPTION
 The
 .Nm libnv

Modified: head/sys/contrib/libnv/cnvlist.c
==============================================================================
--- head/sys/contrib/libnv/cnvlist.c	Mon Jun 18 20:42:53 2018	(r335340)
+++ head/sys/contrib/libnv/cnvlist.c	Mon Jun 18 21:18:20 2018	(r335341)
@@ -56,29 +56,29 @@ __FBSDID("$FreeBSD$");
 #include "nvpair_impl.h"
 
 const char *
-cnvlist_name(void *cookiep)
+cnvlist_name(void *cookie)
 {
 
-	return (nvpair_name(cookiep));
+	return (nvpair_name(cookie));
 }
 
 int
-cnvlist_type(void *cookiep)
+cnvlist_type(void *cookie)
 {
 
-	return (nvpair_type(cookiep));
+	return (nvpair_type(cookie));
 }
 
 #define	CNVLIST_GET(ftype, type, NVTYPE)				\
 ftype									\
-cnvlist_get_##type(void *cookiep)					\
+cnvlist_get_##type(void *cookie)					\
 {									\
 									\
-	if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) {			\
+	if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {			\
 		nvlist_report_missing(NV_TYPE_##NVTYPE,			\
-		    nvpair_name(cookiep));				\
+		    nvpair_name(cookie));				\
 	}								\
-        return (nvpair_get_##type(cookiep));				\
+        return (nvpair_get_##type(cookie));				\
 }
 
 CNVLIST_GET(bool, bool, BOOL)
@@ -93,14 +93,14 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR)
 
 #define	CNVLIST_GET_ARRAY(ftype, type, NVTYPE)				\
 ftype									\
-cnvlist_get_##type(void *cookiep, size_t *nitemsp)			\
+cnvlist_get_##type(void *cookie, size_t *nitemsp)			\
 {									\
 									\
-	if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) {			\
+	if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {			\
 		nvlist_report_missing(NV_TYPE_##NVTYPE,			\
-		    nvpair_name(cookiep));				\
+		    nvpair_name(cookie));				\
 	}								\
-	return (nvpair_get_##type(cookiep, nitemsp));			\
+	return (nvpair_get_##type(cookie, nitemsp));			\
 }
 
 CNVLIST_GET_ARRAY(const bool *, bool_array, BOOL_ARRAY)
@@ -114,27 +114,27 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCR
 #undef	CNVLIST_GET_ARRAY
 
 const void *
-cnvlist_get_binary(void *cookiep, size_t *sizep)
+cnvlist_get_binary(void *cookie, size_t *sizep)
 {
 
-	if (nvpair_type(cookiep) != NV_TYPE_BINARY)
-		nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep));
-	return (nvpair_get_binary(cookiep, sizep));
+	if (nvpair_type(cookie) != NV_TYPE_BINARY)
+		nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookie));
+	return (nvpair_get_binary(cookie, sizep));
 }
 
 #define CNVLIST_TAKE(ftype, type, NVTYPE)				\
 ftype									\
-cnvlist_take_##type(nvlist_t *nvl, void *cookiep)			\
+cnvlist_take_##type(nvlist_t *nvl, void *cookie)			\
 {									\
 	ftype value;							\
 									\
-	if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) {			\
+	if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {			\
 		nvlist_report_missing(NV_TYPE_##NVTYPE,			\
-		    nvpair_name(cookiep));				\
+		    nvpair_name(cookie));				\
 	}								\
-	value = (ftype)(intptr_t)nvpair_get_##type(cookiep);		\
-	nvlist_remove_nvpair(nvl, cookiep);				\
-	nvpair_free_structure(cookiep);					\
+	value = (ftype)(intptr_t)nvpair_get_##type(cookie);		\
+	nvlist_remove_nvpair(nvl, cookie);				\
+	nvpair_free_structure(cookie);					\
 	return (value);							\
 }
 
@@ -150,17 +150,17 @@ CNVLIST_TAKE(int, descriptor, DESCRIPTOR)
 
 #define	CNVLIST_TAKE_ARRAY(ftype, type, NVTYPE)				\
 ftype									\
-cnvlist_take_##type(nvlist_t *nvl, void *cookiep, size_t *nitemsp)	\
+cnvlist_take_##type(nvlist_t *nvl, void *cookie, size_t *nitemsp)	\
 {									\
 	ftype value;							\
 									\
-	if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) {			\
+	if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {			\
 		nvlist_report_missing(NV_TYPE_##NVTYPE,			\
-		    nvpair_name(cookiep));				\
+		    nvpair_name(cookie));				\
 	}								\
-	value = (ftype)(intptr_t)nvpair_get_##type(cookiep, nitemsp);	\
-	nvlist_remove_nvpair(nvl, cookiep);				\
-	nvpair_free_structure(cookiep);					\
+	value = (ftype)(intptr_t)nvpair_get_##type(cookie, nitemsp);	\
+	nvlist_remove_nvpair(nvl, cookie);				\
+	nvpair_free_structure(cookie);					\
 	return (value);							\
 }
 
@@ -175,25 +175,25 @@ CNVLIST_TAKE_ARRAY(int *, descriptor_array, DESCRIPTOR
 #undef	CNVLIST_TAKE_ARRAY
 
 void *
-cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep)
+cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep)
 {
 	void *value;
 
-	if (nvpair_type(cookiep) != NV_TYPE_BINARY)
-		nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep));
-	value = (void *)(intptr_t)nvpair_get_binary(cookiep, sizep);
-	nvlist_remove_nvpair(nvl, cookiep);
-	nvpair_free_structure(cookiep);
+	if (nvpair_type(cookie) != NV_TYPE_BINARY)
+		nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookie));
+	value = (void *)(intptr_t)nvpair_get_binary(cookie, sizep);
+	nvlist_remove_nvpair(nvl, cookie);
+	nvpair_free_structure(cookie);
 	return (value);
 }
 
 
 #define	CNVLIST_FREE(type)						\
 void									\
-cnvlist_free_##type(nvlist_t *nvl, void *cookiep)			\
+cnvlist_free_##type(nvlist_t *nvl, void *cookie)			\
 {									\
 									\
-	nvlist_free_nvpair(nvl, cookiep);				\
+	nvlist_free_nvpair(nvl, cookie);				\
 }
 
 CNVLIST_FREE(bool)

Modified: head/sys/sys/cnv.h
==============================================================================
--- head/sys/sys/cnv.h	Mon Jun 18 20:42:53 2018	(r335340)
+++ head/sys/sys/cnv.h	Mon Jun 18 21:18:20 2018	(r335341)
@@ -52,8 +52,8 @@ __BEGIN_DECLS
 /*
  * Functions which returns information about the given cookie.
  */
-const char	*cnvlist_name(void *cookiep);
-int		 cnvlist_type(void *cookiep);
+const char	*cnvlist_name(void *cookie);
+int		 cnvlist_type(void *cookie);
 
 /*
  * The cnvlist_get functions returns value associated with the given cookie.
@@ -61,18 +61,18 @@ int		 cnvlist_type(void *cookiep);
  * not be freed by the caller.
  */
 
-bool			 cnvlist_get_bool(void *cookiep);
-uint64_t		 cnvlist_get_number(void *cookiep);
-const char		*cnvlist_get_string(void *cookiep);
-const nvlist_t		*cnvlist_get_nvlist(void *cookiep);
-const void		*cnvlist_get_binary(void *cookiep, size_t *sizep);
-const bool		*cnvlist_get_bool_array(void *cookiep, size_t *nitemsp);
-const uint64_t		*cnvlist_get_number_array(void *cookiep, size_t *nitemsp);
-const char * const	*cnvlist_get_string_array(void *cookiep, size_t *nitemsp);
-const nvlist_t * const	*cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp);
+bool			 cnvlist_get_bool(void *cookie);
+uint64_t		 cnvlist_get_number(void *cookie);
+const char		*cnvlist_get_string(void *cookie);
+const nvlist_t		*cnvlist_get_nvlist(void *cookie);
+const void		*cnvlist_get_binary(void *cookie, size_t *sizep);
+const bool		*cnvlist_get_bool_array(void *cookie, size_t *nitemsp);
+const uint64_t		*cnvlist_get_number_array(void *cookie, size_t *nitemsp);
+const char * const	*cnvlist_get_string_array(void *cookie, size_t *nitemsp);
+const nvlist_t * const	*cnvlist_get_nvlist_array(void *cookie, size_t *nitemsp);
 #ifndef _KERNEL
-int			 cnvlist_get_descriptor(void *cookiep);
-const int		*cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp);
+int			 cnvlist_get_descriptor(void *cookie);
+const int		*cnvlist_get_descriptor_array(void *cookie, size_t *nitemsp);
 #endif
 
 
@@ -82,18 +82,18 @@ const int		*cnvlist_get_descriptor_array(void *cookiep
  * The caller is responsible for freeing received data.
  */
 
-bool			  cnvlist_take_bool(nvlist_t *nvl, void *cookiep);
-uint64_t		  cnvlist_take_number(nvlist_t *nvl, void *cookiep);
-char			 *cnvlist_take_string(nvlist_t *nvl, void *cookiep);
-nvlist_t		 *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep);
-void			 *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep);
-bool			 *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp);
-uint64_t		 *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp);
-char			**cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp);
-nvlist_t		**cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp);
+bool			  cnvlist_take_bool(nvlist_t *nvl, void *cookie);
+uint64_t		  cnvlist_take_number(nvlist_t *nvl, void *cookie);
+char			 *cnvlist_take_string(nvlist_t *nvl, void *cookie);
+nvlist_t		 *cnvlist_take_nvlist(nvlist_t *nvl, void *cookie);
+void			 *cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep);
+bool			 *cnvlist_take_bool_array(nvlist_t *nvl, void *cookie, size_t *nitemsp);
+uint64_t		 *cnvlist_take_number_array(nvlist_t *nvl, void *cookie, size_t *nitemsp);
+char			**cnvlist_take_string_array(nvlist_t *nvl, void *cookie, size_t *nitemsp);
+nvlist_t		**cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookie, size_t *nitemsp);
 #ifndef _KERNEL
-int			  cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep);
-int			 *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp);
+int			  cnvlist_take_descriptor(nvlist_t *nvl, void *cookie);
+int			 *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookie, size_t *nitemsp);
 #endif
 
 /*
@@ -101,18 +101,18 @@ int			 *cnvlist_take_descriptor_array(nvlist_t *nvl, v
  * and frees memory associated with it.
  */
 
-void	cnvlist_free_bool(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_number(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_string(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_binary(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_number_array(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_string_array(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep);
+void	cnvlist_free_bool(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_number(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_string(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_nvlist(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_binary(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_bool_array(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_number_array(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_string_array(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookie);
 #ifndef _KERNEL
-void	cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
-void	cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep);
+void	cnvlist_free_descriptor(nvlist_t *nvl, void *cookie);
+void	cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookie);
 #endif
 
 __END_DECLS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806182118.w5ILILHm085167>