2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2013 Blender Foundation. All rights reserved. */
|
2013-09-05 22:24:12 +00:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bli
|
2013-09-05 22:24:12 +00:00
|
|
|
*/
|
|
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-09-05 22:24:12 +00:00
|
|
|
/**
|
|
|
|
|
* \note keep \a sort_value first,
|
|
|
|
|
* so cmp functions can be reused.
|
|
|
|
|
*/
|
2018-03-31 19:25:27 +02:00
|
|
|
struct SortPtrByFloat {
|
2013-09-05 22:24:12 +00:00
|
|
|
float sort_value;
|
|
|
|
|
void *data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct SortIntByFloat {
|
|
|
|
|
float sort_value;
|
|
|
|
|
int data;
|
|
|
|
|
};
|
|
|
|
|
|
2018-03-31 19:25:27 +02:00
|
|
|
struct SortPtrByInt {
|
2013-09-05 22:24:12 +00:00
|
|
|
int sort_value;
|
|
|
|
|
void *data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct SortIntByInt {
|
|
|
|
|
int sort_value;
|
|
|
|
|
int data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int BLI_sortutil_cmp_float(const void *a_, const void *b_);
|
|
|
|
|
int BLI_sortutil_cmp_float_reverse(const void *a_, const void *b_);
|
|
|
|
|
|
|
|
|
|
int BLI_sortutil_cmp_int(const void *a_, const void *b_);
|
|
|
|
|
int BLI_sortutil_cmp_int_reverse(const void *a_, const void *b_);
|
|
|
|
|
|
2018-03-31 19:25:27 +02:00
|
|
|
int BLI_sortutil_cmp_ptr(const void *a_, const void *b_);
|
|
|
|
|
int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_);
|
|
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|