r4199 - developers/tick/scripts

tick at sita.openmoko.org tick at sita.openmoko.org
Thu Mar 13 04:42:16 CET 2008


Author: tick
Date: 2008-03-13 04:42:12 +0100 (Thu, 13 Mar 2008)
New Revision: 4199

Added:
   developers/tick/scripts/checkMacro
Log:
adding a check #ifdef  #else #endif macro tool


Added: developers/tick/scripts/checkMacro
===================================================================
--- developers/tick/scripts/checkMacro	2008-03-13 01:54:31 UTC (rev 4198)
+++ developers/tick/scripts/checkMacro	2008-03-13 03:42:12 UTC (rev 4199)
@@ -0,0 +1,26 @@
+#!/usr/bin/awk -f
+BEGIN {
+	tab=0;
+}
+{
+	show=0;
+	if (index($1,"#if")==1 || 
+	    index($1,"#else")==1 || 
+	    index($1,"#elif")==1 || 
+	    index($1,"#endif")==1 ) {
+		show=1;
+	}
+	if (index($1,"#endif")==1 || index($1,"#else")==1 || index($1,"#elif")==1) {
+		tab--;
+	}
+	if (show==1) {
+		printf("%4d:",NR);
+		for(i=0;i<tab;i++) {
+			printf("   ");
+		}
+		print $0
+	}
+	if (index($1,"#if")==1 || index($1,"#else")==1 || index($1,"#elif")==1) {
+		tab++;
+	}
+}


Property changes on: developers/tick/scripts/checkMacro
___________________________________________________________________
Name: svn:executable
   + *





More information about the commitlog mailing list