1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00
Simo Sorce 2d6d6bcb5d talloc: Change the way mksysms work
Make sure we always have a sorted (per file) export file.
This way we can directly compare the real export and the check file w/o having
to further sort things.

Also return error code from abi_checks.sh if warnings were reported
2009-10-14 11:05:51 -04:00

64 lines
939 B
Awk

#
# mksyms.awk
#
# Extract symbols to export from C-header files.
# output in version-script format for linking shared libraries.
#
# Copyright (C) 2008 Micheal Adam <obnox@samba.org>
#
BEGIN {
inheader=0;
}
END {
}
{
if (inheader) {
if (match($0,"[)][^()]*[;][ \t]*$")) {
inheader = 0;
}
next;
}
}
/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_]/ {
next;
}
/^extern[ \t]+[^()]+[;][ \t]*$/ {
gsub(/[^ \t]+[ \t]+/, "");
sub(/[;][ \t]*$/, "");
printf " %s;\n", $0;
next;
}
# look for function headers:
{
gotstart = 0;
if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
gotstart = 1;
}
if(!gotstart) {
next;
}
}
/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ {
sub(/[(].*$/, "");
gsub(/[^ \t]+[ \t]+/, "");
gsub(/^[*]+/, "");
printf " %s;\n",$0;
next;
}
/[_A-Za-z0-9]+[ \t]*[(]/ {
inheader=1;
sub(/[(].*$/, "");
gsub(/[^ \t]+[ \t]+/, "");
gsub(/^[*]/, "");
printf " %s;\n",$0;
next;
}