OpenTP1 Version 7 Programming Reference C Language
UAPs used with the OpenTP1 require libraries for fulfilling inter-UAP service requests. One of these libraries is called a stub.
The explanation below deals with stubs of UAPs (SUP and SPP) which use an OpenTP1 remote procedure calls (dc_rpc_call()) and MHP stubs. See 1.3 Creating XATMI interface application programs (TCP/IP, OSI TP) on how to create stubs which will be used when the XATMI interface is used for communication.
Among the UAPs used with the OpenTP1, UAPs having service functions (SPP and MHP) usually require a stub. However, a stub is not required if all service functions are put in the UAP shared library from which they are loaded dynamically. The UAP shared library is created by linking the UAP object files compiled from UAP source files.
Note that UAPs that handle offline work and SUPs do not require a stub because they do not have a service function.
Before creating a stub, create a file (RPC interface definition file) in which UAP service functions are defined. Execute the stbmake command with this file as the argument.
When the stbmake command is executed, a source file (C-language source file) for the stub is created. Compile this file with the C-language compiler and link it to the object file of the UAP.
When modifying the stub, create the UAP from scratch. Modify the RPC interface definition file, recreate the stub, and link it to the object file of the recompiled UAP.
The figure below shows the stub creation procedure.
Figure 1-7 Stub creation procedure
When creating a stub, create a file which defines entry points to the SPP and MHP services. This is called the RPC interface definition. The file containing this definition is called the RPC interface definition file.
Create an RPC interface definition file for each executable file of the SPP or MHP.
Write the RPC interface definition in the following format:
entry "entry-point-name"["entry-point-name"...]; |
entry "sv01"; entry "sv02"; |
entry "sv01" "sv02"; |
The file name must end with the suffix .def indicating an RPC interface definition file. The directory to contain the file must be in a path that the stbmake command can search. No other restrictions are placed on it.
The name of an RPC interface definition file can have up to 255 characters. However, the name that can be specified may be shorter than 255 characters due to OS restrictions.
After the stbmake command is executed, a stub source file is created under a name different from that of the RPC interface definition file. Therefore, the RPC interface definition file is not used during the OpenTP1 operation.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.