From 50acf46b925adb9fcaa0fb5e0ba592c5de37f580 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Sat, 9 Jan 1999 19:15:59 +0000 Subject: [PATCH] Sort openssl functions by name. --- CHANGES | 3 +++ apps/openssl.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/CHANGES b/CHANGES index 18f4f48381..be75d9f502 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes between 0.9.1c and 0.9.2 + *) Sort openssl functions by name. + [Ben Laurie] + *) Get the gendsa program working (hopefully) and add it to app list. Remove encryption from sample DSA keys (in case anyone is interested the password was "1234"). diff --git a/apps/openssl.c b/apps/openssl.c index e4bf362fa0..dfa23d674e 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -318,10 +318,26 @@ end: return(ret); } +static int SortFnByName(const void *_f1,const void *_f2) + { + const FUNCTION *f1=_f1; + const FUNCTION *f2=_f2; + + if(f1->type != f2->type) + return f1->type-f2->type; + return strcmp(f1->name,f2->name); + } + static LHASH *prog_init() { LHASH *ret; FUNCTION *f; + int i; + + /* Purely so it looks nice when the user hits ? */ + for(i=0,f=functions ; f->name != NULL ; ++f,++i) + ; + qsort(functions,i,sizeof *functions,SortFnByName); if ((ret=lh_new(hash,cmp)) == NULL) return(NULL); -- 2.34.1