viric@0: #include viric@0: #include viric@0: #include "dictre.h" viric@0: viric@0: extern struct Word words[]; viric@0: extern int nwords; viric@0: viric@0: static int cmp_words(const void *v1, const void *v2) viric@0: { viric@0: struct Word *w1 = (struct Word *) v1; viric@0: struct Word *w2 = (struct Word *) v2; viric@0: viric@0: return strcmp(w1->w, w2->w); viric@0: } viric@0: viric@0: int sort_words() viric@0: { viric@4: printf("Sorting...\n"); viric@0: qsort(words, nwords, sizeof(words[0]), cmp_words); viric@0: }