|
myMPD
Internal API documentation
|
Array functions for sds strings. More...
#include "src/lib/sds/sds_array.h"#include "src/lib/mem.h"#include "dist/sds/sds.h"#include "src/lib/random.h"#include "src/lib/utf8_wrapper.h"
Functions | |
| static int | sort_compare_asc (const void *a, const void *b) |
| static int | sort_compare_desc (const void *a, const void *b) |
| struct t_sds_array * | sds_array_new (void) |
| void | sds_array_init (struct t_sds_array *array) |
| void | sds_array_clear (struct t_sds_array *array) |
| void | sds_array_free (struct t_sds_array *array) |
| bool | sds_array_push (struct t_sds_array *array, sds s) |
| bool | sds_array_shuffle (struct t_sds_array *array) |
| bool | sds_array_sort (struct t_sds_array *array, bool desc) |
Array functions for sds strings.
| void sds_array_clear | ( | struct t_sds_array * | array | ) |
Clears the sds array, freeing all sds strings
| array | Pointer to the sds array to clear |
| void sds_array_free | ( | struct t_sds_array * | array | ) |
Frees the sds array and all its contents
| array | Pointer to the sds array to free |
| void sds_array_init | ( | struct t_sds_array * | array | ) |
Initializes an existing sds array
| array | Pointer to the sds array to initialize |
| struct t_sds_array * sds_array_new | ( | void | ) |
Creates and initializes a new sds array
| bool sds_array_push | ( | struct t_sds_array * | array, |
| sds | s ) |
Pushes the sds string to the array
| array | Pointer to the sds array |
| s | Pointer of sds string to push (this function does not copy it) |
| bool sds_array_shuffle | ( | struct t_sds_array * | array | ) |
Shuffles the sds array using the Fisher-Yates algorithm
| array | Pointer to the sds array |
| bool sds_array_sort | ( | struct t_sds_array * | array, |
| bool | desc ) |
Sorts the sds array utf8 aware and case insensitive using qsort
| array | Pointer to the sds array |
| desc | If true, sorts in descending order; otherwise, sorts in ascending order |
|
static |
Compares two sds strings for sorting in ascending order
| a | Pointer to the first sds string |
| b | Pointer to the second sds string |
|
static |
Compares two sds strings for sorting in descending order
| a | Pointer to the first sds string |
| b | Pointer to the second sds string |