summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Richard Basch <probe@mit.edu>1993-12-14 10:55:52 +0000
committerGravatar Richard Basch <probe@mit.edu>1993-12-14 10:55:52 +0000
commit148175d8cb52638625218f2f53165fd55b982d7f (patch)
tree5f2118b34ec55cf8f9198b4a38d7821c2e05e33e /zwgc
parentc02f43e9939d1e9691fd900f366ff0128bb997cf (diff)
Initial revision
Diffstat (limited to 'zwgc')
-rwxr-xr-xzwgc/generate_instance42
1 files changed, 42 insertions, 0 deletions
diff --git a/zwgc/generate_instance b/zwgc/generate_instance
new file mode 100755
index 0000000..0a42621
--- /dev/null
+++ b/zwgc/generate_instance
@@ -0,0 +1,42 @@
+#!/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> <stack|dictionary> <name> [<include file>]"
+ exit 1
+fi
+
+source=$1
+type=$2
+name=$3
+incfile=$4
+
+if [ ! -f ${source}/${type}.h ]; then
+ echo "$0: unable to open ${source}/${type}.h"
+ exit 2
+fi
+
+case $type in
+dictionary)
+ 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
+ ;;
+esac
+
+if [ "$incfile" != "" ]; then
+ echo "#include \"$incfile\"" > ${name}_${type}.h
+fi
+sed "s/TYPE_T/$name/g" ${source}/${type}.h >> ${name}_${type}.h