[virt-tools-list] [libosinfo PATCHv3 06/12] Add OsinfoInstallConfigParamList

Christophe Fergeau cfergeau at redhat.com
Wed Dec 12 15:18:36 UTC 2012


---
 osinfo/Makefile.am                       | 157 ++++++++++++++++---------------
 osinfo/libosinfo.syms                    |   3 +
 osinfo/osinfo.h                          |   1 +
 osinfo/osinfo_install_config_paramlist.c |  94 ++++++++++++++++++
 osinfo/osinfo_install_config_paramlist.h |  79 ++++++++++++++++
 5 files changed, 256 insertions(+), 78 deletions(-)
 create mode 100644 osinfo/osinfo_install_config_paramlist.c
 create mode 100644 osinfo/osinfo_install_config_paramlist.h

diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
index c365e5f..20b1ac4 100644
--- a/osinfo/Makefile.am
+++ b/osinfo/Makefile.am
@@ -53,86 +53,87 @@ libosinfo_1_0_la_DEPENDENCIES = libosinfo.syms
 
 libosinfo_1_0_includedir = $(includedir)/libosinfo-1.0/osinfo
 
-OSINFO_HEADER_FILES =		\
-  osinfo.h			\
-  osinfo_avatar_format.h 	\
-  osinfo_db.h			\
-  osinfo_loader.h		\
-  osinfo_datamap.h		\
-  osinfo_datamaplist.h		\
-  osinfo_device.h		\
-  osinfo_device_driver.h	\
-  osinfo_device_driverlist.h	\
-  osinfo_devicelink.h		\
-  osinfo_devicelist.h		\
-  osinfo_devicelinklist.h	\
-  osinfo_devicelinkfilter.h	\
-  osinfo_entity.h		\
-  osinfo_filter.h		\
-  osinfo_install_config.h       \
-  osinfo_install_config_param.h \
-  osinfo_install_script.h       \
-  osinfo_install_scriptlist.h   \
-  osinfo_product.h		\
-  osinfo_productfilter.h	\
-  osinfo_productlist.h		\
-  osinfo_platform.h		\
-  osinfo_platformlist.h		\
-  osinfo_list.h			\
-  osinfo_os.h			\
-  osinfo_oslist.h		\
-  osinfo_deployment.h		\
-  osinfo_deploymentlist.h	\
-  osinfo_media.h		\
-  osinfo_medialist.h		\
-  osinfo_resources.h		\
-  osinfo_resourceslist.h	\
-  osinfo_tree.h			\
-  osinfo_treelist.h		\
+OSINFO_HEADER_FILES =			\
+  osinfo.h				\
+  osinfo_avatar_format.h		\
+  osinfo_db.h				\
+  osinfo_loader.h			\
+  osinfo_datamap.h			\
+  osinfo_datamaplist.h			\
+  osinfo_device.h			\
+  osinfo_devicelink.h			\
+  osinfo_devicelist.h			\
+  osinfo_devicelinklist.h		\
+  osinfo_devicelinkfilter.h		\
+  osinfo_device_driver.h		\
+  osinfo_device_driverlist.h		\
+  osinfo_entity.h			\
+  osinfo_filter.h			\
+  osinfo_install_config.h		\
+  osinfo_install_config_param.h		\
+  osinfo_install_script.h		\
+  osinfo_install_scriptlist.h		\
+  osinfo_product.h			\
+  osinfo_productfilter.h		\
+  osinfo_productlist.h			\
+  osinfo_platform.h			\
+  osinfo_platformlist.h			\
+  osinfo_list.h				\
+  osinfo_os.h				\
+  osinfo_oslist.h			\
+  osinfo_deployment.h			\
+  osinfo_deploymentlist.h		\
+  osinfo_media.h			\
+  osinfo_medialist.h			\
+  osinfo_resources.h			\
+  osinfo_resourceslist.h		\
+  osinfo_tree.h				\
+  osinfo_treelist.h			\
   $(NULL)
 
