summaryrefslogtreecommitdiff
path: root/zwgc/instantiate
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-09-14 18:12:16 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-09-14 18:12:16 +0000
commitce6018836c422c86a729ba39fe5433ec11b87b02 (patch)
treecc2e6601489384fcf41e0565e8906822897b46c8 /zwgc/instantiate
parentac16f380e349fa39ec7e26bccb5456cb300006a5 (diff)
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
Diffstat (limited to 'zwgc/instantiate')
-rwxr-xr-xzwgc/instantiate39
1 files changed, 39 insertions, 0 deletions
diff --git a/zwgc/instantiate b/zwgc/instantiate
new file mode 100755
index 0000000..dae134d
--- /dev/null
+++ b/zwgc/instantiate
@@ -0,0 +1,39 @@
+#!/bin/sh -
+
+# This file is part of the Project Athena Zephyr Notification System.
+# It is one of the source files comprising zwgc, the Zephyr WindowGram
+# client.
+#
+# $Id$
+#
+# Copyright (c) 1989,1993 by the Massachusetts Institute of Technology.
+# For copying and distribution information, see the file
+# "mit-copyright.h".
+#
+
+if [ "$1" = "" ]; then
+ echo "Usage: generate_instance <srcdir> <type> <name> [<include file>]"
+ exit 1
+fi
+
+source=$1
+type=$2
+name=$3
+incfile=$4
+
+if [ "$type" != "stack" ]; then
+ if [ ! -f ${source}/${type}.c ]; then
+ echo "$0: unable to open ${source}/${type}.c"
+ exit 2
+ fi
+ sed "s/TYPE_T/$name/g" ${source}/${type}.c > ${name}_${type}.c
+fi
+
+if [ "$incfile" != "" ]; then
+ echo "#include \"$incfile\"" > ${name}_${type}.h
+fi
+if [ ! -f ${source}/${type}.h ]; then
+ echo "$0: unable to open ${source}/${type}.h"
+ exit 2
+fi
+sed "s/TYPE_T/$name/g" ${source}/${type}.h >> ${name}_${type}.h