File: makeprotos-sed

package info (click to toggle)
rxvt 1%3A2.4.5-16
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,128 kB
  • ctags: 1,296
  • sloc: ansic: 12,852; makefile: 521; sh: 411
file content (17 lines) | stat: -rwxr-xr-x 351 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Get prototypes from a .c file
# /* PROTO */   must be above return type which are above function.
#		Args are on one line
# eg.
# /* PROTO */
# void                           ------>   void main(int argc, char **argv);
# main(int argc, char **argv)
# {
# }
#
/^[/][*] PROTO [*][/]$/{
n
N
s/\n\([_a-zA-Z][_a-zA-Z0-9]* *\)(/ \1 __PROTO((/
s/$/);/
p
}