/work/fwupd-request-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-request-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_request_kind_to_string: |
20 | | * @val: value, e.g. %FWUPD_REQUEST_KIND_POST |
21 | | * |
22 | | * Converts an enumerated value to a string. |
23 | | * |
24 | | * Returns: identifier string |
25 | | * |
26 | | * Since: 1.6.2 |
27 | | **/ |
28 | | const gchar * |
29 | | fwupd_request_kind_to_string(FwupdRequestKind val) |
30 | 0 | { |
31 | 0 | if (val == FWUPD_REQUEST_KIND_POST) |
32 | 0 | return "post"; |
33 | 0 | if (val == FWUPD_REQUEST_KIND_IMMEDIATE) |
34 | 0 | return "immediate"; |
35 | 0 | return NULL; |
36 | 0 | } |
37 | | /** |
38 | | * fwupd_request_kind_from_string: |
39 | | * @val: (nullable): a string, e.g. `post` |
40 | | * |
41 | | * Converts a string to an enumerated value. |
42 | | * |
43 | | * Returns: enumerated value |
44 | | * |
45 | | * Since: 1.6.2 |
46 | | **/ |
47 | | FwupdRequestKind |
48 | | fwupd_request_kind_from_string(const gchar *val) |
49 | 0 | { |
50 | 0 | if (g_strcmp0(val, "post") == 0) |
51 | 0 | return FWUPD_REQUEST_KIND_POST; |
52 | 0 | if (g_strcmp0(val, "immediate") == 0) |
53 | 0 | return FWUPD_REQUEST_KIND_IMMEDIATE; |
54 | 0 | return FWUPD_REQUEST_KIND_UNKNOWN; |
55 | 0 | } |
56 | | |
57 | | /** |
58 | | * fwupd_request_flag_to_string: |
59 | | * @val: value, e.g. %FWUPD_REQUEST_FLAG_ALLOW_GENERIC_MESSAGE |
60 | | * |
61 | | * Converts an enumerated value to a string. |
62 | | * |
63 | | * Returns: identifier string |
64 | | * |
65 | | * Since: 1.8.6 |
66 | | **/ |
67 | | const gchar * |
68 | | fwupd_request_flag_to_string(FwupdRequestFlags val) |
69 | 0 | { |
70 | 0 | if (val == FWUPD_REQUEST_FLAG_NONE) |
71 | 0 | return "none"; |
72 | 0 | if (val == FWUPD_REQUEST_FLAG_ALLOW_GENERIC_MESSAGE) |
73 | 0 | return "allow-generic-message"; |
74 | 0 | if (val == FWUPD_REQUEST_FLAG_ALLOW_GENERIC_IMAGE) |
75 | 0 | return "allow-generic-image"; |
76 | 0 | if (val == FWUPD_REQUEST_FLAG_NON_GENERIC_MESSAGE) |
77 | 0 | return "non-generic-message"; |
78 | 0 | if (val == FWUPD_REQUEST_FLAG_NON_GENERIC_IMAGE) |
79 | 0 | return "non-generic-image"; |
80 | 0 | return NULL; |
81 | 0 | } |
82 | | /** |
83 | | * fwupd_request_flag_from_string: |
84 | | * @val: (nullable): a string, e.g. `allow-generic-message` |
85 | | * |
86 | | * Converts a string to an enumerated value. |
87 | | * |
88 | | * Returns: enumerated value |
89 | | * |
90 | | * Since: 1.8.6 |
91 | | **/ |
92 | | FwupdRequestFlags |
93 | | fwupd_request_flag_from_string(const gchar *val) |
94 | 0 | { |
95 | 0 | if (g_strcmp0(val, "none") == 0) |
96 | 0 | return FWUPD_REQUEST_FLAG_NONE; |
97 | 0 | if (g_strcmp0(val, "allow-generic-message") == 0) |
98 | 0 | return FWUPD_REQUEST_FLAG_ALLOW_GENERIC_MESSAGE; |
99 | 0 | if (g_strcmp0(val, "allow-generic-image") == 0) |
100 | 0 | return FWUPD_REQUEST_FLAG_ALLOW_GENERIC_IMAGE; |
101 | 0 | if (g_strcmp0(val, "non-generic-message") == 0) |
102 | 0 | return FWUPD_REQUEST_FLAG_NON_GENERIC_MESSAGE; |
103 | 0 | if (g_strcmp0(val, "non-generic-image") == 0) |
104 | 0 | return FWUPD_REQUEST_FLAG_NON_GENERIC_IMAGE; |
105 | 0 | return FWUPD_REQUEST_FLAG_UNKNOWN; |
106 | 0 | } |