summary refs log tree commit diff
path: root/src/libnm-core-impl/nm-setting-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnm-core-impl/nm-setting-private.h')
-rw-r--r--src/libnm-core-impl/nm-setting-private.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h
index 7483eaed..38b233e9 100644
--- a/src/libnm-core-impl/nm-setting-private.h
+++ b/src/libnm-core-impl/nm-setting-private.h
@@ -232,6 +232,14 @@ gboolean _nm_setting_clear_secrets(NMSetting                       *setting,
 
 /*****************************************************************************/
 
+/* This holds a property of type NM_VALUE_TYPE_STRV. You probably want
+ * to use nm_strvarray_*() API with this. */
+typedef struct {
+    GArray *arr;
+} NMValueStrv;
+
+/*****************************************************************************/
+
 #define NM_SETTING_PARAM_NONE 0
 
 /* The property of the #NMSetting should be considered during comparisons that
@@ -277,6 +285,7 @@ extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_int64;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_uint64;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_string;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_bytes;
+extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_strv;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_enum;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_flags;
 extern const NMSettInfoPropertType nm_sett_info_propert_type_direct_mac_address;
@@ -774,6 +783,42 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
 
 /*****************************************************************************/
 
+#define _nm_setting_property_define_direct_strv(properties_override,                         \
+                                                obj_properties,                              \
+                                                prop_name,                                   \
+                                                prop_id,                                     \
+                                                param_flags,                                 \
+                                                private_struct_type,                         \
+                                                private_struct_field,                        \
+                                                ... /* extra NMSettInfoProperty fields */)   \
+    G_STMT_START                                                                             \
+    {                                                                                        \
+        GParamSpec *_param_spec;                                                             \
+                                                                                             \
+        G_STATIC_ASSERT(!NM_FLAGS_ANY((param_flags), ~(NM_SETTING_PARAM_FUZZY_IGNORE)));     \
+                                                                                             \
+        _param_spec =                                                                        \
+            g_param_spec_boxed("" prop_name "",                                              \
+                               "",                                                           \
+                               "",                                                           \
+                               G_TYPE_STRV,                                                  \
+                               G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags));  \
+                                                                                             \
+        (obj_properties)[(prop_id)] = _param_spec;                                           \
+                                                                                             \
+        _nm_properties_override_gobj((properties_override),                                  \
+                                     _param_spec,                                            \
+                                     &nm_sett_info_propert_type_direct_strv,                 \
+                                     .direct_offset =                                        \
+                                         NM_STRUCT_OFFSET_ENSURE_TYPE(NMValueStrv,           \
+                                                                      private_struct_type,   \
+                                                                      private_struct_field), \
+                                     __VA_ARGS__);                                           \
+    }                                                                                        \
+    G_STMT_END
+
+/*****************************************************************************/
+
 #define _nm_setting_property_define_direct_enum(properties_override,                             \
                                                 obj_properties,                                  \
                                                 prop_name,                                       \