mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
CHG: Extracted @piwi's bucketsort into separate files under /common
This commit is contained in:
parent
e0b30228e9
commit
089d061f2d
7 changed files with 229 additions and 105 deletions
26
common/bucketsort.h
Normal file
26
common/bucketsort.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef BUCKETSORT_H__
|
||||
#define BUCKETSORT_H__
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
typedef struct bucket {
|
||||
uint32_t *head;
|
||||
uint32_t *bp;
|
||||
} bucket_t;
|
||||
|
||||
typedef bucket_t bucket_array_t[2][0x100];
|
||||
|
||||
typedef struct bucket_info {
|
||||
struct {
|
||||
uint32_t *head, *tail;
|
||||
} bucket_info[2][0x100];
|
||||
uint32_t numbuckets;
|
||||
} bucket_info_t;
|
||||
|
||||
|
||||
bool bucket_malloc(bucket_array_t bucket);
|
||||
void bucket_free(bucket_array_t bucket);
|
||||
void bucket_sort_intersect(uint32_t* const estart, uint32_t* const estop,
|
||||
uint32_t* const ostart, uint32_t* const ostop,
|
||||
bucket_info_t *bucket_info, bucket_array_t bucket);
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue