#****************************************************************************
# *
# *                               GBase.
# *
# *                           PROPRIETARY DATA
# *
# * Licensed Material - Property Of GBase
# *
# * "Restricted Materials of GBase"
# *
# * GBase Client SDK
# *
# * (c)  Copyright GBASE  2002. All rights reserved.
# *
# ****************************************************************************
# */

@echo off
rem This batch file is for renaming GBasedbt ClientSDK component
rem c++ directories to cpp and vice versa under incl, lib and demo

rem This batch file should be run under %GBASEDBTDIR%\bin directory

rem check if both c++ and cpp directories under lib, incl and demo
rem if both exist then report error and exit

rem Rename c++ or cpp directory under %GBASEDBTDIR%\lib
cd ..
goto renlibdir

:renlibdir
cd lib
echo Renaming directory under %GBASEDBTDIR%\lib
if exist c++\nul goto renlibc++dir
if exist cpp\nul goto renlibcppdir

:renlibc++dir
echo Renaming %GBASEDBTDIR%\lib\c++ as %GBASEDBTDIR%\lib\cpp
rename c++ cpp
goto incl

:renlibcppdir
echo Renaming %GBASEDBTDIR%\lib\cpp as %GBASEDBTDIR%\lib\c++
rename cpp c++
goto incl

:incl
rem Rename c++ or cpp directory under %GBASEDBTDIR%\incl
cd ..
goto renincldir

:renincldir
cd incl
echo Renaming directory under %GBASEDBTDIR%\incl
if exist c++\nul goto reninclc++dir
if exist cpp\nul goto reninclcppdir

:reninclc++dir
echo Renaming %GBASEDBTDIR%\incl\c++ as %GBASEDBTDIR%\incl\cpp
rename c++ cpp
goto demo

:reninclcppdir
echo Renaming %GBASEDBTDIR%\incl\cpp as %GBASEDBTDIR%\incl\c++
rename cpp c++
goto demo

:demo
rem Rename c++ or cpp directory under %GBASEDBTDIR%\demo
cd ..
goto rendemodir

:rendemodir
cd demo
echo Renaming directory under %GBASEDBTDIR%\demo
if exist c++\nul goto rendemoc++dir
if exist cpp\nul goto rendemocppdir

:rendemoc++dir
echo Renaming %GBASEDBTDIR%\demo\c++ as %GBASEDBTDIR%\demo\cpp
rename c++ cpp
goto end

:rendemocppdir
echo Renaming %GBASEDBTDIR%\demo\cpp as %GBASEDBTDIR%\demo\c++
rename cpp c++
goto end

:end
cd ..
cd bin
echo Successfully terminating batch program
pause
