From 1d483e2e17efc9fce5e2b3c27fe533e386178e3d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 2 Nov 2022 11:20:53 +0100 Subject: templating helper --- src/exchangedb/pg_template.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 src/exchangedb/pg_template.sh (limited to 'src/exchangedb/pg_template.sh') diff --git a/src/exchangedb/pg_template.sh b/src/exchangedb/pg_template.sh new file mode 100755 index 000000000..5aa8f8d45 --- /dev/null +++ b/src/exchangedb/pg_template.sh @@ -0,0 +1,12 @@ +#!/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 -- cgit v1.2.3