summaryrefslogtreecommitdiff
path: root/zwgc/Dictionary/generate_dictionary_instance
blob: 444d51bdff0d1f843b019f35a672a2062566bcac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/csh -f
# This file is part of the Project Athena Zephyr Notification System.
# It is a tool used in the compilation of zwgc, the Zephyr WindowGram
# client.
#
#      Created by:     Marc Horowitz <marc@athena.mit.edu>
#
#      $Source$
#      $Author$
#	$Id$
#
#      Copyright (c) 1989 by the Massachusetts Institute of Technology.
#      For copying and distribution information, see the file
#      "mit-copyright.h".
#

set source=$1
shift

if (z$1x == zx) then
	echo "usage: generate_dictionary_instance <srcdir> <typename> [<include file>]"
	exit 1
endif
if (-r $source/dictionary.c) then
else
	echo "generate_dictionary_instance: unable to open" $source/dictionary.c
	exit 2
endif

if (z$2x == zx) then
	echo > $1_dictionary.h
else
	echo "#include" '"'$2'"' > $1_dictionary.h
endif
sed "s/TYPE_T/$1/g" $source/dictionary.h >> $1_dictionary.h
sed "s/TYPE_T/$1/g" $source/dictionary.c > $1_dictionary.c