]>
git.ipfire.org Git - thirdparty/openssl.git/blob - util/su-filter.pl
18 $incomm++ while $tststr =~ /\/\
*/g
;
19 $incomm-- while $tststr =~ /\*\//g
;
26 } elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) {
29 $arrcnt++ while $tststr =~ /\[/g;
38 } elsif($in_su == 2) {
44 my @strucdata = structureData
($data);
45 $out .= displayData
($indent, 0, \
@strucdata);
46 $out .= "\n$indent};\n";
50 } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) {
63 my @datalist = split(/(\{|\}|,|"|#|\n|\/\
*|\
*\
/|\(|\))/, $data);
75 foreach $item (@datalist) {
80 push @struclist, $dataitem;
97 push @struclist, $dataitem;
109 $substruc = structureData
($dataitem);
110 $dataitem = $substruc;
113 } elsif($item eq "{") {
115 } elsif ($item eq "\"") {
133 push @struclist, $dataitem;
139 push @struclist, $dataitem;
153 push @struclist, $dataitem;
162 if($item =~ /^\s*$/) {
165 if(ref $dataitem eq 'ARRAY') {
166 push @struclist, $dataitem;
171 push @struclist, $dataitem;
186 foreach $item (@
{$data}) {
187 if($item =~ /^\/\
*/) {
189 $item =~ s/\n/\n$indent/g;
190 if($out =~ /\n\s*$/s) {
191 $out .= $item."\n".$indent;
193 $out .= "\n".$indent.$item."\n".$indent;
201 #Pre-processor directive
202 if($out =~ /\n\s*$/s) {
203 $out =~ s/\n\s*$/\n/;
204 $out .= $item."\n".$indent;
206 $out .= "\n".$item."\n".$indent;
219 if(!$prevpreproc && !$prevcomment) {
228 $currline .= $indent;
236 if (ref $item eq 'ARRAY') {
238 $out .= displayData
("$indent ", $depth+1, $item);
240 $out .= "{\n".displayData
("$indent ", $depth+1, $item)."\n".$indent."}";
241 $currline = $indent."}";
244 if(length $currline.$item > 79) {
257 # Strip any trailing whitespace
258 $out =~ s/\s+\n/\n/g;