- Define what the valid access bits are for a name element and a
[rsync/rsync.git] / mkproto.awk
1 # generate prototypes for Samba C code
2 # tridge, June 1996
3
4 BEGIN {
5   inheader=0;
6   print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
7   print ""
8 }
9
10 {
11   if (inheader) {
12     if (match($0,"[)][ \t]*$")) {
13       inheader = 0;
14       printf "%s;\n",$0;
15     } else {
16       printf "%s\n",$0;
17     }
18     next;
19   }
20 }
21
22 /^FN_LOCAL_BOOL/ {
23   split($0,a,"[,()]")
24   printf "BOOL %s(int );\n", a[2]
25 }
26
27 /^FN_LOCAL_STRING/ {
28   split($0,a,"[,()]")
29   printf "char *%s(int );\n", a[2]
30 }
31
32 /^FN_LOCAL_INT/ {
33   split($0,a,"[,()]")
34   printf "int %s(int );\n", a[2]
35 }
36
37 /^FN_LOCAL_CHAR/ {
38   split($0,a,"[,()]")
39   printf "char %s(int );\n", a[2]
40 }
41
42 /^FN_GLOBAL_BOOL/ {
43   split($0,a,"[,()]")
44   printf "BOOL %s(void);\n", a[2]
45 }
46
47 /^FN_GLOBAL_STRING/ {
48   split($0,a,"[,()]")
49   printf "char *%s(void);\n", a[2]
50 }
51
52 /^FN_GLOBAL_INT/ {
53   split($0,a,"[,()]")
54   printf "int %s(void);\n", a[2]
55 }
56
57 /^static|^extern/ || /[;]/ {
58   next;
59 }
60
61 !/^[A-Za-z][A-Za-z0-9_]* / {
62   next;
63 }
64
65 /[(].*[)][ \t]*$/ {
66     printf "%s;\n",$0;
67     next;
68 }
69
70 /[(]/ {
71   inheader=1;
72   printf "%s\n",$0;
73   next;
74 }