shithub: qk1

ref: 999f960108cdd4f36aff80d80b898030b9177275
dir: /plan9/inline/

View raw version
#!/bin/rc

awk '
	/ inline / { inlining = 1; striptypes = 1; printf "#define "; next }
	/^}$/ && inlining { inlining = 0; print; next }
	inlining {
		if(striptypes)
			gsub(/[a-zA-Z_0-9]+ [*]?/, "")
		striptypes = 0
		printf "%s\\\n", $0
		next
	}
	!inlining { print }
' $*