Previous | Contents | Index |
Other properties may be defined in the CDD for records and fields. ACMSADU supports translation of the following property to STDL:
OCCURS
The OCCURS field declares fixed-length, one-dimensional arrays.
OCCURS n TIMES |
This chapter describes how to use the TPware client build utility and
its GUI to build Automation or C clients on Windows NT or Windows 95/98
systems.
5.1 Building Client Programs
The TPware client build utility provides a GUI that makes it easier for you to create Automation or C clients. You provide input through the GUI, and the utility creates the files needed to build the client program.
As input, you provide the utility with an STDL task group file name, an input adapter type, an output adapter type, and an output directory name. The utility places the created files in the specified output directory along with a log file that describes the results of running the utility, including errors if any occurred. The utility notifies you whether the build succeeded or failed.
Although the client build utility eliminates some of the complexity of having to create a makefile (the utility creates the client makefile), you need to refer to Chapter 3 and the specific client chapters for other steps associated with creating a client.
Using the client build utility requires that you fulfill the following prerequisites:
The following sections describe some differences in the way the utility
builds specific clients.
5.1.1 Building an Automation Client
If the input adapter type that you specify is Automation, the utility creates a makefile that invokes the STDL compiler and the platform linker to create a DLL that is invoked by the Automation client. The utility performs the following operations:
See Chapter 7 for information about registering this DLL and other
steps for creating an Automation client.
5.1.2 Building a C Client
If the input adapter type that you specify is C, the utility creates a makefile that invokes the STDL compiler to create build files in the output directory. As shown in Table 5-1, the files generated for building a client depend on the output adapter type that you specify.
Adapter Type | File Type | File Name |
---|---|---|
ACMS | Header | input_file_name.h |
Object | task_group_name_c_acmsda.obj | |
ACMSxp-DCE | Header | input_file_name.h |
Object | task_group_name_dce_cstub.obj | |
Object | task_group_name_c_dce.obj | |
ACMSxp-MSRPC | Header | input_file_name.h |
Object | task_group_name_msrpc_c.obj | |
Object | task_group_name_c_msrpc.obj | |
Portable TP | Header | input_file_name.h |
Object | task_group_name_c_mts.obj | |
DLL | task_group_name_mts_ps.dll |
A header file (.h) is a file that you include in your C compile. Object files (.obj) are files that you link with your C client. The DLL file is a proxy stub DLL that you can register (see Chapter 9).
See Chapter 6 for more information about linking object files and
libraries with your C client.
5.2 The Graphical User Interface
The client build utility allows you to easily enter your requisite build information through a GUI. By using the GUI, you do not need to use the STDL command-line interface and, in the case of Automation clients, you do not need to write a client build makefile.
To invoke the client build utility, choose TPware Client Build Utility from the TPware program group. When the TPware Client Build Utility screen opens, enter the information that is appropriate for the client that you want to build:
In the output directory, the utility creates a subdirectory for temporary files. When the build is completed successfully, the utility deletes this subdirectory.
The utility also creates a log file, makefile, and a batch file in the output directory. If the object files or the DLL are created successfully, the utility deletes the makefile and batch file. However, if errors occur, the utility retains these files for debugging purposes.
Before invoking the makefile that invokes the STDL compiler, the utility runs the stdl_set_version.bat batch file to set up the environment for the STDL compiler to run successfully. The location of stdl_set_version.bat depends on an environment variable (STDL_DEV_DIR) that is set during installation of the product (see Section 2.1). If the utility cannot find this file via the environment variable, an error occurs.
Client programs written in C can call:
6.1 Steps for Writing and Building the Client
To build a client program written in C, perform the following steps:
When building a C client program, you can perform the compile step using the client build utility GUI (see Chapter 5) rather than the command-line interface described here. However, this utility does not support asynchronous clients. |
Adapter Type | Specification | Purpose |
---|---|---|
Input | async | Executes asynchronous calls to ACMS tasks, ACMSxp tasks, or tasks running under a Portable TP for Windows NT system |
c | Executes synchronous calls to ACMS tasks, ACMSxp tasks, or tasks running under a Portable TP for Windows NT system | |
Output | acmsda | Calls ACMS tasks |
dce | Calls ACMSxp tasks using the DCE RPC protocol | |
msrpc | Calls ACMSxp tasks using the Microsoft RPC protocol | |
mts | Calls tasks running under a Portable TP for Windows NT system |
stdl -c -a c:dce test_task_group |
group.h |
group_c_out_adapter.obj |
The format conventions are:
group | Converted name of the compiled STDL task group specification. When developing client interfaces for ACMS applications, the group name prefix is the ACMS application_name prefix (see Section 4.2.3). |
c | Value for either the C or asynchronous input adapter. If you specify an asynchronous input adapter, c appears in the name, not async . |
out_adapter | One of the values for the specified output adapter types listed in Table 6-1. |
If Client Calls... | Input File Name is... | Comment |
---|---|---|
ACMS tasks (uses acmsda adapter) | group_c_acmsda.obj | The adapter stub for the ACMS application (STDL task group) |
stdl_acmsda.lib | ACMS Gateway adapter runtime link library | |
ACMSxp tasks and uses dce adapter | group_c_dce.obj | Adapter stub for the task group |
group_dce_cstub.obj | DCE client stub | |
libdce.lib
pthreads.lib stdl_dce.lib |
DCE libraries | |
ACMSxp tasks and uses the msrpc adapter | group_c_msrpc.obj | Adapter stub for the task group |
group_msrpc_c.obj | Microsoft RPC client stub | |
stdl_msrpc.lib | Microsoft RPC adapter runtime link library | |
rpcndr.lib
rpcns4.lib rpcrt4.lib |
Windows NT libraries | |
Tasks running under a Portable TP for Windows NT system, and the client runs on a different hardware architecture than the server (client uses the mts adapter) | group_c_mts.obj | Adapter stub for the task group |
stdl_mts.lib | MTS adapter runtime link library | |
Tasks running under a Portable TP for Windows NT system, and the client runs on the same hardware architecture as the server (client uses the mts adapter) | group_cli.obj | The client stub for the task group copied from the Portable TP for Windows NT development system |
stdl_mts.lib | MTS adapter runtime link library |
stdl_rtm.lib |
The STDL compiler generates C header files to support client development. Include the following files in your C client:
The STDL compiler creates a function prototype that contains a C external task name function declaration for each noncomposable task in a task group specification. The function prototypes are written to the group header file. Unless the calls are to ACMS applications, functions have the following format:
converted-task-name([argument [,...]]) |
Task names are converted to function names according to the rules for identifiers (see Section 6.2.4). Task function declarations do not have a value, and all arguments are passed as pointers.
Call the C procedures for the tasks as normal procedure calls.
For each task argument, declare a variable using the STDL data type
definition from the group header file.
6.2.1.1 ACMS Task Call Arguments
If the calls are to ACMS applications, functions have the following format:
converted-task-name(string,status[,argument [,...]]) |
The string argument is the selection string, consisting of one
STDL record containing one 256-character field of data type ISO-LATIN-1
text. The status argument is an extended status string,
consisting of one STDL record containing one 80-character field of data
type ISO-LATIN-1 text. This extended status is message text associated
with an error returned from the ACMS application (see
Section 3.4.6.2).
6.2.2 STDL to C Data Type Mapping
The group header file contains C definitions corresponding to record data type definitions in the STDL source files. Table 6-3 maps the STDL data types to the C data types. The STDL compiler generates header files with these mappings.
STDL | C |
---|---|
ARRAY SIZE n OF type | type id[ n] |
ARRAY SIZE
n OF ARRAY SIZE
m
OF type |
type id[ n] [ m] |
ARRAY SIZE
n TO
m
DEPENDING ON number OF type 1 |
struct
rec {
long int number ; type id[ n] ; } ; |
DECIMAL STRING SIZE a SCALE b | char id[ a+1] 2 |
INTEGER | long id (or equivalent signed long, long int, or signed long int) |
OCTET | unsigned char id |
TYPE
rec IS RECORD
id IS type ; END ; |
struct
rec {
type id; } ; |
TEXT SIZE
n CHARACTER SET
ISO-LATIN-1 ISO-LATIN-2 SIMPLE-LATIN |
char id[ n] |
TEXT SIZE
n CHARACTER SET
KANJI KATAKANA |
char id[ M] |
UUID | uuid_t id 3 |
Previous | Next | Contents | Index |