[virt-tools-list] [PATCH 12/47] Make osinfo_list_add into a public API
Daniel P. Berrange
berrange at redhat.com
Wed Aug 25 19:37:07 UTC 2010
Make osinfo_list_add a public API on OsinfoList since
apps should be allowed to manipulate objects at will
if they're not using the XML loader. This also avoids
compile warnings from other objects using this API
without it being declared
* osinfo/osinfo_list.h, osinfo/osinfo_list.c: Make
osinfo_list_add a public API
* osinfo/osinfo_db.c, osinfo/osinfo_filter.c,
osinfo/osinfo_hypervisor.c, osinfo/osinfo_os.c: Update
for changing API name
---
osinfo/osinfo_db.c | 4 ++--
osinfo/osinfo_filter.c | 2 +-
osinfo/osinfo_hypervisor.c | 2 +-
osinfo/osinfo_list.c | 10 +++++-----
osinfo/osinfo_list.h | 2 +-
osinfo/osinfo_os.c | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index 5e7ad90..f3ebc4c 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)) {
- __osinfo_list_add(list, entity);
+ osinfo_list_add(list, entity);
}
args->errcode = 0;
@@ -470,7 +470,7 @@ static gboolean __osinfoAddOsIfRelationship(gpointer key, gpointer value, gpoint
GPtrArray *relatedOses = NULL;
relatedOses = g_tree_lookup(os->priv->relationshipsByType, (gpointer) args->relshp);
if (relatedOses) {
- __osinfo_list_add(list, OSINFO_ENTITY (os));
+ osinfo_list_add(list, OSINFO_ENTITY (os));
}
return FALSE;
diff --git a/osinfo/osinfo_filter.c b/osinfo/osinfo_filter.c
index 4dd2dc5..cb81da8 100644
--- a/osinfo/osinfo_filter.c
+++ b/osinfo/osinfo_filter.c
@@ -252,7 +252,7 @@ OsinfoOsList *osinfo_filter_get_relationship_constraint_value(OsinfoFilter *self
len = relatedOses->len;
for (i = 0; i < len; i++) {
OsinfoOs *os = g_ptr_array_index(relatedOses, i);
- __osinfo_list_add(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 2eba6c2..900689b 100644
--- a/osinfo/osinfo_hypervisor.c
+++ b/osinfo/osinfo_hypervisor.c
@@ -107,7 +107,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))
- __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
+ osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
}
return newList;
diff --git a/osinfo/osinfo_list.c b/osinfo/osinfo_list.c
index 35bcb24..30df4cb 100644
--- a/osinfo/osinfo_list.c
+++ b/osinfo/osinfo_list.c
@@ -51,7 +51,7 @@ OsinfoEntity *osinfo_list_get_nth(OsinfoList *self, gint idx)
return g_ptr_array_index(self->priv->array, idx);
}
-void __osinfo_list_add(OsinfoList *self, OsinfoEntity *entity)
+void osinfo_list_add(OsinfoList *self, OsinfoEntity *entity)
{
g_ptr_array_add(self->priv->array, entity);
}
@@ -63,7 +63,7 @@ void __osinfo_list_filter(OsinfoList *src, OsinfoList *dst, OsinfoFilter *filter
for (i = 0; i < len; i++) {
OsinfoEntity *entity = osinfo_list_get_nth(src, i);
if (__osinfoEntityPassesFilter(filter, entity))
- __osinfo_list_add(dst, entity);
+ osinfo_list_add(dst, entity);
}
}
@@ -111,7 +111,7 @@ int __osinfo_list_intersect(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
if (g_tree_lookup(otherSet, entity->priv->id) &&
!g_tree_lookup(newSet, entity->priv->id)) {
g_tree_insert(newSet, id, entity);
- __osinfo_list_add(dst, entity);
+ osinfo_list_add(dst, entity);
}
}
@@ -151,7 +151,7 @@ int __osinfo_list_union(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
for (i = 0; i < len; i++) {
OsinfoEntity *entity = osinfo_list_get_nth(src2, i);
gchar *id = entity->priv->id;
- __osinfo_list_add(dst, entity);
+ osinfo_list_add(dst, entity);
g_tree_insert(newSet, id, entity);
}
@@ -162,7 +162,7 @@ int __osinfo_list_union(OsinfoList *src1, OsinfoList *src2, OsinfoList *dst)
gchar *id = entity->priv->id;
// If new list does not contain element, add to new list
if (!g_tree_lookup(newSet, id)) {
- __osinfo_list_add(dst, entity);
+ osinfo_list_add(dst, entity);
g_tree_insert(newSet, id, entity);
}
}
diff --git a/osinfo/osinfo_list.h b/osinfo/osinfo_list.h
index ee81195..4e9b088 100644
--- a/osinfo/osinfo_list.h
+++ b/osinfo/osinfo_list.h
@@ -43,7 +43,7 @@ struct _OsinfoListClass
GType osinfo_list_get_type(void);
gint osinfo_list_get_length(OsinfoList *self);
-
+void osinfo_list_add(OsinfoList *self, OsinfoEntity *entity);
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);
diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index 8543e2f..bf93182 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -301,7 +301,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);
- __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (osLink->directObjectOs));
+ osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (osLink->directObjectOs));
}
}
@@ -360,7 +360,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))
- __osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
+ osinfo_list_add(OSINFO_LIST (newList), OSINFO_ENTITY (deviceLink->dev));
}
return NULL;
--
1.7.2.1
More information about the virt-tools-list
mailing list