4 # Extract symbols to export from C-header files.
5 # output in version-script format for linking shared libraries.
7 # Copyright (C) 2008 Michael Adam <obnox@samba.org>
13 print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
26 if (FILENAME!=current_file
) {
27 print "\t\t# The following definitions come from",FILENAME
31 if (match($
0,"[)][^()]*[;][ \t]*$")) {
38 /^static
/ || /^
[ \t]*typedef
/ || !
/^
[a
-zA
-Z\_
]/ {
42 /^extern
[ \t]+[^
()]+[;][ \t]*$
/ {
43 gsub(/[^
\t]+[ \t]+/, "");
44 sub(/[;][ \t]*$
/, "");
45 printf "\t\t%s;\n", $
0;
49 # look for function headers:
52 if ($
0 ~
/^
[A
-Za
-z_
][A
-Za
-z0
-9_
]+/) {
60 /[_A
-Za
-z0
-9]+[ \t]*[(].
*[)][^
()]*;[ \t]*$
/ {
62 gsub(/[^
\t]+[ \t]+/, "");
64 printf "\t\t%s;\n",$
0;
68 /[_A
-Za
-z0
-9]+[ \t]*[(]/ {
71 gsub(/[^
\t]+[ \t]+/, "");
73 printf "\t\t%s;\n",$
0;