      logical function hec_nextevt()
c
c read next event from data and save into common blocks
c in include files
c
c hec_nextevt = .true.  => event read successfully
c             = .false. => event read successfully and eof
c
c     Author: 07.04.97   Dieter Striegel
c   modified: 29.04.97   Dugan O'Neil
c   modified: 03.11.97   Dieter Striegel
c   modified: 12/04/98   ML
c
      implicit none
c
      include'hec_par.inc'      !shared parameters
      include'hec_datacard.inc' !datacard values
      include'hec_maxepio.inc'  !epio buffer
c
      logical hec_nextevt_epio
      logical hec_nextevt_zebra
      logical hec_nextevt_online_epio
c
c start by reseting raw data commons
c
      call hec_adc_ini
      call hec_dwpc_ini
c
c if we are reading zebra, call zebra nextevt, else epio nextevt
c
      if (in_typ(1) .eq. 1) then
        hec_nextevt = hec_nextevt_zebra()
      elseif (in_typ(1) .eq. 2 .and. run_mode .eq. 1) then
        hec_nextevt = hec_nextevt_epio(epdatabuf,iepbufset)
      elseif (in_typ(1) .eq. 2 .and. run_mode .eq. 2) then
        hec_nextevt = hec_nextevt_online_epio(epdatabuf,iepbufset)
      endif
c
      end


