All pastes #383238 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-06 05:53 UTC
rendered paste body
bool setmove_list (list_ref list, list_move move) {
   assert (is_list (list));
   switch (move) {
      case MOVE_HEAD:
           list->curr = list->head;
           break;
      case MOVE_PREV:
           if (list->curr != list->head) 
             list->curr = list->curr->prev;
           break;
      case MOVE_NEXT:
           if (list->curr != list->last)
              list->curr = list->curr->next;
           break;
      case MOVE_LAST:
           list->curr = list->last;
           break;
      default: assert (FALSE);
   };
   return FALSE;
}