Kbase P30972: HLC: Example of a C program using HLC on UNIX
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/07/2003 |
|
Status: Unverified
GOAL:
Example of a C program using HLC
FIX:
1) Copy the following files from the $DLC/probuild/hlc directory into your working directory:
hlc.h, hlprodsp.c, and c
2) Add the definition of the HLC function "HOLA" into hlprodsp.c to look like this:
#define FUNCTEST(nam, rout) \
if (strcmp(nam, pfunnam) == 0) \
return rout(argc,argv);
long PRODSP(pfunnam, argc, argv)
char *pfunnam; /* Name of function to call */
int argc;
char *argv[];
{
FUNCTEST("HOLA",mytest);
return 1;
}
3) Create a file called mytest.c with the following c code:
#include "hlc.h"
int mytest (int argc, char *argv[]) {
promsgd("Hello World");
return 0;
}
4) execute the Progress script $DLC/probuild/eucapp/buildenv
5) Compile the hlprodsp.c and mytest.c programs using the following command:
./c *.c
This must generate the hlprodsp.o and mytest.o object files.
6) Execute probuild
7) In the first screen that reads "Install Link Script Into:" just select "<continue>"
8) In the "PRODUCT LIST" select "PROGRESS CLIENT" and press <ENTER>
9) Leave the default names for link scripts and select "<Continue>"
10) In the "CONFIGURABLE ELEMENTS" select "TCP-IP NETWORK PROTOCOL" and "HLC" then select "<Continue>"
11) In the "OBJECT FILES" screen, type hlprodsp.o and mytest.o and press "<Continue>"
12) Exit from Probuild by pressing <F4> twice.
13) Execute the script ldpro, this will generate an _progres executable. There must be no error messages or warnings.
14) Set the the environment variable PROEXE to point the new executable.
Example: PROEXE=/usr/hlc/_progres; export PROEXE
15) To test the HLC function with the following 4GL command:
CALL HOLA