[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH 2/3] install_script: add get_config_param function



Return, if exists, the sought OsinfoInstallConfigParam from an
OsinfoInstallScript. Otherwise, NULL is returned.
---
 osinfo/libosinfo.syms          |  1 +
 osinfo/osinfo_install_script.c | 13 +++++++++++++
 osinfo/osinfo_install_script.h |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index 772e89c..df76108 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -309,6 +309,7 @@ LIBOSINFO_0.2.1 {
 	osinfo_entity_get_param_value_int64_with_default;
 	osinfo_entity_set_param_int64;
 	osinfo_install_script_get_expected_filename;
+	osinfo_install_script_get_config_param;
 } LIBOSINFO_0.2.0;
 
 /* Symbols in next release...
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index 8efe5f1..3726ae7 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -262,6 +262,19 @@ GList *osinfo_install_script_get_config_param_list(const OsinfoInstallScript *sc
     return g_list_copy(script->priv->config_param_list);
 }
 
+const OsinfoInstallConfigParam *osinfo_install_script_get_config_param(const OsinfoInstallScript *script, const gchar *name)
+{
+    GList *l;
+
+    for (l = script->priv->config_param_list; l != NULL; l = l->next)
+    {
+        OsinfoInstallConfigParam *tmp = l->data;
+        if (g_strcmp0(osinfo_install_config_param_get_name(tmp), name) == 0)
+            return tmp;
+    }
+    return NULL;
+}
+
 static void
 osinfo_install_script_init (OsinfoInstallScript *list)
 {
diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h
index d128f94..49dcddb 100644
--- a/osinfo/osinfo_install_script.h
+++ b/osinfo/osinfo_install_script.h
@@ -137,6 +137,8 @@ gboolean osinfo_install_script_has_config_param(const OsinfoInstallScript *scrip
 
 gboolean osinfo_install_script_has_config_param_name(const OsinfoInstallScript *script, const gchar *name);
 
+const OsinfoInstallConfigParam *osinfo_install_script_get_config_param(const OsinfoInstallScript *script, const gchar *name);
+
 void osinfo_install_script_add_config_param(OsinfoInstallScript *script, OsinfoInstallConfigParam *param);
 
 GList *osinfo_install_script_get_config_param_list(const OsinfoInstallScript *script);
-- 
1.7.12.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]