1996-06-04 06:42:03 +00:00
BEGIN {
inheader = 0 ;
1998-05-18 11:54:00 +00:00
# use_ldap_define = 0;
1996-06-17 14:11:14 +00:00
current_file = "" ;
2000-07-03 04:28:29 +00:00
if ( headername == "" ) {
headername = "_PROTO_H_" ;
}
print "#ifndef" , headername
print "#define" , headername
2002-03-28 03:43:54 +00:00
print ""
1996-06-10 04:38:24 +00:00
print "/* This file is automatically generated with \"make proto\". DO NOT EDIT */"
print ""
1996-06-04 06:42:03 +00:00
}
1998-06-08 14:59:30 +00:00
END {
2002-03-28 04:12:39 +00:00
print ""
2002-03-28 03:43:54 +00:00
print "#endif /* " , headername , " */"
1998-06-08 14:59:30 +00:00
}
1996-06-04 06:42:03 +00:00
{
1996-06-17 14:11:14 +00:00
if ( FILENAME != current_file ) {
1998-05-18 11:54:00 +00:00
# if (use_ldap_define)
# {
# print "#endif /* USE_LDAP */"
# use_ldap_define = 0;
# }
1996-06-17 14:11:14 +00:00
print ""
2001-05-14 04:11:39 +00:00
print "/* The following definitions come from" , FILENAME , " */"
1996-06-17 14:11:14 +00:00
print ""
current_file = FILENAME
}
1996-06-04 06:42:03 +00:00
if ( inheader ) {
if ( match ( $ 0 , "[)][ \t]*$" ) ) {
inheader = 0 ;
printf "%s;\n" , $ 0 ;
} else {
printf "%s\n" , $ 0 ;
}
next ;
}
}
1996-06-10 04:38:24 +00:00
# we handle the loadparm.c fns separately
/^FN_LOCAL_BOOL/ {
split ( $ 0 , a , "[,()]" )
2007-10-18 17:40:25 -07:00
printf "bool %s(int );\n" , a [ 2 ]
1996-06-10 04:38:24 +00:00
}
2006-07-11 18:01:26 +00:00
/^FN_LOCAL_PARM_BOOL/ {
split ( $ 0 , a , "[,()]" )
2007-10-18 17:40:25 -07:00
printf "bool %s(const struct share_params *p );\n" , a [ 2 ]
2006-07-11 18:01:26 +00:00
}
2006-11-11 17:05:11 +00:00
/^FN_LOCAL_PARM_INTEGER/ {
split ( $ 0 , a , "[,()]" )
printf "int %s(const struct share_params *p );\n" , a [ 2 ]
}
2001-06-20 16:54:32 +00:00
/^FN_LOCAL_LIST/ {
split ( $ 0 , a , "[,()]" )
2002-11-12 23:20:50 +00:00
printf "const char **%s(int );\n" , a [ 2 ]
2001-06-20 16:54:32 +00:00
}
1996-06-10 04:38:24 +00:00
/^FN_LOCAL_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "char *%s(int );\n" , a [ 2 ]
}
2006-07-11 18:01:26 +00:00
/^FN_LOCAL_PARM_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "char *%s(const struct share_params *p );\n" , a [ 2 ]
}
2002-07-15 10:35:28 +00:00
/^FN_LOCAL_CONST_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "const char *%s(int );\n" , a [ 2 ]
}
1996-06-10 04:38:24 +00:00
/^FN_LOCAL_INT/ {
split ( $ 0 , a , "[,()]" )
printf "int %s(int );\n" , a [ 2 ]
}
/^FN_LOCAL_CHAR/ {
split ( $ 0 , a , "[,()]" )
2006-07-11 18:01:26 +00:00
printf "char %s(const struct share_params *p );\n" , a [ 2 ]
1996-06-10 04:38:24 +00:00
}
/^FN_GLOBAL_BOOL/ {
split ( $ 0 , a , "[,()]" )
2007-10-18 17:40:25 -07:00
printf "bool %s(void);\n" , a [ 2 ]
1996-06-10 04:38:24 +00:00
}
2001-06-20 16:54:32 +00:00
/^FN_GLOBAL_LIST/ {
split ( $ 0 , a , "[,()]" )
2002-11-12 23:20:50 +00:00
printf "const char **%s(void);\n" , a [ 2 ]
2001-06-20 16:54:32 +00:00
}
1996-06-10 04:38:24 +00:00
/^FN_GLOBAL_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "char *%s(void);\n" , a [ 2 ]
}
2002-07-15 10:35:28 +00:00
/^FN_GLOBAL_CONST_STRING/ {
split ( $ 0 , a , "[,()]" )
printf "const char *%s(void);\n" , a [ 2 ]
}
1996-06-10 04:38:24 +00:00
/^FN_GLOBAL_INT/ {
split ( $ 0 , a , "[,()]" )
printf "int %s(void);\n" , a [ 2 ]
}
2007-11-08 14:34:02 +01:00
/^static|^extern/ || ! /^[a-zA-Z\_]/ || /[;]/ {
1996-06-04 06:42:03 +00:00
next ;
}
1998-09-28 21:43:48 +00:00
#
# We have to split up the start
# matching as we now have so many start
# types that it can cause some versions
# of nawk/awk to choke and fail on
# the full match. JRA.
#
{
gotstart = 0 ;
2002-02-05 01:30:50 +00:00
if ( $ 0 ~ /^const|^connection_struct|^pipes_struct|^smb_np_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t|^double/ ) {
1998-09-28 21:43:48 +00:00
gotstart = 1 ;
}
2000-11-13 23:03:34 +00:00
if ( $ 0 ~ /^vuser_key|^UNISTR2|^LOCAL_GRP|^DOMAIN_GRP|^SMB_STRUCT_DIRENT|^SEC_ACL|^SEC_DESC|^SEC_DESC_BUF|^DOM_SID|^RPC_HND_NODE|^BYTE/ ) {
1999-11-08 22:00:41 +00:00
gotstart = 1 ;
}
2003-10-06 01:38:46 +00:00
if ( $ 0 ~ /^ADS_STRUCT|^ADS_STATUS|^DATA_BLOB|^ASN1_DATA|^TDB_CONTEXT|^TDB_DATA|^smb_ucs2_t|^TALLOC_CTX|^hash_element|^NT_DEVICEMODE|^enum.*\(|^NT_USER_TOKEN|^SAM_ACCOUNT|^NTTIME/ ) {
1999-12-21 04:54:30 +00:00
gotstart = 1 ;
}
2007-10-18 17:40:25 -07:00
if ( $ 0 ~ /^smb_iconv_t|^long|^char|^uint|^NTSTATUS|^WERROR|^CLI_POLICY_HND|^struct|^bool|^void|^time|^smb_shm_offset_t|^shm_offset_t|^FILE|^XFILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT|^SMB_BIG_INT/ ) {
1998-09-28 21:43:48 +00:00
gotstart = 1 ;
}
2000-11-13 23:03:34 +00:00
2005-09-30 17:13:37 +00:00
if ( $ 0 ~ /^SAM_ACCT_INFO_NODE|^SMB_ACL_T|^ADS_MODLIST|^PyObject|^SORTED_TREE|^REGISTRY_HOOK|^REGISTRY_VALUE|^REGVAL_CTR|^DEVICEMODE|^PAC_DATA|^NET_USER_INFO_3|^smb_event_id_t/ ) {
2000-11-13 23:03:34 +00:00
gotstart = 1 ;
}
2005-06-03 15:42:03 +00:00
if ( $ 0 ~ /^WINBINDD_PW|^WINBINDD_GR|^NT_PRINTER_INFO_LEVEL_2|^LOGIN_CACHE|^krb5_error_code|^LDAP|^u32|^LUID_ATTR|^NSS_STATUS/ ) {
2003-07-09 16:44:47 +00:00
gotstart = 1 ;
}
2007-12-21 11:57:34 -06:00
if ( $ 0 ~ /^NODE_STATUS_STRUCT|^SMB_STRUCT_DIR|^ELOG_TDB|^codepoint_t|^_PUBLIC_|^wbcErr/ ) {
2005-06-24 20:25:18 +00:00
gotstart = 1 ;
}
1998-09-28 21:43:48 +00:00
if ( ! gotstart ) {
next ;
}
1996-06-04 06:42:03 +00:00
}
/[(].*[)][ \t]*$/ {
printf "%s;\n" , $ 0 ;
next ;
}
/[(]/ {
inheader = 1 ;
printf "%s\n" , $ 0 ;
next ;
}