HP-UX SNAplus2 R7 APPC Programmer's Guide

Writing Transaction Programs
Writing Portable TPs
2.13 Writing Portable TPs
The following guidelines are provided for writing TPs that they will are portable to other operating system
environments:
Include the APPC header le without any pathname prex. Use include options on the compiler to locate the
le (see the appropriate section for your operating system, earlier in this chapter). This enables the TP to be
used in an environment with a different le system.
Use the symbolic constant names for parameter values and return codes, not the numeric values shown in the
header le; this ensures that the correct value will be used regardless of the way these values are stored in
memory.
Include a check for return codes other than those applicable to your current operating system (for example using
a default case in a switch statement), and provide appropriate diagnostics.
Use the asynchronous entry point.
The [MC_]RECEIVE_AND_POST verb cannot be used if the TP is to be completely portable. If you use this
verb, you will need to rewrite sections of the TP for use in other environments. You may want to restrict the
use of this verb to a few specic routines, to allow easier modication.
The extended form of the RECEIVE_ALLOCATE verb is specic to the SNAplus2 APPC implementation, and
is not provided by other APPC implementations. If you use this form of the verb, you will need to rewrite
sections of the TP for use in other environments. You may want to restrict the use of this feature to a few
specic routines, to allow easier modication.
76