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. |
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. |
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.
Previous | Next | Contents | Index |