ae2f::Core
|
Go to the source code of this file.
Macros | |
#define | ae2f_ds_Arr_NOT_FOUND ae2f_static_cast(ae2f_errint_t, 0b1100000) |
#define | ae2f_ds_Arr_EQUAL ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, 0) |
they are same | |
#define | ae2f_ds_Arr_RIGHT_UNIT ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, 1) |
right is lesser | |
#define | ae2f_ds_Arr_LEFT_UNIT ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, -1) |
left is lesser | |
#define | ae2f_ds_Arr_BSearch(arr, wanted, fpElCmp, retidx, elw) |
Finds the element [wanted] via binary search. | |
#define | ae2f_ds_Arr_QSort(arr, fpElCmp, elw) |
Order the arr via quick sort. | |
Typedefs | |
typedef int | ae2f_ds_Arr_CmpRet_t |
A predefined returning data type for ae2f_ds_Arr_fpElCmp_t. | |
typedef ae2f_ds_Arr_CmpRet_t(* | ae2f_ds_Arr_fpElCmp_t) (const void *l, const void *r) |
It is an api for following approximate pseudo code. | |
Functions | |
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t | ae2f_ds_Arr_BSearch_imp (const ae2f_struct ae2f_ds_cAlloc *arr, const void *wanted, const ae2f_ds_Arr_fpElCmp_t fpElCmp, size_t *out, size_t elsize) |
Finds the element [wanted] via binary search. | |
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t | ae2f_ds_Arr_QSort_imp (ae2f_struct ae2f_ds_cAlloc *arr, const ae2f_ds_Arr_fpElCmp_t fpElCmp, size_t elsize) |
Order the arr via quick sort. | |
#define ae2f_ds_Arr_BSearch | ( | arr, | |
wanted, | |||
fpElCmp, | |||
retidx, | |||
elw ) |
Finds the element [wanted] via binary search.
arr | Array to see. It must be sorted. |
wanted | The element which is wanted |
fpElCmp | Comparing function. comparing will be proceed as fpElCmp(element, wanted);
|
retidx | Buffer where the Index may be stored |
elw | Suggested each element's size. |
ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_IMP_NOT_FOUND
ae2f_errGlob_ALLOC_FAILED
ae2f_errGlob_WRONG_OPERATION
#define ae2f_ds_Arr_EQUAL ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, 0) |
they are same
#define ae2f_ds_Arr_LEFT_UNIT ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, -1) |
left is lesser
#define ae2f_ds_Arr_NOT_FOUND ae2f_static_cast(ae2f_errint_t, 0b1100000) |
#define ae2f_ds_Arr_QSort | ( | arr, | |
fpElCmp, | |||
elw ) |
Order the arr via quick sort.
arr | An array to sort |
fpElCmp | comparing will be proceed as fpElCmp(element, wanted);
|
elw | Suggested each element's size. |
#define ae2f_ds_Arr_RIGHT_UNIT ae2f_static_cast(ae2f_ds_Arr_CmpRet_t, 1) |
right is lesser
typedef int ae2f_ds_Arr_CmpRet_t |
A predefined returning data type for ae2f_ds_Arr_fpElCmp_t.
typedef ae2f_ds_Arr_CmpRet_t(* ae2f_ds_Arr_fpElCmp_t) (const void *l, const void *r) |
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Arr_BSearch_imp | ( | const ae2f_struct ae2f_ds_cAlloc * | arr, |
const void * | wanted, | ||
const ae2f_ds_Arr_fpElCmp_t | fpElCmp, | ||
size_t * | out, | ||
size_t | elsize ) |
Finds the element [wanted] via binary search.
arr | Array to see. It must be sorted. |
wanted | The element which is wanted |
fpElCmp | comparing will be proceed as fpElCmp(element, wanted);
|
out | Buffer where the Index may be stored |
elsize | Suggested each element's size. |
ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_IMP_NOT_FOUND
ae2f_errGlob_ALLOC_FAILED
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Arr_QSort_imp | ( | ae2f_struct ae2f_ds_cAlloc * | arr, |
const ae2f_ds_Arr_fpElCmp_t | fpElCmp, | ||
size_t | elsize ) |
Order the arr via quick sort.
arr | An array to sort |
fpElCmp | comparing will be proceed as fpElCmp(element, wanted);
|
elsize | Suggested each element's size. |