Line | Count | Source (jump to first uncovered line) |
1 | | /* auto-generated, do not modify */ |
2 | | #include "config.h" |
3 | | |
4 | | #include "fu-coswid-struct.h" |
5 | | |
6 | | #ifdef G_LOG_DOMAIN |
7 | | #undef G_LOG_DOMAIN |
8 | | #endif |
9 | | #define G_LOG_DOMAIN "FuStruct" |
10 | | |
11 | | const gchar * |
12 | | fu_coswid_tag_to_string(FuCoswidTag val) |
13 | 0 | { |
14 | 0 | if (val == FU_COSWID_TAG_TAG_ID) |
15 | 0 | return "tag-id"; |
16 | 0 | if (val == FU_COSWID_TAG_SOFTWARE_NAME) |
17 | 0 | return "software-name"; |
18 | 0 | if (val == FU_COSWID_TAG_ENTITY) |
19 | 0 | return "entity"; |
20 | 0 | if (val == FU_COSWID_TAG_EVIDENCE) |
21 | 0 | return "evidence"; |
22 | 0 | if (val == FU_COSWID_TAG_LINK) |
23 | 0 | return "link"; |
24 | 0 | if (val == FU_COSWID_TAG_SOFTWARE_META) |
25 | 0 | return "software-meta"; |
26 | 0 | if (val == FU_COSWID_TAG_PAYLOAD) |
27 | 0 | return "payload"; |
28 | 0 | if (val == FU_COSWID_TAG_HASH) |
29 | 0 | return "hash"; |
30 | 0 | if (val == FU_COSWID_TAG_CORPUS) |
31 | 0 | return "corpus"; |
32 | 0 | if (val == FU_COSWID_TAG_PATCH) |
33 | 0 | return "patch"; |
34 | 0 | if (val == FU_COSWID_TAG_MEDIA) |
35 | 0 | return "media"; |
36 | 0 | if (val == FU_COSWID_TAG_SUPPLEMENTAL) |
37 | 0 | return "supplemental"; |
38 | 0 | if (val == FU_COSWID_TAG_TAG_VERSION) |
39 | 0 | return "tag-version"; |
40 | 0 | if (val == FU_COSWID_TAG_SOFTWARE_VERSION) |
41 | 0 | return "software-version"; |
42 | 0 | if (val == FU_COSWID_TAG_VERSION_SCHEME) |
43 | 0 | return "version-scheme"; |
44 | 0 | if (val == FU_COSWID_TAG_LANG) |
45 | 0 | return "lang"; |
46 | 0 | if (val == FU_COSWID_TAG_DIRECTORY) |
47 | 0 | return "directory"; |
48 | 0 | if (val == FU_COSWID_TAG_FILE) |
49 | 0 | return "file"; |
50 | 0 | if (val == FU_COSWID_TAG_PROCESS) |
51 | 0 | return "process"; |
52 | 0 | if (val == FU_COSWID_TAG_RESOURCE) |
53 | 0 | return "resource"; |
54 | 0 | if (val == FU_COSWID_TAG_SIZE) |
55 | 0 | return "size"; |
56 | 0 | if (val == FU_COSWID_TAG_FILE_VERSION) |
57 | 0 | return "file-version"; |
58 | 0 | if (val == FU_COSWID_TAG_KEY) |
59 | 0 | return "key"; |
60 | 0 | if (val == FU_COSWID_TAG_LOCATION) |
61 | 0 | return "location"; |
62 | 0 | if (val == FU_COSWID_TAG_FS_NAME) |
63 | 0 | return "fs-name"; |
64 | 0 | if (val == FU_COSWID_TAG_ROOT) |
65 | 0 | return "root"; |
66 | 0 | if (val == FU_COSWID_TAG_PATH_ELEMENTS) |
67 | 0 | return "path-elements"; |
68 | 0 | if (val == FU_COSWID_TAG_PROCESS_NAME) |
69 | 0 | return "process-name"; |
70 | 0 | if (val == FU_COSWID_TAG_PID) |
71 | 0 | return "pid"; |
72 | 0 | if (val == FU_COSWID_TAG_TYPE) |
73 | 0 | return "type"; |
74 | 0 | if (val == FU_COSWID_TAG_MISSING30) |
75 | 0 | return "missing30"; |
76 | 0 | if (val == FU_COSWID_TAG_ENTITY_NAME) |
77 | 0 | return "entity-name"; |
78 | 0 | if (val == FU_COSWID_TAG_REG_ID) |
79 | 0 | return "reg-id"; |
80 | 0 | if (val == FU_COSWID_TAG_ROLE) |
81 | 0 | return "role"; |
82 | 0 | if (val == FU_COSWID_TAG_THUMBPRINT) |
83 | 0 | return "thumbprint"; |
84 | 0 | if (val == FU_COSWID_TAG_DATE) |
85 | 0 | return "date"; |
86 | 0 | if (val == FU_COSWID_TAG_DEVICE_ID) |
87 | 0 | return "device-id"; |
88 | 0 | if (val == FU_COSWID_TAG_ARTIFACT) |
89 | 0 | return "artifact"; |
90 | 0 | if (val == FU_COSWID_TAG_HREF) |
91 | 0 | return "href"; |
92 | 0 | if (val == FU_COSWID_TAG_OWNERSHIP) |
93 | 0 | return "ownership"; |
94 | 0 | if (val == FU_COSWID_TAG_REL) |
95 | 0 | return "rel"; |
96 | 0 | if (val == FU_COSWID_TAG_MEDIA_TYPE) |
97 | 0 | return "media-type"; |
98 | 0 | if (val == FU_COSWID_TAG_USE) |
99 | 0 | return "use"; |
100 | 0 | if (val == FU_COSWID_TAG_ACTIVATION_STATUS) |
101 | 0 | return "activation-status"; |
102 | 0 | if (val == FU_COSWID_TAG_CHANNEL_TYPE) |
103 | 0 | return "channel-type"; |
104 | 0 | if (val == FU_COSWID_TAG_COLLOQUIAL_VERSION) |
105 | 0 | return "colloquial-version"; |
106 | 0 | if (val == FU_COSWID_TAG_DESCRIPTION) |
107 | 0 | return "description"; |
108 | 0 | if (val == FU_COSWID_TAG_EDITION) |
109 | 0 | return "edition"; |
110 | 0 | if (val == FU_COSWID_TAG_ENTITLEMENT_DATA_REQUIRED) |
111 | 0 | return "entitlement-data-required"; |
112 | 0 | if (val == FU_COSWID_TAG_ENTITLEMENT_KEY) |
113 | 0 | return "entitlement-key"; |
114 | 0 | if (val == FU_COSWID_TAG_GENERATOR) |
115 | 0 | return "generator"; |
116 | 0 | if (val == FU_COSWID_TAG_PERSISTENT_ID) |
117 | 0 | return "persistent-id"; |
118 | 0 | if (val == FU_COSWID_TAG_PRODUCT) |
119 | 0 | return "product"; |
120 | 0 | if (val == FU_COSWID_TAG_PRODUCT_FAMILY) |
121 | 0 | return "product-family"; |
122 | 0 | if (val == FU_COSWID_TAG_REVISION) |
123 | 0 | return "revision"; |
124 | 0 | if (val == FU_COSWID_TAG_SUMMARY) |
125 | 0 | return "summary"; |
126 | 0 | if (val == FU_COSWID_TAG_UNSPSC_CODE) |
127 | 0 | return "unspsc-code"; |
128 | 0 | if (val == FU_COSWID_TAG_UNSPSC_VERSION) |
129 | 0 | return "unspsc-version"; |
130 | 0 | return NULL; |
131 | 0 | } |
132 | | FuCoswidTag |
133 | | fu_coswid_tag_from_string(const gchar *val) |
134 | 0 | { |
135 | 0 | if (g_strcmp0(val, "tag-id") == 0) |
136 | 0 | return FU_COSWID_TAG_TAG_ID; |
137 | 0 | if (g_strcmp0(val, "software-name") == 0) |
138 | 0 | return FU_COSWID_TAG_SOFTWARE_NAME; |
139 | 0 | if (g_strcmp0(val, "entity") == 0) |
140 | 0 | return FU_COSWID_TAG_ENTITY; |
141 | 0 | if (g_strcmp0(val, "evidence") == 0) |
142 | 0 | return FU_COSWID_TAG_EVIDENCE; |
143 | 0 | if (g_strcmp0(val, "link") == 0) |
144 | 0 | return FU_COSWID_TAG_LINK; |
145 | 0 | if (g_strcmp0(val, "software-meta") == 0) |
146 | 0 | return FU_COSWID_TAG_SOFTWARE_META; |
147 | 0 | if (g_strcmp0(val, "payload") == 0) |
148 | 0 | return FU_COSWID_TAG_PAYLOAD; |
149 | 0 | if (g_strcmp0(val, "hash") == 0) |
150 | 0 | return FU_COSWID_TAG_HASH; |
151 | 0 | if (g_strcmp0(val, "corpus") == 0) |
152 | 0 | return FU_COSWID_TAG_CORPUS; |
153 | 0 | if (g_strcmp0(val, "patch") == 0) |
154 | 0 | return FU_COSWID_TAG_PATCH; |
155 | 0 | if (g_strcmp0(val, "media") == 0) |
156 | 0 | return FU_COSWID_TAG_MEDIA; |
157 | 0 | if (g_strcmp0(val, "supplemental") == 0) |
158 | 0 | return FU_COSWID_TAG_SUPPLEMENTAL; |
159 | 0 | if (g_strcmp0(val, "tag-version") == 0) |
160 | 0 | return FU_COSWID_TAG_TAG_VERSION; |
161 | 0 | if (g_strcmp0(val, "software-version") == 0) |
162 | 0 | return FU_COSWID_TAG_SOFTWARE_VERSION; |
163 | 0 | if (g_strcmp0(val, "version-scheme") == 0) |
164 | 0 | return FU_COSWID_TAG_VERSION_SCHEME; |
165 | 0 | if (g_strcmp0(val, "lang") == 0) |
166 | 0 | return FU_COSWID_TAG_LANG; |
167 | 0 | if (g_strcmp0(val, "directory") == 0) |
168 | 0 | return FU_COSWID_TAG_DIRECTORY; |
169 | 0 | if (g_strcmp0(val, "file") == 0) |
170 | 0 | return FU_COSWID_TAG_FILE; |
171 | 0 | if (g_strcmp0(val, "process") == 0) |
172 | 0 | return FU_COSWID_TAG_PROCESS; |
173 | 0 | if (g_strcmp0(val, "resource") == 0) |
174 | 0 | return FU_COSWID_TAG_RESOURCE; |
175 | 0 | if (g_strcmp0(val, "size") == 0) |
176 | 0 | return FU_COSWID_TAG_SIZE; |
177 | 0 | if (g_strcmp0(val, "file-version") == 0) |
178 | 0 | return FU_COSWID_TAG_FILE_VERSION; |
179 | 0 | if (g_strcmp0(val, "key") == 0) |
180 | 0 | return FU_COSWID_TAG_KEY; |
181 | 0 | if (g_strcmp0(val, "location") == 0) |
182 | 0 | return FU_COSWID_TAG_LOCATION; |
183 | 0 | if (g_strcmp0(val, "fs-name") == 0) |
184 | 0 | return FU_COSWID_TAG_FS_NAME; |
185 | 0 | if (g_strcmp0(val, "root") == 0) |
186 | 0 | return FU_COSWID_TAG_ROOT; |
187 | 0 | if (g_strcmp0(val, "path-elements") == 0) |
188 | 0 | return FU_COSWID_TAG_PATH_ELEMENTS; |
189 | 0 | if (g_strcmp0(val, "process-name") == 0) |
190 | 0 | return FU_COSWID_TAG_PROCESS_NAME; |
191 | 0 | if (g_strcmp0(val, "pid") == 0) |
192 | 0 | return FU_COSWID_TAG_PID; |
193 | 0 | if (g_strcmp0(val, "type") == 0) |
194 | 0 | return FU_COSWID_TAG_TYPE; |
195 | 0 | if (g_strcmp0(val, "missing30") == 0) |
196 | 0 | return FU_COSWID_TAG_MISSING30; |
197 | 0 | if (g_strcmp0(val, "entity-name") == 0) |
198 | 0 | return FU_COSWID_TAG_ENTITY_NAME; |
199 | 0 | if (g_strcmp0(val, "reg-id") == 0) |
200 | 0 | return FU_COSWID_TAG_REG_ID; |
201 | 0 | if (g_strcmp0(val, "role") == 0) |
202 | 0 | return FU_COSWID_TAG_ROLE; |
203 | 0 | if (g_strcmp0(val, "thumbprint") == 0) |
204 | 0 | return FU_COSWID_TAG_THUMBPRINT; |
205 | 0 | if (g_strcmp0(val, "date") == 0) |
206 | 0 | return FU_COSWID_TAG_DATE; |
207 | 0 | if (g_strcmp0(val, "device-id") == 0) |
208 | 0 | return FU_COSWID_TAG_DEVICE_ID; |
209 | 0 | if (g_strcmp0(val, "artifact") == 0) |
210 | 0 | return FU_COSWID_TAG_ARTIFACT; |
211 | 0 | if (g_strcmp0(val, "href") == 0) |
212 | 0 | return FU_COSWID_TAG_HREF; |
213 | 0 | if (g_strcmp0(val, "ownership") == 0) |
214 | 0 | return FU_COSWID_TAG_OWNERSHIP; |
215 | 0 | if (g_strcmp0(val, "rel") == 0) |
216 | 0 | return FU_COSWID_TAG_REL; |
217 | 0 | if (g_strcmp0(val, "media-type") == 0) |
218 | 0 | return FU_COSWID_TAG_MEDIA_TYPE; |
219 | 0 | if (g_strcmp0(val, "use") == 0) |
220 | 0 | return FU_COSWID_TAG_USE; |
221 | 0 | if (g_strcmp0(val, "activation-status") == 0) |
222 | 0 | return FU_COSWID_TAG_ACTIVATION_STATUS; |
223 | 0 | if (g_strcmp0(val, "channel-type") == 0) |
224 | 0 | return FU_COSWID_TAG_CHANNEL_TYPE; |
225 | 0 | if (g_strcmp0(val, "colloquial-version") == 0) |
226 | 0 | return FU_COSWID_TAG_COLLOQUIAL_VERSION; |
227 | 0 | if (g_strcmp0(val, "description") == 0) |
228 | 0 | return FU_COSWID_TAG_DESCRIPTION; |
229 | 0 | if (g_strcmp0(val, "edition") == 0) |
230 | 0 | return FU_COSWID_TAG_EDITION; |
231 | 0 | if (g_strcmp0(val, "entitlement-data-required") == 0) |
232 | 0 | return FU_COSWID_TAG_ENTITLEMENT_DATA_REQUIRED; |
233 | 0 | if (g_strcmp0(val, "entitlement-key") == 0) |
234 | 0 | return FU_COSWID_TAG_ENTITLEMENT_KEY; |
235 | 0 | if (g_strcmp0(val, "generator") == 0) |
236 | 0 | return FU_COSWID_TAG_GENERATOR; |
237 | 0 | if (g_strcmp0(val, "persistent-id") == 0) |
238 | 0 | return FU_COSWID_TAG_PERSISTENT_ID; |
239 | 0 | if (g_strcmp0(val, "product") == 0) |
240 | 0 | return FU_COSWID_TAG_PRODUCT; |
241 | 0 | if (g_strcmp0(val, "product-family") == 0) |
242 | 0 | return FU_COSWID_TAG_PRODUCT_FAMILY; |
243 | 0 | if (g_strcmp0(val, "revision") == 0) |
244 | 0 | return FU_COSWID_TAG_REVISION; |
245 | 0 | if (g_strcmp0(val, "summary") == 0) |
246 | 0 | return FU_COSWID_TAG_SUMMARY; |
247 | 0 | if (g_strcmp0(val, "unspsc-code") == 0) |
248 | 0 | return FU_COSWID_TAG_UNSPSC_CODE; |
249 | 0 | if (g_strcmp0(val, "unspsc-version") == 0) |
250 | 0 | return FU_COSWID_TAG_UNSPSC_VERSION; |
251 | 0 | return FU_COSWID_TAG_TAG_ID; |
252 | 0 | } |
253 | | |
254 | | const gchar * |
255 | | fu_coswid_version_scheme_to_string(FuCoswidVersionScheme val) |
256 | 0 | { |
257 | 0 | if (val == FU_COSWID_VERSION_SCHEME_UNKNOWN) |
258 | 0 | return "unknown"; |
259 | 0 | if (val == FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC) |
260 | 0 | return "multipartnumeric"; |
261 | 0 | if (val == FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC_SUFFIX) |
262 | 0 | return "multipartnumeric-suffix"; |
263 | 0 | if (val == FU_COSWID_VERSION_SCHEME_ALPHANUMERIC) |
264 | 0 | return "alphanumeric"; |
265 | 0 | if (val == FU_COSWID_VERSION_SCHEME_DECIMAL) |
266 | 0 | return "decimal"; |
267 | 0 | if (val == FU_COSWID_VERSION_SCHEME_SEMVER) |
268 | 0 | return "semver"; |
269 | 0 | return NULL; |
270 | 0 | } |
271 | | FuCoswidVersionScheme |
272 | | fu_coswid_version_scheme_from_string(const gchar *val) |
273 | 0 | { |
274 | 0 | if (g_strcmp0(val, "unknown") == 0) |
275 | 0 | return FU_COSWID_VERSION_SCHEME_UNKNOWN; |
276 | 0 | if (g_strcmp0(val, "multipartnumeric") == 0) |
277 | 0 | return FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC; |
278 | 0 | if (g_strcmp0(val, "multipartnumeric-suffix") == 0) |
279 | 0 | return FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC_SUFFIX; |
280 | 0 | if (g_strcmp0(val, "alphanumeric") == 0) |
281 | 0 | return FU_COSWID_VERSION_SCHEME_ALPHANUMERIC; |
282 | 0 | if (g_strcmp0(val, "decimal") == 0) |
283 | 0 | return FU_COSWID_VERSION_SCHEME_DECIMAL; |
284 | 0 | if (g_strcmp0(val, "semver") == 0) |
285 | 0 | return FU_COSWID_VERSION_SCHEME_SEMVER; |
286 | 0 | return FU_COSWID_VERSION_SCHEME_UNKNOWN; |
287 | 0 | } |
288 | | |
289 | | const gchar * |
290 | | fu_coswid_link_rel_to_string(FuCoswidLinkRel val) |
291 | 0 | { |
292 | 0 | if (val == FU_COSWID_LINK_REL_LICENSE) |
293 | 0 | return "license"; |
294 | 0 | if (val == FU_COSWID_LINK_REL_COMPILER) |
295 | 0 | return "compiler"; |
296 | 0 | if (val == FU_COSWID_LINK_REL_UNKNOWN) |
297 | 0 | return "unknown"; |
298 | 0 | if (val == FU_COSWID_LINK_REL_ANCESTOR) |
299 | 0 | return "ancestor"; |
300 | 0 | if (val == FU_COSWID_LINK_REL_COMPONENT) |
301 | 0 | return "component"; |
302 | 0 | if (val == FU_COSWID_LINK_REL_FEATURE) |
303 | 0 | return "feature"; |
304 | 0 | if (val == FU_COSWID_LINK_REL_INSTALLATIONMEDIA) |
305 | 0 | return "installationmedia"; |
306 | 0 | if (val == FU_COSWID_LINK_REL_PACKAGEINSTALLER) |
307 | 0 | return "packageinstaller"; |
308 | 0 | if (val == FU_COSWID_LINK_REL_PARENT) |
309 | 0 | return "parent"; |
310 | 0 | if (val == FU_COSWID_LINK_REL_PATCHES) |
311 | 0 | return "patches"; |
312 | 0 | if (val == FU_COSWID_LINK_REL_REQUIRES) |
313 | 0 | return "requires"; |
314 | 0 | if (val == FU_COSWID_LINK_REL_SEE_ALSO) |
315 | 0 | return "see-also"; |
316 | 0 | if (val == FU_COSWID_LINK_REL_SUPERSEDES) |
317 | 0 | return "supersedes"; |
318 | 0 | if (val == FU_COSWID_LINK_REL_SUPPLEMENTAL) |
319 | 0 | return "supplemental"; |
320 | 0 | return NULL; |
321 | 0 | } |
322 | | FuCoswidLinkRel |
323 | | fu_coswid_link_rel_from_string(const gchar *val) |
324 | 0 | { |
325 | 0 | if (g_strcmp0(val, "license") == 0) |
326 | 0 | return FU_COSWID_LINK_REL_LICENSE; |
327 | 0 | if (g_strcmp0(val, "compiler") == 0) |
328 | 0 | return FU_COSWID_LINK_REL_COMPILER; |
329 | 0 | if (g_strcmp0(val, "unknown") == 0) |
330 | 0 | return FU_COSWID_LINK_REL_UNKNOWN; |
331 | 0 | if (g_strcmp0(val, "ancestor") == 0) |
332 | 0 | return FU_COSWID_LINK_REL_ANCESTOR; |
333 | 0 | if (g_strcmp0(val, "component") == 0) |
334 | 0 | return FU_COSWID_LINK_REL_COMPONENT; |
335 | 0 | if (g_strcmp0(val, "feature") == 0) |
336 | 0 | return FU_COSWID_LINK_REL_FEATURE; |
337 | 0 | if (g_strcmp0(val, "installationmedia") == 0) |
338 | 0 | return FU_COSWID_LINK_REL_INSTALLATIONMEDIA; |
339 | 0 | if (g_strcmp0(val, "packageinstaller") == 0) |
340 | 0 | return FU_COSWID_LINK_REL_PACKAGEINSTALLER; |
341 | 0 | if (g_strcmp0(val, "parent") == 0) |
342 | 0 | return FU_COSWID_LINK_REL_PARENT; |
343 | 0 | if (g_strcmp0(val, "patches") == 0) |
344 | 0 | return FU_COSWID_LINK_REL_PATCHES; |
345 | 0 | if (g_strcmp0(val, "requires") == 0) |
346 | 0 | return FU_COSWID_LINK_REL_REQUIRES; |
347 | 0 | if (g_strcmp0(val, "see-also") == 0) |
348 | 0 | return FU_COSWID_LINK_REL_SEE_ALSO; |
349 | 0 | if (g_strcmp0(val, "supersedes") == 0) |
350 | 0 | return FU_COSWID_LINK_REL_SUPERSEDES; |
351 | 0 | if (g_strcmp0(val, "supplemental") == 0) |
352 | 0 | return FU_COSWID_LINK_REL_SUPPLEMENTAL; |
353 | 0 | return FU_COSWID_LINK_REL_LICENSE; |
354 | 0 | } |
355 | | |
356 | | const gchar * |
357 | | fu_coswid_entity_role_to_string(FuCoswidEntityRole val) |
358 | 0 | { |
359 | 0 | if (val == FU_COSWID_ENTITY_ROLE_UNKNOWN) |
360 | 0 | return "unknown"; |
361 | 0 | if (val == FU_COSWID_ENTITY_ROLE_TAG_CREATOR) |
362 | 0 | return "tag-creator"; |
363 | 0 | if (val == FU_COSWID_ENTITY_ROLE_SOFTWARE_CREATOR) |
364 | 0 | return "software-creator"; |
365 | 0 | if (val == FU_COSWID_ENTITY_ROLE_AGGREGATOR) |
366 | 0 | return "aggregator"; |
367 | 0 | if (val == FU_COSWID_ENTITY_ROLE_DISTRIBUTOR) |
368 | 0 | return "distributor"; |
369 | 0 | if (val == FU_COSWID_ENTITY_ROLE_LICENSOR) |
370 | 0 | return "licensor"; |
371 | 0 | if (val == FU_COSWID_ENTITY_ROLE_MAINTAINER) |
372 | 0 | return "maintainer"; |
373 | 0 | return NULL; |
374 | 0 | } |
375 | | FuCoswidEntityRole |
376 | | fu_coswid_entity_role_from_string(const gchar *val) |
377 | 0 | { |
378 | 0 | if (g_strcmp0(val, "unknown") == 0) |
379 | 0 | return FU_COSWID_ENTITY_ROLE_UNKNOWN; |
380 | 0 | if (g_strcmp0(val, "tag-creator") == 0) |
381 | 0 | return FU_COSWID_ENTITY_ROLE_TAG_CREATOR; |
382 | 0 | if (g_strcmp0(val, "software-creator") == 0) |
383 | 0 | return FU_COSWID_ENTITY_ROLE_SOFTWARE_CREATOR; |
384 | 0 | if (g_strcmp0(val, "aggregator") == 0) |
385 | 0 | return FU_COSWID_ENTITY_ROLE_AGGREGATOR; |
386 | 0 | if (g_strcmp0(val, "distributor") == 0) |
387 | 0 | return FU_COSWID_ENTITY_ROLE_DISTRIBUTOR; |
388 | 0 | if (g_strcmp0(val, "licensor") == 0) |
389 | 0 | return FU_COSWID_ENTITY_ROLE_LICENSOR; |
390 | 0 | if (g_strcmp0(val, "maintainer") == 0) |
391 | 0 | return FU_COSWID_ENTITY_ROLE_MAINTAINER; |
392 | 0 | return FU_COSWID_ENTITY_ROLE_UNKNOWN; |
393 | 0 | } |
394 | | |
395 | | const gchar * |
396 | | fu_coswid_hash_alg_to_string(FuCoswidHashAlg val) |
397 | 0 | { |
398 | 0 | if (val == FU_COSWID_HASH_ALG_UNKNOWN) |
399 | 0 | return "unknown"; |
400 | 0 | if (val == FU_COSWID_HASH_ALG_SHA256) |
401 | 0 | return "sha256"; |
402 | 0 | if (val == FU_COSWID_HASH_ALG_SHA384) |
403 | 0 | return "sha384"; |
404 | 0 | if (val == FU_COSWID_HASH_ALG_SHA512) |
405 | 0 | return "sha512"; |
406 | 0 | return NULL; |
407 | 0 | } |
408 | | FuCoswidHashAlg |
409 | | fu_coswid_hash_alg_from_string(const gchar *val) |
410 | 0 | { |
411 | 0 | if (g_strcmp0(val, "unknown") == 0) |
412 | 0 | return FU_COSWID_HASH_ALG_UNKNOWN; |
413 | 0 | if (g_strcmp0(val, "sha256") == 0) |
414 | 0 | return FU_COSWID_HASH_ALG_SHA256; |
415 | 0 | if (g_strcmp0(val, "sha384") == 0) |
416 | 0 | return FU_COSWID_HASH_ALG_SHA384; |
417 | 0 | if (g_strcmp0(val, "sha512") == 0) |
418 | 0 | return FU_COSWID_HASH_ALG_SHA512; |
419 | 0 | return FU_COSWID_HASH_ALG_UNKNOWN; |
420 | 0 | } |