5 # It does this by parsing the header files and looking for the
6 # non-prototyped functions.
9 $crypto_num="util/libeay.num";
10 $ssl_num= "util/ssleay.num";
17 $do_ssl=1 if $_ eq "ssleay";
18 $do_crypto=1 if $_ eq "libeay";
21 if (!$do_ssl && !$do_crypto)
23 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n";
27 %ssl_list=&load_numbers($ssl_num);
28 %crypto_list=&load_numbers($crypto_num);
32 $crypto ="crypto/crypto.h";
33 $crypto.=" crypto/des/des.h";
34 $crypto.=" crypto/idea/idea.h";
35 $crypto.=" crypto/rc4/rc4.h";
36 $crypto.=" crypto/rc2/rc2.h";
37 $crypto.=" crypto/bf/blowfish.h";
38 $crypto.=" crypto/md/md2.h";
39 $crypto.=" crypto/md/md5.h";
40 $crypto.=" crypto/mdc2/mdc2.h";
41 $crypto.=" crypto/sha/sha.h";
43 $crypto.=" crypto/bn/bn.h";
44 $crypto.=" crypto/rsa/rsa.h";
45 $crypto.=" crypto/dsa/dsa.h";
46 $crypto.=" crypto/dh/dh.h";
48 $crypto.=" crypto/stack/stack.h";
49 $crypto.=" crypto/buffer/buffer.h";
50 $crypto.=" crypto/bio/bio.h";
51 $crypto.=" crypto/lhash/lhash.h";
52 $crypto.=" crypto/conf/conf.h";
53 $crypto.=" crypto/txt_db/txt_db.h";
55 $crypto.=" crypto/evp/evp.h";
56 $crypto.=" crypto/objects/objects.h";
57 $crypto.=" crypto/pem/pem.h";
58 #$crypto.=" crypto/meth/meth.h";
59 $crypto.=" crypto/asn1/asn1.h";
60 $crypto.=" crypto/asn1/asn1_mac.h";
61 $crypto.=" crypto/err/err.h";
62 $crypto.=" crypto/pkcs7/pkcs7.h";
63 $crypto.=" crypto/x509/x509.h";
64 $crypto.=" crypto/x509/x509_vfy.h";
65 $crypto.=" crypto/rand/rand.h";
70 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl))
73 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto))
78 local($name,$files)=@_;
82 foreach $file (split(/\s+/,$files))
84 # print STDERR "reading $file\n";
85 open(IN,"<$file") || die "unable to open $file:$!\n";
91 while (($i=index($a,"/*")) >= 0)
94 break unless ($j >= 0);
95 $a=substr($a,0,$i).substr($a,$j+2);
98 foreach (split("\n",$a))
100 if (/^\#ifndef (.*)/)
106 elsif (/^\#if !defined\(([^\)]+)\)/)
112 elsif (/^\#ifdef (.*)/)
138 { $t=&do_extern($name,$_); }
139 elsif ( ($tag{'NOPROTO'} == 1) &&
140 ($tag{'FreeBSD'} != 1) &&
141 (($NT && ($tag{'WIN16'} != 1)) ||
142 (!$NT && ($tag{'WIN16'} != -1))) &&
143 ($tag{'PERL5'} != 1))
144 { $t=&do_line($name,$_); }
145 if (($t ne undef) && (!$done{$name,$t}))
161 return(undef) if /^$/;
162 return(undef) if /^\s/;
163 if (/(CRYPTO_get_locking_callback)/)
165 elsif (/(CRYPTO_get_id_callback)/)
167 elsif (/(CRYPTO_get_add_lock_callback)/)
169 elsif (/(SSL_CTX_get_verify_callback)/)
189 local(*OUT,$name,*nums,@functions)=@_;
199 ; Definition file for the DDL version of the $name library from SSLeay
204 DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com'
211 CODE PRELOAD MOVEABLE
212 DATA PRELOAD MOVEABLE SINGLE
225 (@e)=grep(/^SSLeay/,@functions);
226 (@r)=grep(!/^SSLeay/,@functions);
227 @functions=((sort @e),(sort @r));
229 foreach $func (@functions)
231 if (!defined($nums{$func}))
233 printf STDERR "$func does not have a number assigned\n";
238 printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n;
249 open(IN,"<$name") || die "unable to open $name:$!\n";