mirror of https://github.com/GNOME/gimp.git
app: add gimp_list_compare()
... which lexicographically (shallowly) compares a pair of GLists.
This commit is contained in:
parent
b1c113c444
commit
c4ce70a2d3
|
@ -858,6 +858,29 @@ gimp_ascii_strtod (const gchar *nptr,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
gimp_list_compare (GList *list1,
|
||||
GList *list2)
|
||||
{
|
||||
while (list1 && list2)
|
||||
{
|
||||
if (list1->data < list2->data)
|
||||
return -1;
|
||||
else if (list1->data > list2->data)
|
||||
return +1;
|
||||
|
||||
list1 = g_list_next (list1);
|
||||
list2 = g_list_next (list2);
|
||||
}
|
||||
|
||||
if (! list1)
|
||||
return -1;
|
||||
else if (! list2)
|
||||
return +1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* debug stuff */
|
||||
|
||||
|
|
|
@ -98,6 +98,9 @@ gboolean gimp_ascii_strtod (const gchar *nptr,
|
|||
gchar **endptr,
|
||||
gdouble *result);
|
||||
|
||||
gint gimp_list_compare (GList *list1,
|
||||
GList *list2);
|
||||
|
||||
GimpImage * gimp_create_image_from_buffer (Gimp *gimp,
|
||||
GeglBuffer *buffer,
|
||||
const gchar *image_name);
|
||||
|
|
Loading…
Reference in New Issue