drop_invalid_objects (pData);       }
mng_retcode MNG_DECL mng_readdisplay (mng_handle hHandle){  mng_datap   pData;                   /* local vars */  mng_retcode iRetcode;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (((mng_datap)hHandle), MNG_FN_READDISPLAY, MNG_LC_START)#endif  MNG_VALIDHANDLE (hHandle)            /* check validity handle and callbacks */  pData = ((mng_datap)hHandle);        /* and make it addressable */#ifndef MNG_INTERNAL_MEMMNGMT  MNG_VALIDCB (hHandle, fMemalloc)  MNG_VALIDCB (hHandle, fMemfree)#endif  MNG_VALIDCB (hHandle, fReaddata)  MNG_VALIDCB (hHandle, fGetcanvasline)  MNG_VALIDCB (hHandle, fRefresh)  MNG_VALIDCB (hHandle, fGettickcount)  MNG_VALIDCB (hHandle, fSettimer)                                       /* valid at this point ? */  if ((pData->bReading) || (pData->bDisplaying))    MNG_ERROR (pData, MNG_FUNCTIONINVALID)#ifdef MNG_SUPPORT_WRITE  if ((pData->bWriting) || (pData->bCreating))    MNG_ERROR (pData, MNG_FUNCTIONINVALID)#endif  cleanup_errors (pData);              /* cleanup previous errors */  pData->bReading      = MNG_TRUE;     /* read & display! */  pData->bDisplaying   = MNG_TRUE;  pData->bRunning      = MNG_TRUE;  pData->iFrameseq     = 0;  pData->iLayerseq     = 0;  pData->iFrametime    = 0;  pData->iRequestframe = 0;  pData->iRequestlayer = 0;  pData->iRequesttime  = 0;  pData->bSearching    = MNG_FALSE;  pData->iRuntime      = 0;  pData->iSynctime     = pData->fGettickcount (hHandle);  pData->iSuspendtime  = 0;  pData->iStarttime    = pData->iSynctime;  pData->iEndtime      = 0;  if (!pData->fOpenstream (hHandle))   /* open it and start reading */    iRetcode = MNG_APPIOERROR;  else    iRetcode = read_graphic (pData);  if (pData->bEOF)                     /* already at EOF ? */    pData->bReading = MNG_FALSE;       /* then we're no longer reading */  if (iRetcode)                        /* on error bail out */    return iRetcode;  if (pData->bSuspended)               /* read suspension ? */  {     iRetcode            = MNG_NEEDMOREDATA;     pData->iSuspendtime = pData->fGettickcount ((mng_handle)pData);  }  else  if (pData->bTimerset)                /* indicate timer break ? */    iRetcode = MNG_NEEDTIMERWAIT;  else  if (pData->bSectionwait)             /* indicate section break ? */    iRetcode = MNG_NEEDSECTIONWAIT;  else    pData->bRunning = MNG_FALSE;       /* no breaks = end of run */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (((mng_datap)hHandle), MNG_FN_READDISPLAY, MNG_LC_END)#endif  return iRetcode;}