Service Configuration Facility Library Functions
scftmplpgname(3SCF)
NAME
scftmplpgname, scftmplpgtype, scftmplpgtarget,
scftmplpgrequired, scftmplpgcommonname,
scftmplpgdescription - retrieve the metadata about a
specific property group
SYNOPSIS
cc [ flag... ] file... -lscf [ library... ]
#include
ssizet scftmplpgname(const scfpgtmplt *pgtmpl,
char **out);
ssizet scftmplpgtype(const scfpgtmplt *pgtmpl,
char **out);
ssizet scftmplpgtarget(const scfpgtmplt *pgtmpl,
char **out);
int scftmplpgrequired(const scfpgtmplt *pgtmpl,
uint8t *out)
ssizet scftmplpgcommonname(const scfpgtmplt *pgtmpl,
char * locale, char **out);
ssizet scftmplpgdescription(const scfpgtmplt *pgtmpl,
char * locale, char **out);
DESCRIPTION
These functions retrieve the metadata about a specific pro-
perty group. They require that the template for the property
group has already been located by one of the
scftmplpgcreate(3SCF) suite of functions.
The scftmplpgname() function retrieves the name of the
property group template and place it in *out. If the pro-
perty group name is implicitly wildcarded (see
smftemplate(5)) in the template, this function will return
a string containing SCFTMPLWILDCARD ("*") in *out. The
caller is responsible for freeing the *out buffer on suc-
cess.
SunOS 5.11 Last change: 28 Oct 2008 1
Service Configuration Facility Library Functions
scftmplpgname(3SCF)
The scftmplpgtype() function will retrieve the type of
the property group template and place it in *out. If the
property group type is implicitly wildcarded (see
smftemplate(5)) in the template, this function will return
a string containing SCFTMPLWILDCARD ("*") in *out. The
caller is responsible for freeing the *out buffer on suc-
cess.
The scftmplpgtarget() function will retrieve the target
of the property group template and place it in *out. The
caller is responsible for freeing the *out buffer on suc-
cess.
The scftmplpgrequired() function will determine whether
the property group is required and place the result of that
check in *out. If required is unset, out will be the default
value of 0. If the property is explicitly set to required,
out will be 1.
The scftmplpgcommonname() function will retrieve the
property group's localized common name as currently tem-
plated and place it in *out. A locale (as described in
setlocale(3C)) may be specified, or if the supplied locale
is NUL, the current locale will be used. If a commonname
in the specified locale is not found, the function will also
look for a commonname in the C locale. Some templates will
not specify the property group common name. The caller is
responsible for freeing the *out buffer on success.
The scftmplpgdescription() function will retrieve the
property group's localized description as currently tem-
plated and place it in *out. A locale (as described in
setlocale(3C)) may be specified, or if the supplied locale
is NUL, the current locale will be used. If a description
in the specified locale is not found, the function will also
look for a description in the C locale. Some templates will
not specify the property group description. The caller is
responsible for freeing the *out buffer on success.
RETURN VALUES
Upon successful completion, scftmplpgname(),
scftmplpgcommonname(), scftmplpgdescription(),
scftmplpgtarget(), and scftmplpgtype() return the
length of the string written, not including the terminating
null byte. Otherwise, they return -1.
SunOS 5.11 Last change: 28 Oct 2008 2
Service Configuration Facility Library Functions
scftmplpgname(3SCF)
Upon successful completion, scftmplpgrequired() returns
0. Otherwise, it returns -1.
ERORS
The scftmplpgname(), scftmplpgcommonname(),
scftmplpgdescription(), scftmplpgrequired(),
scftmplpgtarget(), and scftmplpgtype() functions will
fail if:
SCFERORBACKENDACES
The storage mechanism that the repository server
(svc.configd(1M)) chose for the operation denied access.
SCFERORCONECTIONBROKEN
The connection to the repository was lost.
SCFERORDELETED
The template property group has been deleted.
SCFERORHANDLEDESTROYED
The handle passed in has been destroyed.
SCFERORINTERNAL
An internal error occurred.
SCFERORNOMEMORY
There is not enough memory to populate the
scfpgtmplt.
SCFERORNORESOURCES
The server does not have adequate resources to complete
the request.
SCFERORNOTBOUND
The handle is not currently bound.
SunOS 5.11 Last change: 28 Oct 2008 3
Service Configuration Facility Library Functions
scftmplpgname(3SCF)
SCFERORPERMISIONDENIED
The template could not be read due to access restric-
tions.
SCFERORTEMPLATEINVALID
The template data is invalid.
The scftmplpgcommonname() and scftmplpgdescription()
functions will fail if:
SCFERORNOTFOUND The property does not exist or
exists and has no value.
SCFERORINVALIDARGUMENT The locale string is too long.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
svc.configd(1M), scftmplpgcreate(3SCF), setlocale(3C),
attributes(5), smftemplate(5)
SunOS 5.11 Last change: 28 Oct 2008 4
Service Configuration Facility Library Functions
scftmplpgname(3SCF)
SunOS 5.11 Last change: 28 Oct 2008 5
|