This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenlib/BLI_sort_utils.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
914 B
C++
Raw Normal View History

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2013 Blender Foundation. All rights reserved. */
#pragma once
/** \file
* \ingroup bli
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* \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_);
int BLI_sortutil_cmp_ptr(const void *a_, const void *b_);
int BLI_sortutil_cmp_ptr_reverse(const void *a_, const void *b_);
#ifdef __cplusplus
}
#endif