#!/bin/sh
# This script is invoked when installing manual entries.  It generates
# additional links to manual entries, corresponding to the procedure
# and command names described by the manual entry.  For example, the
# Tcl manual entry Hash.3 describes procedures Tcl_InitHashTable,
# Tcl_CreateHashEntry, and many more.  This script will make hard
# links so that Tcl_InitHashTable.3, Tcl_CreateHashEntry.3, and so
# on all refer to Hash.3 in the installed directory.
#
# Because of the length of command and procedure names, this mechanism
# only works on machines that support file names longer than 14 characters.
# This script checks to see if long file names are supported, and it
# doesn't make any links if they are not.
#
# The script takes one argument, which is the name of the directory
# where the manual entries have been installed.

if test $# != 1; then
    echo "Usage: mkLinks dir"
    exit 1
fi

echo foo >  xyzzyTestingAVeryLongFileName.foo
x=`echo xyzzyTe*`
rm xyzzyTe*
if test "$x" != "xyzzyTestingAVeryLongFileName.foo"; then
    exit 0
fi
if test -r $1/AddErrInfo.3; then
    rm -f $1/Tcl_AddErrorInfo.3
    cp $1/AddErrInfo.3 $1/Tcl_AddErrorInfo.3
fi
if test -r $1/AllowExc.3; then
    rm -f $1/Tcl_AllowExceptions.3
    cp $1/AllowExc.3 $1/Tcl_AllowExceptions.3
fi
if test -r $1/AppInit.3; then
    rm -f $1/Tcl_AppInit.3
    cp $1/AppInit.3 $1/Tcl_AppInit.3
fi
if test -r $1/SetResult.3; then
    rm -f $1/Tcl_AppendElement.3
    cp $1/SetResult.3 $1/Tcl_AppendElement.3
fi
if test -r $1/SetResult.3; then
    rm -f $1/Tcl_AppendResult.3
    cp $1/SetResult.3 $1/Tcl_AppendResult.3
fi
if test -r $1/Async.3; then
    rm -f $1/Tcl_AsyncCreate.3
    cp $1/Async.3 $1/Tcl_AsyncCreate.3
fi
if test -r $1/Async.3; then
    rm -f $1/Tcl_AsyncDelete.3
    cp $1/Async.3 $1/Tcl_AsyncDelete.3
fi
if test -r $1/Async.3; then
    rm -f $1/Tcl_AsyncInvoke.3
    cp $1/Async.3 $1/Tcl_AsyncInvoke.3
fi
if test -r $1/Async.3; then
    rm -f $1/Tcl_AsyncMark.3
    cp $1/Async.3 $1/Tcl_AsyncMark.3
fi
if test -r $1/Backslash.3; then
    rm -f $1/Tcl_Backslash.3
    cp $1/Backslash.3 $1/Tcl_Backslash.3
fi
if test -r $1/CallDel.3; then
    rm -f $1/Tcl_CallWhenDeleted.3
    cp $1/CallDel.3 $1/Tcl_CallWhenDeleted.3
fi
if test -r $1/CmdCmplt.3; then
    rm -f $1/Tcl_CommandComplete.3
    cp $1/CmdCmplt.3 $1/Tcl_CommandComplete.3
fi
if test -r $1/Concat.3; then
    rm -f $1/Tcl_Concat.3
    cp $1/Concat.3 $1/Tcl_Concat.3
fi
if test -r $1/SplitList.3; then
    rm -f $1/Tcl_ConvertElement.3
    cp $1/SplitList.3 $1/Tcl_ConvertElement.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_CreateAlias.3
    cp $1/CrtSlave.3 $1/Tcl_CreateAlias.3
fi
if test -r $1/CrtCommand.3; then
    rm -f $1/Tcl_CreateCommand.3
    cp $1/CrtCommand.3 $1/Tcl_CreateCommand.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_CreateHashEntry.3
    cp $1/Hash.3 $1/Tcl_CreateHashEntry.3
fi
if test -r $1/CrtInterp.3; then
    rm -f $1/Tcl_CreateInterp.3
    cp $1/CrtInterp.3 $1/Tcl_CreateInterp.3
fi
if test -r $1/CrtMathFnc.3; then
    rm -f $1/Tcl_CreateMathFunc.3
    cp $1/CrtMathFnc.3 $1/Tcl_CreateMathFunc.3
fi
if test -r $1/CrtPipelin.3; then
    rm -f $1/Tcl_CreatePipeline.3
    cp $1/CrtPipelin.3 $1/Tcl_CreatePipeline.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_CreateSlave.3
    cp $1/CrtSlave.3 $1/Tcl_CreateSlave.3
fi
if test -r $1/CrtTrace.3; then
    rm -f $1/Tcl_CreateTrace.3
    cp $1/CrtTrace.3 $1/Tcl_CreateTrace.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringAppend.3
    cp $1/DString.3 $1/Tcl_DStringAppend.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringAppendElement.3
    cp $1/DString.3 $1/Tcl_DStringAppendElement.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringEndSublist.3
    cp $1/DString.3 $1/Tcl_DStringEndSublist.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringFree.3
    cp $1/DString.3 $1/Tcl_DStringFree.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringGetResult.3
    cp $1/DString.3 $1/Tcl_DStringGetResult.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringInit.3
    cp $1/DString.3 $1/Tcl_DStringInit.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringLength.3
    cp $1/DString.3 $1/Tcl_DStringLength.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringResult.3
    cp $1/DString.3 $1/Tcl_DStringResult.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringSetLength.3
    cp $1/DString.3 $1/Tcl_DStringSetLength.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringStartSublist.3
    cp $1/DString.3 $1/Tcl_DStringStartSublist.3
fi
if test -r $1/DString.3; then
    rm -f $1/Tcl_DStringValue.3
    cp $1/DString.3 $1/Tcl_DStringValue.3
fi
if test -r $1/AssocData.3; then
    rm -f $1/Tcl_DeleteAssocData.3
    cp $1/AssocData.3 $1/Tcl_DeleteAssocData.3
fi
if test -r $1/CrtCommand.3; then
    rm -f $1/Tcl_DeleteCommand.3
    cp $1/CrtCommand.3 $1/Tcl_DeleteCommand.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_DeleteHashEntry.3
    cp $1/Hash.3 $1/Tcl_DeleteHashEntry.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_DeleteHashTable.3
    cp $1/Hash.3 $1/Tcl_DeleteHashTable.3
fi
if test -r $1/CrtInterp.3; then
    rm -f $1/Tcl_DeleteInterp.3
    cp $1/CrtInterp.3 $1/Tcl_DeleteInterp.3
fi
if test -r $1/CrtTrace.3; then
    rm -f $1/Tcl_DeleteTrace.3
    cp $1/CrtTrace.3 $1/Tcl_DeleteTrace.3
fi
if test -r $1/DetachPids.3; then
    rm -f $1/Tcl_DetachPids.3
    cp $1/DetachPids.3 $1/Tcl_DetachPids.3
fi
if test -r $1/CallDel.3; then
    rm -f $1/Tcl_DontCallWhenDeleted.3
    cp $1/CallDel.3 $1/Tcl_DontCallWhenDeleted.3
fi
if test -r $1/EnterFile.3; then
    rm -f $1/Tcl_EnterFile.3
    cp $1/EnterFile.3 $1/Tcl_EnterFile.3
fi
if test -r $1/Eval.3; then
    rm -f $1/Tcl_Eval.3
    cp $1/Eval.3 $1/Tcl_Eval.3
fi
if test -r $1/Eval.3; then
    rm -f $1/Tcl_EvalFile.3
    cp $1/Eval.3 $1/Tcl_EvalFile.3
fi
if test -r $1/ExprLong.3; then
    rm -f $1/Tcl_ExprBoolean.3
    cp $1/ExprLong.3 $1/Tcl_ExprBoolean.3
fi
if test -r $1/ExprLong.3; then
    rm -f $1/Tcl_ExprDouble.3
    cp $1/ExprLong.3 $1/Tcl_ExprDouble.3
fi
if test -r $1/ExprLong.3; then
    rm -f $1/Tcl_ExprLong.3
    cp $1/ExprLong.3 $1/Tcl_ExprLong.3
fi
if test -r $1/ExprLong.3; then
    rm -f $1/Tcl_ExprString.3
    cp $1/ExprLong.3 $1/Tcl_ExprString.3
fi
if test -r $1/EnterFile.3; then
    rm -f $1/Tcl_FilePermissions.3
    cp $1/EnterFile.3 $1/Tcl_FilePermissions.3
