exchange/src/exchangedb/pg_template.sh
Christian Grothoff 1d483e2e17
templating helper
2022-11-02 11:20:53 +01:00

13 lines
359 B
Bash
Executable File

#!/bin/sh
# This file is in the public domain.
#
# Instantiates pg_template for a particular function.
for n in $*
do
NCAPS=`echo $n | tr a-z A-Z`
cat pg_template.c | sed -e s/template/$n/g -e s/TEMPLATE/$NCAPS/g > pg_$n.c
cat pg_template.h | sed -e s/template/$n/g -e s/TEMPLATE/$NCAPS/g > pg_$n.h
echo "\#include \"pg_$n.h\"" >> hdr.h
done