To verify HLC is installed correctly on Unix, run the Tank sample application.

To run the sample application on Unix:

  1. Log on as a system administrator.
  2. Set the environment variables for the C compiler.
  3. Copy the example HLC files to your working directory:
    cp $DLC/oebuild/hlc/examples/* .
    Note: Before you develop your own applications, move c and build_prohlc.sh to a directory that is in your path and move hlc.h to your include file directory or your current working directory.
  4. Run the testhlc script in the command line.

The testhlc script creates an empty database, compiles the C source files to create object files in your current directory, links your test HLC module, and runs a small sample application.

After you run hltank.p, verify the results you obtain are correct by comparing them with the following results, which list the input values for radius, tlength, and depth, and the correct output for tavail:



The following code example is the testhlc script on Unix:

#!/bin/sh
#  testhlc -- single-user test of HLC

#BLOCK 1
DLC=${DLC-/usr/dlc};export DLC
DLCDB=${DLCDB-$DLC};export DLCDB
OEBUILD=${OEBUILD-$DLC/oebuild};export OEBUILD

#BLOCK 2
SOURCEDB=$DLCDB/empty
DBNAME=hlcdemo
rm -fr $DBNAME.*
$DLC/bin/prodb $DBNAME $SOURCEDB
if [ $? -ne 0 ]
then
	echo "Failed to create database"
	exit 1
fi

#BLOCK 3
echo Now compiling *.c ...
c *.c
mv hlprodsp.o $OEBUILD/obj/

#BLOCK 4
echo Now making the test hlc shared object ...
HLC_OBJS="`ls -1 *.o`"
export HLC_OBJS
. $OEBUILD/make/build_prohlc.sh

export PROHLC=libprohlc.so

#BLOCK 5
rx $DBNAME -1 -p hldemo.p

if [ -r hlcout ] 
then

	if cmp -s hlcout savehlc
	then
		 echo "** HLC Installation Test has Completed Successfully."
	else
		 diff hlcout savehlc >testhlc.diff
		 echo "** HLC Installation Test reports conflicts."
		 echo "   Please look at files:"
		 echo "      'hlcout.dif', 'hlcout' & 'savehlc'"
	fi
fi

The following notes explain the blocks in the Unix testhlc script:

  1. Sets up your Unix environment.
  2. Creates and starts an empty database.
  3. Compiles all the .c files necessary to run the sample application.
  4. Links and loads the object files.
  5. Starts an OpenEdge session and runs the hldemo.p procedure.