/* Returns: the index of the element containing the data, or -1 if the data is not found  */
gint g_list_index(GList *list, gconstpointer data)
/* Returns: the index of the element containing the data, or -1 if the data is not found  */
gint g_list_index(GList *list, gconstpointer data)
{
  gint i;
  i = 0;
  while (list)
    {
      if (list->data == data)
        return i;
      i++;
      list = list->next;
    }
  return -1;
}