]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mk-globals-c.pl
Prep for 3.3.12 and 3.4.4
[thirdparty/squid.git] / src / mk-globals-c.pl
1 print "#include \"squid.h\"\n";
2 while (<>) {
3 $init = undef;
4 next if (/ SQUID_GLOBALS_H/);
5 if (/^#/) {
6 print;
7 next;
8 }
9 if (/^.\*/) {
10 print;
11 next;
12 }
13 if (/extern \"C\"/) {
14 print;
15 next;
16 }
17 if (/^}/) {
18 print;
19 next;
20 }
21 if (/^{/) {
22 print;
23 next;
24 }
25 next unless (/./);
26 next if (/\[\];$/);
27 #
28 # Check exactly for lines beginning with " extern", generated
29 # from astyle (grrrrr ...)
30 #
31 die unless (/^ extern\s+([^;]+);(.*)$/);
32 $var = $1;
33 $comments = $2;
34 if ($comments =~ m+/\*\s*(.*)\s*\*/+) {
35 $init = $1;
36 $init =~ s/\s$// while ($init =~ /\s$/);
37 }
38 print $var;
39 print " = $init" if (defined $init);
40 print ";\n";
41 }
42 exit 0;