Exemplo n.º 1
0
void point_list_add(POINT_LIST * l, POINT p)
{
    POINT_LIST *n;

    n = point_list_new(p);
    n->next = l->next;
    l->next = n;
    return;
}
Exemplo n.º 2
0
point_list_t *point_list_new_and_copy(point_list_t *list)
{
  dlink_t *a, *b;
  point_list_t *ret;
  point_t *p;

  assert(list);

  ret = point_list_new();

  for (a = list->tail->next; a != list->head; a = a->next) {
    p = point_new_and_copy((point_t *)a->object);
    //point_inc_ref(p);
    b = dlink_new();
    b->object = (void *)p;
    dlist_insert(b, (dlist_t *)ret);
  }

  return ret;
}