author | viric@llimona |
Sun, 02 Sep 2007 15:59:31 +0200 | |
changeset 26 | 700a68421116 |
parent 4 | b2dfe3374454 |
permissions | -rw-r--r-- |
0 | 1 |
#include <stdio.h> |
2 |
#include <stdlib.h> |
|
3 |
#include "dictre.h" |
|
4 |
||
5 |
extern struct Word words[]; |
|
6 |
extern int nwords; |
|
7 |
||
8 |
static int cmp_words(const void *v1, const void *v2) |
|
9 |
{ |
|
10 |
struct Word *w1 = (struct Word *) v1; |
|
11 |
struct Word *w2 = (struct Word *) v2; |
|
12 |
||
13 |
return strcmp(w1->w, w2->w); |
|
14 |
} |
|
15 |
||
16 |
int sort_words() |
|
17 |
{ |
|
4 | 18 |
printf("Sorting...\n"); |
0 | 19 |
qsort(words, nwords, sizeof(words[0]), cmp_words); |
20 |
} |