mirror of
https://github.com/CTCaer/hekate.git
synced 2025-09-16 22:41:57 +00:00
bdk: utils: added qsort compare functions
int qsort_compare_int(const void *a, const void *b); int qsort_compare_char(const void *a, const void *b); int qsort_compare_char_case(const void *a, const void *b);
This commit is contained in:
parent
9fbdb39390
commit
94b36f658c
2 changed files with 36 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
* Copyright (c) 2018-2024 CTCaer
|
||||
* Copyright (c) 2018-2025 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
|
@ -239,6 +239,21 @@ u32 crc32_calc(u32 crc, const u8 *buf, u32 len)
|
|||
return ~crc;
|
||||
}
|
||||
|
||||
int qsort_compare_int(const void *a, const void *b)
|
||||
{
|
||||
return (*(int *)a - *(int *)b);
|
||||
}
|
||||
|
||||
int qsort_compare_char(const void *a, const void *b)
|
||||
{
|
||||
return strcmp(*(const char **)a, *(const char **)b);
|
||||
}
|
||||
|
||||
int qsort_compare_char_case(const void *a, const void *b)
|
||||
{
|
||||
return strcasecmp(*(const char **)a, *(const char **)b);
|
||||
}
|
||||
|
||||
void panic(u32 val)
|
||||
{
|
||||
// Set panic code.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
* Copyright (c) 2018-2024 CTCaer
|
||||
* Copyright (c) 2018-2025 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
|
@ -89,6 +89,10 @@ int atoi(const char *nptr);
|
|||
void reg_write_array(u32 *base, const reg_cfg_t *cfg, u32 num_cfg);
|
||||
u32 crc32_calc(u32 crc, const u8 *buf, u32 len);
|
||||
|
||||
int qsort_compare_int(const void *a, const void *b);
|
||||
int qsort_compare_char(const void *a, const void *b);
|
||||
int qsort_compare_char_case(const void *a, const void *b);
|
||||
|
||||
void panic(u32 val);
|
||||
void power_set_state(power_state_t state);
|
||||
void power_set_state_ex(void *param);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue