| 1 |
// SPDX-License-Identifier: MPL-2.0 |
| 2 |
// (c) Hare authors <https://harelang.org> |
| 3 |
|
| 4 |
// This function type is used when sorting and searching. Given two pointers to |
| 5 |
// values, a function of this type should return an integer less than, equal to, |
| 6 |
// or greater than zero if the first argument is, respectively, less than, equal |
| 7 |
// to, or greater than the second argument. |
| 8 |
// |
| 9 |
// [[sort::cmp::]] provides convenience functions for some commonly sorted |
| 10 |
// builtin types, such as integers and strings. |
| 11 |
export type cmpfunc = fn(a: const *opaque, b: const *opaque) int; |