llistsort.c - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       llistsort.c (678B)
       ---
            1 /*
            2  * Copy me if you can.
            3  * by 20h
            4  *
            5  * % make llistsort
            6  * % llistsort
            7  */
            8 
            9 #include <unistd.h>
           10 #include <stdlib.h>
           11 #include <stdio.h>
           12 #include <string.h>
           13 
           14 #include "ind.h"
           15 #include "llist.h"
           16 
           17 int
           18 main(int argc, char *argv[])
           19 {
           20         llist_t *tosort;
           21 
           22         tosort = llist_new();
           23         llist_add(tosort, "zde", NULL, 0);
           24         llist_add(tosort, "ghe", NULL, 0);
           25         llist_add(tosort, "23b", NULL, 0);
           26         llist_add(tosort, "ghe", NULL, 0);
           27         llist_add(tosort, "abcd", NULL, 0);
           28         llist_add(tosort, "abcde", NULL, 0);
           29         llist_add(tosort, "abcdc", NULL, 0);
           30 
           31         printf("before:\n");
           32         llist_print(tosort);
           33 
           34         llist_sort(tosort);
           35         printf("sorted:\n");
           36         llist_print(tosort);
           37 
           38         llist_free(tosort);
           39 
           40         return 0;
           41 }
           42