xref: /minix3/common/lib/libprop/prop_object.3 (revision 6b6d114a21a24bee45291fa4af8899e108396c4a)
1*6b6d114aSBen Gras.\"	$NetBSD: prop_object.3,v 1.8 2011/01/20 10:44:42 wiz Exp $
2*6b6d114aSBen Gras.\"
3*6b6d114aSBen Gras.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
4*6b6d114aSBen Gras.\" All rights reserved.
5*6b6d114aSBen Gras.\"
6*6b6d114aSBen Gras.\" This code is derived from software contributed to The NetBSD Foundation
7*6b6d114aSBen Gras.\" by Jason R. Thorpe.
8*6b6d114aSBen Gras.\"
9*6b6d114aSBen Gras.\" Redistribution and use in source and binary forms, with or without
10*6b6d114aSBen Gras.\" modification, are permitted provided that the following conditions
11*6b6d114aSBen Gras.\" are met:
12*6b6d114aSBen Gras.\" 1. Redistributions of source code must retain the above copyright
13*6b6d114aSBen Gras.\" notice, this list of conditions and the following disclaimer.
14*6b6d114aSBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
15*6b6d114aSBen Gras.\" notice, this list of conditions and the following disclaimer in the
16*6b6d114aSBen Gras.\" documentation and/or other materials provided with the distribution.
17*6b6d114aSBen Gras.\"
18*6b6d114aSBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19*6b6d114aSBen Gras.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20*6b6d114aSBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21*6b6d114aSBen Gras.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22*6b6d114aSBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23*6b6d114aSBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24*6b6d114aSBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25*6b6d114aSBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26*6b6d114aSBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27*6b6d114aSBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28*6b6d114aSBen Gras.\" POSSIBILITY OF SUCH DAMAGE.
29*6b6d114aSBen Gras.\"
30*6b6d114aSBen Gras.Dd August 21, 2006
31*6b6d114aSBen Gras.Dt PROP_OBJECT 3
32*6b6d114aSBen Gras.Os
33*6b6d114aSBen Gras.Sh NAME
34*6b6d114aSBen Gras.Nm prop_object ,
35*6b6d114aSBen Gras.Nm prop_object_retain ,
36*6b6d114aSBen Gras.Nm prop_object_release ,
37*6b6d114aSBen Gras.Nm prop_object_type ,
38*6b6d114aSBen Gras.Nm prop_object_equals ,
39*6b6d114aSBen Gras.Nm prop_object_iterator_next ,
40*6b6d114aSBen Gras.Nm prop_object_iterator_reset ,
41*6b6d114aSBen Gras.Nm prop_object_iterator_release
42*6b6d114aSBen Gras.Nd general property container object functions
43*6b6d114aSBen Gras.Sh LIBRARY
44*6b6d114aSBen Gras.Lb libprop
45*6b6d114aSBen Gras.Sh SYNOPSIS
46*6b6d114aSBen Gras.In prop/proplib.h
47*6b6d114aSBen Gras.\"
48*6b6d114aSBen Gras.Ft void
49*6b6d114aSBen Gras.Fn prop_object_retain "prop_object_t obj"
50*6b6d114aSBen Gras.Ft void
51*6b6d114aSBen Gras.Fn prop_object_release "prop_object_t obj"
52*6b6d114aSBen Gras.\"
53*6b6d114aSBen Gras.Ft prop_type_t
54*6b6d114aSBen Gras.Fn prop_object_type "prop_object_t obj"
55*6b6d114aSBen Gras.Ft bool
56*6b6d114aSBen Gras.Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2"
57*6b6d114aSBen Gras.\"
58*6b6d114aSBen Gras.Ft prop_object_t
59*6b6d114aSBen Gras.Fn prop_object_iterator_next "prop_object_iterator_t iter"
60*6b6d114aSBen Gras.Ft void
61*6b6d114aSBen Gras.Fn prop_object_iterator_reset "prop_object_iterator_t iter"
62*6b6d114aSBen Gras.Ft void
63*6b6d114aSBen Gras.Fn prop_object_iterator_release "prop_object_iterator_t iter"
64*6b6d114aSBen Gras.Sh DESCRIPTION
65*6b6d114aSBen GrasThe
66*6b6d114aSBen Gras.Nm prop_object
67*6b6d114aSBen Grasfamily of functions operate on all property container object types.
68*6b6d114aSBen Gras.Bl -tag -width ""
69*6b6d114aSBen Gras.It Fn prop_object_retain "prop_object_t obj"
70*6b6d114aSBen GrasIncrement the reference count on an object.
71*6b6d114aSBen Gras.It Fn prop_object_release "prop_object_t obj"
72*6b6d114aSBen GrasDecrement the reference count on an object.
73*6b6d114aSBen GrasIf the last reference is dropped, the object is freed.
74*6b6d114aSBen Gras.It Fn prop_object_type "prop_object_t obj"
75*6b6d114aSBen GrasDetermine the type of the object.
76*6b6d114aSBen GrasObjects are one of the following types:
77*6b6d114aSBen Gras.Pp
78*6b6d114aSBen Gras.Bl -tag -width "PROP_TYPE_DICT_KEYSYM" -compact
79*6b6d114aSBen Gras.It Dv PROP_TYPE_BOOL
80*6b6d114aSBen GrasBoolean value
81*6b6d114aSBen Gras.Pq prop_bool_t
82*6b6d114aSBen Gras.It Dv PROP_TYPE_NUMBER
83*6b6d114aSBen GrasNumber
84*6b6d114aSBen Gras.Pq prop_number_t
85*6b6d114aSBen Gras.It Dv PROP_TYPE_STRING
86*6b6d114aSBen GrasString
87*6b6d114aSBen Gras.Pq prop_string_t
88*6b6d114aSBen Gras.It Dv PROP_TYPE_DATA
89*6b6d114aSBen GrasOpaque data
90*6b6d114aSBen Gras.Pq prop_data_t
91*6b6d114aSBen Gras.It Dv PROP_TYPE_ARRAY
92*6b6d114aSBen GrasArray
93*6b6d114aSBen Gras.Pq prop_array_t
94*6b6d114aSBen Gras.It Dv PROP_TYPE_DICTIONARY
95*6b6d114aSBen GrasDictionary
96*6b6d114aSBen Gras.Pq prop_dictionary_t
97*6b6d114aSBen Gras.It Dv PROP_TYPE_DICT_KEYSYM
98*6b6d114aSBen GrasDictionary key symbol
99*6b6d114aSBen Gras.Pq prop_dictionary_keysym_t
100*6b6d114aSBen Gras.El
101*6b6d114aSBen Gras.Pp
102*6b6d114aSBen GrasIf
103*6b6d114aSBen Gras.Fa obj
104*6b6d114aSBen Grasis
105*6b6d114aSBen Gras.Dv NULL ,
106*6b6d114aSBen Grasthen
107*6b6d114aSBen Gras.Dv PROP_TYPE_UNKNOWN
108*6b6d114aSBen Grasis returned.
109*6b6d114aSBen Gras.It Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2"
110*6b6d114aSBen GrasReturns
111*6b6d114aSBen Gras.Dv true
112*6b6d114aSBen Grasif the two objects are of the same type and are equivalent.
113*6b6d114aSBen Gras.It Fn prop_object_iterator_next "prop_object_iterator_t iter"
114*6b6d114aSBen GrasReturn the next object in the collection
115*6b6d114aSBen Gras.Pq array or dictionary
116*6b6d114aSBen Grasbeing iterated by the iterator
117*6b6d114aSBen Gras.Fa iter .
118*6b6d114aSBen GrasIf there are no more objects in the collection,
119*6b6d114aSBen Gras.Dv NULL
120*6b6d114aSBen Grasis returned.
121*6b6d114aSBen Gras.It Fn prop_object_iterator_reset "prop_object_iterator_t iter"
122*6b6d114aSBen GrasReset the iterator to the first object in the collection being iterated
123*6b6d114aSBen Grasby the iterator
124*6b6d114aSBen Gras.Fa iter .
125*6b6d114aSBen Gras.It Fn prop_object_iterator_release "prop_object_iterator_t iter"
126*6b6d114aSBen GrasRelease the iterator
127*6b6d114aSBen Gras.Fa iter .
128*6b6d114aSBen Gras.El
129*6b6d114aSBen Gras.Sh SEE ALSO
130*6b6d114aSBen Gras.Xr prop_array 3 ,
131*6b6d114aSBen Gras.Xr prop_bool 3 ,
132*6b6d114aSBen Gras.Xr prop_data 3 ,
133*6b6d114aSBen Gras.Xr prop_dictionary 3 ,
134*6b6d114aSBen Gras.Xr prop_number 3 ,
135*6b6d114aSBen Gras.Xr prop_string 3 ,
136*6b6d114aSBen Gras.Xr proplib 3
137*6b6d114aSBen Gras.Sh HISTORY
138*6b6d114aSBen GrasThe
139*6b6d114aSBen Gras.Nm proplib
140*6b6d114aSBen Grasproperty container object library first appeared in
141*6b6d114aSBen Gras.Nx 4.0 .
142