summaryrefslogtreecommitdiffstats
path: root/tools/sed-functions
blob: 71ecc8e11138c5e6d967d8a2f6939e02118718b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# eat all comments
/^\s*\/\*/ {
  :comment
  /\*\/\s*$/ { n; b nocomment }
  n; b comment
}
:nocomment
# drop if don't start with EAPI
/^\s*EAPI/ ! b
# drop extern definitions
/EAPI\s+extern/ b
# if does not end with ;, append next line
/EAPI.*[^;]\s*$/ { N; s/\n/ / }
# while unfinished argument list, append next line
:loop
/,$/ { N; s/\n/ /; t loop }
# replace multi spaces with one ...
s/ {2,}/ /g
s/\s+EINA_.*/;/
s/^\s*EAPI/EAPI/p