New sentence, new line. Use Dq.diff -r1.9 -r1.10 src/common/lib/libprop/prop_number.3
(wiz)
--- src/common/lib/libprop/prop_number.3 2008/04/30 13:10:46 1.9
+++ src/common/lib/libprop/prop_number.3 2011/01/20 10:44:42 1.10
@@ -1,204 +1,210 @@ | @@ -1,204 +1,210 @@ | |||
1 | .\" $NetBSD: prop_number.3,v 1.9 2008/04/30 13:10:46 martin Exp $ | 1 | .\" $NetBSD: prop_number.3,v 1.10 2011/01/20 10:44:42 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Jason R. Thorpe. | 7 | .\" by Jason R. Thorpe. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | 15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | 16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 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 | 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 | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 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 | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd January 21, 2008 | 30 | .Dd January 21, 2008 | |
31 | .Dt PROP_NUMBER 3 | 31 | .Dt PROP_NUMBER 3 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm prop_number , | 34 | .Nm prop_number , | |
35 | .Nm prop_number_create_integer , | 35 | .Nm prop_number_create_integer , | |
36 | .Nm prop_number_create_unsigned_integer , | 36 | .Nm prop_number_create_unsigned_integer , | |
37 | .Nm prop_number_copy , | 37 | .Nm prop_number_copy , | |
38 | .Nm prop_number_size , | 38 | .Nm prop_number_size , | |
39 | .Nm prop_number_unsigned , | 39 | .Nm prop_number_unsigned , | |
40 | .Nm prop_number_integer_value , | 40 | .Nm prop_number_integer_value , | |
41 | .Nm prop_number_unsigned_integer_value , | 41 | .Nm prop_number_unsigned_integer_value , | |
42 | .Nm prop_number_equals , | 42 | .Nm prop_number_equals , | |
43 | .Nm prop_number_equals_integer , | 43 | .Nm prop_number_equals_integer , | |
44 | .Nm prop_number_equals_unsigned_integer | 44 | .Nm prop_number_equals_unsigned_integer | |
45 | .Nd numeric value property object | 45 | .Nd numeric value property object | |
46 | .Sh LIBRARY | 46 | .Sh LIBRARY | |
47 | .Lb libprop | 47 | .Lb libprop | |
48 | .Sh SYNOPSIS | 48 | .Sh SYNOPSIS | |
49 | .In prop/proplib.h | 49 | .In prop/proplib.h | |
50 | .\" | 50 | .\" | |
51 | .Ft prop_number_t | 51 | .Ft prop_number_t | |
52 | .Fn prop_number_create_integer "int64_t val" | 52 | .Fn prop_number_create_integer "int64_t val" | |
53 | .Ft prop_number_t | 53 | .Ft prop_number_t | |
54 | .Fn prop_number_create_unsigned_integer "uint64_t val" | 54 | .Fn prop_number_create_unsigned_integer "uint64_t val" | |
55 | .Ft prop_number_t | 55 | .Ft prop_number_t | |
56 | .Fn prop_number_copy "prop_number_t number" | 56 | .Fn prop_number_copy "prop_number_t number" | |
57 | .\" | 57 | .\" | |
58 | .Ft int | 58 | .Ft int | |
59 | .Fn prop_number_size "prop_number_t number" | 59 | .Fn prop_number_size "prop_number_t number" | |
60 | .Ft bool | 60 | .Ft bool | |
61 | .Fn prop_number_unsigned "prop_number_t number" | 61 | .Fn prop_number_unsigned "prop_number_t number" | |
62 | .Ft int64_t | 62 | .Ft int64_t | |
63 | .Fn prop_number_integer_value "prop_number_t number" | 63 | .Fn prop_number_integer_value "prop_number_t number" | |
64 | .Ft uint64_t | 64 | .Ft uint64_t | |
65 | .Fn prop_number_unsigned_integer_value "prop_number_t number" | 65 | .Fn prop_number_unsigned_integer_value "prop_number_t number" | |
66 | .\" | 66 | .\" | |
67 | .Ft bool | 67 | .Ft bool | |
68 | .Fn prop_number_equals "prop_number_t num1" "prop_number_t num2" | 68 | .Fn prop_number_equals "prop_number_t num1" "prop_number_t num2" | |
69 | .Ft bool | 69 | .Ft bool | |
70 | .Fn prop_number_equals_integer "prop_number_t number" "int64_t val" | 70 | .Fn prop_number_equals_integer "prop_number_t number" "int64_t val" | |
71 | .Ft bool | 71 | .Ft bool | |
72 | .Fn prop_number_equals_unsigned_integer "prop_number_t number" "uint64_t val" | 72 | .Fn prop_number_equals_unsigned_integer "prop_number_t number" "uint64_t val" | |
73 | .Sh DESCRIPTION | 73 | .Sh DESCRIPTION | |
74 | The | 74 | The | |
75 | .Nm prop_number | 75 | .Nm prop_number | |
76 | family of functions operate on a numeric value property object type. | 76 | family of functions operate on a numeric value property object type. | |
77 | Values are either signed or unsigned, and promoted to a 64-bit type | 77 | Values are either signed or unsigned, and promoted to a 64-bit type | |
78 | .Pq int64_t or uint64_t , respectively . | 78 | .Pq int64_t or uint64_t , respectively . | |
79 | .Pp | 79 | .Pp | |
80 | It is possible to compare number objects that differ in sign. | 80 | It is possible to compare number objects that differ in sign. | |
81 | Such comparisons first test to see if each object is within the valid | 81 | Such comparisons first test to see if each object is within the valid | |
82 | number range of the other: | 82 | number range of the other: | |
83 | .Bl -bullet | 83 | .Bl -bullet | |
84 | .It | 84 | .It | |
85 | Signed numbers that are greater than or equal to 0 can be compared to | 85 | Signed numbers that are greater than or equal to 0 can be compared to | |
86 | unsigned numbers. | 86 | unsigned numbers. | |
87 | .It | 87 | .It | |
88 | Unsigned numbers that are less than or equal to the largest signed 64-bit | 88 | Unsigned numbers that are less than or equal to the largest signed 64-bit | |
89 | value | 89 | value | |
90 | .Pq Dv INT64_MAX | 90 | .Pq Dv INT64_MAX | |
91 | can be compared to signed numbers. | 91 | can be compared to signed numbers. | |
92 | .El | 92 | .El | |
93 | .Pp | 93 | .Pp | |
94 | Number objects have a different externalized representation depending | 94 | Number objects have a different externalized representation depending | |
95 | on their sign: | 95 | on their sign: | |
96 | .Bl -bullet | 96 | .Bl -bullet | |
97 | .It | 97 | .It | |
98 | Signed numbers are externalized in base-10 | 98 | Signed numbers are externalized in base-10 | |
99 | .Pq decimal . | 99 | .Pq decimal . | |
100 | .It | 100 | .It | |
101 | Unsigned numbers are externalized in base-16 | 101 | Unsigned numbers are externalized in base-16 | |
102 | .Pq hexadecimal . | 102 | .Pq hexadecimal . | |
103 | .El | 103 | .El | |
104 | .Pp | 104 | .Pp | |
105 | When numbers are internalized, the sign of the resulting number object | 105 | When numbers are internalized, the sign of the resulting number object | |
106 | .Pq and thus its valid range | 106 | .Pq and thus its valid range | |
107 | is determined by a set of rules evaluated in the following order: | 107 | is determined by a set of rules evaluated in the following order: | |
108 | .Bl -bullet | 108 | .Bl -bullet | |
109 | .It | 109 | .It | |
110 | If the first character of the number is a | 110 | If the first character of the number is a | |
111 | .Sq - | 111 | .Sq - | |
112 | then the number is signed. | 112 | then the number is signed. | |
113 | .It | 113 | .It | |
114 | If the first two characters of the number are | 114 | If the first two characters of the number are | |
115 | .Sq 0x | 115 | .Sq 0x | |
116 | then the number is unsigned. | 116 | then the number is unsigned. | |
117 | .It | 117 | .It | |
118 | If the number value fits into the range of a signed number then the | 118 | If the number value fits into the range of a signed number then the | |
119 | number is signed. | 119 | number is signed. | |
120 | .It | 120 | .It | |
121 | In all other cases, the number is unsigned. | 121 | In all other cases, the number is unsigned. | |
122 | .El | 122 | .El | |
123 | .Bl -tag -width "xxxxx" | 123 | .Bl -tag -width "xxxxx" | |
124 | .It Fn prop_number_create_integer "int64_t val" | 124 | .It Fn prop_number_create_integer "int64_t val" | |
125 | Create a numeric value object with the signed value | 125 | Create a numeric value object with the signed value | |
126 | .Fa val . | 126 | .Fa val . | |
127 | Returns | 127 | Returns | |
128 | .Dv NULL | 128 | .Dv NULL | |
129 | on failure. | 129 | on failure. | |
130 | .It Fn prop_number_create_unsigned_integer "uint64_t val" | 130 | .It Fn prop_number_create_unsigned_integer "uint64_t val" | |
131 | Create a numeric value object with the unsigned value | 131 | Create a numeric value object with the unsigned value | |
132 | .Fa val . | 132 | .Fa val . | |
133 | Returns | 133 | Returns | |
134 | .Dv NULL | 134 | .Dv NULL | |
135 | on failure. | 135 | on failure. | |
136 | .It Fn prop_number_copy "prop_number_t number" | 136 | .It Fn prop_number_copy "prop_number_t number" | |
137 | Copy a numeric value object. | 137 | Copy a numeric value object. | |
138 | If the supplied object isn't a numeric value, | 138 | If the supplied object isn't a numeric value, | |
139 | .Dv NULL | 139 | .Dv NULL | |
140 | is returned. | 140 | is returned. | |
141 | .It Fn prop_number_size "prop_number_t number" | 141 | .It Fn prop_number_size "prop_number_t number" | |
142 | Returns 8, 16, 32, or 64, representing the number of bits required to | 142 | Returns 8, 16, 32, or 64, representing the number of bits required to | |
143 | hold the value of the object. | 143 | hold the value of the object. | |
144 | If the supplied object isn't a numeric value, | 144 | If the supplied object isn't a numeric value, | |
145 | .Dv NULL | 145 | .Dv NULL | |
146 | is returned. | 146 | is returned. | |
147 | .It Fn prop_number_unsigned "prop_number_t number" | 147 | .It Fn prop_number_unsigned "prop_number_t number" | |
148 | Returns | 148 | Returns | |
149 | .Dv true | 149 | .Dv true | |
150 | if the numeric value object has an unsigned value. | 150 | if the numeric value object has an unsigned value. | |
151 | .It Fn prop_number_integer_value "prop_number_t number" | 151 | .It Fn prop_number_integer_value "prop_number_t number" | |
152 | Returns the signed integer value of the numeric value object. | 152 | Returns the signed integer value of the numeric value object. | |
153 | If the supplied object isn't a numeric value, zero is returned. Thus, | 153 | If the supplied object isn't a numeric value, zero is returned. | |
154 | it is not possible to distinguish between ``not a prop_number_t'' | 154 | Thus, | |
155 | and ``prop_number_t has a value of 0''. | 155 | it is not possible to distinguish between | |
156 | .Dq not a prop_number_t | |||
157 | and | |||
158 | .Dq prop_number_t has a value of 0 . | |||
156 | .It Fn prop_number_unsigned_integer_value "prop_number_t number" | 159 | .It Fn prop_number_unsigned_integer_value "prop_number_t number" | |
157 | Returns the unsigned integer value of the numeric value object. | 160 | Returns the unsigned integer value of the numeric value object. | |
158 | If the supplied object isn't a numeric value, zero is returned. Thus, | 161 | If the supplied object isn't a numeric value, zero is returned. | |
159 | it is not possible to distinguish between ``not a prop_number_t'' | 162 | Thus, | |
160 | and ``prop_number_t has a value of 0''. | 163 | it is not possible to distinguish between | |
164 | .Dq not a prop_number_t | |||
165 | and | |||
166 | .Dq prop_number_t has a value of 0 . | |||
161 | .It Fn prop_number_equals "prop_number_t num1" "prop_number_t num2" | 167 | .It Fn prop_number_equals "prop_number_t num1" "prop_number_t num2" | |
162 | Returns | 168 | Returns | |
163 | .Dv true | 169 | .Dv true | |
164 | if the two numeric value objects are equivalent. | 170 | if the two numeric value objects are equivalent. | |
165 | If at least one of the supplied objects isn't a numeric value, | 171 | If at least one of the supplied objects isn't a numeric value, | |
166 | .Dv false | 172 | .Dv false | |
167 | is returned. | 173 | is returned. | |
168 | .It Fn prop_number_equals_integer "prop_number_t number" "int64_t val" | 174 | .It Fn prop_number_equals_integer "prop_number_t number" "int64_t val" | |
169 | Returns | 175 | Returns | |
170 | .Dv true | 176 | .Dv true | |
171 | if the object's value is equivalent to the signed value | 177 | if the object's value is equivalent to the signed value | |
172 | .Fa val . | 178 | .Fa val . | |
173 | If the supplied object isn't a numerical value or if | 179 | If the supplied object isn't a numerical value or if | |
174 | .Fa val | 180 | .Fa val | |
175 | exceeds | 181 | exceeds | |
176 | .Dv INT64_MAX , | 182 | .Dv INT64_MAX , | |
177 | .Dv false | 183 | .Dv false | |
178 | is returned. | 184 | is returned. | |
179 | .It Fn prop_number_equals_unsigned_integer "prop_number_t number" \ | 185 | .It Fn prop_number_equals_unsigned_integer "prop_number_t number" \ | |
180 | "uint64_t val" | 186 | "uint64_t val" | |
181 | Returns | 187 | Returns | |
182 | .Dv true | 188 | .Dv true | |
183 | if the object's value is equivalent to the unsigned value | 189 | if the object's value is equivalent to the unsigned value | |
184 | .Fa val . | 190 | .Fa val . | |
185 | If the supplied object isn't a numerical value or if | 191 | If the supplied object isn't a numerical value or if | |
186 | .Fa val | 192 | .Fa val | |
187 | exceeds | 193 | exceeds | |
188 | .Dv INT64_MAX , | 194 | .Dv INT64_MAX , | |
189 | .Dv false | 195 | .Dv false | |
190 | is returned. | 196 | is returned. | |
191 | .El | 197 | .El | |
192 | .Sh SEE ALSO | 198 | .Sh SEE ALSO | |
193 | .Xr prop_array 3 , | 199 | .Xr prop_array 3 , | |
194 | .Xr prop_bool 3 , | 200 | .Xr prop_bool 3 , | |
195 | .Xr prop_data 3 , | 201 | .Xr prop_data 3 , | |
196 | .Xr prop_dictionary 3 , | 202 | .Xr prop_dictionary 3 , | |
197 | .Xr prop_object 3 , | 203 | .Xr prop_object 3 , | |
198 | .Xr prop_string 3 , | 204 | .Xr prop_string 3 , | |
199 | .Xr proplib 3 | 205 | .Xr proplib 3 | |
200 | .Sh HISTORY | 206 | .Sh HISTORY | |
201 | The | 207 | The | |
202 | .Nm proplib | 208 | .Nm proplib | |
203 | property container object library first appeared in | 209 | property container object library first appeared in | |
204 | .Nx 4.0 . | 210 | .Nx 4.0 . |
--- src/common/lib/libprop/prop_object.3 2008/04/30 13:10:46 1.7
+++ src/common/lib/libprop/prop_object.3 2011/01/20 10:44:42 1.8
@@ -1,140 +1,141 @@ | @@ -1,140 +1,141 @@ | |||
1 | .\" $NetBSD: prop_object.3,v 1.7 2008/04/30 13:10:46 martin Exp $ | 1 | .\" $NetBSD: prop_object.3,v 1.8 2011/01/20 10:44:42 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Jason R. Thorpe. | 7 | .\" by Jason R. Thorpe. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | 15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | 16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 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 | 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 | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 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 | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd August 21, 2006 | 30 | .Dd August 21, 2006 | |
31 | .Dt PROP_OBJECT 3 | 31 | .Dt PROP_OBJECT 3 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm prop_object , | 34 | .Nm prop_object , | |
35 | .Nm prop_object_retain , | 35 | .Nm prop_object_retain , | |
36 | .Nm prop_object_release , | 36 | .Nm prop_object_release , | |
37 | .Nm prop_object_type , | 37 | .Nm prop_object_type , | |
38 | .Nm prop_object_equals , | 38 | .Nm prop_object_equals , | |
39 | .Nm prop_object_iterator_next , | 39 | .Nm prop_object_iterator_next , | |
40 | .Nm prop_object_iterator_reset , | 40 | .Nm prop_object_iterator_reset , | |
41 | .Nm prop_object_iterator_release | 41 | .Nm prop_object_iterator_release | |
42 | .Nd general property container object functions | 42 | .Nd general property container object functions | |
43 | .Sh LIBRARY | 43 | .Sh LIBRARY | |
44 | .Lb libprop | 44 | .Lb libprop | |
45 | .Sh SYNOPSIS | 45 | .Sh SYNOPSIS | |
46 | .In prop/proplib.h | 46 | .In prop/proplib.h | |
47 | .\" | 47 | .\" | |
48 | .Ft void | 48 | .Ft void | |
49 | .Fn prop_object_retain "prop_object_t obj" | 49 | .Fn prop_object_retain "prop_object_t obj" | |
50 | .Ft void | 50 | .Ft void | |
51 | .Fn prop_object_release "prop_object_t obj" | 51 | .Fn prop_object_release "prop_object_t obj" | |
52 | .\" | 52 | .\" | |
53 | .Ft prop_type_t | 53 | .Ft prop_type_t | |
54 | .Fn prop_object_type "prop_object_t obj" | 54 | .Fn prop_object_type "prop_object_t obj" | |
55 | .Ft bool | 55 | .Ft bool | |
56 | .Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2" | 56 | .Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2" | |
57 | .\" | 57 | .\" | |
58 | .Ft prop_object_t | 58 | .Ft prop_object_t | |
59 | .Fn prop_object_iterator_next "prop_object_iterator_t iter" | 59 | .Fn prop_object_iterator_next "prop_object_iterator_t iter" | |
60 | .Ft void | 60 | .Ft void | |
61 | .Fn prop_object_iterator_reset "prop_object_iterator_t iter" | 61 | .Fn prop_object_iterator_reset "prop_object_iterator_t iter" | |
62 | .Ft void | 62 | .Ft void | |
63 | .Fn prop_object_iterator_release "prop_object_iterator_t iter" | 63 | .Fn prop_object_iterator_release "prop_object_iterator_t iter" | |
64 | .Sh DESCRIPTION | 64 | .Sh DESCRIPTION | |
65 | The | 65 | The | |
66 | .Nm prop_object | 66 | .Nm prop_object | |
67 | family of functions operate on all property container object types. | 67 | family of functions operate on all property container object types. | |
68 | .Bl -tag -width "" | 68 | .Bl -tag -width "" | |
69 | .It Fn prop_object_retain "prop_object_t obj" | 69 | .It Fn prop_object_retain "prop_object_t obj" | |
70 | Increment the reference count on an object. | 70 | Increment the reference count on an object. | |
71 | .It Fn prop_object_release "prop_object_t obj" | 71 | .It Fn prop_object_release "prop_object_t obj" | |
72 | Decrement the reference count on an object. | 72 | Decrement the reference count on an object. | |
73 | If the last reference is dropped, the object is freed. | 73 | If the last reference is dropped, the object is freed. | |
74 | .It Fn prop_object_type "prop_object_t obj" | 74 | .It Fn prop_object_type "prop_object_t obj" | |
75 | Determine the type of the object. Objects are one of the following types: | 75 | Determine the type of the object. | |
76 | Objects are one of the following types: | |||
76 | .Pp | 77 | .Pp | |
77 | .Bl -tag -width "PROP_TYPE_DICT_KEYSYM" -compact | 78 | .Bl -tag -width "PROP_TYPE_DICT_KEYSYM" -compact | |
78 | .It Dv PROP_TYPE_BOOL | 79 | .It Dv PROP_TYPE_BOOL | |
79 | Boolean value | 80 | Boolean value | |
80 | .Pq prop_bool_t | 81 | .Pq prop_bool_t | |
81 | .It Dv PROP_TYPE_NUMBER | 82 | .It Dv PROP_TYPE_NUMBER | |
82 | Number | 83 | Number | |
83 | .Pq prop_number_t | 84 | .Pq prop_number_t | |
84 | .It Dv PROP_TYPE_STRING | 85 | .It Dv PROP_TYPE_STRING | |
85 | String | 86 | String | |
86 | .Pq prop_string_t | 87 | .Pq prop_string_t | |
87 | .It Dv PROP_TYPE_DATA | 88 | .It Dv PROP_TYPE_DATA | |
88 | Opaque data | 89 | Opaque data | |
89 | .Pq prop_data_t | 90 | .Pq prop_data_t | |
90 | .It Dv PROP_TYPE_ARRAY | 91 | .It Dv PROP_TYPE_ARRAY | |
91 | Array | 92 | Array | |
92 | .Pq prop_array_t | 93 | .Pq prop_array_t | |
93 | .It Dv PROP_TYPE_DICTIONARY | 94 | .It Dv PROP_TYPE_DICTIONARY | |
94 | Dictionary | 95 | Dictionary | |
95 | .Pq prop_dictionary_t | 96 | .Pq prop_dictionary_t | |
96 | .It Dv PROP_TYPE_DICT_KEYSYM | 97 | .It Dv PROP_TYPE_DICT_KEYSYM | |
97 | Dictionary key symbol | 98 | Dictionary key symbol | |
98 | .Pq prop_dictionary_keysym_t | 99 | .Pq prop_dictionary_keysym_t | |
99 | .El | 100 | .El | |
100 | .Pp | 101 | .Pp | |
101 | If | 102 | If | |
102 | .Fa obj | 103 | .Fa obj | |
103 | is | 104 | is | |
104 | .Dv NULL , | 105 | .Dv NULL , | |
105 | then | 106 | then | |
106 | .Dv PROP_TYPE_UNKNOWN | 107 | .Dv PROP_TYPE_UNKNOWN | |
107 | is returned. | 108 | is returned. | |
108 | .It Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2" | 109 | .It Fn prop_object_equals "prop_object_t obj1" "prop_object_t obj2" | |
109 | Returns | 110 | Returns | |
110 | .Dv true | 111 | .Dv true | |
111 | if the two objects are of the same type and are equivalent. | 112 | if the two objects are of the same type and are equivalent. | |
112 | .It Fn prop_object_iterator_next "prop_object_iterator_t iter" | 113 | .It Fn prop_object_iterator_next "prop_object_iterator_t iter" | |
113 | Return the next object in the collection | 114 | Return the next object in the collection | |
114 | .Pq array or dictionary | 115 | .Pq array or dictionary | |
115 | being iterated by the iterator | 116 | being iterated by the iterator | |
116 | .Fa iter . | 117 | .Fa iter . | |
117 | If there are no more objects in the collection, | 118 | If there are no more objects in the collection, | |
118 | .Dv NULL | 119 | .Dv NULL | |
119 | is returned. | 120 | is returned. | |
120 | .It Fn prop_object_iterator_reset "prop_object_iterator_t iter" | 121 | .It Fn prop_object_iterator_reset "prop_object_iterator_t iter" | |
121 | Reset the iterator to the first object in the collection being iterated | 122 | Reset the iterator to the first object in the collection being iterated | |
122 | by the iterator | 123 | by the iterator | |
123 | .Fa iter . | 124 | .Fa iter . | |
124 | .It Fn prop_object_iterator_release "prop_object_iterator_t iter" | 125 | .It Fn prop_object_iterator_release "prop_object_iterator_t iter" | |
125 | Release the iterator | 126 | Release the iterator | |
126 | .Fa iter . | 127 | .Fa iter . | |
127 | .El | 128 | .El | |
128 | .Sh SEE ALSO | 129 | .Sh SEE ALSO | |
129 | .Xr prop_array 3 , | 130 | .Xr prop_array 3 , | |
130 | .Xr prop_bool 3 , | 131 | .Xr prop_bool 3 , | |
131 | .Xr prop_data 3 , | 132 | .Xr prop_data 3 , | |
132 | .Xr prop_dictionary 3 , | 133 | .Xr prop_dictionary 3 , | |
133 | .Xr prop_number 3 , | 134 | .Xr prop_number 3 , | |
134 | .Xr prop_string 3 , | 135 | .Xr prop_string 3 , | |
135 | .Xr proplib 3 | 136 | .Xr proplib 3 | |
136 | .Sh HISTORY | 137 | .Sh HISTORY | |
137 | The | 138 | The | |
138 | .Nm proplib | 139 | .Nm proplib | |
139 | property container object library first appeared in | 140 | property container object library first appeared in | |
140 | .Nx 4.0 . | 141 | .Nx 4.0 . |
--- src/common/lib/libprop/prop_send_ioctl.3 2008/04/30 13:10:46 1.5
+++ src/common/lib/libprop/prop_send_ioctl.3 2011/01/20 10:44:42 1.6
@@ -1,149 +1,150 @@ | @@ -1,149 +1,150 @@ | |||
1 | .\" $NetBSD: prop_send_ioctl.3,v 1.5 2008/04/30 13:10:46 martin Exp $ | 1 | .\" $NetBSD: prop_send_ioctl.3,v 1.6 2011/01/20 10:44:42 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2006 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Jason R. Thorpe. | 7 | .\" by Jason R. Thorpe. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | 15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | 16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 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 | 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 | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 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 | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd January 21, 2008 | 30 | .Dd January 21, 2008 | |
31 | .Dt PROP_SEND_IOCTL 3 | 31 | .Dt PROP_SEND_IOCTL 3 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm prop_array_send_ioctl , | 34 | .Nm prop_array_send_ioctl , | |
35 | .Nm prop_array_recv_ioctl , | 35 | .Nm prop_array_recv_ioctl , | |
36 | .Nm prop_dictionary_send_ioctl , | 36 | .Nm prop_dictionary_send_ioctl , | |
37 | .Nm prop_dictionary_recv_ioctl , | 37 | .Nm prop_dictionary_recv_ioctl , | |
38 | .Nm prop_dictionary_sendrecv_ioctl | 38 | .Nm prop_dictionary_sendrecv_ioctl | |
39 | .Nd Send and receive propertly lists to and from the kernel using ioctl | 39 | .Nd Send and receive propertly lists to and from the kernel using ioctl | |
40 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS | |
41 | .In prop/proplib.h | 41 | .In prop/proplib.h | |
42 | .Ft int | 42 | .Ft int | |
43 | .Fn prop_array_send_ioctl "prop_array_t array" "int fd" "unsigned long cmd" | 43 | .Fn prop_array_send_ioctl "prop_array_t array" "int fd" "unsigned long cmd" | |
44 | .Ft int | 44 | .Ft int | |
45 | .Fn prop_array_recv_ioctl "int fd" "unsigned long cmd" "prop_array_t *arrayp" | 45 | .Fn prop_array_recv_ioctl "int fd" "unsigned long cmd" "prop_array_t *arrayp" | |
46 | .Ft int | 46 | .Ft int | |
47 | .Fn prop_dictionary_send_ioctl "prop_dictionary_t dict" "int fd" \ | 47 | .Fn prop_dictionary_send_ioctl "prop_dictionary_t dict" "int fd" \ | |
48 | "unsigned long cmd" | 48 | "unsigned long cmd" | |
49 | .Ft int | 49 | .Ft int | |
50 | .Fn prop_dictionary_recv_ioctl "int fd" "unsigned long cmd" \ | 50 | .Fn prop_dictionary_recv_ioctl "int fd" "unsigned long cmd" \ | |
51 | "prop_dictionary_t *dictp" | 51 | "prop_dictionary_t *dictp" | |
52 | .Fn prop_dictionary_sendrecv_ioctl "prop_dictionary_t dict" "int fd" \ | 52 | .Fn prop_dictionary_sendrecv_ioctl "prop_dictionary_t dict" "int fd" \ | |
53 | "unsigned long cmd" "prop_dictionary_t *dictp" | 53 | "unsigned long cmd" "prop_dictionary_t *dictp" | |
54 | .Sh DESCRIPTION | 54 | .Sh DESCRIPTION | |
55 | The | 55 | The | |
56 | .Nm prop_array_send_ioctl , | 56 | .Nm prop_array_send_ioctl , | |
57 | .Nm prop_array_recv_ioctl , | 57 | .Nm prop_array_recv_ioctl , | |
58 | .Nm prop_dictionary_send_ioctl , | 58 | .Nm prop_dictionary_send_ioctl , | |
59 | .Nm prop_dictionary_recv_ioctl , | 59 | .Nm prop_dictionary_recv_ioctl , | |
60 | and | 60 | and | |
61 | .Nm prop_dictionary_sendrecv_ioctl | 61 | .Nm prop_dictionary_sendrecv_ioctl | |
62 | functions implement the user space side of a protocol for sending property | 62 | functions implement the user space side of a protocol for sending property | |
63 | lists to and from the kernel using | 63 | lists to and from the kernel using | |
64 | .Xr ioctl 2 . | 64 | .Xr ioctl 2 . | |
65 | .Sh RETURN VALUES | 65 | .Sh RETURN VALUES | |
66 | If successful, functions return zero. Otherwise, an error number is returned to indicate the error. | 66 | If successful, functions return zero. | |
67 | Otherwise, an error number is returned to indicate the error. | |||
67 | .Sh ERRORS | 68 | .Sh ERRORS | |
68 | .Fn prop_array_send_ioctl | 69 | .Fn prop_array_send_ioctl | |
69 | and | 70 | and | |
70 | .Fn prop_dictionary_send_ioctl | 71 | .Fn prop_dictionary_send_ioctl | |
71 | will fail if: | 72 | will fail if: | |
72 | .Bl -tag -width Er | 73 | .Bl -tag -width Er | |
73 | .It Bq Er ENOMEM | 74 | .It Bq Er ENOMEM | |
74 | Cannot allocate memory | 75 | Cannot allocate memory | |
75 | .It Bq Er ENOTSUP | 76 | .It Bq Er ENOTSUP | |
76 | Not supported | 77 | Not supported | |
77 | .El | 78 | .El | |
78 | .Pp | 79 | .Pp | |
79 | .Fn prop_array_recv_ioctl | 80 | .Fn prop_array_recv_ioctl | |
80 | and | 81 | and | |
81 | .Fn prop_dictionary_recv_ioctl | 82 | .Fn prop_dictionary_recv_ioctl | |
82 | will fail if: | 83 | will fail if: | |
83 | .Bl -tag -width Er | 84 | .Bl -tag -width Er | |
84 | .It Bq Er EIO | 85 | .It Bq Er EIO | |
85 | Input/output error | 86 | Input/output error | |
86 | .It Bq Er ENOTSUP | 87 | .It Bq Er ENOTSUP | |
87 | Not supported | 88 | Not supported | |
88 | .El | 89 | .El | |
89 | .Pp | 90 | .Pp | |
90 | In addition to these, | 91 | In addition to these, | |
91 | .Xr ioctl 2 | 92 | .Xr ioctl 2 | |
92 | errors may be returned. | 93 | errors may be returned. | |
93 | .Sh EXAMPLES | 94 | .Sh EXAMPLES | |
94 | The following | 95 | The following | |
95 | .Pq simplified | 96 | .Pq simplified | |
96 | example demonstrates using | 97 | example demonstrates using | |
97 | .Fn prop_dictionary_send_ioctl | 98 | .Fn prop_dictionary_send_ioctl | |
98 | and | 99 | and | |
99 | .Fn prop_dictionary_recv_ioctl | 100 | .Fn prop_dictionary_recv_ioctl | |
100 | in an application: | 101 | in an application: | |
101 | .Bd -literal | 102 | .Bd -literal | |
102 | void | 103 | void | |
103 | foo_setprops(prop_dictionary_t dict) | 104 | foo_setprops(prop_dictionary_t dict) | |
104 | { | 105 | { | |
105 | int fd; | 106 | int fd; | |
106 | 107 | |||
107 | fd = open("/dev/foo", O_RDWR, 0640); | 108 | fd = open("/dev/foo", O_RDWR, 0640); | |
108 | if (fd == -1) | 109 | if (fd == -1) | |
109 | return; | 110 | return; | |
110 | 111 | |||
111 | (void) prop_dictionary_send_ioctl(dict, fd, FOOSETPROPS); | 112 | (void) prop_dictionary_send_ioctl(dict, fd, FOOSETPROPS); | |
112 | 113 | |||
113 | (void) close(fd); | 114 | (void) close(fd); | |
114 | } | 115 | } | |
115 | 116 | |||
116 | prop_dictionary_t | 117 | prop_dictionary_t | |
117 | foo_getprops(void) | 118 | foo_getprops(void) | |
118 | { | 119 | { | |
119 | prop_dictionary_t dict; | 120 | prop_dictionary_t dict; | |
120 | int fd; | 121 | int fd; | |
121 | 122 | |||
122 | fd = open("/dev/foo", O_RDONLY, 0640); | 123 | fd = open("/dev/foo", O_RDONLY, 0640); | |
123 | if (fd == -1) | 124 | if (fd == -1) | |
124 | return (NULL); | 125 | return (NULL); | |
125 | 126 | |||
126 | if (prop_dictionary_recv_ioctl(fd, FOOGETPROPS, \*[Am]dict) != 0) | 127 | if (prop_dictionary_recv_ioctl(fd, FOOGETPROPS, \*[Am]dict) != 0) | |
127 | return (NULL); | 128 | return (NULL); | |
128 | 129 | |||
129 | (void) close(fd); | 130 | (void) close(fd); | |
130 | 131 | |||
131 | return (dict); | 132 | return (dict); | |
132 | } | 133 | } | |
133 | .Ed | 134 | .Ed | |
134 | .Pp | 135 | .Pp | |
135 | The | 136 | The | |
136 | .Nm prop_dictionary_sendrecv_ioctl | 137 | .Nm prop_dictionary_sendrecv_ioctl | |
137 | function combines the send and receive functionality, allowing for | 138 | function combines the send and receive functionality, allowing for | |
138 | ioctls that require two-way communication | 139 | ioctls that require two-way communication | |
139 | .Pq for example to specify arguments for the ioctl operation . | 140 | .Pq for example to specify arguments for the ioctl operation . | |
140 | .Sh SEE ALSO | 141 | .Sh SEE ALSO | |
141 | .Xr prop_array 3 , | 142 | .Xr prop_array 3 , | |
142 | .Xr prop_dictionary 3 , | 143 | .Xr prop_dictionary 3 , | |
143 | .Xr proplib 3 , | 144 | .Xr proplib 3 , | |
144 | .Xr prop_copyin_ioctl 9 | 145 | .Xr prop_copyin_ioctl 9 | |
145 | .Sh HISTORY | 146 | .Sh HISTORY | |
146 | The | 147 | The | |
147 | .Nm proplib | 148 | .Nm proplib | |
148 | property container object library first appeared in | 149 | property container object library first appeared in | |
149 | .Nx 4.0 . | 150 | .Nx 4.0 . |