Ignore machine-check MSRs
[freebsd-src/fkvm-freebsd.git] / crypto / openssl / util / add_cr.pl
blobc7b62c11ec96249c3b440fd9bc90b255f09f2bc6
1 #!/usr/local/bin/perl
3 # This adds a copyright message to a souce code file.
4 # It also gets the file name correct.
6 # perl util/add_cr.pl *.[ch] */*.[ch] */*/*.[ch]
9 foreach (@ARGV)
11 &dofile($_);
14 sub dofile
16 local($file)=@_;
18 open(IN,"<$file") || die "unable to open $file:$!\n";
20 print STDERR "doing $file\n";
21 @in=<IN>;
23 return(1) if ($in[0] =~ / NOCW /);
25 @out=();
26 open(OUT,">$file.out") || die "unable to open $file.$$:$!\n";
27 push(@out,"/* $file */\n");
28 if (($in[1] !~ /^\/\* Copyright \(C\) [0-9-]+ Eric Young \(eay\@cryptsoft.com\)/))
30 push(@out,&Copyright);
31 $i=2;
32 @a=grep(/ Copyright \(C\) /,@in);
33 if ($#a >= 0)
35 while (($i <= $#in) && ($in[$i] ne " */\n"))
36 { $i++; }
37 $i++ if ($in[$i] eq " */\n");
39 while (($i <= $#in) && ($in[$i] =~ /^\s*$/))
40 { $i++; }
42 push(@out,"\n");
43 for ( ; $i <= $#in; $i++)
44 { push(@out,$in[$i]); }
46 else
47 { push(@out,@in); }
49 else
51 shift(@in);
52 push(@out,@in);
54 print OUT @out;
55 close(IN);
56 close(OUT);
57 rename("$file","$file.orig") || die "unable to rename $file:$!\n";
58 rename("$file.out",$file) || die "unable to rename $file.out:$!\n";
63 sub Copyright
65 return <<'EOF';
66 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
67 * All rights reserved.
69 * This package is an SSL implementation written
70 * by Eric Young (eay@cryptsoft.com).
71 * The implementation was written so as to conform with Netscapes SSL.
73 * This library is free for commercial and non-commercial use as long as
74 * the following conditions are aheared to. The following conditions
75 * apply to all code found in this distribution, be it the RC4, RSA,
76 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
77 * included with this distribution is covered by the same copyright terms
78 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
80 * Copyright remains Eric Young's, and as such any Copyright notices in
81 * the code are not to be removed.
82 * If this package is used in a product, Eric Young should be given attribution
83 * as the author of the parts of the library used.
84 * This can be in the form of a textual message at program startup or
85 * in documentation (online or textual) provided with the package.
87 * Redistribution and use in source and binary forms, with or without
88 * modification, are permitted provided that the following conditions
89 * are met:
90 * 1. Redistributions of source code must retain the copyright
91 * notice, this list of conditions and the following disclaimer.
92 * 2. Redistributions in binary form must reproduce the above copyright
93 * notice, this list of conditions and the following disclaimer in the
94 * documentation and/or other materials provided with the distribution.
95 * 3. All advertising materials mentioning features or use of this software
96 * must display the following acknowledgement:
97 * "This product includes cryptographic software written by
98 * Eric Young (eay@cryptsoft.com)"
99 * The word 'cryptographic' can be left out if the rouines from the library
100 * being used are not cryptographic related :-).
101 * 4. If you include any Windows specific code (or a derivative thereof) from
102 * the apps directory (application code) you must include an acknowledgement:
103 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
105 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
106 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
107 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
108 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
109 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
110 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
111 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
112 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
113 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
114 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
115 * SUCH DAMAGE.
117 * The licence and distribution terms for any publically available version or
118 * derivative of this code cannot be changed. i.e. this code cannot simply be
119 * copied and put under another distribution licence
120 * [including the GNU Public Licence.]