2 .\" Copyright (c) 2004, 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_SCOPE_CREATE 3SCF "Sep 9, 2004"
8 scf_scope_create, scf_scope_handle, scf_scope_destroy, scf_scope_get_name,
9 scf_handle_get_scope \- create and manipulate scope handles in the Service
10 Configuration Facility
14 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
17 \fBscf_scope_t *\fR\fBscf_scope_create\fR(\fBscf_handle_t *\fR\fIhandle\fR);
22 \fBscf_handle_t *\fR\fBscf_scope_handle\fR(\fBscf_scope_t *\fR\fIsc\fR);
27 \fBvoid\fR \fBscf_scope_destroy\fR(\fBscf_scope_t *\fR\fIsc\fR);
32 \fBssize_t\fR \fBscf_scope_get_name\fR(\fBscf_scope_t *\fR\fIsc\fR, \fBchar *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
37 \fBint\fR \fBscf_handle_get_scope\fR(\fBscf_handle_t *\fR\fIhandle\fR, \fBconst char *\fR\fIname\fR,
38 \fBscf_scope_t *\fR\fIout\fR);
44 Scopes are the top level of the Service Configuration Facility's repository
45 tree. The children of a scope are services (see \fBscf_service_create\fR(3SCF))
46 and can be walked using \fBscf_iter_scope_services\fR(3SCF).
49 There is a distinguished scope with the name \fBSCF_SCOPE_LOCAL\fR that is the
50 root for all available services on the local machine. In the current
51 implementation, there are no other scopes.
54 An \fBscf_scope_t\fR is an opaque handle that can be set to a single scope at
55 any given time. The \fBscf_scope_create()\fR function allocates a new
56 \fBscf_scope_t\fR bound to \fIhandle\fR. The \fBscf_scope_destroy()\fR function
57 destroys and frees \fIsc\fR.
60 The \fBscf_scope_handle()\fR function retrieves the handle to which \fIsc\fR is
64 The \fBscf_scope_get_name()\fR function retrieves the name of the scope to
65 which \fIsc\fR is set.
68 The \fBscf_handle_get_scope()\fR function sets \fIout\fR to the scope specified
69 by \fIname\fR for the repository handle specified by \fIhandle\fR. The
70 \fBscf_iter_handle_scopes\fR(3SCF) and \fBscf_iter_next_scope\fR(3SCF) calls
71 can be used to iterate through all available scopes.
75 Upon successful completion, \fBscf_scope_create()\fR returns a new
76 \fBscf_scope_t\fR. Otherwise, it returns \fINULL\fR.
79 Upon successful completion, \fBscf_scope_handle()\fR returns the handle to
80 which \fIsc\fR is bound. Otherwise, it returns \fINULL\fR.
83 Upon successful completion, \fBscf_scope_get_name()\fR returns the length of
84 the string written, not including the terminating null byte. Otherwise, it
88 Upon successful completion, \fBscf_handle_get_scope()\fR returns 0. Otherwise,
93 The \fBscf_scope_create()\fR function will fail if:
97 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
100 The value of the \fIhandle\fR argument is \fINULL\fR.
106 \fB\fBSCF_ERROR_NO_MEMORY\fR\fR
109 There is not enough memory to allocate an \fBscf_scope_t\fR.
115 \fB\fBSCF_ERROR_NO_RESOURCES\fR\fR
118 The server does not have adequate resources for a new scope handle.
123 The \fBscf_scope_handle()\fR function will fail if:
127 \fB\fBSCF_ERROR_HANDLE_DESTROYED\fR\fR
130 The handle associated with \fIsc\fR has been destroyed.
135 The \fBscf_scope_get_name()\fR function will fail if:
139 \fB\fBSCF_ERROR_NOT_SET\fR\fR
143 The scope is not set.
149 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
153 The handle is not bound.
159 \fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
163 The connection to the repository was lost.
168 The \fBscf_handle_get_scope()\fR function will fail if:
172 \fB\fBSCF_ERROR_NOT_FOUND\fR\fR
176 No scope named name was found.
182 \fB\fBSCF_ERROR_INVALID_ARGUMENT\fR\fR
186 The \fIname\fR argument is not a valid scope name.
192 \fB\fBSCF_ERROR_NOT_BOUND\fR\fR
196 The handle is not bound.
202 \fB\fBSCF_ERROR_CONNECTION_BROKEN\fR\fR
206 The connection to the repository was lost.
212 \fB\fBSCF_ERROR_HANDLE_MISMATCH\fR\fR
216 The value of the \fIout\fR argument is not derived from handle.
221 The \fBscf_error\fR(3SCF) function can be used to retrieve the error value.
225 See \fBattributes\fR(5) for descriptions of the following attributes:
233 ATTRIBUTE TYPE ATTRIBUTE VALUE
235 Interface Stability Evolving
243 \fBlibscf\fR(3LIB), \fBscf_error\fR(3SCF), \fBscf_handle_decode_fmri\fR(3SCF),
244 \fBscf_iter_handle_scopes\fR(3SCF), \fBscf_iter_next_scope\fR(3SCF),
245 \fBscf_iter_scope_services\fR(3SCF), \fBscf_scope_to_fmri\fR(3SCF),
246 \fBscf_service_create\fR(3SCF), \fBattributes\fR(5)