ucx/ucx.h

changeset 244
98dc2d3a9b1d
parent 243
2e74828c5e94
child 250
b7d1317b138e
equal deleted inserted replaced
243:2e74828c5e94 244:98dc2d3a9b1d
85 * The function shall then return -1 if the first argument is less than the 85 * The function shall then return -1 if the first argument is less than the
86 * second argument, 1 if the first argument is greater than the second argument 86 * second argument, 1 if the first argument is greater than the second argument
87 * and 0 if both arguments are equal. If the third argument is 87 * and 0 if both arguments are equal. If the third argument is
88 * <code>NULL</code>, it shall be ignored. 88 * <code>NULL</code>, it shall be ignored.
89 */ 89 */
90 typedef int(*cmp_func)(void*,void*,void*); 90 typedef int(*cmp_func)(const void*,const void*,void*);
91 91
92 /** 92 /**
93 * Function pointer to a distance function. 93 * Function pointer to a distance function.
94 * 94 *
95 * The distance function shall take three arguments: the two values for which 95 * The distance function shall take three arguments: the two values for which
96 * the distance shall be computed and optional additional data. 96 * the distance shall be computed and optional additional data.
97 * The function shall then return the signed distance as integer value. 97 * The function shall then return the signed distance as integer value.
98 */ 98 */
99 typedef intmax_t(*distance_func)(void*,void*,void*); 99 typedef intmax_t(*distance_func)(const void*,const void*,void*);
100 100
101 /** 101 /**
102 * Function pointer to a copy function. 102 * Function pointer to a copy function.
103 * 103 *
104 * The copy function shall create a copy of the first argument and may use 104 * The copy function shall create a copy of the first argument and may use
107 107
108 * <b>Attention:</b> if pointers returned by functions of this type may be 108 * <b>Attention:</b> if pointers returned by functions of this type may be
109 * passed to <code>free()</code> depends on the implementation of the 109 * passed to <code>free()</code> depends on the implementation of the
110 * respective <code>copy_func</code>. 110 * respective <code>copy_func</code>.
111 */ 111 */
112 typedef void*(*copy_func)(void*,void*); 112 typedef void*(*copy_func)(const void*,void*);
113 113
114 /** 114 /**
115 * Function pointer to a write function. 115 * Function pointer to a write function.
116 * 116 *
117 * The signature of the write function shall be compatible to the signature 117 * The signature of the write function shall be compatible to the signature

mercurial