xref: /freebsd/crypto/krb5/src/util/getsyms.sed (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert# emulate a C preprocessor (well, sort of)
2*7f2fe78bSCy Schubert:TOP
3*7f2fe78bSCy Schuberty/	/ /
4*7f2fe78bSCy Schuberts/  */ /g
5*7f2fe78bSCy Schuberts%/\*.*\*/%%
6*7f2fe78bSCy Schubert/\/\*/{
7*7f2fe78bSCy Schubert	:COMMENT
8*7f2fe78bSCy Schubert	/\*\//!{
9*7f2fe78bSCy Schubert		s/.*//
10*7f2fe78bSCy Schubert		N
11*7f2fe78bSCy Schubert		bCOMMENT
12*7f2fe78bSCy Schubert	}
13*7f2fe78bSCy Schubert	s%^.*\*/%%
14*7f2fe78bSCy Schubert	bTOP
15*7f2fe78bSCy Schubert}
16*7f2fe78bSCy Schubert/^ *# *ifdef/{
17*7f2fe78bSCy Schubert	s/^ *# *ifdef //
18*7f2fe78bSCy Schubert	b
19*7f2fe78bSCy Schubert}
20*7f2fe78bSCy Schubert/^ *# *ifndef/{
21*7f2fe78bSCy Schubert	s/^ *# *ifndef //
22*7f2fe78bSCy Schubert	b
23*7f2fe78bSCy Schubert}
24*7f2fe78bSCy Schubert/^ *# *if.*defined/{
25*7f2fe78bSCy Schubert	s/^ *# *if //
26*7f2fe78bSCy Schubert	:IF
27*7f2fe78bSCy Schubert	/^defined/!{
28*7f2fe78bSCy Schubert		:NUKE
29*7f2fe78bSCy Schubert		s/^.//
30*7f2fe78bSCy Schubert		/^defined/!bNUKE
31*7f2fe78bSCy Schubert	}
32*7f2fe78bSCy Schubert	h
33*7f2fe78bSCy Schubert	/^defined/s/^defined *( *\([A-Za-z0-9_]*\) *).*/\1/p
34*7f2fe78bSCy Schubert	g
35*7f2fe78bSCy Schubert	/^defined/s/^defined *( *\([[A-Za-z0-9_]*\) *)//
36*7f2fe78bSCy Schubert	/defined/!{
37*7f2fe78bSCy Schubert		d
38*7f2fe78bSCy Schubert		b
39*7f2fe78bSCy Schubert	}
40*7f2fe78bSCy Schubert	bIF
41*7f2fe78bSCy Schubert}
42*7f2fe78bSCy Schubertd
43