c
c Definitions for searching in files
c
	include 'dix_def.inc'
c
c search style
c
	integer*4 match_flag_locate
	integer*4 match_flag_match
	integer*4 match_flag_eq
	integer*4 match_flag_ne
	integer*4 match_flag_lt
	integer*4 match_flag_le
	integer*4 match_flag_ge
	integer*4 match_flag_gt
	integer*4 match_flag_exists
	integer*4 match_flag_valid
	integer*4 match_flag_range
	integer*4 match_flag_always
	integer*4 match_flag_never
	parameter (match_flag_locate= 0)	!only locate
	parameter (match_flag_match = 1) !match whole record
	parameter (match_flag_eq    = 2) != match
	parameter (match_flag_ne    = 3) != match
	parameter (match_flag_lt    = 4) !< match
	parameter (match_flag_le    = 5) !<= match
	parameter (match_flag_ge    = 6) !>= match
	parameter (match_flag_gt    = 7) !> match
	parameter (match_flag_valid = 8) !type valid with the data
	parameter (match_flag_exists= 9) !field/window exists
	parameter (match_flag_range =10) !range
	parameter (match_flag_always=11) !always match
	parameter (match_flag_never =12) !never match
c
c COmbinining multiple
c  a/and,b/or,c  means (a .and. b) .or. c
c
	integer*4 logic_flag_or
	integer*4 logic_flag_and
	parameter (logic_flag_or=0)
	parameter (logic_flag_and=1)
c
	integer*4 search_location_data
	integer*4 search_location_vfc
	integer*4 search_location_both
	integer*4 search_location_recl
c
	parameter (search_location_data=0)
	parameter (search_location_vfc =1)
	parameter (search_location_both=2)
	parameter (search_location_recl=3)
c
	integer*4 magic_search
	parameter (magic_search = 'SEAR')
	structure /search_rec/
	  integer*4 match_flag		!locate/match/eq/ge/gt...
	  integer*4 wild_flag		!wild style (none,standard,extended)
	  integer*4 logic_flag          !combining flag
	  integer*4 location 		!match data/recl/vfc
	  logical*4 case_sensitive      !case sensitive
	  logical*4 not_flag		!inverse test
	  logical*4 next_record		!Next record flag
	  integer*4 position            !start pos in record
	  integer*4 size                !size of window
	  integer*4 datatype		!datatype (not for fields)
	  integer*4 nb_datatype		!length of datatype
	  logical*4 is_text
	  integer*4 nb_reserved		!reserved data for variable length string
	  logical*4 is_variable		!variable length data?
	  integer*4 nkar                !length of searstring
	  character*(max_search_length) name  !search string
	  integer*4 nkar2                !length of searstring for range
	  character*(max_search_length) name2  !search string for range
	  integer*4 nk_field
	  character*(name_length*2) fieldnam
	  integer*4 magic               !magic word for sanity checking
	  integer*4 align		!align=1,2,4,8
	  logical*4 do_display
	  integer*4 binary_type		!current inary type
	  integer*4 binary_size
	  integer*4 nb_binary
	  integer*4 nb_binary2
	  union
	    map
	      byte binary_data(max_search_length*4)
	    end map
	    map
	      integer*4 value1
	    end map
	  end union
	  union
	    map
	      byte binary_data2(max_search_length*4)	!for range data
	    end map
	    map
	      integer*4 value2
	    end map
	  end union
	end structure
c
c Control_t structure
c
        structure /search_control_t/
          record /rfa/ rfa
	  logical*2 fast                !fast/normal
          integer*4 bucket_size		!bucket/block
          integer*4 curblock
          integer*4 totblock
          integer*4 recnr
          integer*4 nkar
          character*255 filename
        end structure
c
	structure /search_stats/
	  integer*4 handle
	  integer*4 nrec_read
	  integer*4 nrec_fnd
	  integer*4 nbyt_read(2)
	  integer*4 nbyt_fnd(2)
	end structure

	integer*4  search_flag_statistics
	parameter (search_flag_statistics=1)
