reimplement compare function for quicksort

This commit is contained in:
2026-05-15 23:24:04 -05:00
parent f186ebfca8
commit 861088152f
4 changed files with 18 additions and 11 deletions

View File

@@ -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

View File

@@ -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;