1996-06-04 10:42:03 +04:00
BEGIN {
inheader = 0 ;
1998-05-18 15:54:00 +04:00
# use_ldap_define = 0;
1996-06-17 18:11:14 +04:00
current_file = "" ;
1998-06-08 18:59:30 +04:00
print "#ifndef _PROTO_H_"
print "#define _PROTO_H_"
1996-06-10 08:38:24 +04:00
print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
print ""
1996-06-04 10:42:03 +04:00
}
1998-06-08 18:59:30 +04:00
END {
print "#endif /* _PROTO_H_ */"
}
1996-06-04 10:42:03 +04:00
{
1996-06-17 18:11:14 +04:00
if ( FILENAME != current_file ) {
1998-05-18 15:54:00 +04:00
# if (use_ldap_define)
# {
# print "#endif /* USE_LDAP */"
# use_ldap_define = 0;
# }
1996-06-17 18:11:14 +04:00
print ""
print "/*The following definitions come from " , FILENAME , " */"
print ""
current_file = FILENAME
1998-05-18 15:54:00 +04:00
# if (current_file=="ldap.c") {
# print "#ifdef USE_LDAP"
# use_ldap_define = 1;
# }
1996-06-17 18:11:14 +04:00
}
1996-06-04 10:42:03 +04:00
if ( inheader ) {
if ( match ( $ 0 , "[)][ \t]*$" ) ) {
inheader = 0 ;
printf "%s;\n" , $ 0 ;
} else {
printf "%s\n" , $ 0 ;
}
next ;
}
}
1996-06-10 08:38:24 +04:00
# we handle the loadparm.c fns separately
/^FN_LOCAL_BOOL/ {
split ( $ 0 , a , "[,()]" )
printf "BOOL %s(int );\n" , a [ 2 ]
}
/^FN_LOCAL_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "char *%s(int );\n" , a [ 2 ]
}
/^FN_LOCAL_INT/ {
split ( $ 0 , a , "[,()]" )
printf "int %s(int );\n" , a [ 2 ]
}
/^FN_LOCAL_CHAR/ {
split ( $ 0 , a , "[,()]" )
printf "char %s(int );\n" , a [ 2 ]
}
/^FN_GLOBAL_BOOL/ {
split ( $ 0 , a , "[,()]" )
printf "BOOL %s(void);\n" , a [ 2 ]
}
/^FN_GLOBAL_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "char *%s(void);\n" , a [ 2 ]
}
/^FN_GLOBAL_INT/ {
split ( $ 0 , a , "[,()]" )
printf "int %s(void);\n" , a [ 2 ]
}
1996-06-04 10:42:03 +04:00
/^static|^extern/ || ! /^[a-zA-Z]/ || /[;]/ {
next ;
}
1998-08-15 11:27:34 +04:00
! /^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time|^smb_shm_offset_t|^shm_offset_t|^enum remote_arch_types|^FILE/ {
1996-06-04 10:42:03 +04:00
next ;
}
/[(].*[)][ \t]*$/ {
printf "%s;\n" , $ 0 ;
next ;
}
/[(]/ {
inheader = 1 ;
printf "%s\n" , $ 0 ;
next ;
}