Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Host Language Call Interface : Example HLC application : Running the sample application on UNIX
 
Running the sample application on UNIX
To verify that your HLC application is installed correctly on UNIX, run the sample application.
To run the sample application on UNIX:
1. Run the buildenv script provided in the $DLC/oebuild/eucapp directory to set up your HLC environment and to set environment variables for the C compiler and linker.
2. Create a working directory, then go to it.
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 buildenv to a directory that is in your path and move hlc.h to your include file directory or your current working directory.
4. Enter testhlc on 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 that 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:
Here is the testhlc script on UNIX:
#!/bin/sh
# testhlc -- single-user test of HLC

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

#2
SOURCEDB=$DLCDB/empty
DBNAME=hlcdemo
rm -fr $DBNAME.*
prodb $DBNAME $SOURCEDB

#3
echo Now compiling *.c ...
c *.c

#4
echo Now linking test hlc module ...
./ldhlcrx

#5
./_progres $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
These 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
Note: This link script is specific to the sample application. For your own application development, use the OEBuild utility to automatically generate a tailored link script.
5. Starts an OpenEdge session and runs the hldemo.p procedure