#!/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.
ZIP=true
while true; do
case $1 in
-s | --symlinks )
S=-s
;;
-z | --compress )
ZIP=$2
shift
;;
*) break
;;
esac
shift
done
if test $# != 1; then
echo "Usage: mkLinks <options> dir"
exit 1
fi
if test "x$ZIP" != "xtrue"; then
touch TeST
$ZIP TeST
Z=`ls TeST* | sed 's/^[^.]*//'`
rm -f TeST*
fi
cd $1
echo foo > xyzzyTestingAVeryLongFileName.foo
x=`echo xyzzyTe*`
echo foo > xyzzyTestingaverylongfilename.foo
y=`echo xyzzyTestingav*`
rm xyzzyTe*
if test "$x" != "xyzzyTestingAVeryLongFileName.foo"; then
exit
fi
if test "$y" != "xyzzyTestingaverylongfilename.foo"; then
CASEINSENSITIVEFS=1
fi
if test -r geoLn.3
then
rm -f geoLn.3.*
$ZIP geoLn.3
for mpg in GeoLn GeoLnCreate GeoLnClear GeoLnSetAlloc GeoLnAddPt GeoLnInfo GeoLnGetPt GeoLnDestroy GeoLnCtr GeoLnContainGeoPt
do
rm -f $mpg ${mpg}.*
ln $S geoLn.3$Z ${mpg}.3$Z
done
fi
if test -r geoLnArr.3
then
rm -f geoLnArr.3.*
$ZIP geoLnArr.3
for mpg in GeoLnArr GeoLnArrCreate GeoLnArrSetDescr GeoLnArrSetAlloc GeoLnArrAddLine GeoLnArrPutLine GeoLnArrContainGeoPt GeoLnArrGetDescr GeoLnArrGetInfo GeoLnArrGetLine GeoLnArrFree GeoLnArrDestroy,
do
rm -f $mpg ${mpg}.*
ln $S geoLnArr.3$Z ${mpg}.3$Z
done
fi
if test -r geoProj.3
then
rm -f geoProj.3.*
$ZIP geoProj.3
for mpg in GeoProj GeoProjAlloc GeoProjInit GeoProjFree GeoProjDestroy GeoProjGetInfo GeoProjGetType GeoProjDescriptor ProjToLatLon LatLonToProj SetCylEqDist SetCylEqArea SetMercator SetLambertConfConic SetLambertEqArea SetStereographic SetOrthographic
do
rm -f $mpg ${mpg}.*
ln $S geoProj.3$Z ${mpg}.3$Z
done
fi
if test -r geography.3
then
rm -f geography.3.*
$ZIP geography.3
for mpg in REarth SetREarth BadAngle AngleIsOK AngleIsBad AngleFmDeg AngleToDeg AngleFmRad AngleToRad ISin ICos GeoPtSetDeg GeoPtSetRad GeoPtGetDeg GeoPtGetRad GeoPtIsSomewhere GeoPtIsNowhere GeoPtNowhere MapPtIsSomewhere MapPtIsNowhere MapPtNowhere ScaleMapPt GeoStep GeoDistance GeoQuickDistance Azimuth GCircleX DomainLat DomainLon GwchLon DomainLonPt GwchLonPt LonCmp LatCmp AngleCmp LonBtwn LonBtwn1 Rotation NewRotation SetRotation GetRotation DeleteRotation Rotate
do
rm -f $mpg ${mpg}.*
ln $S geography.3$Z ${mpg}.3$Z
done
fi
if test -r mapLn.3
then
rm -f mapLn.3.*
$ZIP mapLn.3
for mpg in MapLn MapLnCreate MapLnClear MapLnSetAlloc MapLnAddPt MapLnGetInfo MapLnGetPt MapLnDestroy
do
rm -f $mpg ${mpg}.*
ln $S mapLn.3$Z ${mpg}.3$Z
done
fi
if test -r mapLnArr.3
then
rm -f mapLnArr.3.*
$ZIP mapLnArr.3
for mpg in MapLnArr MapLnArrCreate MapLnArrSet MapLnArrSetDescr MapLnArrSetAlloc MapLnArrAddLine MapLnArrGetDescr MapLnArrGetInfo MapLnArrGetLine MapLnArrDestroy
do
rm -f $mpg ${mpg}.*
ln $S mapLnArr.3$Z ${mpg}.3$Z
done
fi
if test -r tclgeomap.3
then
rm -f tclgeomap.3.*
$ZIP tclgeomap.3
for mpg in Tclgeomap_Init Tclgeomap_NewGeoPtObj Tclgeomap_SetGeoPtObj Tclgeomap_GetGeoPtFromObj Tclgeomap_NewMapPtObj Tclgeomap_SetMapPtObj Tclgeomap_GetMapPtFromObj Tclgeomap_GetProj Tclgeomap_ProjName Tclgeomap_AddProjUpdateTask Tclgeomap_CnxProjUpdateTask Tclgeomap_AddProjDeleteTask Tclgeomap_CnxProjDeleteTask Tclgeomap_AddLnArr Tclgeomap_GetLnArr Tclgeomap_LnArrName Tclgeomap_AddLnArrDeleteTask Tclgeomap_CnxLnArrDeleteTask Tclgeomap_AddPlaceUpdateTask Tclgeomap_CnxPlaceUpdateTask Tclgeomap_AddPlaceDeleteTask Tclgeomap_CnxPlaceDeleteTask Tclgeomap_GetPlace Tclgeomap_PlaceLoc Tclgeomap_PlaceName
do
rm -f $mpg ${mpg}.*
ln $S tclgeomap.3$Z ${mpg}.3$Z
done
fi
if test -r tclgeomap.n
then
rm -f tclgeomap.n.*
$ZIP tclgeomap.n
for mpg in georadius latlonok mapptok lonbtwn gclcross rotatpt scalept domnlat domnlon domnlonpt gwchlon gwchpt dmstodec dectodm dectodms cartg projection lnarr place
do
rm -f $mpg ${mpg}.*
ln $S tclgeomap.n$Z ${mpg}.n$Z
done
fi
if test -r tclgeomap_procs.n
then
rm -f tclgeomap_procs.n.*
$ZIP tclgeomap_procs.n
for mpg in latitude longitude latlon circle fillsegment grid_list ocean_list
do
rm -f $mpg ${mpg}.*
ln $S tclgeomap_procs.n$Z ${mpg}.n$Z
done
fi
syntax highlighted by Code2HTML, v. 0.9.1