/*
 * TLGB_BinSearch.h
 *
 *  Created on: 22/dic/2015
 *      Author: gozzini.davide
 */

#ifndef TLGB_BINSEARCH_H_
#define TLGB_BINSEARCH_H_

//==============================================================================
// Include files

//==============================================================================
// Constants

//==============================================================================
// Types

// Typedef for ansi compatible comparison function
typedef int (*CompareFunction)(void *item, void *itemOrArray);

//==============================================================================
// External variables

//==============================================================================
// Global functions

int ShortCompare(void *a, void *b);
int IntCompare(void *a, void *b);
int FloatCompare(void *a, void *b);
int DoubleCompare(void *a, void *b);
int CStringCompare(void *a, void *b);
int ListMemBlockCmp(void *a, void *b, unsigned int size);
long BinSearch(const void *array, unsigned int numElements, unsigned int elementSize, const void *itemPtr, CompareFunction compareFunction);


#endif /* TLGB_BINSEARCH_H_ */
