File: nbcompat.awk

package info (click to toggle)
libnbcompat 20240319-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: ansic: 18,476; sh: 3,046; makefile: 92; awk: 20
file content (24 lines) | stat: -rw-r--r-- 377 bytes parent folder | download
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 }