34 lines
1.1 KiB
C
34 lines
1.1 KiB
C
#ifndef INCLUDED_C_MSD_H
|
|||
|
|
#define INCLUDED_C_MSD_H
|
||
|
|
|
||
|
|
#ifndef INCLUDED_C_TYPES_H
|
||
|
|
#include <c_Types.h>
|
||
|
|
#endif /*INCLUDED_C_TYPES_H*/
|
||
|
|
|
||
|
|
#ifndef INCLUDED_C_ALLOCATOR_H
|
||
|
|
#include <c_Allocator.h>
|
||
|
|
#endif /*INCLUDED_C_ALLOCATOR_H*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
||
|
|
/* */
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief 泛型 MSD 专用字节密钥提取器函数指针
|
||
|
|
*
|
||
|
|
* @param elem 指向当前泛型对象的指针
|
||
|
|
* @param d 当前从高向低扫描的第 d 个字节下标(0 代表最高位字节/首字节)
|
||
|
|
* @param args 自定义上下文参数
|
||
|
|
* @return int 返回该泛型对象在第 d 个字节处的 8 位键值。
|
||
|
|
* 🌟【重要工业契约】:如果 d 已经超越了该变长元素的极限长度,必须强制返回 -1 充当哨兵终止符!
|
||
|
|
*/
|
||
|
|
typedef int (*c_MSD_ExtractorFn)(const void* elem, c_size_t d, void* args);
|
||
|
|
|
||
|
|
|
||
|
|
c_err_t c_MSD_RadixSort(void* base, c_size_t num, c_size_t elem_size,
|
||
|
|
c_MSD_ExtractorFn extractor, void* args, c_Allocator_t* allocator);
|
||
|
|
|
||
|
|
|
||
|
|
#endif /*INCLUDED_C_MSD_H*/
|