binary_search (CK_OBJECT_HANDLE *elem,
               int low,
               int high,
               CK_OBJECT_HANDLE handle)
{
	int mid;

	if (low == high)
		return low;

	mid = low + ((high - low) / 2);
	if (handle > elem[mid])
		return binary_search (elem, mid + 1, high, handle);
	else if (handle < elem[mid])
		return binary_search (elem, low, mid, handle);

	return mid;
}
binary_search (CK_OBJECT_HANDLE *elem,
               int low,
               int high,
               CK_OBJECT_HANDLE handle)
{
	int mid;

	if (low == high)
		return low;

	mid = low + ((high - low) / 2);
	if (handle > elem[mid])
		return binary_search (elem, mid + 1, high, handle);
	else if (handle < elem[mid])
		return binary_search (elem, low, mid, handle);

	return mid;
}