function [drhs]=sw06_getAllDRH_shru(fid)
% ------------------------------------------------------------------
%   sw06_getAllDRH_shru
%
%      Reads in all data record headers for a particular file
%
%   for shru in SW06 only.
%
%  Remember:  File should be opened big endian for Shru
%               fid = fopen(filename,'rb','ieee-be');
%
%                   A Newhall  Aug 2006
%                   modified by YT Lin Sep 2006
% -------------------------------------------------------------------

% system settings of shur. In fact, the bytes_hdr variable is not 
% necessary for this propagram, so it is remarked. --yt
%   bytes_hdr = 1024;               
  nch = 1;

% -----------------------------------

  fseek(fid,0,'bof');   %  go to beginning of file
  drhs = [];
  sav = 0;
    
  while 1,
      
    [drh,status] = sw06_getDRH_shru(fid);
    if(status < 0),
        fprintf('\t%d records found\n',sav);  % first one is rec #0
        return; 
    end
       
    if (drh.rhkey ~= 'DATA')
          fprintf('Bad record found at #%d\n',sav+1);   % starts at #0
          return
    end

    % skip over data
    sfreq = drh.rhfs;
    spts = drh.npts;
    bytes_rec = nch * spts * 2;
    status = fseek(fid,bytes_rec,'cof');
    
    if (status < 0),
        fprintf('\t%d records found\n',sav);  % first one is rec #0
        return; 
    end
    
    sav = sav + 1;
    drhs = [drhs; drh];
    
  end   

  fprintf('%d records found\n',sav);  
% --------------------------------------------------------------
  