fi
if test -r $1/FindExec.3; then
    rm -f $1/Tcl_FindExecutable.3
    cp $1/FindExec.3 $1/Tcl_FindExecutable.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_FindHashEntry.3
    cp $1/Hash.3 $1/Tcl_FindHashEntry.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_FirstHashEntry.3
    cp $1/Hash.3 $1/Tcl_FirstHashEntry.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_GetAlias.3
    cp $1/CrtSlave.3 $1/Tcl_GetAlias.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_GetAliases.3
    cp $1/CrtSlave.3 $1/Tcl_GetAliases.3
fi
if test -r $1/AssocData.3; then
    rm -f $1/Tcl_GetAssocData.3
    cp $1/AssocData.3 $1/Tcl_GetAssocData.3
fi
if test -r $1/GetInt.3; then
    rm -f $1/Tcl_GetBoolean.3
    cp $1/GetInt.3 $1/Tcl_GetBoolean.3
fi
if test -r $1/CrtCommand.3; then
    rm -f $1/Tcl_GetCommandInfo.3
    cp $1/CrtCommand.3 $1/Tcl_GetCommandInfo.3
fi
if test -r $1/GetInt.3; then
    rm -f $1/Tcl_GetDouble.3
    cp $1/GetInt.3 $1/Tcl_GetDouble.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_GetHashKey.3
    cp $1/Hash.3 $1/Tcl_GetHashKey.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_GetHashValue.3
    cp $1/Hash.3 $1/Tcl_GetHashValue.3
fi
if test -r $1/GetInt.3; then
    rm -f $1/Tcl_GetInt.3
    cp $1/GetInt.3 $1/Tcl_GetInt.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_GetMaster.3
    cp $1/CrtSlave.3 $1/Tcl_GetMaster.3
fi
if test -r $1/EnterFile.3; then
    rm -f $1/Tcl_GetOpenFile.3
    cp $1/EnterFile.3 $1/Tcl_GetOpenFile.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_GetSlave.3
    cp $1/CrtSlave.3 $1/Tcl_GetSlave.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_GetSlaves.3
    cp $1/CrtSlave.3 $1/Tcl_GetSlaves.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_GetVar.3
    cp $1/SetVar.3 $1/Tcl_GetVar.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_GetVar2.3
    cp $1/SetVar.3 $1/Tcl_GetVar2.3
fi
if test -r $1/Eval.3; then
    rm -f $1/Tcl_GlobalEval.3
    cp $1/Eval.3 $1/Tcl_GlobalEval.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_HashStats.3
    cp $1/Hash.3 $1/Tcl_HashStats.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_InitHashTable.3
    cp $1/Hash.3 $1/Tcl_InitHashTable.3
fi
if test -r $1/Interp.3; then
    rm -f $1/Tcl_Interp.3
    cp $1/Interp.3 $1/Tcl_Interp.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_IsSafe.3
    cp $1/CrtSlave.3 $1/Tcl_IsSafe.3
fi
if test -r $1/LinkVar.3; then
    rm -f $1/Tcl_LinkVar.3
    cp $1/LinkVar.3 $1/Tcl_LinkVar.3
fi
if test -r $1/CrtSlave.3; then
    rm -f $1/Tcl_MakeSafe.3
    cp $1/CrtSlave.3 $1/Tcl_MakeSafe.3
fi
if test -r $1/SplitList.3; then
    rm -f $1/Tcl_Merge.3
    cp $1/SplitList.3 $1/Tcl_Merge.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_NextHashEntry.3
    cp $1/Hash.3 $1/Tcl_NextHashEntry.3
fi
if test -r $1/AddErrInfo.3; then
    rm -f $1/Tcl_PosixError.3
    cp $1/AddErrInfo.3 $1/Tcl_PosixError.3
fi
if test -r $1/PrintDbl.3; then
    rm -f $1/Tcl_PrintDouble.3
    cp $1/PrintDbl.3 $1/Tcl_PrintDouble.3
fi
if test -r $1/DetachPids.3; then
    rm -f $1/Tcl_ReapDetachedProcs.3
    cp $1/DetachPids.3 $1/Tcl_ReapDetachedProcs.3
fi
if test -r $1/RecordEval.3; then
    rm -f $1/Tcl_RecordAndEval.3
    cp $1/RecordEval.3 $1/Tcl_RecordAndEval.3
fi
if test -r $1/RegExp.3; then
    rm -f $1/Tcl_RegExpCompile.3
    cp $1/RegExp.3 $1/Tcl_RegExpCompile.3
