pLOOP = pENDL->pLOOP;
if ((pData->bDisplaying) && (pData->bRunning)) { pLOOP = pENDL->pLOOP;
mng_retcode process_ani_endl (mng_datap   pData,                              mng_objectp pObject){  mng_ani_endlp pENDL = (mng_ani_endlp)pObject;  mng_ani_loopp pLOOP;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_PROCESS_ANI_ENDL, MNG_LC_START)#endif  pLOOP = pENDL->pLOOP;                /* determine matching LOOP */  if (!pLOOP)                          /* haven't got it yet ? */  {                                    /* go and look back in the list */    pLOOP = (mng_ani_loopp)pENDL->sHeader.pPrev;    while ((pLOOP) &&           ((pLOOP->sHeader.fCleanup != free_ani_loop) ||            (pLOOP->iLevel           != pENDL->iLevel)    ))      pLOOP = pLOOP->sHeader.pPrev;  }                                       /* got it now ? */  if ((pLOOP) && (pLOOP->iLevel == pENDL->iLevel))  {    pENDL->pLOOP = pLOOP;              /* save for next time ! */                                       /* decrease running counter ? */    if ((pLOOP->iRunningcount) && (pLOOP->iRunningcount < 0x7fffffffL))      pLOOP->iRunningcount--;    /* TODO: we're cheating out on the termination_condition,       iteration_min, iteration_max and possible signals;       it's just not ready for that can of worms.... */      if (!pLOOP->iRunningcount)         /* reached zero ? */    {                                  /* was this the outer LOOP ? */      if (pLOOP == pData->pFirstaniobj)        pData->bHasLOOP = MNG_FALSE;    }    else    {      if (pData->pCurraniobj)          /* was we processing objects ? */        pData->pCurraniobj = pLOOP;    /* then restart with LOOP */      else                             /* else restart behind LOOP !!! */        pData->pCurraniobj = pLOOP->sHeader.pNext;    }  }  else  {    MNG_ERROR (pData, 1234);    /* TODO: error abort ??? */  }#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_PROCESS_ANI_ENDL, MNG_LC_END)#endif  return MNG_NOERROR;}