[Gtk-sharp-list] patch for gapi_pp.pl

Martin Willemoes Hansen mwh@sysrq.dk
15 Jun 2003 17:18:51 +0100


--=-9dk4YsBkL6loxLDxrUEb
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi there!

During my endavour of making a wrapper for diacanvas I made this patch
to work around comments in the c src code.

-- 
Martin Willemoes Hansen

--------------------------------------------------------
E-Mail	mwh@sysrq.dk	Website	mwh.sysrq.dk
IRC     MWH, freenode.net	
--------------------------------------------------------               


--=-9dk4YsBkL6loxLDxrUEb
Content-Disposition: attachment; filename=gapi_pp.pl.diff
Content-Type: text/plain; name=gapi_pp.pl.diff; charset=
Content-Transfer-Encoding: 7bit

--- gapi_pp.pl.original	2003-06-13 08:37:08.000000000 +0100
+++ gapi_pp.pl.new	2003-06-13 08:39:35.000000000 +0100
@@ -130,8 +130,30 @@
 			print "private";
 		}
 
+		$comment = 0;
+		$begin = 0;
+		$end = 0;
 		do {
-			print $line;
+			if ($line =~ /\/\*/) {
+				$comment = 1;
+				$begin = 1;
+			}
+
+			if ($comment != 1) {
+				print $line;
+			}
+
+			if ($line =~ /\*\//) {
+				$comment = 0;
+				$end = 1;
+			}
+
+			if ($begin == 1 && $end == 1) {
+				print $line;
+			}
+
+			$begin = 0;
+			$end = 0;
 		} until (($line = <INFILE>) =~ /^}/);
 		print $line;
 	}

--=-9dk4YsBkL6loxLDxrUEb--