File: redefine_need.init

package info (click to toggle)
texi2html 1.82-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 47,744 kB
  • ctags: 24,597
  • sloc: perl: 15,888; xml: 6,075; sh: 3,977; makefile: 553
file content (33 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

$misc_command{'need'}->{'keep'} = 1;
$misc_command{'evenheading'}->{'keep'} = 1;

$unknown = \&t2h_redefine_need_unknown;

sub t2h_redefine_need_unknown($$$)
{
   my $command = shift;
   my $line = shift;
   my $pass = shift;

   my ($result_line, $result, $result_text, $message);

   if ($command eq 'need' and $pass == 2)
   {
       my $arg = '';
       if (($line =~ s/^\s+([0-9]+(\.[0-9]*)?)//) or ($line =~ s/\s+(\.[0-9]+)//))
       {
           $arg = $1;
           $line =~ s/^\s+//; 
           $message = "$command has the right arg: $arg\n";
       }
       else
       {
           $message = "Bad arg for $command\n";
       }
       $result_text = &$comment("$command: $arg");
       return ($line, 1, $result_text, $message);
   } 

   return ($line, 0, undef, undef);
}