Exemple #1
0
void vdl_list_remove (struct VdlList *list, void *data)
{
  void **i;
  for  (i = vdl_list_find (list, data); 
	i != vdl_list_end (list); 
	i = vdl_list_find_from (list, i, data))
    {
      i = vdl_list_erase (list, i);
    }
}
Exemple #2
0
void vdl_list_unicize (struct VdlList *list)
{
  void **i;
  for (i = vdl_list_begin (list);
       i != vdl_list_end (list);
       i = vdl_list_next (i))
    {
      void *next = vdl_list_find_from (list, vdl_list_next (i), *i);
      while (next != vdl_list_end (list))
	{
	  next = vdl_list_erase (list, next);
	  next = vdl_list_find_from (list, next, *i);
	}
    }
}
Exemple #3
0
void vdl_list_unique (struct VdlList *list)
{
  void **i = vdl_list_begin (list);
  while (i != vdl_list_end (list))
    {
      void **prev = vdl_list_prev (i);
      if (prev == vdl_list_end (list) ||
	  *prev != *i)
	{
	  i = vdl_list_next (i);
	}
      else
	{
	  i = vdl_list_erase (list, i);
	}
    }
}
Exemple #4
0
struct VdlList *
vdl_utils_splitpath (const char *value)
{
  struct VdlList *list = vdl_utils_strsplit (value, ':');
  void **i;
  for (i = vdl_list_begin (list);
       i != vdl_list_end (list);
       i = vdl_list_next (list, i))
    {
      if (vdl_utils_strisequal (*i, ""))
        {
          // the empty string is interpreted as '.'
          vdl_alloc_free (*i);
          i = vdl_list_erase (list, i);
          i = vdl_list_insert (list, i, vdl_utils_strdup ("."));
        }
    }
  return list;
}
Exemple #5
0
void vdl_list_pop_front (struct VdlList *list)
{
  vdl_list_erase (list, vdl_list_begin (list));
}
Exemple #6
0
void vdl_list_pop_back (struct VdlList *list)
{
  vdl_list_erase (list, vdl_list_rbegin (list));
}