diff options
Diffstat (limited to 'gen_todo.pl')
-rwxr-xr-x | gen_todo.pl | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/gen_todo.pl b/gen_todo.pl deleted file mode 100755 index 20b0894..0000000 --- a/gen_todo.pl +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # Copyright 2003-2004 Edward Rudd | ||
4 | # | ||
5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | # you may not use this file except in compliance with the License. | ||
7 | # You may obtain a copy of the License at | ||
8 | # | ||
9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | # | ||
11 | # Unless required by applicable law or agreed to in writing, software | ||
12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | # See the License for the specific language governing permissions and | ||
15 | # limitations under the License. | ||
16 | |||
17 | use strict; | ||
18 | my $rootdir = "."; | ||
19 | opendir(MYDIR, $rootdir) or die "Unable to open directory"; | ||
20 | print "Building TODO file for source directory\n"; | ||
21 | my $todo_header = "* Things TODO *\n\n"; | ||
22 | if (open ( TODOFILE, "TODO.in")) { | ||
23 | $todo_header = do { local $/; <TODOFILE> }; | ||
24 | close (TODOFILE); | ||
25 | } | ||
26 | open (TODOFILE, "> TODO"); | ||
27 | print TODOFILE $todo_header; | ||
28 | print "Parsing..."; | ||
29 | while (my $entry = readdir(MYDIR)) { | ||
30 | next if (!($entry =~ /\.[ch]$/)); | ||
31 | print "$entry..."; | ||
32 | open(DAFILE, $rootdir.'/'.$entry) or die "Unable to open file\n"; | ||
33 | my $linenumber = 0; | ||
34 | my $status = 0; # 0=no comment 1=comment 2=in todo block | ||
35 | while (my $line = <DAFILE>) { | ||
36 | $linenumber++; | ||
37 | if ($status==0) { | ||
38 | if ( ($line =~ /\/\/\s+TODO: (.*)/) || ($line =~ /\/\*\s+TODO: (.*)\s*\*\//) ){ | ||
39 | print TODOFILE $entry.":".$linenumber.": ".$1."\n"; | ||
40 | } else { | ||
41 | if ($line =~ /\/\*\*/) { | ||
42 | $status = 1; | ||
43 | } | ||
44 | } | ||
45 | } else { | ||
46 | if ($line =~ /\*\//) { | ||
47 | $status = 0; | ||
48 | } else { | ||
49 | if ($status==1) { | ||
50 | if ($line =~ /TODO:/) { | ||
51 | $status=2; | ||
52 | } | ||
53 | } else { | ||
54 | if ($line =~ /\* \s+-?\s*(.*)/) { | ||
55 | print TODOFILE $entry.":".$linenumber.": ".$1."\n"; | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | close(DAFILE); | ||
62 | } | ||
63 | print "\n"; | ||
64 | closedir(MYDIR); | ||