To set a list to be the alias of another list, we only need to duplicate
the pointer to the first node. The C implementation is as follows. Note
that the list pointed to by pList
becomes an alias of the list
pointed to by orig
.
void List_makealias(struct List *pList, struct List *orig)
{
((struct _List *))pList->first = ((struct _List *)orig)->first;
}
Copyright © 2006-09-27 by Tak Auyeung