summaryrefslogtreecommitdiffstats
path: root/gen_todo.pl
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-04-03 18:27:23 +0000
committerGravatar Edward Rudd 2004-04-03 18:27:23 +0000
commitbf387bc750caf37fe2cbe45a901161861fc50b01 (patch)
tree85d2e54ac072eb4804ff97da1efc441767e05911 /gen_todo.pl
parentd14dcc25d77a556940bcbb6feb71f0b6e67c2674 (diff)
Added gen_todo.pl to extract TODO items from source code.
Diffstat (limited to 'gen_todo.pl')
-rwxr-xr-xgen_todo.pl41
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
17use strict;
18
19opendir(MYDIR, ".") or die "Unable to open directory";
20print "Building TODO file for source directory\n";
21
22open ( TODOFILE, "TODO.in");
23my $todo_header = do { local $/; <TODOFILE> };
24close (TODOFILE);
25open (TODOFILE, "> TODO");
26print TODOFILE $todo_header;
27print "Parsing...";
28while (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}
40print "\n";
41closedir(MYDIR);