1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
guile/libguile/guile-func-name-check.in
Martin Grabmüller 58ade1022c * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,
chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c,
	feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c,
	gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c,
	gh_predicates.c, gsubr.c, gsubr.h, guardians.h,
	guile-func-name-check.in, guile-snarf-docs-texi.in,
	guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in,
	hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h,
	objprop.c, objprop.h, options.c, options.h, random.h,
	regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c,
	strerror.c, strop.h, strports.h, threads.h, values.c, values.h,
	version.c, version.h: Updated copyright notice.
2001-07-19 21:08:49 +00:00

65 lines
2 KiB
Awk

#!/usr/bin/awk -f
#
# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
#
# Written by Greg J. Badros, <gjb@cs.washington.edu>
# 11-Jan-2000
BEGIN {
filename = ARGV[1];
in_a_func = 0;
}
/^SCM_DEFINE/ {
func_name = $0;
sub(/^[^\(\n]*\([ \t]*/,"", func_name);
sub(/[ \t]*,.*/,"", func_name);
# print func_name; # GJB:FIXME:: flag to do this to list primitives?
in_a_func = 1;
}
/^\{/ && in_a_func {
if (!match(last_line,/^#define[ \t]+FUNC_NAME[ \t]+/)) {
printf filename ":" NR ":***" > "/dev/stderr";
print "Missing or erroneous `#define FUNC_NAME s_" func_name "'" > "/dev/stderr";
} else {
sub(/^#define[ \t]+FUNC_NAME[ \t]+s_/, "", last_line);
sub(/[ \t]*$/,"",last_line);
if (last_line != func_name) {
printf filename ":" NR ":***" > "/dev/stderr";
print "Mismatching FUNC_NAME. Should be: `#define FUNC_NAME s_" func_name "'" > "/dev/stderr";
}
}
}
1 == next_line_better_be_undef {
if (!match($0,/^#undef FUNC_NAME[ \t]*$/)) {
printf filename ":" NR ":***" > "/dev/stderr";
print "Missing or erroneous #undef for " func_name ": "
"Got `" $0 "' instead." > "/dev/stderr";
}
in_a_func = "";
func_name = "";
next_line_better_be_undef = 0;
}
/^\}/ && in_a_func {
next_line_better_be_undef = 1;
}
{ last_line = $0; }