libnv: add const to cookies arguments
Pointed out by: pjd@
This commit is contained in:
parent
e596eca80f
commit
9d5f6dd992
@ -38,32 +38,32 @@
|
||||
.Sh SYNOPSIS
|
||||
.In sys/cnv.h
|
||||
.Ft const char *
|
||||
.Fn cnvlist_name "void *cookie"
|
||||
.Fn cnvlist_name "const void *cookie"
|
||||
.Ft int
|
||||
.Fn cnvlist_type "void *cookie"
|
||||
.Fn cnvlist_type "const void *cookie"
|
||||
.\"
|
||||
.Ft bool
|
||||
.Fn cnvlist_get_bool "void *cookie"
|
||||
.Fn cnvlist_get_bool "const void *cookie"
|
||||
.Ft uint64_t
|
||||
.Fn cnvlist_get_number "void *cookie"
|
||||
.Fn cnvlist_get_number "const void *cookie"
|
||||
.Ft "const char *"
|
||||
.Fn cnvlist_get_string "void *cookie"
|
||||
.Fn cnvlist_get_string "const void *cookie"
|
||||
.Ft "const nvlist_t *"
|
||||
.Fn cnvlist_get_nvlist "void *cookie"
|
||||
.Fn cnvlist_get_nvlist "const void *cookie"
|
||||
.Ft "const void *"
|
||||
.Fn cnvlist_get_binary "void *cookie" "size_t *sizep"
|
||||
.Fn cnvlist_get_binary "const void *cookie" "size_t *sizep"
|
||||
.Ft "const bool *"
|
||||
.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp"
|
||||
.Fn cnvlist_get_bool_array "const void *cookie" "size_t *nitemsp"
|
||||
.Ft "const uint64_t *"
|
||||
.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp"
|
||||
.Fn cnvlist_get_number_array "const void *cookie" "size_t *nitemsp"
|
||||
.Ft "const char * const *"
|
||||
.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp"
|
||||
.Fn cnvlist_get_string_array "const void *cookie" "size_t *nitemsp"
|
||||
.Ft "const nvlist_t * const *"
|
||||
.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp"
|
||||
.Fn cnvlist_get_nvlist_array "const void *cookie" "size_t *nitemsp"
|
||||
.Ft int
|
||||
.Fn cnvlist_get_descriptor "void *cookie"
|
||||
.Fn cnvlist_get_descriptor "const void *cookie"
|
||||
.Ft "const int *"
|
||||
.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp"
|
||||
.Fn cnvlist_get_descriptor_array "const void *cookie" "size_t *nitemsp"
|
||||
.\"
|
||||
.Ft bool
|
||||
.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie"
|
||||
|
@ -56,14 +56,14 @@ __FBSDID("$FreeBSD$");
|
||||
#include "nvpair_impl.h"
|
||||
|
||||
const char *
|
||||
cnvlist_name(void *cookie)
|
||||
cnvlist_name(const void *cookie)
|
||||
{
|
||||
|
||||
return (nvpair_name(cookie));
|
||||
}
|
||||
|
||||
int
|
||||
cnvlist_type(void *cookie)
|
||||
cnvlist_type(const void *cookie)
|
||||
{
|
||||
|
||||
return (nvpair_type(cookie));
|
||||
@ -71,7 +71,7 @@ cnvlist_type(void *cookie)
|
||||
|
||||
#define CNVLIST_GET(ftype, type, NVTYPE) \
|
||||
ftype \
|
||||
cnvlist_get_##type(void *cookie) \
|
||||
cnvlist_get_##type(const void *cookie) \
|
||||
{ \
|
||||
\
|
||||
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \
|
||||
@ -93,7 +93,7 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR)
|
||||
|
||||
#define CNVLIST_GET_ARRAY(ftype, type, NVTYPE) \
|
||||
ftype \
|
||||
cnvlist_get_##type(void *cookie, size_t *nitemsp) \
|
||||
cnvlist_get_##type(const void *cookie, size_t *nitemsp) \
|
||||
{ \
|
||||
\
|
||||
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \
|
||||
@ -114,7 +114,7 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCRIPTOR_ARRAY)
|
||||
#undef CNVLIST_GET_ARRAY
|
||||
|
||||
const void *
|
||||
cnvlist_get_binary(void *cookie, size_t *sizep)
|
||||
cnvlist_get_binary(const void *cookie, size_t *sizep)
|
||||
{
|
||||
|
||||
if (nvpair_type(cookie) != NV_TYPE_BINARY)
|
||||
|
@ -52,8 +52,8 @@ __BEGIN_DECLS
|
||||
/*
|
||||
* Functions which returns information about the given cookie.
|
||||
*/
|
||||
const char *cnvlist_name(void *cookie);
|
||||
int cnvlist_type(void *cookie);
|
||||
const char *cnvlist_name(const void *cookie);
|
||||
int cnvlist_type(const void *cookie);
|
||||
|
||||
/*
|
||||
* The cnvlist_get functions returns value associated with the given cookie.
|
||||
@ -61,18 +61,18 @@ int cnvlist_type(void *cookie);
|
||||
* not be freed by the caller.
|
||||
*/
|
||||
|
||||
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);
|
||||
bool cnvlist_get_bool(const void *cookie);
|
||||
uint64_t cnvlist_get_number(const void *cookie);
|
||||
const char *cnvlist_get_string(const void *cookie);
|
||||
const nvlist_t *cnvlist_get_nvlist(const void *cookie);
|
||||
const void *cnvlist_get_binary(const void *cookie, size_t *sizep);
|
||||
const bool *cnvlist_get_bool_array(const void *cookie, size_t *nitemsp);
|
||||
const uint64_t *cnvlist_get_number_array(const void *cookie, size_t *nitemsp);
|
||||
const char * const *cnvlist_get_string_array(const void *cookie, size_t *nitemsp);
|
||||
const nvlist_t * const *cnvlist_get_nvlist_array(const void *cookie, size_t *nitemsp);
|
||||
#ifndef _KERNEL
|
||||
int cnvlist_get_descriptor(void *cookie);
|
||||
const int *cnvlist_get_descriptor_array(void *cookie, size_t *nitemsp);
|
||||
int cnvlist_get_descriptor(const void *cookie);
|
||||
const int *cnvlist_get_descriptor_array(const void *cookie, size_t *nitemsp);
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user