diff options
Diffstat (limited to 'gen_todo.pl')
-rwxr-xr-x | gen_todo.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gen_todo.pl b/gen_todo.pl new file mode 100755 index 0000000..d90d2b2 --- /dev/null +++ b/gen_todo.pl | |||
@@ -0,0 +1,41 @@ | |||
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 | |||
19 | opendir(MYDIR, ".") or die "Unable to open directory"; | ||
20 | print "Building TODO file for source directory\n"; | ||
21 | |||
22 | open ( TODOFILE, "TODO.in"); | ||
23 | my $todo_header = do { local $/; <TODOFILE> }; | ||
24 | close (TODOFILE); | ||
25 | open (TODOFILE, "> TODO"); | ||
26 | print TODOFILE $todo_header; | ||
27 | print "Parsing..."; | ||
28 | while (my $entry = readdir(MYDIR)) { | ||
29 | next if (!($entry =~ /\.[ch]$/)); | ||
30 | print "$entry..."; | ||
31 | open(DAFILE, $entry) or die "Unable to open file"; | ||
32 | my $linenumber = 0; | ||
33 | while (my $line = <DAFILE>) { | ||
34 | $linenumber ++; | ||
35 | next if (!($line =~ /\/\* TODO: (.*)\*\//)); | ||
36 | print TODOFILE $entry.":".$linenumber.": ".$1."\n"; | ||
37 | } | ||
38 | close(DAFILE); | ||
39 | } | ||
40 | print "\n"; | ||
41 | closedir(MYDIR); | ||