Re: gtk-doc vs doxygen



On Thu, 2002-12-05 at 23:11, Matthias Clasen wrote:

> Well, after glancing at the doxygen manual, it seems that doxygen
> supports far too many variations of doc comments for this to be a
> reasonable fix. Among other things, doxygen also supports javadoc-style
> comments starting with /** on a line by itself. I guess a more pragmatic
> approach would be an option to exclude subdirectories from scanning.
> Then I would simply add --exclude-dir=trio to MKDB_OPTIONS in glib and
> be done.

Here is a patch to add an --ignore-files option to gtkdoc-mkdb
(blatantly copied from gtkdoc-scan --ignore-headers). Ok to commit ?

Matthias
Index: gtkdoc-mkdb.in
===================================================================
RCS file: /cvs/gnome/gtk-doc/gtkdoc-mkdb.in,v
retrieving revision 1.68
diff -u -b -B -p -r1.68 gtkdoc-mkdb.in
--- gtkdoc-mkdb.in	8 Dec 2002 22:50:24 -0000	1.68
+++ gtkdoc-mkdb.in	11 Dec 2002 21:31:30 -0000
@@ -42,6 +42,7 @@ my $MODULE;
 my $TMPL_DIR;
 my $SGML_OUTPUT_DIR;
 my @SOURCE_DIRS;
+my $IGNORE_FILES = "";
 my $PRINT_VERSION;
 my $PRINT_HELP;
 my $OUTPUT_ALL_SYMBOLS;
@@ -51,6 +52,7 @@ my $OUTPUT_FORMAT;
 
 my %optctl = (module => \$MODULE,
 	      'source-dir' => \ SOURCE_DIRS,
+	      'ignore-files' => \$IGNORE_FILES,
 	      'output-dir' => \$SGML_OUTPUT_DIR,
 	      'tmpl-dir' => \$TMPL_DIR,
 	      'version' => \$PRINT_VERSION,
@@ -59,7 +61,7 @@ my %optctl = (module => \$MODULE,
 	      'outputallsymbols' => \$OUTPUT_ALL_SYMBOLS,
 	      'sgml-mode' => \$SGML_MODE,
 	      'output-format' => \$OUTPUT_FORMAT);
-GetOptions(\%optctl, "module=s", "source-dir:s", "output-dir:s", "version", "outputallsymbols", "main-sgml-file:s", "help", "sgml-mode", "output-format:s");
+GetOptions(\%optctl, "module=s", "source-dir:s", "ignore-files:s", "output-dir:s", "version", "outputallsymbols", "main-sgml-file:s", "help", "sgml-mode", "output-format:s");
 
 if ($PRINT_VERSION) {
     print "@VERSION \n";
@@ -74,6 +76,7 @@ if ($PRINT_HELP) {
     print "gtkdoc-mkdb version @VERSION \n";
     print "\n--module=MODULE_NAME   Name of the doc module being parsed";
     print "\n--source-dir=DIRNAME   Directories which contain inline reference material";
+    print "\n--ignore-files=FILES   Files or directories which should not be scanned";
     print "\n                       May be used more than once for multiple directories";
     print "\n--output-dir=DIRNAME   Directory to put the generated Docbook files in";
     print "\n--tmpl-dir=DIRNAME     DIRECTORY in which template files may be found";
@@ -1905,6 +1908,7 @@ sub ReadSourceDocumentation {
     # Now recursively scan the subdirectories.
     my $dir;
     foreach $dir (@subdirs) {
+	next if ($IGNORE_FILES =~ m/(\s|^)\Q${dir}\E(\s|$)/);
 	&ReadSourceDocumentation ("$source_dir/$dir");
     }
 }
@@ -1922,6 +1926,19 @@ sub ReadSourceDocumentation {
 
 sub ScanSourceFile {
     my ($file) = @_;
+    my $basename;
+
+    if ($file =~ m/^.*[\/\\](.*\.[hc])$/) {
+	$basename = $1;
+    } else {
+	print "WARNING: Can't find basename of file $file\n";
+	$basename = $file;
+    }
+
+    # Check if the basename is in the list of files to ignore.
+    if ($IGNORE_FILES =~ m/(\s|^)\Q${basename}(\s|$)/) {
+	return;
+    }
 
     open (SRCFILE, $file)
 	|| die "Can't open $file: $!";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]