Lines Matching +full:sub +full:- +full:spaces

2 # SPDX-License-Identifier: GPL-2.0
43 "enable-lineno" => \$enable_lineno,
44 "rst-source!" => \$description_is_rst,
47 "show-hints" => \$hint,
48 "search-string=s" => \$search_string,
53 pod2usage(-exitstatus => 0, -noperldoc, -verbose => 2) if $man;
70 sub parse_error($$$$) {
89 sub parse_abi {
104 $data{$nametag}->{what} = "File $name";
105 $data{$nametag}->{type} = "File";
106 $data{$nametag}->{file} = $name;
107 $data{$nametag}->{filepath} = $file;
108 $data{$nametag}->{is_file} = 1;
109 $data{$nametag}->{line_no} = 1;
152 push @{$symbols{$content}->{file}}, " $file:" . ($ln - 1);
158 …parse_error($file, $ln, "What '$what' doesn't have a description", "") if (!$data{$what}->{descrip…
161 $symbols{$w}->{xref} = $what;
172 push @{$data{$nametag}->{symbols}}, $content if ($data{$nametag}->{what});
180 @{$data{$what}->{label_list}} = @labels if ($data{$nametag}->{what});
185 $data{$what}->{type} = $type;
186 if (!defined($data{$what}->{file})) {
187 $data{$what}->{file} = $name;
188 $data{$what}->{filepath} = $file;
190 $data{$what}->{description} .= "\n\n" if (defined($data{$what}->{description}));
191 if ($name ne $data{$what}->{file}) {
192 $data{$what}->{file} .= " " . $name;
193 $data{$what}->{filepath} .= " " . $file;
197 $data{$what}->{line_no} = $ln;
199 $data{$what}->{line_no} = $ln if (!defined($data{$what}->{line_no}));
209 while ($content =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}
211 # Preserve initial spaces for the first line
214 $data{$what}->{$tag} .= $content;
220 $data{$what}->{$tag} = $content;
227 if (!$tag && $data{$nametag}->{what}) {
228 $data{$nametag}->{description} .= $_;
234 while ($content =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}
236 $data{$what}->{$tag} .= "\n";
241 # Preserve initial spaces for the first line
249 $data{$what}->{$tag} .= $content;
254 $data{$what}->{$tag} .= "\n$1";
255 $data{$what}->{$tag} =~ s/\n+$//;
262 $data{$nametag}->{description} =~ s/^\n+// if ($data{$nametag}->{description});
264 …parse_error($file, $ln, "What '$what' doesn't have a description", "") if (!$data{$what}->{descrip…
267 $symbols{$w}->{xref} = $what;
273 sub create_labels {
277 next if ($data{$what}->{file} eq "File");
279 foreach my $p (@{$data{$what}->{label_list}}) {
282 $label =~ tr/A-Z/a-z/;
285 $label =~s/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xff])/_/g;
296 $data{$what}->{label} = $label;
309 # Boundaries are punct characters, spaces and end-of-line
313 my $symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x2f\x3a-\x40\x7b-\xff]) }x;
315 sub output_rest {
321 ($data{$a}->{type} eq "File") cmp ($data{$b}->{type} eq "File") ||
324 my $type = $data{$what}->{type};
326 my @file = split / /, $data{$what}->{file};
327 my @filepath = split / /, $data{$what}->{filepath};
332 $data{$what}->{line_no};
340 if ($what =~ m#^(\/?(?:[\w\-]+\/?){1,2})#) {
349 $bar =~ s/./-/g;
353 printf ".. _%s:\n\n", $data{$what}->{label};
364 print "+-" . "-" x $len . "-+\n";
366 printf "| %s", $name . " " x ($len - length($name)) . " |\n";
367 print "+-" . "-" x $len . "-+\n";
378 $path =~ s,[/\-],_,g;;
390 $bar =~ s/./-/g;
395 $desc = $data{$what}->{description} if (defined($data{$what}->{description}));
404 $desc =~ s/\n[\-\*\=\^\~]+\n/\n\n/g;
406 # Enrich text by creating cross-references
409 my $init_indent = -1;
410 my $literal_indent = -1;
415 my $spaces = length($indent);
418 if ($spaces > $literal_indent) {
422 $literal_indent = -1;
426 $literal_indent = $spaces;
432 my @matches = $d =~ m,Documentation/ABI/([\w\/\-]+),g;
437 $path =~ s,[/\-],_,g;;
447 if (defined($data{$s}) && defined($data{$s}->{label})) {
451 $xref = ":ref:`$xref <" . $data{$s}->{label} . ">`";
466 $desc =~ s/\n[\-\*\=\^\~]+\n/\n\n/g;
468 if ($desc =~ m/\:\n/ || $desc =~ m/\n[\t ]+/ || $desc =~ m/[\x00-\x08\x0b-\x1f\x7b-\xff]/) {
476 $desc =~s/([\x00-\x08\x0b-\x1f\x21-\x2a\x2d\x2f\x3c-\x40\x5c\x5e-\x60\x7b-\xff])/\\$1/g;
481 print "DESCRIPTION MISSING for $what\n\n" if (!$data{$what}->{is_file});
484 if ($data{$what}->{symbols}) {
487 foreach my $content(@{$data{$what}->{symbols}}) {
488 my $label = $data{$symbols{$content}->{xref}}->{label};
491 $content =~s/([\x00-\x1f\x21-\x2f\x3a-\x40\x7b-\xff])/\\$1/g;
493 print "- :ref:`$content <$label>`\n\n";
497 if (defined($data{$what}->{users})) {
498 my $users = $data{$what}->{users};
510 sub search_symbols {
514 my $type = $data{$what}->{type};
517 my $file = $data{$what}->{filepath};
521 $bar =~ s/./-/g;
525 my $kernelversion = $data{$what}->{kernelversion} if (defined($data{$what}->{kernelversion}));
526 my $contact = $data{$what}->{contact} if (defined($data{$what}->{contact}));
527 my $users = $data{$what}->{users} if (defined($data{$what}->{users}));
528 my $date = $data{$what}->{date} if (defined($data{$what}->{date}));
529 my $desc = $data{$what}->{description} if (defined($data{$what}->{description}));
550 sub dont_parse_special_attributes {
567 sub graph_add_file {
593 sub graph_add_link {
621 printf STDERR "Error: Couldn't find a non-empty name on a children of $file/.*: ";
638 my $escape_symbols = qr { ([\x01-\x08\x0e-\x1f\x21-\x29\x2b-\x2d\x3a-\x40\x7b-\xfe]) }x;
639 sub parse_existing_sysfs {
661 # Documentation/admin-guide/kernel-parameters.txt, but this
680 sub get_leave($)
709 sub check_file($$)
722 my @expr = @{$leaf{$leave}->{expr}};
736 print STDERR "--> $names[$i]\n";
750 my @expr = @{$leaf{"others"}->{expr}};
764 my $what = $leaf{$leave}->{what};
774 sub check_undefined_symbols {
790 $is_console = 1 if (-t STDERR);
803 my $tm = $cur_time - $start_time;
804 my $time = sprintf "%d:%02d", int($tm), 60 * ($tm - int($tm));
809 STDERR->flush();
817 my $tm = $cur_time - $start_time;
818 my $time = sprintf "%d:%02d", int($tm), 60 * ($tm - int($tm));
828 sub undefined_symbols {
837 $leaf{"others"}->{what} = "";
849 # Temporarily change [0-9]+ type of patterns
850 $what =~ s/\[0\-9\]\+/\xff/g;
852 # Temporarily change [\d+-\d+] type of patterns
853 $what =~ s/\[0\-\d+\]/\xff/g;
856 # Temporarily change [0-9] type of patterns
857 $what =~ s/\[(\d)\-(\d)\]/\xf4$1-$2\xf5/g;
871 # Recover [0-9] type of patterns
875 # Remove duplicated spaces
890 $what =~ s/(\d+)\\(-\d+)/$1$2/g;
909 next if ($leaf{$l}->{what} =~ m/\b$what\b/);
910 $leaf{$l}->{what} .= "\xac" . $what;
913 $leaf{$l}->{what} = $what;
926 foreach my $w(sort split /\xac/, $leaf{$l}->{what}) {
929 $leaf{$l}->{expr} = \@expr;
944 # with --enable-lineno
955 print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug & $dbg_dump_abi_structs);
971 my @files = @{$symbols{$what}->{file}};
984 get_abi.pl - parse the Linux ABI files and produce a ReST book.
988 B<get_abi.pl> [--debug <level>] [--enable-lineno] [--man] [--help]
989 [--(no-)rst-source] [--dir=<dir>] [--show-hints]
990 [--search-string <regex>]
997 B<search> I<SEARCH_REGEX> - search for I<SEARCH_REGEX> inside ABI
999 B<rest> - output the ABI in ReST markup language
1001 B<validate> - validate the ABI contents
1003 B<undefined> - existing symbols at the system that aren't
1012 =item B<--dir>
1017 =item B<--rst-source> and B<--no-rst-source>
1020 selecting between a rst-compliant source ABI (B<--rst-source>), or a
1022 logic (B<--no-rst-source>).
1024 =item B<--enable-lineno>
1028 =item B<--debug> I<debug level>
1033 - 1: Debug parsing What entries from ABI files;
1034 - 2: Shows what files are opened from ABI files;
1035 - 4: Dump the structs used to store the contents of the ABI files.
1037 =item B<--show-hints>
1042 =item B<--search-string> I<regex string>
1047 =item B<--help>
1051 =item B<--man>
1069 $ scripts/get_abi.pl search usb --dir Documentation/ABI/stable
1085 $ scripts/get_abi.pl rest --dir Documentation/ABI/obsolete
1095 Copyright (c) 2016-2021 by Mauro Carvalho Chehab <mchehab+huawei@kernel.org>.