Service Configuration Facility Library Functions
scfscopecreate(3SCF)
NAME
scfscopecreate, scfscopehandle, scfscopedestroy,
scfscopegetname, scfhandlegetscope - create and mani-
pulate scope handles in the Service Configuration Facility
SYNOPSIS
cc [ flag... ] file... -lscf [ library... ]
#include
scfscopet *scfscopecreate(scfhandlet *handle);
scfhandlet *scfscopehandle(scfscopet *sc);
void scfscopedestroy(scfscopet *sc);
ssizet scfscopegetname(scfscopet *sc, char *buf, sizet size);
int scfhandlegetscope(scfhandlet *handle, const char *name,
scfscopet *out);
DESCRIPTION
Scopes are the top level of the Service Configuration
Facility's repository tree. The children of a scope are ser-
vices (see scfservicecreate(3SCF)) and can be walked using
scfiterscopeservices(3SCF).
There is a distinguished scope with the name SCFSCOPELOCAL
that is the root for all available services on the local
machine. In the current implementation, there are no other
scopes.
An scfscopet is an opaque handle that can be set to a sin-
gle scope at any given time. The scfscopecreate() function
allocates a new scfscopet bound to handle. The
scfscopedestroy() function destroys and frees sc.
The scfscopehandle() function retrieves the handle to
which sc is bound.
The scfscopegetname() function retrieves the name of the
scope to which sc is set.
SunOS 5.11 Last change: 9 Sep 2004 1
Service Configuration Facility Library Functions
scfscopecreate(3SCF)
The scfhandlegetscope() function sets out to the scope
specified by name for the repository handle specified by
handle. The scfiterhandlescopes(3SCF) and
scfiternextscope(3SCF) calls can be used to iterate
through all available scopes.
RETURN VALUES
Upon successful completion, scfscopecreate() returns a new
scfscopet. Otherwise, it returns NUL.
Upon successful completion, scfscopehandle() returns the
handle to which sc is bound. Otherwise, it returns NUL.
Upon successful completion, scfscopegetname() returns the
length of the string written, not including the terminating
null byte. Otherwise, it returns -1.
Upon successful completion, scfhandlegetscope() returns
0. Otherwise, it returns -1.
ERORS
The scfscopecreate() function will fail if:
SCFERORINVALIDARGUMENT The value of the handle argu-
ment is NUL.
SCFERORNOMEMORY There is not enough memory to
allocate an scfscopet.
SCFERORNORESOURCES The server does not have ade-
quate resources for a new
scope handle.
The scfscopehandle() function will fail if:
SCFERORHANDLEDESTROYED The handle associated with sc
has been destroyed.
The scfscopegetname() function will fail if:
SCFERORNOTSET
SunOS 5.11 Last change: 9 Sep 2004 2
Service Configuration Facility Library Functions
scfscopecreate(3SCF)
The scope is not set.
SCFERORNOTBOUND
The handle is not bound.
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
The scfhandlegetscope() function will fail if:
SCFERORNOTFOUND
No scope named name was found.
SCFERORINVALIDARGUMENT
The name argument is not a valid scope name.
SCFERORNOTBOUND
The handle is not bound.
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SCFERORHANDLEMISMATCH
The value of the out argument is not derived from han-
dle.
The scferror(3SCF) function can be used to retrieve the
error value.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 9 Sep 2004 3
Service Configuration Facility Library Functions
scfscopecreate(3SCF)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
libscf(3LIB), scferror(3SCF), scfhandledecodefmri(3SCF),
scfiterhandlescopes(3SCF), scfiternextscope(3SCF),
scfiterscopeservices(3SCF), scfscopetofmri(3SCF),
scfservicecreate(3SCF), attributes(5)
SunOS 5.11 Last change: 9 Sep 2004 4
Service Configuration Facility Library Functions
scfscopecreate(3SCF)
SunOS 5.11 Last change: 9 Sep 2004 5
|