xp_comm_proj/rd_dicom/Papyrus3/PapyList3.c
/********************************************************************************/
/*										*/
/*	DeleteLastInList : Deletes the last element of the list.		*/
/*	return : papNoError if OK, listError in case of an error.		*/
/*										*/
/********************************************************************************/
DeleteLastInList : Deletes the last element of the list.
return : papNoError if OK, listError in case of an error.
DeleteLastInList : Deletes the last element of the list . return : papNoError if OK listError in case of an error .
PapyShort
DeleteLastInList (PapyShort inFileNb, Papy_List **ioListP, int inDelAll, int inDelGroup, int inDelSeq)
{
  Papy_List	*theWrk1P, *theWrk2P;
  PapyShort	theErr = 0;
  if (*ioListP == NULL) return theErr;
  theWrk1P = *ioListP;
  theWrk2P = NULL;
  while (theWrk1P->next != NULL) 
  {
    theWrk2P = theWrk1P;
    theWrk1P = theWrk1P->next;
  } 
  if (theWrk2P != NULL) theWrk2P->next = NULL;
  else *ioListP = NULL;
  theErr = FreeCell (inFileNb, &theWrk1P, inDelAll, inDelGroup, inDelSeq);
  RETURN (theErr);
}
PapyShort DeleteLastInList ( PapyShort inFileNb , Papy_List * * ioListP , int inDelAll , int inDelGroup , int inDelSeq ) { Papy_List * theWrk1P , * theWrk2P ; PapyShort theErr = 0 ; if ( * ioListP == NULL ) return theErr ; theWrk1P = * ioListP ; theWrk2P = NULL ; while ( theWrk1P -> next != NULL ) { theWrk2P = theWrk1P ; theWrk1P = theWrk1P -> next ; } if ( theWrk2P != NULL ) theWrk2P -> next = NULL ; else * ioListP = NULL ; theErr = FreeCell ( inFileNb , & theWrk1P , inDelAll , inDelGroup , inDelSeq ) ; RETURN ( theErr ) ; }
DeleteLastInList : Deletes the last element of the list.
DeleteLastInList : Deletes the last element of the list .
/* search the last cell of the list */ /* while */ /* free the cell and its content */