1scf_tmpl_pg_nameS(e3rSvCiFc)e Configuration Facility Library Funscctfi_otnmspl_pg_name(3SCF)
2
3
4

NAME

6       scf_tmpl_pg_name,         scf_tmpl_pg_type,         scf_tmpl_pg_target,
7       scf_tmpl_pg_required, scf_tmpl_pg_common_name,  scf_tmpl_pg_description
8       - retrieve the metadata about a specific property group
9

SYNOPSIS

11       cc [ flag... ] file... -lscf [ library... ]
12       #include <libscf.h>
13
14       ssize_t scf_tmpl_pg_name(const scf_pg_tmpl_t *pg_tmpl,
15            char **out);
16
17
18       ssize_t scf_tmpl_pg_type(const scf_pg_tmpl_t *pg_tmpl,
19            char **out);
20
21
22       ssize_t scf_tmpl_pg_target(const scf_pg_tmpl_t *pg_tmpl,
23            char **out);
24
25
26       int scf_tmpl_pg_required(const scf_pg_tmpl_t *pg_tmpl,
27            uint8_t *out)
28
29
30       ssize_t scf_tmpl_pg_common_name(const scf_pg_tmpl_t *pg_tmpl,
31            char * locale, char **out);
32
33
34       ssize_t scf_tmpl_pg_description(const scf_pg_tmpl_t *pg_tmpl,
35            char * locale, char **out);
36
37

DESCRIPTION

39       These  functions retrieve the metadata about a specific property group.
40       They require that the template for the property group has already  been
41       located by one of the scf_tmpl_pg_create(3SCF) suite of functions.
42
43
44       The  scf_tmpl_pg_name()  function  retrieves  the  name of the property
45       group template and place it in *out. If  the  property  group  name  is
46       implicitly wildcarded (see smf_template(5)) in the template, this func‐
47       tion will return a string containing SCF_TMPL_WILDCARD ("*")  in  *out.
48       The caller is responsible for freeing the *out buffer on success.
49
50
51       The  scf_tmpl_pg_type() function will retrieve the type of the property
52       group template and place it in *out. If  the  property  group  type  is
53       implicitly wildcarded (see smf_template(5)) in the template, this func‐
54       tion will return a string containing SCF_TMPL_WILDCARD ("*")  in  *out.
55       The caller is responsible for freeing the *out buffer on success.
56
57
58       The scf_tmpl_pg_target() function will retrieve the target of the prop‐
59       erty group template and place it in *out. The caller is responsible for
60       freeing the *out buffer on success.
61
62
63       The scf_tmpl_pg_required() function will determine whether the property
64       group is required and place the  result  of  that  check  in  *out.  If
65       required  is unset, out will be the default value of 0. If the property
66       is explicitly set to required, out will be 1.
67
68
69       The  scf_tmpl_pg_common_name()  function  will  retrieve  the  property
70       group's  localized  common  name as currently templated and place it in
71       *out. A locale (as described in setlocale(3C)) may be specified, or  if
72       the  supplied  locale  is  NULL, the current locale will be used.  If a
73       common_name in the specified locale is not  found,  the  function  will
74       also  look  for  a common_name in the C locale. Some templates will not
75       specify the property group common name.  The caller is responsible  for
76       freeing the *out buffer on success.
77
78
79       The  scf_tmpl_pg_description()  function  will  retrieve  the  property
80       group's localized description as currently templated and  place  it  in
81       *out.  A locale (as described in setlocale(3C)) may be specified, or if
82       the supplied locale is NULL, the current locale  will  be  used.  If  a
83       description  in  the  specified  locale is not found, the function will
84       also look for a description in the C locale. Some  templates  will  not
85       specify  the property group description.  The caller is responsible for
86       freeing the *out buffer on success.
87

RETURN VALUES

89       Upon  successful   completion,   scf_tmpl_pg_name(),   scf_tmpl_pg_com‐
90       mon_name(),    scf_tmpl_pg_description(),   scf_tmpl_pg_target(),   and
91       scf_tmpl_pg_type() return the length of the string written, not includ‐
92       ing the terminating null byte. Otherwise, they return -1.
93
94
95       Upon  successful  completion,  scf_tmpl_pg_required() returns 0. Other‐
96       wise, it returns -1.
97

ERRORS

99       The scf_tmpl_pg_name(), scf_tmpl_pg_common_name(), scf_tmpl_pg_descrip‐
100       tion(),      scf_tmpl_pg_required(),      scf_tmpl_pg_target(),     and
101       scf_tmpl_pg_type() functions will fail if:
102
103       SCF_ERROR_BACKEND_ACCESS
104
105           The storage mechanism that the repository server  (svc.configd(1M))
106           chose for the operation denied access.
107
108
109       SCF_ERROR_CONNECTION_BROKEN
110
111           The connection to the repository was lost.
112
113
114       SCF_ERROR_DELETED
115
116           The template property group has been deleted.
117
118
119       SCF_ERROR_HANDLE_DESTROYED
120
121           The handle passed in has been destroyed.
122
123
124       SCF_ERROR_INTERNAL
125
126           An internal error occurred.
127
128
129       SCF_ERROR_NO_MEMORY
130
131           There is not enough memory to populate the scf_pg_tmpl_t.
132
133
134       SCF_ERROR_NO_RESOURCES
135
136           The  server  does  not  have  adequate  resources  to  complete the
137           request.
138
139
140       SCF_ERROR_NOT_BOUND
141
142           The handle is not currently bound.
143
144
145       SCF_ERROR_PERMISSION_DENIED
146
147           The template could not be read due to access restrictions.
148
149
150       SCF_ERROR_TEMPLATE_INVALID
151
152           The template data is invalid.
153
154
155
156       The scf_tmpl_pg_common_name() and  scf_tmpl_pg_description()  functions
157       will fail if:
158
159       SCF_ERROR_NOT_FOUND           The property does not exist or exists and
160                                     has no value.
161
162
163       SCF_ERROR_INVALID_ARGUMENT    The locale string is too long.
164
165

ATTRIBUTES

167       See attributes(5) for descriptions of the following attributes:
168
169
170
171
172       ┌─────────────────────────────┬─────────────────────────────┐
173       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
174       ├─────────────────────────────┼─────────────────────────────┤
175       │Interface Stability          │Committed                    │
176       ├─────────────────────────────┼─────────────────────────────┤
177       │MT-Level                     │Safe                         │
178       └─────────────────────────────┴─────────────────────────────┘
179

SEE ALSO

181       svc.configd(1M),        scf_tmpl_pg_create(3SCF),        setlocale(3C),
182       attributes(5), smf_template(5)
183
184
185
186SunOS 5.11                        28 Oct 2008           scf_tmpl_pg_name(3SCF)
Impressum