#!/bin/csh
# Motif
#
# Copyright (c) 1987-2012, The Open Group. All rights reserved.
#
# These libraries and programs are free software; you can
# redistribute them and/or modify them under the terms of the GNU
# Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# These libraries and programs are distributed in the hope that
# they will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with these librararies and programs; if not, write
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301 USA
# 
# HISTORY
#
# This is the script to create links to a predefined subset of the
# test suite (.c .dat and .scr files only) before any configuration RUN.
#

if ( "$1" == "-undo" ) then 
	set mode = "-undo"
else
	set mode = "-do"
endif

set LIST="../Menus Menu1 MenuBar1 OptionMenu1 PopupMenu1 -next \
../Text Text1 Text2 TextField2 TextField3 ScrollText1 ScrollText2 -next\
../Traversal Navigation3 Navigation12 -next\
../List List1 List2 -next\
../Buttons ArrowBGad1 PushBGad2 ToggleBGad1 ArrowBtn1 PushBtn1 ToggleBtn1 -next\
../Select Command2 FileSelect2 PromptDia1 SelectBox2 -next\
../Primitive Label1 LabelGad1 -next\
../Scrollbar Scale1 Scale3 Scrollbar1 Scrollbar2 -next\
../Shells DiaShell1 Protocol -next\
../Windows MainWin2 ScrollWin1"

set DIR=""
foreach i ( $LIST )
	if ( "$DIR" == "" ) then 
		set DIR = "$i"
	else
		if ( "$i" == "-next" ) then 
			set DIR = ""
		else
			if ( "$mode" == "-do" ) then
#set verbose
				rm -f C$i.c; ln -s $DIR/$i.c C$i.c
				rm -f C$i.dat; ln -s $DIR/$i.dat C$i.dat
				rm -f C$i.scr; ln -s $DIR/$i.scr C$i.scr
#unset verbose
			else if ( "$mode" == "-undo" ) then
#set verbose
				rm -f C$i.c; rm -f C$i.dat; rm -f C$i.scr
#unset verbose
			endif
		endif
	endif
end

#
# Create links for certain needed header files also
#
if ( "$mode" == "-do" ) then
	rm -f List1.h; ln -s ../List/List1.h List1.h
	rm -f List2.h; ln -s ../List/List2.h List2.h
	rm -f TextField1.h; ln -s ../Text/TextField1.h TextField1.h
else if ( "$mode" == "-undo" ) then
	rm -f List1.h
	rm -f List2.h
	rm -f TextField1.h
endif
