X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=adu.c;h=27c026701d493d502f8856c82c76a37336d37340;hb=17ec9800d532ef9de0e3970e1f5bf5914c939739;hp=3eec0b4d67c20509c4de586b5d4bf16d17fb362c;hpb=1e723f61001e9f4448a465886b0b4ebcdadb388e;p=adu.git diff --git a/adu.c b/adu.c index 3eec0b4..27c0267 100644 --- a/adu.c +++ b/adu.c @@ -53,8 +53,6 @@ struct osl_table *dir_table = NULL; */ struct uid_range *admissible_uids; -/** Evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y. */ -#define NUM_COMPARE(x, y) ((int)((x) < (y)) - (int)((x) > (y))) /** * Compare the size of two directories @@ -475,6 +473,12 @@ char *get_uid_list_name(void) return make_message("%s/uid_list", conf.database_dir_arg); } +void sort_hash_table(int (*comp)(const void *, const void *)) +{ + qsort(uid_hash_table, uid_hash_table_size, sizeof(struct user_info), + comp); +} + int open_dir_table(int create) { dir_table_desc.dir = adu_strdup(conf.database_dir_arg);