gtk-doc r582 - in trunk: . tools
- From: stefkost svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-doc r582 - in trunk: . tools
- Date: Sat, 21 Jun 2008 09:39:53 +0000 (UTC)
Author: stefkost
Date: Sat Jun 21 09:39:53 2008
New Revision: 582
URL: http://svn.gnome.org/viewvc/gtk-doc?rev=582&view=rev
Log:
* tools/migratetmpl.pl:
Convert single line c comments to c++ ones. Indent multiline parameter docs.
Modified:
trunk/ChangeLog
trunk/tools/migratetmpl.pl
Modified: trunk/tools/migratetmpl.pl
==============================================================================
--- trunk/tools/migratetmpl.pl (original)
+++ trunk/tools/migratetmpl.pl Sat Jun 21 09:39:53 2008
@@ -283,6 +283,7 @@
if (defined ($SymbolDocs{"$TMPL_DIR/$file:Long_Description"})) {
$long_desc = $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
$long_desc = &ConvertNewlines ($long_desc);
+ $long_desc = &ConvertComments ($long_desc);
delete $SymbolDocs{"$TMPL_DIR/$file:Long_Description"};
}
if (defined ($SymbolDocs{"$TMPL_DIR/$file:See_Also"})) {
@@ -360,6 +361,7 @@
}
$long_desc = $SymbolDocs{$symbol};
$long_desc = &ConvertNewlines ($long_desc);
+ $long_desc = &ConvertComments ($long_desc);
$str=<<EOF;
/**
@@ -375,7 +377,12 @@
for $line (split (/\n/, $param_desc)) {
if ($line ne "") {
- $stripped=$stripped."$line\n";
+ $line =~ m/\s*(.*)\s*/g;
+ if ($stripped eq "") {
+ $stripped=$stripped."$1\n";
+ } else {
+ $stripped=$stripped." * $1\n";
+ }
}
}
$param_desc=$stripped;
@@ -440,3 +447,23 @@
return $ostr;
}
+
+#############################################################################
+# Function : ConvertComments
+# Description : Convert signle line c comments to c++ comments
+# Arguments : $istr - string to convert
+#############################################################################
+sub ConvertComments {
+ my ($istr) = @_;
+ my ($line,$ostr);
+
+ for $line (split (/\n/, $istr)) {
+ if ($line =~ m#/\*.*\*/#) {
+ $line =~ s#/\*#//#;
+ $line =~ s#\s*\*/##;
+ }
+ $ostr.="$line\n";
+ }
+
+ return $ostr;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]