package brotli

/* Copyright 2018 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

func ( *hashComposite) () uint {
	var  uint = .ha.HashTypeLength()
	var  uint = .hb.HashTypeLength()
	if  >  {
		return 
	} else {
		return 
	}
}

func ( *hashComposite) () uint {
	var  uint = .ha.StoreLookahead()
	var  uint = .hb.StoreLookahead()
	if  >  {
		return 
	} else {
		return 
	}
}

/* Composite hasher: This hasher allows to combine two other hashers, HASHER_A
   and HASHER_B. */
type hashComposite struct {
	hasherCommon
	ha     hasherHandle
	hb     hasherHandle
	params *encoderParams
}

func ( *hashComposite) ( *encoderParams) {
	.params = 
}

/* TODO: Initialize of the hashers is defered to Prepare (and params
   remembered here) because we don't get the one_shot and input_size params
   here that are needed to know the memory size of them. Instead provide
   those params to all hashers InitializehashComposite */
func ( *hashComposite) ( bool,  uint,  []byte) {
	if .ha == nil {
		var  *hasherCommon
		var  *hasherCommon

		 = .ha.Common()
		.params = .params.hasher
		.is_prepared_ = false
		.dict_num_lookups = 0
		.dict_num_matches = 0
		.ha.Initialize(.params)

		 = .hb.Common()
		.params = .params.hasher
		.is_prepared_ = false
		.dict_num_lookups = 0
		.dict_num_matches = 0
		.hb.Initialize(.params)
	}

	.ha.Prepare(, , )
	.hb.Prepare(, , )
}

func ( *hashComposite) ( []byte,  uint,  uint) {
	.ha.Store(, , )
	.hb.Store(, , )
}

func ( *hashComposite) ( []byte,  uint,  uint,  uint) {
	.ha.StoreRange(, , , )
	.hb.StoreRange(, , , )
}

func ( *hashComposite) ( uint,  uint,  []byte,  uint) {
	.ha.StitchToPreviousBlock(, , , )
	.hb.StitchToPreviousBlock(, , , )
}

func ( *hashComposite) ( []int) {
	.ha.PrepareDistanceCache()
	.hb.PrepareDistanceCache()
}

func ( *hashComposite) ( *encoderDictionary,  []byte,  uint,  []int,  uint,  uint,  uint,  uint,  uint,  *hasherSearchResult) {
	.ha.FindLongestMatch(, , , , , , , , , )
	.hb.FindLongestMatch(, , , , , , , , , )
}