4.3.8 Get rest

This operation is similar to ``get first value''. However, it is valid even if the list is empty. If a list is empty, it returns the list itself. Otherwise, it returns the rest of the list node pointed to by first.

The implementation is as follows:

struct List *List_getrest(struct List *pList)
{
  struct List *result;

  if (!((struct _List *)pList)->first)
  {
    result = pList;
  }
  else
  {
    result = (struct List *)&(((struct _List *)pList)->first->rest);
  }
  return result;
}



Copyright © 2006-09-27 by Tak Auyeung