* net_db.c: declare inet_aton only if HAVE_INET_ATON is not
[bpt/guile.git] / libguile / guile-func-name-check.in
CommitLineData
0f981281
GB
1#!/usr/bin/awk -f
2# Written by Greg J. Badros, <gjb@cs.washington.edu>
3# 11-Jan-2000
4
5BEGIN {
6 filename = ARGV[1];
7}
8
9/^SCM_DEFINE/ {
10 func_name = $0;
11 sub(/^[^\(\n]*\([ \t]*/,"", func_name);
12 sub(/[ \t]*,.*/,"", func_name);
13# print func_name; # GJB:FIXME:: flag to do this to list primitives?
14 in_a_func = 1;
15}
16
17in_a_func && /^\{/ {
18 if (!match(last_line,/^#define[ \t]+FUNC_NAME[ \t]+/)) {
19 printf filename ":" NR ":***" > "/dev/stderr";
20 print "Missing or erroneous `#define FUNC_NAME s_" func_name "'" > "/dev/stderr";
21 } else {
22 sub(/^#define[ \t]+FUNC_NAME[ \t]+s_/, "", last_line);
23 sub(/[ \t]*$/,"",last_line);
24 if (last_line != func_name) {
25 printf filename ":" NR ":***" > "/dev/stderr";
26 print "Mismatching FUNC_NAME. Should be: `#define FUNC_NAME s_" func_name "'" > "/dev/stderr";
27 }
28 }
29}
30
311 == next_line_better_be_undef {
32 if (!match($0,/^#undef FUNC_NAME[ \t]*$/)) {
33 printf filename ":" NR ":***" > "/dev/stderr";
34 print "Missing or erroneous #undef for " func_name ": "
35 "Got `" $0 "' instead." > "/dev/stderr";
36 }
37 in_a_func = "";
38 func_name = "";
39 next_line_better_be_undef = 0;
40}
41
42in_a_func && /^\}/ {
43 next_line_better_be_undef = 1;
44}
45
46{ last_line = $0; }