/work/fwupd-report-struct.c
Line | Count | Source |
1 | | /* |
2 | | * This file is auto-generated, do not modify! |
3 | | * |
4 | | * SPDX-License-Identifier: LGPL-2.1-or-later |
5 | | */ |
6 | | |
7 | | #include "config.h" |
8 | | |
9 | | #include <glib.h> |
10 | | |
11 | | #include "fwupd-report-struct.h" |
12 | | |
13 | | #ifdef G_LOG_DOMAIN |
14 | | #undef G_LOG_DOMAIN |
15 | | #endif |
16 | | #define G_LOG_DOMAIN "FuStruct" |
17 | | |
18 | | /** |
19 | | * fwupd_report_flag_to_string: |
20 | | * @val: value, e.g. %FWUPD_REPORT_FLAG_FROM_OEM |
21 | | * |
22 | | * Converts an enumerated value to a string. |
23 | | * |
24 | | * Returns: identifier string |
25 | | * |
26 | | * Since: 1.9.1 |
27 | | **/ |
28 | | const gchar * |
29 | | fwupd_report_flag_to_string(FwupdReportFlags val) |
30 | 0 | { |
31 | 0 | if (val == FWUPD_REPORT_FLAG_NONE) |
32 | 0 | return "none"; |
33 | 0 | if (val == FWUPD_REPORT_FLAG_FROM_OEM) |
34 | 0 | return "from-oem"; |
35 | 0 | if (val == FWUPD_REPORT_FLAG_IS_UPGRADE) |
36 | 0 | return "is-upgrade"; |
37 | 0 | return NULL; |
38 | 0 | } |
39 | | /** |
40 | | * fwupd_report_flag_from_string: |
41 | | * @val: (nullable): a string, e.g. `from-oem` |
42 | | * |
43 | | * Converts a string to an enumerated value. |
44 | | * |
45 | | * Returns: enumerated value |
46 | | * |
47 | | * Since: 1.9.1 |
48 | | **/ |
49 | | FwupdReportFlags |
50 | | fwupd_report_flag_from_string(const gchar *val) |
51 | 0 | { |
52 | 0 | if (g_strcmp0(val, "none") == 0) |
53 | 0 | return FWUPD_REPORT_FLAG_NONE; |
54 | 0 | if (g_strcmp0(val, "from-oem") == 0) |
55 | 0 | return FWUPD_REPORT_FLAG_FROM_OEM; |
56 | 0 | if (g_strcmp0(val, "is-upgrade") == 0) |
57 | 0 | return FWUPD_REPORT_FLAG_IS_UPGRADE; |
58 | 0 | return FWUPD_REPORT_FLAG_UNKNOWN; |
59 | 0 | } |