C
C    Copyright (C) 2009 Anders Aspegren Søndergaard <andersas@gmail.com>
C    -------------------------------------------------------------------

C    This file is part of Wavlib.

C    Wavlib is free software: you can redistribute it and/or modify
C    it under the terms of the GNU General Public License as published by
C    the Free Software Foundation, either version 3 of the License, or
C    (at your option) any later version.

C    Wavlib is distributed in the hope that it will be useful,
C    but WITHOUT ANY WARRANTY; without even the implied warranty of
C    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
C    GNU General Public License for more details.

C    You should have received a copy of the GNU General Public License
C    along with Wavlib. If not, see <http://www.gnu.org/licenses/>.


C     Test if an open file is a RIFF file.
      LOGICAL FUNCTION ISRIFF(U)
       INTEGER U
       CHARACTER*4 HDR
       LOGICAL GETSTR

C      Get 4-character string from start of file
       ISRIFF = GETSTR(HDR,U,1,4)
       IF (.NOT. ISRIFF) THEN
           RETURN
       ENDIF

       ISRIFF = (HDR .EQ. 'RIFF')
      
       RETURN
      END

