From 853bbb3752a5fa2f58ef456ffb6e3a552e13cb11 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 3 Aug 2025 19:22:36 +0200 Subject: initial commit --- simclist-1.5/perftest/sort.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 simclist-1.5/perftest/sort.c (limited to 'simclist-1.5/perftest/sort.c') diff --git a/simclist-1.5/perftest/sort.c b/simclist-1.5/perftest/sort.c new file mode 100644 index 0000000..171c8d7 --- /dev/null +++ b/simclist-1.5/perftest/sort.c @@ -0,0 +1,24 @@ +#include +#include +#include + +#define BUFLEN 20 + +int main() { + list_t l; + unsigned int i; + char buf[BUFLEN]; + + list_init(&l); + list_attributes_copy(&l, list_meter_int32_t, 1); + list_attributes_comparator(&l, list_comparator_int32_t); + + while (fgets(buf, BUFLEN, stdin) != NULL) { + i = atoi(buf); + list_append(&l, &i); + } + + list_sort(&l, 1); + + return 0; +} -- cgit v1.2.3-70-g09d2