In mplex_write(), make extra sure something unexpected doesn't get
[rsync.git] / mkproto.awk
blob6a46c46d9bb2bfc9dd7ca9f9ebb95ce2368b66f8
1 # generate prototypes for Samba C code
2 # tridge, June 1996
4 BEGIN {
5 inheader=0;
6 print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
7 print ""
11 if (inheader) {
12 if (match($0,"[)][ \t]*$")) {
13 inheader = 0;
14 printf "%s;\n",$0;
15 } else {
16 printf "%s\n",$0;
18 next;
22 /^FN_LOCAL_BOOL/ {
23 split($0,a,"[,()]")
24 printf "BOOL %s(int );\n", a[2]
27 /^FN_LOCAL_STRING/ {
28 split($0,a,"[,()]")
29 printf "char *%s(int );\n", a[2]
32 /^FN_LOCAL_INT/ {
33 split($0,a,"[,()]")
34 printf "int %s(int );\n", a[2]
37 /^FN_LOCAL_CHAR/ {
38 split($0,a,"[,()]")
39 printf "char %s(int );\n", a[2]
42 /^FN_GLOBAL_BOOL/ {
43 split($0,a,"[,()]")
44 printf "BOOL %s(void);\n", a[2]
47 /^FN_GLOBAL_STRING/ {
48 split($0,a,"[,()]")
49 printf "char *%s(void);\n", a[2]
52 /^FN_GLOBAL_INT/ {
53 split($0,a,"[,()]")
54 printf "int %s(void);\n", a[2]
57 /^static|^extern/ || /[;]/ {
58 next;
61 !/^[A-Za-z][A-Za-z0-9_]* / {
62 next;
65 /[(].*[)][ \t]*$/ {
66 printf "%s;\n",$0;
67 next;
70 /[(]/ {
71 inheader=1;
72 printf "%s\n",$0;
73 next;