Files
test/source/blender/blenlib/BLI_sort_utils.h
Brecht Van Lommel e2e1984e60 Refactor: Convert remainder of blenlib to C++
A few headers like BLI_math_constants.h and BLI_utildefines.h keep working
for C code, for remaining makesdna and userdef defaults code in C.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +01:00

40 lines
712 B
C

/* SPDX-FileCopyrightText: 2013 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup bli
*/
/**
* \note keep \a sort_value first,
* so cmp functions can be reused.
*/
struct SortPtrByFloat {
float sort_value;
void *data;
};
struct SortIntByFloat {
float sort_value;
int data;
};
struct SortPtrByInt {
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_);