File: nbcompat.awk

package info (click to toggle)
libnbcompat 20180822-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,916 kB
  • sloc: ansic: 18,356; sh: 3,046; makefile: 92; awk: 20
file content (24 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
BEGIN { process = 1 }

/NBCOMPAT template section follows\./ { process = 0 }

/^\#[ 	]*define[ 	]+PACKAGE_.*/ {
	if (process == 1) {
		print "/* " $0 " */";
		next;
	}
}

/^\#[ 	]*define[ 	]+/ {
	if (process == 1) {
		guard = $0;
		sub("^#[ 	]*define[ 	]+", "", guard);
		sub("[ 	]+.*", "", guard);
		print "#ifndef " guard;
		print $0;
		print "#endif";
		next;
	}
}

{ print }