--- a/ucx/ucx.h Fri Sep 22 20:19:00 2017 +0200 +++ b/ucx/ucx.h Fri Sep 22 20:42:33 2017 +0200 @@ -40,9 +40,10 @@ #define UCX_VERSION_MAJOR 0 /** Minor UCX version as integer constant. */ -#define UCX_VERSION_MINOR 11 +#define UCX_VERSION_MINOR 12 #include <stdlib.h> +#include <stdint.h> #ifdef _WIN32 #if !(defined __ssize_t_defined || defined _SSIZE_T_) @@ -86,7 +87,16 @@ * and 0 if both arguments are equal. If the third argument is * <code>NULL</code>, it shall be ignored. */ -typedef int(*cmp_func)(void*,void*,void*); +typedef int(*cmp_func)(const void*,const void*,void*); + +/** + * Function pointer to a distance function. + * + * The distance function shall take three arguments: the two values for which + * the distance shall be computed and optional additional data. + * The function shall then return the signed distance as integer value. + */ +typedef intmax_t(*distance_func)(const void*,const void*,void*); /** * Function pointer to a copy function. @@ -99,7 +109,7 @@ * passed to <code>free()</code> depends on the implementation of the * respective <code>copy_func</code>. */ -typedef void*(*copy_func)(void*,void*); +typedef void*(*copy_func)(const void*,void*); /** * Function pointer to a write function.