]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/instantiate
unpack of new upstream
[1ts-debian.git] / zephyr / zwgc / instantiate
1 #!/bin/sh -
2
3 # This file is part of the Project Athena Zephyr Notification System.
4 # It is one of the source files comprising zwgc, the Zephyr WindowGram
5 # client.
6 #
7 # $Id: instantiate,v 1.1 1997/09/14 22:14:07 ghudson Exp $
8 #
9 # Copyright (c) 1989,1993 by the Massachusetts Institute of Technology.
10 # For copying and distribution information, see the file
11 # "mit-copyright.h".
12 #
13
14 if [ "$1" = "" ]; then
15         echo "Usage: generate_instance <srcdir> <type> <name> [<include file>]"
16         exit 1
17 fi
18
19 source=$1
20 type=$2
21 name=$3
22 incfile=$4
23
24 if [ "$type" != "stack" ]; then
25         if [ ! -f ${source}/${type}.c ]; then
26                 echo "$0: unable to open ${source}/${type}.c"
27                 exit 2
28         fi
29         sed "s/TYPE_T/$name/g" ${source}/${type}.c > ${name}_${type}.c
30 fi
31
32 if [ "$incfile" != "" ]; then
33         echo "#include \"$incfile\"" > ${name}_${type}.h
34 fi
35 if [ ! -f ${source}/${type}.h ]; then
36         echo "$0: unable to open ${source}/${type}.h"
37         exit 2
38 fi
39 sed "s/TYPE_T/$name/g" ${source}/${type}.h >> ${name}_${type}.h