]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mk-globals-c.pl
Boilerplate: update copyright blurbs on src/
[thirdparty/squid.git] / src / mk-globals-c.pl
CommitLineData
bbc27441
AJ
1## Copyright (C) 1996-2014 The Squid Software Foundation and contributors
2##
3## Squid software is distributed under GPLv2+ license and includes
4## contributions from numerous individuals and organizations.
5## Please see the COPYING and CONTRIBUTORS files for details.
6##
7
f1dc9b30 8print "#include \"squid.h\"\n";
9while (<>) {
10 $init = undef;
fb9e5a5f 11 next if (/ SQUID_GLOBALS_H/);
f1dc9b30 12 if (/^#/) {
13 print;
14 next;
15 }
560866b3 16 if (/^.\*/) {
17 print;
18 next;
19 }
42c674fd 20 if (/extern \"C\"/) {
21 print;
22 next;
23 }
24 if (/^}/) {
25 print;
26 next;
27 }
28 if (/^{/) {
29 print;
30 next;
31 }
f1dc9b30 32 next unless (/./);
33 next if (/\[\];$/);
42c674fd 34#
35# Check exactly for lines beginning with " extern", generated
36# from astyle (grrrrr ...)
37#
38 die unless (/^ extern\s+([^;]+);(.*)$/);
f1dc9b30 39 $var = $1;
40 $comments = $2;
1dbe0b5f 41 if ($comments =~ m+/\*\s*(.*)\s*\*/+) {
f1dc9b30 42 $init = $1;
1dbe0b5f 43 $init =~ s/\s$// while ($init =~ /\s$/);
f1dc9b30 44 }
45 print $var;
46 print " = $init" if (defined $init);
47 print ";\n";
48}
49exit 0;