summaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_template.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-11-02 11:20:53 +0100
committerChristian Grothoff <christian@grothoff.org>2022-11-02 11:20:53 +0100
commit1d483e2e17efc9fce5e2b3c27fe533e386178e3d (patch)
tree332db230ab8a1fbc54dd5d86f6d67b22e94abdfa /src/exchangedb/pg_template.sh
parent481ffc1a0a2c808316877a76d74262aa61274a26 (diff)
downloadexchange-1d483e2e17efc9fce5e2b3c27fe533e386178e3d.tar.gz
exchange-1d483e2e17efc9fce5e2b3c27fe533e386178e3d.tar.bz2
exchange-1d483e2e17efc9fce5e2b3c27fe533e386178e3d.zip
templating helper
Diffstat (limited to 'src/exchangedb/pg_template.sh')
-rwxr-xr-xsrc/exchangedb/pg_template.sh12
1 files changed, 12 insertions, 0 deletions
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