//-----------------------------------------------------------------------------
// Copyright © 2003 - Philip Howard - All rights reserved
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//-----------------------------------------------------------------------------
// package	libh/map
// homepage	http://libh.slashusr.org/
//-----------------------------------------------------------------------------
// author	Philip Howard
// email	libh at ipal dot org
// homepage	http://phil.ipal.org/
//-----------------------------------------------------------------------------
// This file is best viewed using a fixed spaced font such as Courier
// and in a display at least 112 columns wide.
//-----------------------------------------------------------------------------

#include "map_ssa.h"

__PROTO_BEGIN__
//-----------------------------------------------------------------------------
// function	map_ssa_compare_alt_opt (internal)
//
// purpose	Compare the array keys in two AVL tree nodes.  This function
//		is not globally exported.  It is used only to establish the
//		comparison method for the AVL tree used to hold this mapping.
//
// features	This function is used to invoke a caller supplied comparison
//		function.
//
// arguments	1 (struct map_link_ssa *)
//		2 (struct map_link_ssa *)
//		3 (void *) alternate compare function
//
// returns	(int) comparison status, -1, 0, 1
//
// The alternate compare function has this interface:
//
// arguments	1 (const signed short *) key 1
//		2 (size_t) length of key 1
//		3 (const signed short *) key 2
//		4 (size_t) length of key 2
//		5 (int) options
//
// returns	(int) comparison status, -1, 0, 1
//-----------------------------------------------------------------------------
int
map_ssa_compare_alt_opt (
    avl_link *		arg_one
    ,
    avl_link *		arg_two
    ,
    AVL *		arg_avl
    )
__PROTO_END__
{
    return ( * map_cmp_func( arg_avl ) ) (
	( (struct map_link_ssa *) (void *) arg_one )->key,
	( (struct map_link_ssa *) (void *) arg_one )->keylen,
	( (struct map_link_ssa *) (void *) arg_two )->key,
	( (struct map_link_ssa *) (void *) arg_two )->keylen,
	map_from_avl( arg_avl )->options
	);
}