fi
if test -r $1/RegExp.3; then
    rm -f $1/Tcl_RegExpExec.3
    cp $1/RegExp.3 $1/Tcl_RegExpExec.3
fi
if test -r $1/RegExp.3; then
    rm -f $1/Tcl_RegExpMatch.3
    cp $1/RegExp.3 $1/Tcl_RegExpMatch.3
fi
if test -r $1/RegExp.3; then
    rm -f $1/Tcl_RegExpRange.3
    cp $1/RegExp.3 $1/Tcl_RegExpRange.3
fi
if test -r $1/SetResult.3; then
    rm -f $1/Tcl_ResetResult.3
    cp $1/SetResult.3 $1/Tcl_ResetResult.3
fi
if test -r $1/SplitList.3; then
    rm -f $1/Tcl_ScanElement.3
    cp $1/SplitList.3 $1/Tcl_ScanElement.3
fi
if test -r $1/AssocData.3; then
    rm -f $1/Tcl_SetAssocData.3
    cp $1/AssocData.3 $1/Tcl_SetAssocData.3
fi
if test -r $1/CrtCommand.3; then
    rm -f $1/Tcl_SetCommandInfo.3
    cp $1/CrtCommand.3 $1/Tcl_SetCommandInfo.3
fi
if test -r $1/AddErrInfo.3; then
    rm -f $1/Tcl_SetErrorCode.3
    cp $1/AddErrInfo.3 $1/Tcl_SetErrorCode.3
fi
if test -r $1/Hash.3; then
    rm -f $1/Tcl_SetHashValue.3
    cp $1/Hash.3 $1/Tcl_SetHashValue.3
fi
if test -r $1/SetRecLmt.3; then
    rm -f $1/Tcl_SetRecursionLimit.3
    cp $1/SetRecLmt.3 $1/Tcl_SetRecursionLimit.3
fi
if test -r $1/SetResult.3; then
    rm -f $1/Tcl_SetResult.3
    cp $1/SetResult.3 $1/Tcl_SetResult.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_SetVar.3
    cp $1/SetVar.3 $1/Tcl_SetVar.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_SetVar2.3
    cp $1/SetVar.3 $1/Tcl_SetVar2.3
fi
if test -r $1/SplitList.3; then
    rm -f $1/Tcl_SplitList.3
    cp $1/SplitList.3 $1/Tcl_SplitList.3
fi
if test -r $1/StrMatch.3; then
    rm -f $1/Tcl_StringMatch.3
    cp $1/StrMatch.3 $1/Tcl_StringMatch.3
fi
if test -r $1/TildeSubst.3; then
    rm -f $1/Tcl_TildeSubst.3
    cp $1/TildeSubst.3 $1/Tcl_TildeSubst.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_TraceVar.3
    cp $1/TraceVar.3 $1/Tcl_TraceVar.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_TraceVar2.3
    cp $1/TraceVar.3 $1/Tcl_TraceVar2.3
fi
if test -r $1/LinkVar.3; then
    rm -f $1/Tcl_UnlinkVar.3
    cp $1/LinkVar.3 $1/Tcl_UnlinkVar.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_UnsetVar.3
    cp $1/SetVar.3 $1/Tcl_UnsetVar.3
fi
if test -r $1/SetVar.3; then
    rm -f $1/Tcl_UnsetVar2.3
    cp $1/SetVar.3 $1/Tcl_UnsetVar2.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_UntraceVar.3
    cp $1/TraceVar.3 $1/Tcl_UntraceVar.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_UntraceVar2.3
    cp $1/TraceVar.3 $1/Tcl_UntraceVar2.3
fi
if test -r $1/UpVar.3; then
    rm -f $1/Tcl_UpVar.3
    cp $1/UpVar.3 $1/Tcl_UpVar.3
fi
if test -r $1/UpVar.3; then
    rm -f $1/Tcl_UpVar2.3
    cp $1/UpVar.3 $1/Tcl_UpVar2.3
fi
if test -r $1/Eval.3; then
    rm -f $1/Tcl_VarEval.3
    cp $1/Eval.3 $1/Tcl_VarEval.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_VarTraceInfo.3
    cp $1/TraceVar.3 $1/Tcl_VarTraceInfo.3
fi
if test -r $1/TraceVar.3; then
    rm -f $1/Tcl_VarTraceInfo2.3
    cp $1/TraceVar.3 $1/Tcl_VarTraceInfo2.3
fi
exit 0
