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

[virt-tools-list] [PATCH 08/47] Sanitize naming of all list object APIs



The GObject naming conversion is lowercase, separated
by underscores. This needs to be followed to allow
gobject introspection to be auto-generated easily.

* osinfo/osinfo_devicelist.c, osinfo/osinfo_devicelist.h,
  osinfo/osinfo_hypervisorlist.c, osinfo/osinfo_hypervisorlist.h,
  osinfo/osinfo_list.c, osinfo/osinfo_list.h: Convert
  API naming to use lowercase + underscores. Add
  explicit constructors.
* osinfo/osinfo_db.c, osinfo/osinfo_filter.c,
  osinfo/osinfo_hypervisor.c, osinfo/osinfo_os.c: Update
  for changing API naming
---
 osinfo/osinfo_db.c             |    4 +-
 osinfo/osinfo_devicelist.c     |   16 +++++-----
 osinfo/osinfo_devicelist.h     |    8 +++---
 osinfo/osinfo_filter.c         |    2 +-
 osinfo/osinfo_hypervisor.c     |    2 +-
 osinfo/osinfo_hypervisorlist.c |   16 +++++-----
 osinfo/osinfo_hypervisorlist.h |    8 +++---
 osinfo/osinfo_list.c           |   57 ++++++++++++++++++---------------------
 osinfo/osinfo_list.h           |   11 +++----
 osinfo/osinfo_os.c             |    4 +-
 osinfo/osinfo_oslist.c         |   16 +++++-----
 osinfo/osinfo_oslist.h         |    8 +++---
 12 files changed, 73 insertions(+), 79 deletions(-)

diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index b83b2bd..8f3bb03 100644
--- a/osinfo/osinfo_db.c
+++ b/osinfo/osinfo_db.c
@@ -240,7 +240,7 @@ static gboolean __osinfoFilteredAddToList(gpointer key, gpointer value, gpointer
     // Key is string ID, value is pointer to entity
     OsinfoEntity *entity = (OsinfoEntity *) value;
     if (__osinfoEntityPassesFilter(filter, entity)) {
-        __osinfoListAdd(list, entity);
+        __osinfo_list_add(list, entity);
     }
 
     args->errcode = 0;
@@ -493,7 +493,7 @@ static gboolean __osinfoAddOsIfRelationship(gpointer key, gpointer value, gpoint
     GPtrArray *relatedOses = NULL;
     relatedOses = g_tree_lookup(os->priv->relationshipsByType, (gpointer) args->relshp);
     if (relatedOses) {
-        __osinfoListAdd(list, OSINFO_ENTITY (os));
+        __osinfo_list_add(list, OSINFO_ENTITY (os));
     }
 
     return FALSE;
diff --git a/osinfo/osinfo_devicelist.c b/osinfo/osinfo_devicelist.c
index af6f6c0..c3e9f95 100644
--- a/osinfo/osinfo_devicelist.c
+++ b/osinfo/osinfo_devicelist.c
@@ -36,7 +36,7 @@ osinfo_devicelist_init (OsinfoDeviceList *self)
 
 }
 
-OsinfoDevice *osinfoGetDeviceAtIndex(OsinfoDeviceList *self, gint idx, GError **err)
+OsinfoDevice *osinfo_device_list_get_nth(OsinfoDeviceList *self, gint idx, GError **err)
 {
     if (!OSINFO_IS_DEVICELIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_DEVICELIST);
@@ -44,11 +44,11 @@ OsinfoDevice *osinfoGetDeviceAtIndex(OsinfoDeviceList *self, gint idx, GError **
     }
 
     OsinfoList *selfAsList = OSINFO_LIST (self);
-    OsinfoEntity *entity = osinfoGetEntityAtIndex(selfAsList, idx);
+    OsinfoEntity *entity = osinfo_list_get_nth(selfAsList, idx);
     return OSINFO_DEVICE (entity);
 }
 
-OsinfoDeviceList *osinfoDeviceListFilter(OsinfoDeviceList *self, OsinfoFilter *filter, GError **err)
+OsinfoDeviceList *osinfo_device_list_filter(OsinfoDeviceList *self, OsinfoFilter *filter, GError **err)
 {
     if (!OSINFO_IS_DEVICELIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_DEVICELIST);
@@ -67,11 +67,11 @@ OsinfoDeviceList *osinfoDeviceListFilter(OsinfoDeviceList *self, OsinfoFilter *f
         return NULL;
     }
 
-    __osinfoDoFilter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
+    __osinfo_list_filter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
     return newList;
 }
 
-OsinfoDeviceList *osinfoDeviceListIntersect(OsinfoDeviceList *self, OsinfoDeviceList *otherList, GError **err)
+OsinfoDeviceList *osinfo_device_list_intersect(OsinfoDeviceList *self, OsinfoDeviceList *otherList, GError **err)
 {
     if (!OSINFO_IS_DEVICELIST(self) || !OSINFO_IS_DEVICELIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_DEVICELIST);
@@ -86,7 +86,7 @@ OsinfoDeviceList *osinfoDeviceListIntersect(OsinfoDeviceList *self, OsinfoDevice
 
     int ret;
 
-    ret = __osinfoDoIntersect(self, otherList, newList);
+    ret = __osinfo_list_intersect(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
@@ -96,7 +96,7 @@ OsinfoDeviceList *osinfoDeviceListIntersect(OsinfoDeviceList *self, OsinfoDevice
     return newList;
 }
 
-OsinfoDeviceList *osinfoDeviceListUnion(OsinfoDeviceList *self, OsinfoDeviceList *otherList, GError **err)
+OsinfoDeviceList *osinfo_device_list_union(OsinfoDeviceList *self, OsinfoDeviceList *otherList, GError **err)
 {
     if (!OSINFO_IS_DEVICELIST(self) || !OSINFO_IS_DEVICELIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_DEVICELIST);
@@ -110,7 +110,7 @@ OsinfoDeviceList *osinfoDeviceListUnion(OsinfoDeviceList *self, OsinfoDeviceList
     }
 
     int ret;
-    ret = __osinfoDoUnion(self, otherList, newList);
+    ret = __osinfo_list_union(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
diff --git a/osinfo/osinfo_devicelist.h b/osinfo/osinfo_devicelist.h
index a62bbe8..5075fa4 100644
--- a/osinfo/osinfo_devicelist.h
+++ b/osinfo/osinfo_devicelist.h
@@ -44,9 +44,9 @@ struct _OsinfoDeviceListClass
 
 GType osinfo_devicelist_get_type(void);
 
-OsinfoDeviceList *osinfoDeviceListFilter(OsinfoDeviceList *self, OsinfoFilter *filter, GError **err);
-OsinfoDevice *osinfoGetDeviceAtIndex(OsinfoDeviceList *self, gint idx, GError **err);
-OsinfoDeviceList *osinfoDeviceListIntersect(OsinfoDeviceList *self, OsinfoDeviceList *otherDeviceList, GError **err);
-OsinfoDeviceList *osinfoDeviceListUnion(OsinfoDeviceList *self, OsinfoDeviceList *otherDeviceList, GError **err);
+OsinfoDeviceList *osinfo_device_list_filter(OsinfoDeviceList *self, OsinfoFilter *filter, GError **err);
+OsinfoDevice *osinfo_device_list_get_nth(OsinfoDeviceList *self, gint idx, GError **err);
+OsinfoDeviceList *osinfo_device_list_intersect(OsinfoDeviceList *self, OsinfoDeviceList *otherDeviceList, GError **err);
+OsinfoDeviceList *osinfo_device_list_union(OsinfoDeviceList *self, OsinfoDeviceList *otherDeviceList, GError **err);
 
 #endif /* __OSINFO_DEVICELIST_H__ */
diff --git a/osinfo/osinfo_filter.c b/osinfo/osinfo_filter.c
index 6a2a833..ec4513b 100644
--- a/osinfo/osinfo_filter.c
+++ b/osinfo/osinfo_filter.c
@@ -274,7 +274,7 @@ OsinfoOsList *osinfoGetRelationshipConstraintValue(OsinfoFilter *self, osinfoRel
         len = relatedOses->len;
         for (i = 0; i < len; i++) {
              OsinfoOs *os = g_ptr_array_index(relatedOses, i);
-            __osinfoListAdd(OSINFO_LIST (newList), OSINFO_ENTITY (os));
+            __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (os));
         }
     }
 
diff --git a/osinfo/osinfo_hypervisor.c b/osinfo/osinfo_hypervisor.c
index 15d803d..3ac12cc 100644
--- a/osinfo/osinfo_hypervisor.c
+++ b/osinfo/osinfo_hypervisor.c
@@ -115,7 +115,7 @@ OsinfoDeviceList *osinfo_hypervisor_get_devices_by_type(OsinfoHypervisor *self,
     for (i = 0; i < sectionList->len; i++) {
         deviceLink = g_ptr_array_index(sectionList, i);
         if (__osinfoDevicePassesFilter(filter, deviceLink->dev))
-            __osinfoListAdd(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
+            __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
     }
 
     return newList;
diff --git a/osinfo/osinfo_hypervisorlist.c b/osinfo/osinfo_hypervisorlist.c
index 147f4b4..0874904 100644
--- a/osinfo/osinfo_hypervisorlist.c
+++ b/osinfo/osinfo_hypervisorlist.c
@@ -36,7 +36,7 @@ osinfo_hypervisorlist_init (OsinfoHypervisorList *self)
 
 }
 
-OsinfoHypervisor *osinfoGetHypervisorAtIndex(OsinfoHypervisorList *self, gint idx, GError **err)
+OsinfoHypervisor *osinfo_hypervisor_list_get_nth(OsinfoHypervisorList *self, gint idx, GError **err)
 {
     if (!OSINFO_IS_HYPERVISORLIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_HYPERVISORLIST);
@@ -44,11 +44,11 @@ OsinfoHypervisor *osinfoGetHypervisorAtIndex(OsinfoHypervisorList *self, gint id
     }
 
     OsinfoList *selfAsList = OSINFO_LIST (self);
-    OsinfoEntity *entity = osinfoGetEntityAtIndex(selfAsList, idx);
+    OsinfoEntity *entity = osinfo_list_get_nth(selfAsList, idx);
     return OSINFO_HYPERVISOR (entity);
 }
 
-OsinfoHypervisorList *osinfoHypervisorListFilter(OsinfoHypervisorList *self, OsinfoFilter *filter, GError **err)
+OsinfoHypervisorList *osinfo_hypervisor_list_filter(OsinfoHypervisorList *self, OsinfoFilter *filter, GError **err)
 {
     if (!OSINFO_IS_HYPERVISORLIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_HYPERVISORLIST);
@@ -67,11 +67,11 @@ OsinfoHypervisorList *osinfoHypervisorListFilter(OsinfoHypervisorList *self, Osi
         return NULL;
     }
 
-    __osinfoDoFilter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
+    __osinfo_list_filter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
     return newList;
 }
 
-OsinfoHypervisorList *osinfoHypervisorListIntersect(OsinfoHypervisorList *self, OsinfoHypervisorList *otherList, GError **err)
+OsinfoHypervisorList *osinfo_hypervisor_list_intersect(OsinfoHypervisorList *self, OsinfoHypervisorList *otherList, GError **err)
 {
     if (!OSINFO_IS_HYPERVISORLIST(self) || !OSINFO_IS_HYPERVISORLIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_HYPERVISORLIST);
@@ -86,7 +86,7 @@ OsinfoHypervisorList *osinfoHypervisorListIntersect(OsinfoHypervisorList *self,
 
     int ret;
 
-    ret = __osinfoDoIntersect(self, otherList, newList);
+    ret = __osinfo_list_intersect(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
@@ -96,7 +96,7 @@ OsinfoHypervisorList *osinfoHypervisorListIntersect(OsinfoHypervisorList *self,
     return newList;
 }
 
-OsinfoHypervisorList *osinfoHypervisorListUnion(OsinfoHypervisorList *self, OsinfoHypervisorList *otherList, GError **err)
+OsinfoHypervisorList *osinfo_hypervisor_list_union(OsinfoHypervisorList *self, OsinfoHypervisorList *otherList, GError **err)
 {
     if (!OSINFO_IS_HYPERVISORLIST(self) || !OSINFO_IS_HYPERVISORLIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_HYPERVISORLIST);
@@ -110,7 +110,7 @@ OsinfoHypervisorList *osinfoHypervisorListUnion(OsinfoHypervisorList *self, Osin
     }
 
     int ret;
-    ret = __osinfoDoUnion(self, otherList, newList);
+    ret = __osinfo_list_union(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
diff --git a/osinfo/osinfo_hypervisorlist.h b/osinfo/osinfo_hypervisorlist.h
index eaf0a7c..482314e 100644
--- a/osinfo/osinfo_hypervisorlist.h
+++ b/osinfo/osinfo_hypervisorlist.h
@@ -44,9 +44,9 @@ struct _OsinfoHypervisorListClass
 
 GType osinfo_hypervisorlist_get_type(void);
 
-OsinfoHypervisorList *osinfoHypervisorListFilter(OsinfoHypervisorList *self, OsinfoFilter *filter, GError **err);
-OsinfoHypervisor *osinfoGetHypervisorAtIndex(OsinfoHypervisorList *self, gint idx, GError **err);
-OsinfoHypervisorList *osinfoHypervisorListIntersect(OsinfoHypervisorList *self, OsinfoHypervisorList *otherHypervisorList, GError **err);
-OsinfoHypervisorList *osinfoHypervisorListUnion(OsinfoHypervisorList *self, OsinfoHypervisorList *otherHypervisorList, GError **err);
+OsinfoHypervisorList *osinfo_hypervisor_list_filter(OsinfoHypervisorList *self, OsinfoFilter *filter, GError **err);
+OsinfoHypervisor *osinfo_hypervisor_list_get_nth(OsinfoHypervisorList *self, gint idx, GError **err);
+OsinfoHypervisorList *osinfo_hypervisor_list_intersect(OsinfoHypervisorList *self, OsinfoHypervisorList *otherHypervisorList, GError **err);
+OsinfoHypervisorList *osinfo_hypervisor_list_union(OsinfoHypervisorList *self, OsinfoHypervisorList *otherHypervisorList, GError **err);
 
 #endif /* __OSINFO_HYPERVISORLIST_H__ */
diff --git a/osinfo/osinfo_list.c b/osinfo/osinfo_list.c
index 9e88993..53e8bd4 100644
--- a/osinfo/osinfo_list.c
+++ b/osinfo/osinfo_list.c
@@ -41,38 +41,33 @@ osinfo_list_init (OsinfoList *self)
     self->priv->array = g_ptr_array_new();
 }
 
-void osinfoFreeList(OsinfoList *self)
-{
-    g_object_unref(self);
-}
-
-gint osinfoListLength(OsinfoList *self)
+gint osinfo_list_get_length(OsinfoList *self)
 {
     return self->priv->array->len;
 }
 
-OsinfoEntity *osinfoGetEntityAtIndex(OsinfoList *self, gint idx)
+OsinfoEntity *osinfo_list_get_nth(OsinfoList *self, gint idx)
 {
     return g_ptr_array_index(self->priv->array, idx);
 }
 
-void __osinfoListAdd(OsinfoList *self, OsinfoEntity *entity)
+void __osinfo_list_add(OsinfoList *self, OsinfoEntity *entity)
 {
     g_ptr_array_add(self->priv->array, entity);
 }
 
-void __osinfoDoFilter(OsinfoList *src, OsinfoList *dst, OsinfoFilter *filter)
+void __osinfo_list_filter(OsinfoList *src, OsinfoList *dst, OsinfoFilter *filter)
 {
     int i, len;
-    len = osinfoListLength(src);
+    len = osinfo_list_get_length(src);
     for (i = 0; i < len; i++) {
-        OsinfoEntity *entity = osinfoGetEntityAtIndex(src, i);
+        OsinfoEntity *entity = osinfo_list_get_nth(src, i);
         if (__osinfoEntityPassesFilter(filter, entity))
-            __osinfoListAdd(dst, entity);
+            __osinfo_list_add(dst, entity);
     }
 }
 
-OsinfoList *osinfoListFilter(OsinfoList *self, OsinfoFilter *filter, GError **err)
+OsinfoList *osinfo_list_filter(OsinfoList *self, OsinfoFilter *filter, GError **err)
 {
     if (!OSINFO_IS_LIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_LIST);
@@ -91,11 +86,11 @@ OsinfoList *osinfoListFilter(OsinfoList *self, OsinfoFilter *filter, GError **er
         return NULL;
     }
 
-    __osinfoDoFilter(self, newList, filter);
+    __osinfo_list_filter(self, newList, filter);
     return newList;
 }
 
-int __osinfoDoIntersect(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
+int __osinfo_list_intersect(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
 {
     int i, len;
 
@@ -111,23 +106,23 @@ int __osinfoDoIntersect(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
     }
 
     // Add all from otherList to otherSet
-    len = osinfoListLength(src2);
+    len = osinfo_list_get_length(src2);
     for (i = 0; i < len; i++) {
-        OsinfoEntity *entity = osinfoGetEntityAtIndex(src2, i);
+        OsinfoEntity *entity = osinfo_list_get_nth(src2, i);
         gchar *id = entity->priv->id;
         g_tree_insert(otherSet, id, entity);
     }
 
     // If other contains entity, and new list does not, add to new list
-    len = osinfoListLength(src1);
+    len = osinfo_list_get_length(src1);
     for (i = 0; i < len; i++) {
-        OsinfoEntity *entity = osinfoGetEntityAtIndex(src1, i);
+        OsinfoEntity *entity = osinfo_list_get_nth(src1, i);
         gchar *id = entity->priv->id;
 
         if (g_tree_lookup(otherSet, entity->priv->id) &&
             !g_tree_lookup(newSet, entity->priv->id)) {
             g_tree_insert(newSet, id, entity);
-            __osinfoListAdd(dst, entity);
+            __osinfo_list_add(dst, entity);
         }
     }
 
@@ -136,7 +131,7 @@ int __osinfoDoIntersect(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
     return 0;
 }
 
-OsinfoList *osinfoListIntersect(OsinfoList *self, OsinfoList *otherList, GError **err)
+OsinfoList *osinfo_list_intersect(OsinfoList *self, OsinfoList *otherList, GError **err)
 {
     if (!OSINFO_IS_LIST(self) || !OSINFO_IS_LIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_LIST);
@@ -151,7 +146,7 @@ OsinfoList *osinfoListIntersect(OsinfoList *self, OsinfoList *otherList, GError
 
     int ret;
 
-    ret = __osinfoDoIntersect(self, otherList, newList);
+    ret = __osinfo_list_intersect(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
@@ -161,7 +156,7 @@ OsinfoList *osinfoListIntersect(OsinfoList *self, OsinfoList *otherList, GError
     return newList;
 }
 
-int __osinfoDoUnion(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
+int __osinfo_list_union(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
 {
     // Make set version of new list
     GTree *newSet = g_tree_new(__osinfoStringCompareBase);
@@ -170,22 +165,22 @@ int __osinfoDoUnion(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
 
     // Add all from other list to new list
     int i, len;
-    len = osinfoListLength(src2);
+    len = osinfo_list_get_length(src2);
     for (i = 0; i < len; i++) {
-        OsinfoEntity *entity = osinfoGetEntityAtIndex(src2, i);
+        OsinfoEntity *entity = osinfo_list_get_nth(src2, i);
         gchar *id = entity->priv->id;
-        __osinfoListAdd(dst, entity);
+        __osinfo_list_add(dst, entity);
         g_tree_insert(newSet, id, entity);
     }
 
     // Add remaining elements from this list to new list
-    len = osinfoListLength(src1);
+    len = osinfo_list_get_length(src1);
     for (i = 0; i < len; i++) {
-        OsinfoEntity *entity = osinfoGetEntityAtIndex(src1, i);
+        OsinfoEntity *entity = osinfo_list_get_nth(src1, i);
         gchar *id = entity->priv->id;
         // If new list does not contain element, add to new list
         if (!g_tree_lookup(newSet, id)) {
-            __osinfoListAdd(dst, entity);
+            __osinfo_list_add(dst, entity);
             g_tree_insert(newSet, id, entity);
         }
     }
@@ -194,7 +189,7 @@ int __osinfoDoUnion(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
     return 0;
 }
 
-OsinfoList *osinfoListUnion(OsinfoList *self, OsinfoList *otherList, GError **err)
+OsinfoList *osinfo_list_union(OsinfoList *self, OsinfoList *otherList, GError **err)
 {
     if (!OSINFO_IS_LIST(self) || !OSINFO_IS_LIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_LIST);
@@ -208,7 +203,7 @@ OsinfoList *osinfoListUnion(OsinfoList *self, OsinfoList *otherList, GError **er
     }
 
     int ret;
-    ret = __osinfoDoUnion(self, otherList, newList);
+    ret = __osinfo_list_union(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
diff --git a/osinfo/osinfo_list.h b/osinfo/osinfo_list.h
index 324345b..ee81195 100644
--- a/osinfo/osinfo_list.h
+++ b/osinfo/osinfo_list.h
@@ -42,12 +42,11 @@ struct _OsinfoListClass
 
 GType osinfo_list_get_type(void);
 
-void osinfoFreeList(OsinfoList *self);
-gint osinfoListLength(OsinfoList *self);
+gint osinfo_list_get_length(OsinfoList *self);
 
-OsinfoList *osinfoListFilter(OsinfoList *self, OsinfoFilter *filter, GError **err);
-OsinfoEntity *osinfoGetEntityAtIndex(OsinfoList *self, gint idx);
-OsinfoList *osinfoListIntersect(OsinfoList *self, OsinfoList *otherList, GError **err);
-OsinfoList *osinfoListUnion(OsinfoList *self, OsinfoList *otherList, GError **err);
+OsinfoList *osinfo_list_filter(OsinfoList *self, OsinfoFilter *filter, GError **err);
+OsinfoEntity *osinfo_list_get_nth(OsinfoList *self, gint idx);
+OsinfoList *osinfo_list_intersect(OsinfoList *self, OsinfoList *otherList, GError **err);
+OsinfoList *osinfo_list_union(OsinfoList *self, OsinfoList *otherList, GError **err);
 
 #endif /* __OSINFO_LIST_H__ */
diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index 8420bdd..8ab6dd1 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -309,7 +309,7 @@ OsinfoOsList *osinfo_os_get_related(OsinfoOs *self, osinfoRelationship relshp, G
         len = relatedOses->len;
         for (i = 0; i < len; i++) {
             struct __osinfoOsLink *osLink = g_ptr_array_index(relatedOses, i);
-            __osinfoListAdd(OSINFO_LIST (newList), OSINFO_ENTITY (osLink->directObjectOs));
+            __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (osLink->directObjectOs));
         }
     }
 
@@ -372,7 +372,7 @@ OsinfoDeviceList *osinfo_os_get_devices(OsinfoOs *self, OsinfoHypervisor *hv, gc
     for (i = 0; i < sectionList->len; i++) {
         deviceLink = g_ptr_array_index(sectionList, i);
         if (__osinfoDevicePassesFilter(filter, deviceLink->dev))
-            __osinfoListAdd(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
+            __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
     }
 
     return NULL;
diff --git a/osinfo/osinfo_oslist.c b/osinfo/osinfo_oslist.c
index 4a3d1ce..145db13 100644
--- a/osinfo/osinfo_oslist.c
+++ b/osinfo/osinfo_oslist.c
@@ -36,7 +36,7 @@ osinfo_oslist_init (OsinfoOsList *self)
 
 }
 
-OsinfoOs *osinfoGetOsAtIndex(OsinfoOsList *self, gint idx, GError **err)
+OsinfoOs *osinfo_os_list_get_nth(OsinfoOsList *self, gint idx, GError **err)
 {
     if (!OSINFO_IS_OSLIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_OSLIST);
@@ -44,11 +44,11 @@ OsinfoOs *osinfoGetOsAtIndex(OsinfoOsList *self, gint idx, GError **err)
     }
 
     OsinfoList *selfAsList = OSINFO_LIST (self);
-    OsinfoEntity *entity = osinfoGetEntityAtIndex(selfAsList, idx);
+    OsinfoEntity *entity = osinfo_list_get_nth(selfAsList, idx);
     return OSINFO_OS (entity);
 }
 
-OsinfoOsList *osinfoOsListFilter(OsinfoOsList *self, OsinfoFilter *filter, GError **err)
+OsinfoOsList *osinfo_os_list_filter(OsinfoOsList *self, OsinfoFilter *filter, GError **err)
 {
     if (!OSINFO_IS_OSLIST(self)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_OSLIST);
@@ -67,11 +67,11 @@ OsinfoOsList *osinfoOsListFilter(OsinfoOsList *self, OsinfoFilter *filter, GErro
         return NULL;
     }
 
-    __osinfoDoFilter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
+    __osinfo_list_filter(OSINFO_LIST (self), OSINFO_LIST (newList), filter);
     return newList;
 }
 
-OsinfoOsList *osinfoOsListIntersect(OsinfoOsList *self, OsinfoOsList *otherList, GError **err)
+OsinfoOsList *osinfo_os_list_intersect(OsinfoOsList *self, OsinfoOsList *otherList, GError **err)
 {
     if (!OSINFO_IS_OSLIST(self) || !OSINFO_IS_OSLIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_OSLIST);
@@ -86,7 +86,7 @@ OsinfoOsList *osinfoOsListIntersect(OsinfoOsList *self, OsinfoOsList *otherList,
 
     int ret;
 
-    ret = __osinfoDoIntersect(self, otherList, newList);
+    ret = __osinfo_list_intersect(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
@@ -96,7 +96,7 @@ OsinfoOsList *osinfoOsListIntersect(OsinfoOsList *self, OsinfoOsList *otherList,
     return newList;
 }
 
-OsinfoOsList *osinfoOsListUnion(OsinfoOsList *self, OsinfoOsList *otherList, GError **err)
+OsinfoOsList *osinfo_os_list_union(OsinfoOsList *self, OsinfoOsList *otherList, GError **err)
 {
     if (!OSINFO_IS_OSLIST(self) || !OSINFO_IS_OSLIST(otherList)) {
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), -EINVAL, OSINFO_OBJ_NOT_OSLIST);
@@ -110,7 +110,7 @@ OsinfoOsList *osinfoOsListUnion(OsinfoOsList *self, OsinfoOsList *otherList, GEr
     }
 
     int ret;
-    ret = __osinfoDoUnion(self, otherList, newList);
+    ret = __osinfo_list_union(self, otherList, newList);
     if (ret != 0) {
         g_object_unref(newList);
         g_set_error_literal(err, g_quark_from_static_string("libosinfo"), ret, __osinfoErrorToString(ret));
diff --git a/osinfo/osinfo_oslist.h b/osinfo/osinfo_oslist.h
index 2b51351..e95862e 100644
--- a/osinfo/osinfo_oslist.h
+++ b/osinfo/osinfo_oslist.h
@@ -45,9 +45,9 @@ struct _OsinfoOsListClass
 
 GType osinfo_oslist_get_type(void);
 
-OsinfoOsList *osinfoOsListFilter(OsinfoOsList *self, OsinfoFilter *filter, GError **err);
-OsinfoOs *osinfoGetOsAtIndex(OsinfoOsList *self, gint idx, GError **err);
-OsinfoOsList *osinfoOsListIntersect(OsinfoOsList *self, OsinfoOsList *otherOsList, GError **err);
-OsinfoOsList *osinfoOsListUnion(OsinfoOsList *self, OsinfoOsList *otherOsList, GError **err);
+OsinfoOsList *osinfo_os_list_filter(OsinfoOsList *self, OsinfoFilter *filter, GError **err);
+OsinfoOs *osinfo_os_list_get_nth(OsinfoOsList *self, gint idx, GError **err);
+OsinfoOsList *osinfo_os_list_intersect(OsinfoOsList *self, OsinfoOsList *otherOsList, GError **err);
+OsinfoOsList *osinfo_os_list_union(OsinfoOsList *self, OsinfoOsList *otherOsList, GError **err);
 
 #endif /* __OSINFO_OSLIST_H__ */
-- 
1.7.2.1


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