1 .\" $NetBSD: prop_data.3,v 1.6 2008/04/30 13:10:46 martin 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_data_create_data ,
36 .Nm prop_data_create_data_nocopy ,
40 .Nm prop_data_data_nocopy ,
41 .Nm prop_data_equals ,
42 .Nm prop_data_equals_data
43 .Nd opaque data value property object
50 .Fn prop_data_create_data "const void *blob" "size_t len"
52 .Fn prop_data_create_data_nocopy "const void *blob" "size_t len"
55 .Fn prop_data_copy "prop_data_t data"
58 .Fn prop_data_size "prop_data_t data"
60 .Fn prop_data_data "prop_data_t data"
62 .Fn prop_data_data_nocopy "prop_data_t data"
65 .Fn prop_data_equals "prop_data_t dat1" "prop_data_t dat2"
67 .Fn prop_data_equals_data "prop_data_t data" "const void *blob" "size_t len"
71 family of functions operate on an opaque data value property object type.
72 .Bl -tag -width "xxxxx"
73 .It Fn prop_data_create_data "const void *blob" "size_t len"
74 Create a data object that contains a copy of
81 .It Fn prop_data_create_data_nocopy "const void *blob" "size_t len"
82 Create a data object that contains a reference to
89 .It Fn prop_data_copy "prop_data_t data"
91 If the data object being copied is an external data reference,
92 then the copy also references the same external data.
96 .It Fn prop_data_size "prop_data_t data"
97 Returns the size of the data object.
98 If the supplied object isn't a data object, zero is returned.
99 .It Fn prop_data_data "prop_data_t data"
100 Returns a copy of the data object's contents.
101 The caller is responsible for freeing the returned buffer.
102 If the supplied object isn't a data object or
103 if the data container is empty,
107 In user space, the buffer is allocated using
109 In the kernel, the buffer is allocated using
111 using the malloc type
113 .It Fn prop_data_data_nocopy "prop_data_t data"
114 Returns an immutable reference to the contents of the data object.
115 If the supplied object isn't a data object,
118 .It Fn prop_data_equals "prop_data_t dat1" "prop_data_t dat2"
121 if the two data objects are equivalent.
122 If at least one of the supplied objects isn't a data object,
125 .It Fn prop_data_equals_data "prop_data_t data" "const void *blob" "size_t len"
128 if the data object's value is equivalent to
132 If the supplied object isn't a data object,
139 .Xr prop_dictionary 3 ,
147 property container object library first appeared in