10e3d5408SPeter Wemm#!/bin/sh 24a1a9510SRong-En Fan############################################################################## 3*e1865124SBaptiste Daroussin# Copyright 2019,2020 Thomas E. Dickey # 4*e1865124SBaptiste Daroussin# Copyright 1998,2006 Free Software Foundation, Inc. # 54a1a9510SRong-En Fan# # 64a1a9510SRong-En Fan# Permission is hereby granted, free of charge, to any person obtaining a # 74a1a9510SRong-En Fan# copy of this software and associated documentation files (the "Software"), # 84a1a9510SRong-En Fan# to deal in the Software without restriction, including without limitation # 94a1a9510SRong-En Fan# the rights to use, copy, modify, merge, publish, distribute, distribute # 104a1a9510SRong-En Fan# with modifications, sublicense, and/or sell copies of the Software, and to # 114a1a9510SRong-En Fan# permit persons to whom the Software is furnished to do so, subject to the # 124a1a9510SRong-En Fan# following conditions: # 134a1a9510SRong-En Fan# # 144a1a9510SRong-En Fan# The above copyright notice and this permission notice shall be included in # 154a1a9510SRong-En Fan# all copies or substantial portions of the Software. # 164a1a9510SRong-En Fan# # 174a1a9510SRong-En Fan# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # 184a1a9510SRong-En Fan# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # 194a1a9510SRong-En Fan# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # 204a1a9510SRong-En Fan# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # 214a1a9510SRong-En Fan# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # 224a1a9510SRong-En Fan# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # 234a1a9510SRong-En Fan# DEALINGS IN THE SOFTWARE. # 244a1a9510SRong-En Fan# # 254a1a9510SRong-En Fan# Except as contained in this notice, the name(s) of the above copyright # 264a1a9510SRong-En Fan# holders shall not be used in advertising or otherwise to promote the sale, # 274a1a9510SRong-En Fan# use or other dealings in this Software without prior written # 284a1a9510SRong-En Fan# authorization. # 294a1a9510SRong-En Fan############################################################################## 30*e1865124SBaptiste Daroussin# $Id: MKhashsize.sh,v 1.9 2020/02/02 23:34:34 tom Exp $ 310e3d5408SPeter Wemm# 320e3d5408SPeter Wemm# MKhashsize.sh --- generate size include for hash functions 330e3d5408SPeter Wemm# 340e3d5408SPeter Wemmecho "/*" 350e3d5408SPeter Wemmecho " * hashsize.h -- hash and token table constants" 360e3d5408SPeter Wemmecho " */" 370e3d5408SPeter Wemm 38aae38d10SBaptiste Daroussintest $# = 0 && set Caps 39aae38d10SBaptiste DaroussinTABSIZE=`cat "$@" | grep -v '^[ #]' | grep -v "^$" | grep -v "^capalias"| grep -v "^infoalias" | grep -v "^userdef" | grep -v "^used_by" | wc -l` 400e3d5408SPeter Wemm 410e3d5408SPeter Wemmecho "" 420e3d5408SPeter Wemmecho "#define CAPTABSIZE ${TABSIZE}" 430e3d5408SPeter Wemmecho "#define HASHTABSIZE (${TABSIZE} * 2)" 44