3 open (NUMIN
,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
13 ($Cname,$mynum) = split;
15 if (defined($nidn{$mynum}))
16 { die "$ARGV[1]:$o:There's already an object with NID ",$mynum," on line ",$order{$mynum},"\n"; }
17 if (defined($nid{$Cname}))
18 { die "$ARGV[1]:$o:There's already an object with name ",$Cname," on line ",$order{$nid{$Cname}},"\n"; }
19 $nid{$Cname} = $mynum;
20 $nidn{$mynum} = $Cname;
22 $max_nid = $mynum if $mynum > $max_nid;
26 open (IN
,"$ARGV[0]") || die "Can't open input file $ARGV[0]";
33 if (/^!module\s+(.*)$/)
41 if (/^!Cname\s+(.*)$/)
43 if (/^!Alias\s+(.+?)\s+(.*)$/)
47 $myoid = &process_oid
($myoid);
51 $obj{$Cname} = $myoid;
58 ($myoid,$mysn,$myln) = split ':';
67 $myoid = &process_oid
($myoid);
70 if ($Cname eq "" && !($myln =~ / /))
75 if ($Cname ne "" && defined($ln{$module.$Cname}))
76 { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
82 if ($Cname ne "" && defined($sn{$module.$Cname}))
83 { die "objects.txt:$o:There's already an object with short name ",$sn{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
91 if ($Cname ne "" && defined($ln{$module.$Cname}))
92 { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
96 $Cname = $module.$Cname;
101 $obj{$Cname} = $myoid;
102 if (!defined($nid{$Cname}))
105 $nid{$Cname} = $max_nid;
106 $nidn{$max_nid} = $Cname;
107 print STDERR
"Added OID $Cname\n";
113 #XXX don't modify input files
114 #open (NUMOUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
115 #foreach (sort { $a <=> $b } keys %nidn)
117 # print NUMOUT $nidn{$_},"\t\t",$_,"\n";
121 open (OUT
,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
123 /* crypto/objects/obj_mac.h */
125 /* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
127 * perl objects.pl objects.txt obj_mac.num obj_mac.h
130 /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
131 * All rights reserved.
133 * This package is an SSL implementation written
134 * by Eric Young (eay@cryptsoft.com).
135 * The implementation was written so as to conform with Netscapes SSL.
137 * This library is free for commercial and non-commercial use as long as
138 * the following conditions are aheared to. The following conditions
139 * apply to all code found in this distribution, be it the RC4, RSA,
140 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
141 * included with this distribution is covered by the same copyright terms
142 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
144 * Copyright remains Eric Young's, and as such any Copyright notices in
145 * the code are not to be removed.
146 * If this package is used in a product, Eric Young should be given attribution
147 * as the author of the parts of the library used.
148 * This can be in the form of a textual message at program startup or
149 * in documentation (online or textual) provided with the package.
151 * Redistribution and use in source and binary forms, with or without
152 * modification, are permitted provided that the following conditions
154 * 1. Redistributions of source code must retain the copyright
155 * notice, this list of conditions and the following disclaimer.
156 * 2. Redistributions in binary form must reproduce the above copyright
157 * notice, this list of conditions and the following disclaimer in the
158 * documentation and/or other materials provided with the distribution.
159 * 3. All advertising materials mentioning features or use of this software
160 * must display the following acknowledgement:
161 * "This product includes cryptographic software written by
162 * Eric Young (eay@cryptsoft.com)"
163 * The word 'cryptographic' can be left out if the rouines from the library
164 * being used are not cryptographic related :-).
165 * 4. If you include any Windows specific code (or a derivative thereof) from
166 * the apps directory (application code) you must include an acknowledgement:
167 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
169 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
170 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
171 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
172 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
173 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
174 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
175 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
176 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
177 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
178 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
181 * The licence and distribution terms for any publically available version or
182 * derivative of this code cannot be changed. i.e. this code cannot simply be
183 * copied and put under another distribution licence
184 * [including the GNU Public Licence.]
187 #define SN_undef "UNDEF"
188 #define LN_undef "undefined"
194 foreach (sort { $a <=> $b } keys %ordern)
197 print OUT
"#define SN_",$Cname,"\t\t\"",$sn{$Cname},"\"\n" if $sn{$Cname} ne "";
198 print OUT
"#define LN_",$Cname,"\t\t\"",$ln{$Cname},"\"\n" if $ln{$Cname} ne "";
199 print OUT
"#define NID_",$Cname,"\t\t",$nid{$Cname},"\n" if $nid{$Cname} ne "";
200 print OUT
"#define OBJ_",$Cname,"\t\t",$obj{$Cname},"\n" if $obj{$Cname} ne "";
211 @a = split(/\s+/,$myoid);
214 if (!($a[0] =~ /^[0-9]+$/))
217 if (!defined($obj{$a[0]}))
218 { die "$ARGV[0]:$o:Undefined identifier ",$a[0],"\n"; }
219 $pref_oid = "OBJ_" . $a[0];
223 $oids = join('L,',@a) . "L";
226 $oids = $pref_oid . $pref_sep . $oids;