6 |
|
grep(s/^asn1pars$/asn1parse/,@ARGV); |
7 |
|
|
8 |
|
foreach (@ARGV) |
9 |
< |
{ printf "extern int %s_main(int argc,char *argv[]);\n",$_; } |
9 |
> |
{ printf "extern int %s_main(int argc, char *argv[]);\n",$_; } |
10 |
|
|
11 |
|
print <<'EOF'; |
12 |
|
|
13 |
< |
#define FUNC_TYPE_GENERAL 1 |
14 |
< |
#define FUNC_TYPE_MD 2 |
15 |
< |
#define FUNC_TYPE_CIPHER 3 |
16 |
< |
#define FUNC_TYPE_PKEY 4 |
17 |
< |
#define FUNC_TYPE_MD_ALG 5 |
18 |
< |
#define FUNC_TYPE_CIPHER_ALG 6 |
13 |
> |
#define FUNC_TYPE_GENERAL 1 |
14 |
> |
#define FUNC_TYPE_MD 2 |
15 |
> |
#define FUNC_TYPE_CIPHER 3 |
16 |
> |
#define FUNC_TYPE_PKEY 4 |
17 |
> |
#define FUNC_TYPE_MD_ALG 5 |
18 |
> |
#define FUNC_TYPE_CIPHER_ALG 6 |
19 |
|
|
20 |
|
typedef struct { |
21 |
< |
int type; |
22 |
< |
const char *name; |
23 |
< |
int (*func)(int argc,char *argv[]); |
24 |
< |
} FUNCTION; |
21 |
> |
int type; |
22 |
> |
const char *name; |
23 |
> |
int (*func)(int argc, char *argv[]); |
24 |
> |
} FUNCTION; |
25 |
|
DECLARE_LHASH_OF(FUNCTION); |
26 |
|
|
27 |
|
FUNCTION functions[] = { |
30 |
|
foreach (@ARGV) |
31 |
|
{ |
32 |
|
push(@files,$_); |
33 |
< |
$str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; |
33 |
> |
$str=" {FUNC_TYPE_GENERAL, \"$_\", ${_}_main},\n"; |
34 |
|
if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) |
35 |
|
{ print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; } |
36 |
|
elsif ( ($_ =~ /^speed$/)) |
60 |
|
foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160") |
61 |
|
{ |
62 |
|
push(@files,$_); |
63 |
< |
printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_main},\n#endif\n"; |
63 |
> |
printf "#ifndef OPENSSL_NO_".uc($_)."\n {FUNC_TYPE_MD, \"".$_."\", dgst_main},\n#endif\n"; |
64 |
|
} |
65 |
|
|
66 |
|
foreach ( |
86 |
|
{ |
87 |
|
push(@files,$_); |
88 |
|
|
89 |
< |
$t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_); |
89 |
> |
$t=sprintf(" {FUNC_TYPE_CIPHER, \"%s\", enc_main},\n",$_); |
90 |
|
if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; } |
91 |
|
elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; } |
92 |
|
elsif ($_ =~ /camellia/) { $t="#ifndef OPENSSL_NO_CAMELLIA\n${t}#endif\n"; } |
101 |
|
print $t; |
102 |
|
} |
103 |
|
|
104 |
< |
print "\t{0,NULL,NULL}\n\t};\n"; |
104 |
> |
print " {0, NULL, NULL}\n};\n"; |