maint.mk: prohibit inclusion of "hash.h" without_use
authorJim Meyering <meyering@redhat.com>
Sun, 14 Feb 2010 10:22:29 +0000 (11:22 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 14 Feb 2010 10:23:05 +0000 (11:23 +0100)
* top/maint.mk (sc_prohibit_hash_without_use): New rule.

ChangeLog
top/maint.mk

index c382d58fd1ad06a9b3e967643d3f354c1c6fb467..0ebee71c00b2879d91762699d55549800534f745 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-14  Jim Meyering  <meyering@redhat.com>
+
+       maint.mk: prohibit inclusion of "hash.h" without_use
+       * top/maint.mk (sc_prohibit_hash_without_use): New rule.
+
 2010-02-10  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: prohibit inclusion of "ignore-value.h" without_use
index ed8d3678067878cfaf8b692c152a54a9e3c49777..a623d026e52e9905d3a5e69fc194161c0cc0e153 100644 (file)
@@ -367,6 +367,17 @@ sc_prohibit_xalloc_without_use:
        re='\<($(_xa1)|$(_xa2)) *\('\
          $(_header_without_use)
 
+# Extract function names:
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) \(/ and print $1' lib/hash.h
+_hash_re = \
+clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
+_hash_fn = \<($(_hash_re)) *\(
+_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
+sc_prohibit_hash_without_use:
+       h='"hash.h"' \
+       re='$(_hash_fn)|$(_hash_struct)'\
+         $(_header_without_use)
+
 sc_prohibit_safe_read_without_use:
        @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
          $(_header_without_use)