File: mkproto.awk

package info (click to toggle)
picturebook 0.0pre3-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 328 kB
  • ctags: 427
  • sloc: ansic: 2,717; makefile: 55; sh: 37; awk: 31
file content (42 lines) | stat: -rw-r--r-- 643 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# generate prototypes for Samba C code
# tridge, June 1996

BEGIN {
  inheader=0;
  print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
  print ""
}

{
  if (inheader) {
    if (match($0,"[)][ \t]*$")) {
      inheader = 0;
      printf "%s;\n",$0;
    } else {
      printf "%s\n",$0;
    }
    next;
  }
}


/^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
  next;
}

!/^OFF_T|^u32|^double|^u16|^size_t|^off_t|^pid_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time/ {
  next;
}


/[(].*[)][ \t]*$/ {
    printf "%s;\n",$0;
    next;
}

/[(]/ {
  inheader=1;
  printf "%s\n",$0;
  next;
}