Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use strict; |
| 4 | use Pod::Usage; |
| 5 | use Getopt::Long; |
| 6 | use File::Find; |
| 7 | use Fcntl ':mode'; |
| 8 | |
| 9 | my $help; |
| 10 | my $man; |
| 11 | my $debug; |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 12 | my $prefix="Documentation/ABI"; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 13 | |
| 14 | GetOptions( |
| 15 | "debug|d+" => \$debug, |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 16 | "dir=s" => \$prefix, |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 17 | 'help|?' => \$help, |
| 18 | man => \$man |
| 19 | ) or pod2usage(2); |
| 20 | |
| 21 | pod2usage(1) if $help; |
| 22 | pod2usage(-exitstatus => 0, -verbose => 2) if $man; |
| 23 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 24 | pod2usage(2) if (scalar @ARGV < 1 || @ARGV > 2); |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 25 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 26 | my ($cmd, $arg) = @ARGV; |
| 27 | |
| 28 | pod2usage(2) if ($cmd ne "search" && $cmd ne "rest"); |
| 29 | pod2usage(2) if ($cmd eq "search" && !$arg); |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 30 | |
| 31 | require Data::Dumper if ($debug); |
| 32 | |
| 33 | my %data; |
| 34 | |
| 35 | # |
| 36 | # Displays an error message, printing file name and line |
| 37 | # |
| 38 | sub parse_error($$$$) { |
| 39 | my ($file, $ln, $msg, $data) = @_; |
| 40 | |
| 41 | print STDERR "file $file#$ln: $msg at\n\t$data"; |
| 42 | } |
| 43 | |
| 44 | # |
| 45 | # Parse an ABI file, storing its contents at %data |
| 46 | # |
| 47 | sub parse_abi { |
| 48 | my $file = $File::Find::name; |
| 49 | |
| 50 | my $mode = (stat($file))[2]; |
| 51 | return if ($mode & S_IFDIR); |
| 52 | return if ($file =~ m,/README,); |
| 53 | |
| 54 | my $name = $file; |
| 55 | $name =~ s,.*/,,; |
| 56 | |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 57 | my $nametag = "File $name"; |
| 58 | $data{$nametag}->{what} = "File $name"; |
| 59 | $data{$nametag}->{type} = "File"; |
| 60 | $data{$nametag}->{file} = $name; |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 61 | $data{$nametag}->{filepath} = $file; |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 62 | $data{$nametag}->{is_file} = 1; |
| 63 | |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 64 | my $type = $file; |
| 65 | $type =~ s,.*/(.*)/.*,$1,; |
| 66 | |
| 67 | my $what; |
| 68 | my $new_what; |
| 69 | my $tag; |
| 70 | my $ln; |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 71 | my $xrefs; |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 72 | my $space; |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 73 | my @labels; |
| 74 | my $label; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 75 | |
| 76 | print STDERR "Opening $file\n" if ($debug > 1); |
| 77 | open IN, $file; |
| 78 | while(<IN>) { |
| 79 | $ln++; |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 80 | if (m/^(\S+)(:\s*)(.*)/i) { |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 81 | my $new_tag = lc($1); |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 82 | my $sep = $2; |
| 83 | my $content = $3; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 84 | |
| 85 | if (!($new_tag =~ m/(what|date|kernelversion|contact|description|users)/)) { |
| 86 | if ($tag eq "description") { |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 87 | # New "tag" is actually part of |
| 88 | # description. Don't consider it a tag |
| 89 | $new_tag = ""; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 90 | } else { |
| 91 | parse_error($file, $ln, "tag '$tag' is invalid", $_); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | if ($new_tag =~ m/what/) { |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 96 | $space = ""; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 97 | if ($tag =~ m/what/) { |
| 98 | $what .= ", " . $content; |
| 99 | } else { |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 100 | parse_error($file, $ln, "What '$what' doesn't have a description", "") if ($what && !$data{$what}->{description}); |
| 101 | |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 102 | $what = $content; |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 103 | $label = $content; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 104 | $new_what = 1; |
| 105 | } |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 106 | push @labels, [($content, $label)]; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 107 | $tag = $new_tag; |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 108 | |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 109 | push @{$data{$nametag}->{xrefs}}, [($content, $label)] if ($data{$nametag}->{what}); |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 110 | next; |
| 111 | } |
| 112 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 113 | if ($new_tag) { |
| 114 | $tag = $new_tag; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 115 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 116 | if ($new_what) { |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 117 | @{$data{$what}->{label}} = @labels if ($data{$nametag}->{what}); |
| 118 | @labels = (); |
| 119 | $label = ""; |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 120 | $new_what = 0; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 121 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 122 | $data{$what}->{type} = $type; |
| 123 | $data{$what}->{file} = $name; |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 124 | $data{$what}->{filepath} = $file; |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 125 | print STDERR "\twhat: $what\n" if ($debug > 1); |
| 126 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 127 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 128 | if (!$what) { |
| 129 | parse_error($file, $ln, "'What:' should come first:", $_); |
| 130 | next; |
| 131 | } |
| 132 | if ($tag eq "description") { |
| 133 | next if ($content =~ m/^\s*$/); |
| 134 | if ($content =~ m/^(\s*)(.*)/) { |
| 135 | my $new_content = $2; |
| 136 | $space = $new_tag . $sep . $1; |
| 137 | while ($space =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {} |
| 138 | $space =~ s/./ /g; |
| 139 | $data{$what}->{$tag} .= "$new_content\n"; |
| 140 | } |
| 141 | } else { |
| 142 | $data{$what}->{$tag} = $content; |
| 143 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 144 | next; |
| 145 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 146 | } |
| 147 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 148 | # Store any contents before tags at the database |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 149 | if (!$tag && $data{$nametag}->{what}) { |
| 150 | $data{$nametag}->{description} .= $_; |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 151 | next; |
| 152 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 153 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 154 | if ($tag eq "description") { |
| 155 | if (!$data{$what}->{description}) { |
| 156 | next if (m/^\s*\n/); |
| 157 | if (m/^(\s*)(.*)/) { |
| 158 | $space = $1; |
| 159 | while ($space =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {} |
| 160 | $data{$what}->{$tag} .= "$2\n"; |
| 161 | } |
| 162 | } else { |
| 163 | my $content = $_; |
| 164 | if (m/^\s*\n/) { |
| 165 | $data{$what}->{$tag} .= $content; |
| 166 | next; |
| 167 | } |
| 168 | |
| 169 | while ($content =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {} |
| 170 | $space = "" if (!($content =~ s/^($space)//)); |
| 171 | |
| 172 | # Compress spaces with tabs |
| 173 | $content =~ s<^ {8}> <\t>; |
| 174 | $content =~ s<^ {1,7}\t> <\t>; |
| 175 | $content =~ s< {1,7}\t> <\t>; |
| 176 | $data{$what}->{$tag} .= $content; |
| 177 | } |
| 178 | next; |
| 179 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 180 | if (m/^\s*(.*)/) { |
| 181 | $data{$what}->{$tag} .= "\n$1"; |
| 182 | $data{$what}->{$tag} =~ s/\n+$//; |
| 183 | next; |
| 184 | } |
| 185 | |
| 186 | # Everything else is error |
| 187 | parse_error($file, $ln, "Unexpected line:", $_); |
| 188 | } |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 189 | $data{$nametag}->{description} =~ s/^\n+//; |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 190 | close IN; |
| 191 | } |
| 192 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 193 | # |
| 194 | # Outputs the book on ReST format |
| 195 | # |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 196 | sub output_rest { |
| 197 | foreach my $what (sort keys %data) { |
| 198 | my $type = $data{$what}->{type}; |
| 199 | my $file = $data{$what}->{file}; |
| 200 | |
| 201 | my $w = $what; |
| 202 | $w =~ s/([\(\)\_\-\*\=\^\~\\])/\\$1/g; |
| 203 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 204 | my $bar = $w; |
| 205 | $bar =~ s/./-/g; |
| 206 | |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 207 | foreach my $p (@{$data{$what}->{label}}) { |
| 208 | my ($content, $label) = @{$p}; |
| 209 | $label = "abi_" . $label . " "; |
| 210 | $label =~ tr/A-Z/a-z/; |
| 211 | |
| 212 | # Convert special chars to "_" |
| 213 | $label =~s/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xff])/_/g; |
| 214 | $label =~ s,_+,_,g; |
| 215 | $label =~ s,_$,,; |
| 216 | |
| 217 | $data{$what}->{label} .= $label; |
| 218 | |
| 219 | printf ".. _%s:\n\n", $label; |
| 220 | |
| 221 | # only one label is enough |
| 222 | last; |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 223 | } |
| 224 | |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 225 | print "$w\n$bar\n\n"; |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 226 | |
| 227 | print "- defined on file $file (type: $type)\n\n" if ($type ne "File"); |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 228 | |
| 229 | my $desc = $data{$what}->{description}; |
| 230 | $desc =~ s/^\s+//; |
| 231 | |
| 232 | # Remove title markups from the description, as they won't work |
| 233 | $desc =~ s/\n[\-\*\=\^\~]+\n/\n/g; |
| 234 | |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 235 | if (!($desc =~ /^\s*$/)) { |
Mauro Carvalho Chehab | 4e6a623 | 2019-06-20 14:22:57 -0300 | [diff] [blame] | 236 | if ($desc =~ m/\:\n/ || $desc =~ m/\n[\t ]+/ || $desc =~ m/[\x00-\x08\x0b-\x1f\x7b-\xff]/) { |
| 237 | # put everything inside a code block |
| 238 | $desc =~ s/\n/\n /g; |
| 239 | |
| 240 | print "::\n\n"; |
| 241 | print " $desc\n\n"; |
| 242 | } else { |
| 243 | # Escape any special chars from description |
| 244 | $desc =~s/([\x00-\x08\x0b-\x1f\x21-\x2a\x2d\x2f\x3c-\x40\x5c\x5e-\x60\x7b-\xff])/\\$1/g; |
| 245 | |
| 246 | print "$desc\n\n"; |
| 247 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 248 | } else { |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 249 | print "DESCRIPTION MISSING for $what\n\n" if (!$data{$what}->{is_file}); |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 250 | } |
Mauro Carvalho Chehab | 6619c66 | 2019-06-20 14:22:56 -0300 | [diff] [blame] | 251 | |
Mauro Carvalho Chehab | d0ebaf5 | 2019-06-20 14:22:58 -0300 | [diff] [blame] | 252 | if ($data{$what}->{xrefs}) { |
| 253 | printf "Has the following ABI:\n\n"; |
| 254 | |
| 255 | foreach my $p(@{$data{$what}->{xrefs}}) { |
| 256 | my ($content, $label) = @{$p}; |
| 257 | $label = "abi_" . $label . " "; |
| 258 | $label =~ tr/A-Z/a-z/; |
| 259 | |
| 260 | # Convert special chars to "_" |
| 261 | $label =~s/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xff])/_/g; |
| 262 | $label =~ s,_+,_,g; |
| 263 | $label =~ s,_$,,; |
| 264 | |
| 265 | # Escape special chars from content |
| 266 | $content =~s/([\x00-\x1f\x21-\x2f\x3a-\x40\x7b-\xff])/\\$1/g; |
| 267 | |
| 268 | print "- :ref:`$content <$label>`\n\n"; |
| 269 | } |
| 270 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 271 | } |
| 272 | } |
| 273 | |
| 274 | # |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 275 | # Searches for ABI symbols |
| 276 | # |
| 277 | sub search_symbols { |
| 278 | foreach my $what (sort keys %data) { |
| 279 | next if (!($what =~ m/($arg)/)); |
| 280 | |
| 281 | my $type = $data{$what}->{type}; |
| 282 | next if ($type eq "File"); |
| 283 | |
| 284 | my $file = $data{$what}->{filepath}; |
| 285 | |
| 286 | my $bar = $what; |
| 287 | $bar =~ s/./-/g; |
| 288 | |
| 289 | print "\n$what\n$bar\n\n"; |
| 290 | |
| 291 | my $kernelversion = $data{$what}->{kernelversion}; |
| 292 | my $contact = $data{$what}->{contact}; |
| 293 | my $users = $data{$what}->{users}; |
| 294 | my $date = $data{$what}->{date}; |
| 295 | my $desc = $data{$what}->{description}; |
| 296 | $kernelversion =~ s/^\s+//; |
| 297 | $contact =~ s/^\s+//; |
| 298 | $users =~ s/^\s+//; |
| 299 | $users =~ s/\n//g; |
| 300 | $date =~ s/^\s+//; |
| 301 | $desc =~ s/^\s+//; |
| 302 | |
| 303 | printf "Kernel version:\t\t%s\n", $kernelversion if ($kernelversion); |
| 304 | printf "Date:\t\t\t%s\n", $date if ($date); |
| 305 | printf "Contact:\t\t%s\n", $contact if ($contact); |
| 306 | printf "Users:\t\t\t%s\n", $users if ($users); |
| 307 | print "Defined on file:\t$file\n\n"; |
| 308 | print "Description:\n\n$desc"; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | |
| 313 | # |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 314 | # Parses all ABI files located at $prefix dir |
| 315 | # |
| 316 | find({wanted =>\&parse_abi, no_chdir => 1}, $prefix); |
| 317 | |
| 318 | print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug); |
| 319 | |
| 320 | # |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 321 | # Handles the command |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 322 | # |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 323 | if ($cmd eq "rest") { |
| 324 | output_rest; |
| 325 | } else { |
| 326 | search_symbols; |
| 327 | } |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 328 | |
| 329 | |
| 330 | __END__ |
| 331 | |
| 332 | =head1 NAME |
| 333 | |
| 334 | abi_book.pl - parse the Linux ABI files and produce a ReST book. |
| 335 | |
| 336 | =head1 SYNOPSIS |
| 337 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 338 | B<abi_book.pl> [--debug] <COMAND> [<ARGUMENT>] |
| 339 | |
| 340 | Where <COMMAND> can be: |
| 341 | |
| 342 | =over 8 |
| 343 | |
| 344 | B<search> [SEARCH_REGEX] - search for [SEARCH_REGEX] inside ABI |
| 345 | |
| 346 | B<rest> - output the ABI in ReST markup language |
| 347 | |
| 348 | =back |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 349 | |
| 350 | =head1 OPTIONS |
| 351 | |
| 352 | =over 8 |
| 353 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 354 | =item B<--dir> |
| 355 | |
| 356 | Changes the location of the ABI search. By default, it uses |
| 357 | the Documentation/ABI directory. |
| 358 | |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 359 | =item B<--debug> |
| 360 | |
| 361 | Put the script in verbose mode, useful for debugging. Can be called multiple |
| 362 | times, to increase verbosity. |
| 363 | |
| 364 | =item B<--help> |
| 365 | |
| 366 | Prints a brief help message and exits. |
| 367 | |
| 368 | =item B<--man> |
| 369 | |
| 370 | Prints the manual page and exits. |
| 371 | |
| 372 | =back |
| 373 | |
| 374 | =head1 DESCRIPTION |
| 375 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 376 | Parse the Linux ABI files from ABI DIR (usually located at Documentation/ABI), |
| 377 | allowing to search for ABI symbols or to produce a ReST book containing |
| 378 | the Linux ABI documentation. |
| 379 | |
| 380 | =head1 EXAMPLES |
| 381 | |
| 382 | Search for all stable symbols with the word "usb": |
| 383 | |
| 384 | =over 8 |
| 385 | |
| 386 | $ scripts/get_abi.pl search usb --dir Documentation/ABI/stable |
| 387 | |
| 388 | =back |
| 389 | |
| 390 | Search for all symbols that match the regex expression "usb.*cap": |
| 391 | |
| 392 | =over 8 |
| 393 | |
| 394 | $ scripts/get_abi.pl search usb.*cap |
| 395 | |
| 396 | =back |
| 397 | |
| 398 | Output all obsoleted symbols in ReST format |
| 399 | |
| 400 | =over 8 |
| 401 | |
| 402 | $ scripts/get_abi.pl rest --dir Documentation/ABI/obsolete |
| 403 | |
| 404 | =back |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 405 | |
| 406 | =head1 BUGS |
| 407 | |
| 408 | Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com> |
| 409 | |
| 410 | =head1 COPYRIGHT |
| 411 | |
Mauro Carvalho Chehab | 33e3e99 | 2019-06-20 14:22:59 -0300 | [diff] [blame^] | 412 | Copyright (c) 2016-2017 by Mauro Carvalho Chehab <mchehab@s-opensource.com>. |
Mauro Carvalho Chehab | bbc249f | 2019-06-20 14:22:55 -0300 | [diff] [blame] | 413 | |
| 414 | License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. |
| 415 | |
| 416 | This is free software: you are free to change and redistribute it. |
| 417 | There is NO WARRANTY, to the extent permitted by law. |
| 418 | |
| 419 | =cut |