2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SCF_PROPERTY_CREATE 3SCF "Oct 28, 2008"
8 scf_property_create, scf_property_handle, scf_property_destroy,
9 scf_property_get_name, scf_property_type, scf_property_is_type,
10 scf_type_to_string, scf_string_to_type, scf_property_get_value,
11 scf_pg_get_property \- create and manipulate property handles in the Service
12 Configuration Facility
16 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
19 \fBscf_property_t *\fR\fBscf_property_create\fR(\fBscf_handle_t *\fR\fIhandle\fR);
24 \fBscf_handle_t *\fR\fBscf_property_handle\fR(\fBscf_property_t *\fR\fIprop\fR);
29 \fBvoid\fR \fBscf_property_destroy\fR(\fBscf_property_t *\fR\fIprop\fR);
34 \fBssize_t\fR \fBscf_property_get_name\fR(\fBconst scf_property_t *\fR\fIprop\fR,
35 \fBchar *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
40 \fBint\fR \fBscf_property_type\fR(\fBconst scf_property_t *\fR\fIprop\fR,
41 \fBscf_type_t *\fR\fItype\fR);
46 \fBint\fR \fBscf_property_is_type\fR(\fBconst scf_property_t *\fR\fIprop\fR,
47 \fBscf_type_t\fR \fItype\fR);
52 \fBconst char *\fR\fBscf_type_to_string\fR(\fBscf_type_t\fR \fItype\fR);
57 \fBscf_type_t\fR \fBscf_string_to_type\fR(\fBconst char *\fR\fItype\fR);
62 \fBint\fR \fBscf_property_get_value\fR(\fBconst scf_property_t *\fR\fIprop\fR,
63 \fBscf_value_t *\fR\fIvalue\fR);
68 \fBint\fR \fBscf_pg_get_property\fR(\fBconst scf_property_t *\fR\fIpg\fR,
69 \fBconst char *\fR\fIname\fR, \fBscf_property_t *\fR\fIprop\fR);
75 Properties are named sets of values of one type. They are grouped into property
76 groups (see \fBscf_pg_create\fR(3SCF)) that are updated atomically using
77 transactions (see \fBscf_transaction_create\fR(3SCF)).
80 An \fBscf_property_t\fR is an opaque handle that can be set to a single
81 property at any given time. When set, it inherits the point-in-time from the
82 source \fBscf_propertygroup_t\fR and does not change until reset.
85 The \fBscf_property_create()\fR function allocates and initializes a new
86 \fBscf_property_t\fR bound to \fIhandle\fR. The \fBscf_property_destroy()\fR
87 function destroys and frees \fIprop\fR.
90 The \fBscf_property_handle()\fR function returns the handle to which \fIprop\fR
94 The \fBscf_property_type()\fR function retrieves the type of the property to
95 which \fIprop\fR is set.
98 The \fBscf_property_is_type()\fR function determines if the property is
99 compatible with type. See \fBscf_value_create\fR(3SCF).
102 The \fBscf_type_to_string()\fR function returns the string name of the type
103 supplied. If the type is invalid or unknown, it returns "unknown".
106 The \fBscf_string_to_type()\fR function returns the \fBscf_type_t\fR definition
107 of the string supplied. If the string does not translate to an existing type,
108 it returns \fBSCF_TYPE_INVALID\fR.
111 The \fBscf_property_get_value()\fR function retrieves the single value that the
112 property to which \fIprop\fR is set contains. If the property has more than one
113 value, the \fIvalue\fR argument is set to one of the values. To retrieve all
114 values associated with a property, see \fBscf_iter_property_values\fR(3SCF).
117 The \fBscf_pg_get_property()\fR function sets \fIprop\fR to the property
118 specified by \fIname\fR in the property group specified by \fIpg\fR.
122 Upon successful completion, \fBscf_property_create()\fR returns a new
123 \fBscf_property_t\fR. Otherwise, it returns \fINULL\fR.
126 Upon successful completion, \fBscf_property_get_name()\fR function returns the
127 length of the string written, not including the terminating null byte.
128 Otherwise, it returns -1.
131 Upon successful completion, \fBscf_pg_get_property()\fR,
132 \fBscf_property_type()\fR, \fBscf_property_is_type()\fR, and
133 \fBscf_pg_get_value()\fR functions return 0. Otherwise, they return -1.
136 Upon successful completion, \fBscf_type_to_string()\fR returns a string of the
140 Upon successful completion, \fBscf_string_to_type()\fR returns the
141 \fBscf_type_t\fR definition of the string supplied
145 The \fBscf_property_create()\fR function will fail if:
149 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
152 The value of the \fIhandle\fR argument is \fINULL\fR.
158 \fB\fBSCF_ERROR_NO_MEMORY\fR\fR
161 There is not enough memory to allocate an \fBscf_property_t\fR.
167 \fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
170 The server does not have adequate resources for a new property handle.
175 The \fBscf_property_handle()\fR function will fail if:
179 \fB\fBSCF_ERROR_HANDLE_DESTROYED\fR\fR
182 The handle associated with \fIprop\fR has been destroyed.
187 The \fBscf_property_get_name()\fR, \fBscf_property_type()\fR,
188 \fBscf_property_is_type()\fR, and \fBscf_property_get_value()\fR functions will
193 \fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
197 The connection to the repository was lost.
203 \fB\fBSCF_ERROR_DELETED\fR\fR
207 The property's parent property group or an ancestor has been deleted.
213 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
217 The handle was never bound or has been unbound.
223 \fB\fBSCF_ERROR_NOT_SET\fR\fR
227 The property is not set.
232 The \fBscf_property_is_type()\fR function will fail if:
236 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
239 The \fItype\fR argument is not a valid type.
245 \fB\fBSCF_ERROR_TYPE_MISMATCH\fR\fR
248 The \fIprop\fR argument is not of a type compatible with \fItype\fR.
253 The \fBscf_pg_get_property()\fR function will fail if:
257 \fB\fBSCF_ERROR_BACKEND_ACCESS\fR\fR
261 The storage mechanism that the repository server (\fBsvc.configd\fR(1M))
262 chose for the operation denied access.
268 \fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
272 The connection to the repository was lost.
278 \fB\fBSCF_ERROR_DELETED\fR\fR
282 The property group or an ancestor has been deleted.
288 \fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
292 The property group and property are not derived from the same handle.
298 \fB\fBSCF_ERROR_INTERNAL\fR\fR
302 An internal error occurred.
308 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
312 The value of the \fIname\fR argument is not a valid property name.
318 \fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
322 The server does not have the resources to complete the request.
328 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
332 The handle was never bound or has been unbound.
338 \fB\fBSCF_ERROR_NOT_FOUND\fR\fR
342 The property specified by \fIname\fR was not found.
348 \fB\fBSCF_ERROR_NOT_SET\fR\fR
352 The property group specified by \fIpg\fR is not set.
357 The \fBscf_property_get_value()\fR function will fail if:
361 \fB\fBSCF_ERROR_CONSTRAINT_VIOLATED\fR\fR
365 The property has more than one value associated with it. The \fIvalue\fR
366 argument will be set to one of the values.
372 \fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
376 The property and value are derived from different handles.
382 \fB\fBSCF_ERROR_NOT_FOUND\fR\fR
386 The property has no values associated with it. The \fIvalue\fR argument will be
393 \fB\fBSCF_ERROR_PERMISSION_DENIED\fR\fR
397 The value could not be read due to access restrictions.
402 The \fBscf_error\fR(3SCF) function can be used to retrieve the error value.
406 See \fBattributes\fR(5) for descriptions of the following attributes:
414 ATTRIBUTE TYPE ATTRIBUTE VALUE
416 Interface Stability Committed
424 \fBlibscf\fR(3LIB), \fBscf_error\fR(3SCF), \fBscf_handle_decode_fmri\fR(3SCF),
425 \fBscf_iter_property_values\fR(3SCF), \fBscf_pg_create\fR(3SCF),
426 \fBscf_property_to_fmri\fR(3SCF), \fBscf_transaction_create\fR(3SCF),
427 \fBscf_value_create\fR(3SCF), \fBattributes\fR(5)