|
myMPD
Internal API documentation
|
Linked list implementation. More...
#include "src/lib/list/sort.h"#include "dist/sds/sds.h"#include "src/lib/list/list.h"#include "src/lib/mem.h"#include "src/lib/utf8_wrapper.h"
Data Structures | |
| struct | t_merge_result |
Functions | |
| static bool | sort_cb_value_i (struct t_list_node *first, struct t_list_node *second, enum list_sort_direction direction) |
| static bool | sort_cb_value_p (struct t_list_node *first, struct t_list_node *second, enum list_sort_direction direction) |
| static bool | sort_cb_key (struct t_list_node *first, struct t_list_node *second, enum list_sort_direction direction) |
| static void | merge (struct t_list_node *first, struct t_list_node *first_end, struct t_list_node *second, struct t_list_node *second_end, enum list_sort_direction direction, list_sort_callback sort_cb, struct t_merge_result *result) |
| bool | list_sort_by_callback (struct t_list *l, enum list_sort_direction direction, list_sort_callback sort_cb) |
| bool | list_sort_by_value_i (struct t_list *l, enum list_sort_direction direction) |
| bool | list_sort_by_value_p (struct t_list *l, enum list_sort_direction direction) |
| bool | list_sort_by_key (struct t_list *l, enum list_sort_direction direction) |
Linked list implementation.
| bool list_sort_by_callback | ( | struct t_list * | l, |
| enum list_sort_direction | direction, | ||
| list_sort_callback | sort_cb ) |
The list sorting function. Uses bottom-up merge sort algorithm.
| l | pointer to list to sort |
| direction | sort direction |
| sort_cb | compare function |
| bool list_sort_by_key | ( | struct t_list * | l, |
| enum list_sort_direction | direction ) |
Sorts the list by key. It uses the merge sort algorithm.
| l | pointer to list to sort |
| direction | sort direction |
| bool list_sort_by_value_i | ( | struct t_list * | l, |
| enum list_sort_direction | direction ) |
Sorts the list by value_i. It uses the merge sort algorithm.
| l | pointer to list to sort |
| direction | sort direction |
| bool list_sort_by_value_p | ( | struct t_list * | l, |
| enum list_sort_direction | direction ) |
Sorts the list by value_p. It uses the merge sort algorithm.
| l | pointer to list to sort |
| direction | sort direction |
|
static |
Function to merge two sorted linked lists (ITERATIVE)
| first | Head pointer to first list |
| first_end | Tail pointer to first list |
| second | Head pointer to second list |
| second_end | Tail pointer to second list |
| direction | Sort direction |
| sort_cb | Sort callback |
| result | Merge result |
|
static |
Compare callback to sort by key
| first | first list node |
| second | second list node |
| direction | sort direction |
|
static |
Compare callback to sort by value_i
| first | first list node |
| second | second list node |
| direction | sort direction |
|
static |
Compare callback to sort by value_p
| first | first list node |
| second | second list node |
| direction | sort direction |