reimplement compare function for quicksort
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
int lsort_quicksort(lsort_array* array);
|
||||
int lsort_quicksort(lsort_array* array, int_function_pointer compare_function);
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stddef.h>
|
||||
#include "string.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *buf;
|
||||
size_t len;
|
||||
@@ -13,6 +14,8 @@ typedef struct {
|
||||
int key;
|
||||
void* value;
|
||||
} lsort_item;
|
||||
typedef int (*int_function_pointer)(lsort_item*, lsort_item*);
|
||||
|
||||
|
||||
typedef struct {
|
||||
size_t count;
|
||||
|
||||
Reference in New Issue
Block a user