-libosinfo_1_0_include_HEADERS = \
-  $(OSINFO_HEADER_FILES)	\
-  osinfo_enum_types.h
-
-libosinfo_1_0_la_SOURCES =	  \
-  osinfo_avatar_format.c	  \
-  osinfo_datamap.c		  \
-  osinfo_datamaplist.c		  \
-  osinfo_entity.c		  \
-  osinfo_enum_types.c		  \
-  osinfo_filter.c		  \
-  osinfo_list.c			  \
-  osinfo_device.c		  \
-  osinfo_device_driver.c	  \
-  osinfo_device_driver_private.h  \
-  osinfo_device_driverlist.c	  \
-  osinfo_devicelink.c		  \
-  osinfo_devicelist.c		  \
-  osinfo_devicelinklist.c	  \
-  osinfo_devicelinkfilter.c	  \
-  osinfo_install_config.c         \
-  osinfo_install_config_param.c   \
-  osinfo_install_script.c         \
-  osinfo_install_script_private.h \
-  osinfo_install_scriptlist.c     \
-  osinfo_product.c		  \
-  osinfo_productfilter.c	  \
-  osinfo_productlist.c		  \
-  osinfo_platform.c		  \
-  osinfo_platformlist.c		  \
-  osinfo_oslist.c		  \
-  osinfo_os.c			  \
-  osinfo_deployment.c		  \
-  osinfo_deploymentlist.c	  \
-  osinfo_media.c		  \
-  osinfo_medialist.c		  \
-  osinfo_resources.c		  \
-  osinfo_resourceslist.c	  \
-  osinfo_tree.c			  \
-  osinfo_treelist.c		  \
-  osinfo_db.c			  \
-  osinfo_loader.c		  \
+libosinfo_1_0_include_HEADERS =		\
+  $(OSINFO_HEADER_FILES)		\
+  osinfo_enum_types.h			\
+  $(NULL)
+
+libosinfo_1_0_la_SOURCES =		\
+  osinfo_avatar_format.c		\
+  osinfo_datamap.c			\
+  osinfo_datamaplist.c			\
+  osinfo_entity.c			\
+  osinfo_enum_types.c			\
+  osinfo_filter.c			\
+  osinfo_list.c				\
+  osinfo_device.c			\
+  osinfo_devicelink.c			\
+  osinfo_devicelist.c			\
+  osinfo_devicelinklist.c		\
+  osinfo_devicelinkfilter.c		\
+  osinfo_device_driver.c		\
+  osinfo_device_driverlist.c		\
+  osinfo_install_config.c		\
+  osinfo_install_config_param.c		\
+  osinfo_install_config_paramlist.c	\
+  osinfo_install_script.c		\
+  osinfo_install_script_private.h	\
+  osinfo_install_scriptlist.c		\
+  osinfo_product.c			\
+  osinfo_productfilter.c		\
+  osinfo_productlist.c			\
+  osinfo_platform.c			\
+  osinfo_platformlist.c			\
+  osinfo_oslist.c			\
+  osinfo_os.c				\
+  osinfo_deployment.c			\
+  osinfo_deploymentlist.c		\
+  osinfo_media.c			\
+  osinfo_medialist.c			\
+  osinfo_resources.c			\
+  osinfo_resourceslist.c		\
+  osinfo_tree.c				\
+  osinfo_treelist.c			\
+  osinfo_db.c				\
+  osinfo_loader.c			\
   $(NULL)
 
 osinfo_enum_types.h: $(OSINFO_HEADER_FILES) osinfo_enum_types.h.template
diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index 37736f1..196917d 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -386,6 +386,9 @@ LIBOSINFO_0.2.3 {
 	osinfo_db_add_datamap;
 	osinfo_db_get_datamap;
 	osinfo_db_get_datamap_list;
+
+	osinfo_install_config_paramlist_get_type;
+	osinfo_install_config_paramlist_new;
 } LIBOSINFO_0.2.2;
 
 /* Symbols in next release...
diff --git a/osinfo/osinfo.h b/osinfo/osinfo.h
index 13b5a0b..1012ede 100644
--- a/osinfo/osinfo.h
+++ b/osinfo/osinfo.h
@@ -42,6 +42,7 @@
 #include <osinfo/osinfo_devicelinkfilter.h>
 #include <osinfo/osinfo_install_config.h>
 #include <osinfo/osinfo_install_config_param.h>
+#include <osinfo/osinfo_install_config_paramlist.h>
 #include <osinfo/osinfo_install_script.h>
 #include <osinfo/osinfo_avatar_format.h>
 #include <osinfo/osinfo_install_scriptlist.h>
diff --git a/osinfo/osinfo_install_config_paramlist.c b/osinfo/osinfo_install_config_paramlist.c
new file mode 100644
index 0000000..d3eeffc
--- /dev/null
+++ b/osinfo/osinfo_install_config_paramlist.c
@@ -0,0 +1,94 @@
+/*
+ * libosinfo: a list of installation configuration parameters
+ *
+ * Copyright (C) 2009-2012 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Authors:
+ *   Arjun Roy <arroy at redhat.com>
+ *   Christophe Fergeau <cfergeau at redhat.com>
+ *   Daniel P. Berrange <berrange at redhat.com>
+ */
+
+#include <config.h>
+
+#include <osinfo/osinfo.h>
+#include <glib/gi18n-lib.h>
+
+G_DEFINE_TYPE (OsinfoInstallConfigParamList, osinfo_install_config_paramlist, OSINFO_TYPE_LIST);
+
+#define OSINFO_INSTALL_CONFIG_PARAMLIST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST, OsinfoInstallConfigParamListPrivate))
+
+/**
+ * SECTION:osinfo_install_config_paramlist
+ * @short_description: A list of installation install_config_param
+ * @see_also: #OsinfoList, #OsinfoInstallConfigParam
+ *
+ * #OsinfoInstallConfigParamList is a list specialization that stores
+ * only #OsinfoInstallConfigParam objects.
+ */
+
+struct _OsinfoInstallConfigParamListPrivate
+{
+    gboolean unused;
+};
+
+static void
+osinfo_install_config_paramlist_finalize (GObject *object)
+{
+    /* Chain up to the parent class */
+    G_OBJECT_CLASS (osinfo_install_config_paramlist_parent_class)->finalize (object);
+}
+
+/* Init functions */
+static void
+osinfo_install_config_paramlist_class_init (OsinfoInstallConfigParamListClass *klass)
+{
+    GObjectClass *g_klass = G_OBJECT_CLASS (klass);
+
+    g_klass->finalize = osinfo_install_config_paramlist_finalize;
+    g_type_class_add_private (klass, sizeof (OsinfoInstallConfigParamListPrivate));
+}
+
+static void
+osinfo_install_config_paramlist_init (OsinfoInstallConfigParamList *list)
+{
+    OsinfoInstallConfigParamListPrivate *priv;
+    list->priv = priv = OSINFO_INSTALL_CONFIG_PARAMLIST_GET_PRIVATE(list);
+
+}
+
+/**
+ * osinfo_install_config_paramlist_new:
+ *
+ * Construct a new install_config_param list that is initially empty.
+ *
+ * Returns: (transfer full): an empty install_config_param list
+ */
+OsinfoInstallConfigParamList *osinfo_install_config_paramlist_new(void)
+{
+    return g_object_new(OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST,
+                        "element-type", OSINFO_TYPE_INSTALL_CONFIG_PARAM,
+                        NULL);
+}
+
+/*
+ * Local variables:
+ *  indent-tabs-mode: nil
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ */
diff --git a/osinfo/osinfo_install_config_paramlist.h b/osinfo/osinfo_install_config_paramlist.h
new file mode 100644
index 0000000..81254c3
--- /dev/null
+++ b/osinfo/osinfo_install_config_paramlist.h
@@ -0,0 +1,79 @@
+/*
+ * libosinfo: a list of installation configuration parameters
+ *
+ * Copyright (C) 2009-2012 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Authors:
+ *   Arjun Roy <arroy at redhat.com>
+ *   Christophe Fergeau <cfergeau at redhat.com>
+ *   Daniel P. Berrange <berrange at redhat.com>
+ *   Zeeshan Ali <zeenix at redhat.com>
+ */
+
+#include <glib-object.h>
+#include <osinfo/osinfo_list.h>
+
+#ifndef __OSINFO_INSTALL_CONFIG_PARAMLIST_H__
+#define __OSINFO_INSTALL_CONFIG_PARAMLIST_H__
+
+/*
+ * Type macros.
+ */
+#define OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST                  (osinfo_install_config_paramlist_get_type ())
+#define OSINFO_INSTALL_CONFIG_PARAMLIST(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST, OsinfoInstallConfigParamList))
+#define OSINFO_IS_INSTALL_CONFIG_PARAMLIST(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST))
+#define OSINFO_INSTALL_CONFIG_PARAMLIST_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST, OsinfoInstallConfigParamListClass))
+#define OSINFO_IS_INSTALL_CONFIG_PARAMLIST_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST))
+#define OSINFO_INSTALL_CONFIG_PARAMLIST_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), OSINFO_TYPE_INSTALL_CONFIG_PARAMLIST, OsinfoInstallConfigParamListClass))
+
+typedef struct _OsinfoInstallConfigParamList        OsinfoInstallConfigParamList;
+
+typedef struct _OsinfoInstallConfigParamListClass   OsinfoInstallConfigParamListClass;
+
+typedef struct _OsinfoInstallConfigParamListPrivate OsinfoInstallConfigParamListPrivate;
+
+/* object */
+struct _OsinfoInstallConfigParamList
+{
+    OsinfoList parent_instance;
+
+    /* public */
+
+    /* private */
+    OsinfoInstallConfigParamListPrivate *priv;
+};
+
+/* class */
+struct _OsinfoInstallConfigParamListClass
+{
+    OsinfoListClass parent_class;
+
+    /* class members */
+};
+
+GType osinfo_install_config_paramlist_get_type(void);
+
+OsinfoInstallConfigParamList *osinfo_install_config_paramlist_new(void);
+
+#endif /* __OSINFO_INSTALL_CONFIG_PARAMLIST_H__ */
+/*
+ * Local variables:
+ *  indent-tabs-mode: nil
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ */
-- 
1.8.0.1




More information about the virt-tools-list mailing list