[Libosinfo] [libosinfo PATCH 04/11] os: Group get_*_resources() together

Fabiano Fidêncio fabiano at fidencio.org
Tue Jan 22 19:28:13 UTC 2019


Signed-off-by: Fabiano Fidêncio <fabiano at fidencio.org>
---
 osinfo/osinfo_os.c | 65 +++++++++++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 33 deletions(-)

diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index 86e726f..c396565 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -741,28 +741,6 @@ void osinfo_os_add_variant(OsinfoOs *os, OsinfoOsVariant *variant)
     osinfo_list_add(OSINFO_LIST(os->priv->variants), OSINFO_ENTITY(variant));
 }
 
-/**
- * osinfo_os_get_minimum_resources_without_inheritance:
- * @os: an operating system
- *
- * Get the list of minimum required resources for the operating system @os.
- *
- * Mind that this method is *private*!
- *
- * Returns: (transfer full): A list of resources
- */
-OsinfoResourcesList *
-osinfo_os_get_minimum_resources_without_inheritance(OsinfoOs *os)
-{
-    g_return_val_if_fail(OSINFO_IS_OS(os), NULL);
-
-    OsinfoResourcesList *newList = osinfo_resourceslist_new();
-
-    osinfo_list_add_all(OSINFO_LIST(newList), OSINFO_LIST(os->priv->minimum));
-
-    return newList;
-}
-
 struct GetAllResourcesData {
     OsinfoOs *os;
     OsinfoResourcesList *resourceslist;
@@ -862,6 +840,27 @@ osinfo_os_get_resources_internal(OsinfoOs *os,
     return foreach_data.resourceslist;
 }
 
+/**
+ * osinfo_os_get_minimum_resources_without_inheritance:
+ * @os: an operating system
+ *
+ * Get the list of minimum required resources for the operating system @os.
+ *
+ * Mind that this method is *private*!
+ *
+ * Returns: (transfer full): A list of resources
+ */
+OsinfoResourcesList *
+osinfo_os_get_minimum_resources_without_inheritance(OsinfoOs *os)
+{
+    g_return_val_if_fail(OSINFO_IS_OS(os), NULL);
+
+    OsinfoResourcesList *newList = osinfo_resourceslist_new();
+
+    osinfo_list_add_all(OSINFO_LIST(newList), OSINFO_LIST(os->priv->minimum));
+
+    return newList;
+}
 
 /**
  * osinfo_os_get_minimum_resources:
@@ -878,44 +877,44 @@ OsinfoResourcesList *osinfo_os_get_minimum_resources(OsinfoOs *os)
 }
 
 /**
- * osinfo_os_get_recommended_resources_without_inheritance:
+ * osinfo_os_get_maximum_resources:
  * @os: an operating system
  *
- * Get the list of recommended resources for the operating system @os.
- *
- * Mind that this method is *private*!
+ * Get the list of maximum resources for the operating system @os.
  *
  * Returns: (transfer full): A list of resources
  */
-OsinfoResourcesList *
-osinfo_os_get_recommended_resources_without_inheritance(OsinfoOs *os)
+OsinfoResourcesList *osinfo_os_get_maximum_resources(OsinfoOs *os)
 {
     g_return_val_if_fail(OSINFO_IS_OS(os), NULL);
 
     OsinfoResourcesList *newList = osinfo_resourceslist_new();
 
     osinfo_list_add_all(OSINFO_LIST(newList),
-                        OSINFO_LIST(os->priv->recommended));
+                        OSINFO_LIST(os->priv->maximum));
 
     return newList;
 }
 
 /**
- * osinfo_os_get_maximum_resources:
+ * osinfo_os_get_recommended_resources_without_inheritance:
  * @os: an operating system
  *
- * Get the list of maximum resources for the operating system @os.
+ * Get the list of recommended resources for the operating system @os.
+ *
+ * Mind that this method is *private*!
  *
  * Returns: (transfer full): A list of resources
  */
-OsinfoResourcesList *osinfo_os_get_maximum_resources(OsinfoOs *os)
+OsinfoResourcesList *
+osinfo_os_get_recommended_resources_without_inheritance(OsinfoOs *os)
 {
     g_return_val_if_fail(OSINFO_IS_OS(os), NULL);
 
     OsinfoResourcesList *newList = osinfo_resourceslist_new();
 
     osinfo_list_add_all(OSINFO_LIST(newList),
-                        OSINFO_LIST(os->priv->maximum));
+                        OSINFO_LIST(os->priv->recommended));
 
     return newList;
 }
-- 
1.8.3.1




More information about the Libosinfo mailing list