1 .\" $NetBSD: prop_array_util.3,v 1.2 2008/06/04 07:46:48 wiz Exp $
3 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Jason R. Thorpe.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nm prop_array_get_bool ,
36 .Nm prop_array_set_bool ,
37 .Nm prop_array_get_int8 ,
38 .Nm prop_array_get_uint8 ,
39 .Nm prop_array_set_int8 ,
40 .Nm prop_array_set_uint8 ,
41 .Nm prop_array_get_int16 ,
42 .Nm prop_array_get_uint16 ,
43 .Nm prop_array_set_int16 ,
44 .Nm prop_array_set_uint16 ,
45 .Nm prop_array_get_int32 ,
46 .Nm prop_array_get_uint32 ,
47 .Nm prop_array_set_int32 ,
48 .Nm prop_array_set_uint32 ,
49 .Nm prop_array_get_int64 ,
50 .Nm prop_array_get_uint64 ,
51 .Nm prop_array_set_int64 ,
52 .Nm prop_array_set_uint64 ,
53 .Nm prop_array_add_int8 ,
54 .Nm prop_array_add_uint8 ,
55 .Nm prop_array_add_int16 ,
56 .Nm prop_array_add_uint16 ,
57 .Nm prop_array_add_int32 ,
58 .Nm prop_array_add_uint32 ,
59 .Nm prop_array_add_int64 ,
60 .Nm prop_array_add_uint64 ,
61 .Nm prop_array_get_cstring ,
62 .Nm prop_array_set_cstring ,
63 .Nm prop_array_get_cstring_nocopy ,
64 .Nm prop_array_set_cstring_nocopy
71 .Fn prop_array_get_bool "prop_array_t dict" "unsigned int indx" \
74 .Fn prop_array_set_bool "prop_array_t dict" "unsigned int indx" \
78 .Fn prop_array_get_int8 "prop_array_t dict" "unsigned int indx" \
81 .Fn prop_array_get_uint8 "prop_array_t dict" "unsigned int indx" \
84 .Fn prop_array_set_int8 "prop_array_t dict" "unsigned int indx" \
87 .Fn prop_array_set_uint8 "prop_array_t dict" "unsigned int indx" \
91 .Fn prop_array_get_int16 "prop_array_t dict" "unsigned int indx" \
94 .Fn prop_array_get_uint16 "prop_array_t dict" "unsigned int indx" \
97 .Fn prop_array_set_int16 "prop_array_t dict" "unsigned int indx" \
100 .Fn prop_array_set_uint16 "prop_array_t dict" "unsigned int indx" \
104 .Fn prop_array_get_int32 "prop_array_t dict" "unsigned int indx" \
107 .Fn prop_array_get_uint32 "prop_array_t dict" "unsigned int indx" \
110 .Fn prop_array_set_int32 "prop_array_t dict" "unsigned int indx" \
113 .Fn prop_array_set_uint32 "prop_array_t dict" "unsigned int indx" \
117 .Fn prop_array_get_int64 "prop_array_t dict" "unsigned int indx" \
120 .Fn prop_array_get_uint64 "prop_array_t dict" "unsigned int indx" \
123 .Fn prop_array_set_int64 "prop_array_t dict" "unsigned int indx" \
126 .Fn prop_array_set_uint64 "prop_array_t dict" "unsigned int indx" \
130 .Fn prop_array_set_int32 "prop_array_t dict" "unsigned int indx" \
133 .Fn prop_array_set_uint32 "prop_array_t dict" "unsigned int indx" \
137 .Fn prop_array_add_int8 "prop_array_t dict" "int8_t val"
139 .Fn prop_array_add_uint8 "prop_array_t dict" "uint8_t val"
141 .Fn prop_array_add_int16 "prop_array_t dict" "int16_t val"
143 .Fn prop_array_add_uint16 "prop_array_t dict" "uint16_t val"
145 .Fn prop_array_add_int32 "prop_array_t dict" "int32_t val"
147 .Fn prop_array_add_uint32 "prop_array_t dict" "uint32_t val"
149 .Fn prop_array_add_int64 "prop_array_t dict" "int64_t val"
151 .Fn prop_array_add_uint64 "prop_array_t dict" "uint64_t val"
154 .Fn prop_array_get_cstring "prop_array_t dict" "unsigned int indx" \
157 .Fn prop_array_set_cstring "prop_array_t dict" "unsigned int indx" \
161 .Fn prop_array_get_cstring_nocopy "prop_array_t dict" \
162 "unsigned int indx" "const char **strp"
164 .Fn prop_array_set_cstring_nocopy "prop_array_t dict" \
165 "unsigned int indx" "const char *strp"
169 family of functions are provided to make getting and setting values in
170 arrays more convenient in some applications.
172 The getters check the type of the returned object and, in some cases, also
173 ensure that the returned value is within the range implied by the getter's
176 The setters handle object creation and release for the caller.
179 .Fn prop_array_get_cstring
180 function returns dynamically allocated memory.
183 for more information.
186 .Fn prop_array_get_cstring_nocopy
188 .Fn prop_array_set_cstring_nocopy
189 functions do not copy the string that is set or returned.
192 for more information.
196 getter functions return
198 if the object exists in the array and the value is in-range, or
204 setter functions return
206 if creating the object and storing it in the array is successful, or
217 property container object library first appeared in