1scf_tmpl_prop_crSeeartvei(c3eSCCFo)nfiguration Facility LibraryscFfu_ntcmtpilo_npsrop_create(3SCF)
2
3
4
6 scf_tmpl_prop_create, scf_tmpl_prop_reset, scf_tmpl_prop_destroy,
7 scf_tmpl_get_by_prop, scf_tmpl_iter_props - template property functions
8
10 cc [ flag... ] file... -lscf [ library... ]
11 #include <libscf.h>
12
13 scf_prop_tmpl_t *scf_tmpl_prop_create(scf_handle_t *handle);
14
15
16 void scf_tmpl_prop_reset(scf_prop_tmpl_t *prop_tmpl);
17
18
19 void scf_tmpl_prop_destroy(scf_prop_tmpl_t *prop_tmpl);
20
21
22 int scf_tmpl_get_by_prop(scf_pg_tmpl_t *pg_tmpl,
23 const char *prop, scf_prop_tmpl_t *prop_tmpl, int flags)
24
25
26 int scf_tmpl_iter_props(scf_pg_tmpl_t *pg_tmpl, const char *fmri,
27 scf_prop_tmpl_t *prop_tmpl, int flags);
28
29
31 The template property functions locate and give access to metadata
32 about properties. They require that the template for the property
33 group containing the property has already been located by one of the
34 scf_tmpl_pg_create(3SCF) suite of functions.
35
36
37 Once retrieved, the scf_prop_tmpl_t can be explored using the
38 scf_tmpl_prop_name(3SCF) suite of functions.
39
40
41 Before calling scf_tmpl_get_by_prop() or scf_tmpl_iter_props(), the
42 scf_prop_tmpl_t must be allocated by scf_tmpl_prop_create. The
43 scf_prop_tmpl_t can be reset to contain no template information with
44 scf_tmpl_prop_reset(), so that it can be used to start an iteration
45 from scratch. All associated memory can be freed with
46 scf_tmpl_prop_destroy().
47
48
49 The scf_tmpl_get_by_prop() function locates template data about the
50 property name specified.
51
52
53 The scf_tmpl_iter_props() function iterates across all property tem‐
54 plates defined in the specified property group template.
55
56
57 The iterator state for scf_tmpl_iter_props() is stored on the property
58 template data structure. The data structure should be allocated with
59 scf_tmpl_prop_create(), and to continue the iteration the previously
60 returned structure should be passed in as an argument.
61
63 The scf_tmpl_get_by_prop() function returns -1 on failure and 0 on suc‐
64 cess.
65
66
67 The scf_tmpl_iter_props() function returns 1 on successful completion.
68 If the iteration is complete, it returns 0. It returns -1 on error.
69
71 The scf_tmpl_get_by_prop() and scf_tmpl_iter_props() functions will
72 fail if:
73
74 SCF_ERROR_BACKEND_ACCESS
75
76 The storage mechanism that the repository server (svc.configd(1M))
77 chose for the operation denied access.
78
79
80 SCF_ERROR_CONNECTION_BROKEN
81
82 The connection to the repository was lost.
83
84
85 SCF_ERROR_DELETED
86
87 The instance or its template property group has been deleted.
88
89
90 SCF_ERROR_HANDLE_DESTROYED
91
92 The handle passed in has been destroyed.
93
94
95 SCF_ERROR_INTERNAL
96
97 An internal error occurred.
98
99
100 SCF_ERROR_INVALID_ARGUMENT
101
102 One of the arguments is invalid.
103
104
105 SCF_ERROR_NO_MEMORY
106
107 There is not enough memory to populate the scf_prop_tmpl_t.
108
109
110 SCF_ERROR_NO_RESOURCES
111
112 The server does not have adequate resources to complete the
113 request.
114
115
116 SCF_ERROR_NOT_BOUND
117
118 The handle is not currently bound.
119
120
121
122 The scf_tmpl_get_by_prop() function will fail if:
123
124 SCF_ERROR_NOT_FOUND
125
126 Template object matching property doesn't exist in the repository.
127
128
129 SCF_ERROR_TYPE_MISMATCH
130
131 Matching template object is the wrong type in the repository.
132
133
134 SCF_ERROR_PERMISSION_DENIED
135
136 The template could not be read due to access restrictions.
137
138
139 SCF_ERROR_TEMPLATE_INVALID
140
141 The template data is invalid.
142
143
144
145 The scf_tmpl_prop_create() function will fail if:
146
147 SCF_ERROR_INVALID_ARGUMENT The handle argument is NULL.
148
149
150 SCF_ERROR_NO_MEMORY There is no memory available.
151
152
154 See attributes(5) for descriptions of the following attributes:
155
156
157
158
159 ┌─────────────────────────────┬─────────────────────────────┐
160 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
161 ├─────────────────────────────┼─────────────────────────────┤
162 │Interface Stability │Committed │
163 ├─────────────────────────────┼─────────────────────────────┤
164 │MT-Level │Safe │
165 └─────────────────────────────┴─────────────────────────────┘
166
168 svc.configd(1M), scf_tmpl_pg_create(3SCF), scf_tmpl_prop_name(3SCF),
169 attributes(5), smf_template(5)
170
171
172
173SunOS 5.11 28 Oct 2008 scf_tmpl_prop_create(3SCF)