TCP/IP Programming Manual
3. Source SOCKDEFT to reference socket library structures.
4. Specify the CRE compiler directive (ENV COMMON) either in the program source code or in
the compilation line.
pTAL does not have access to the CRE initialization routine. For information about running a pTAL
program in the CRE environment, see the TNS/R Native Application Migration Guide.
1. All addresses must be 32 bits (.EXT).
2. Source SOCKPROC to reference socket library procedures.
3. Source SOCKDEFT to reference socket library structures.
4. Specify the CRE compiler directive (EXPORT_GLOBALS) prior to compilation.
TAL to pTAL Conversion Issues
NOTE: For more information about socket library support for TAL and pTAL applications, see
TALDOCUM in $system.ztcpip.
TAL users of the socket library converting to pTAL should use the SRL version of the socket library,
ZINETSRL. For applications unable to run as a CRE compliant executable, a CRE-independent
native mode socket library is provided, LNETINDN. LNETINDN is a linkable object.
The TAL-callable functions, paramcapture() and allparamcapture(), have been removed
from the D40 socket library. These functions provided a mechanism to save run-time parameters
used by the socket library (=TCPIP^PROCESS^NAME, =TCPIP^HOSTS^FILE, and so forth).
Because the DEFINE mechanism is now utilized instead of PARAM, this functionality is no longer
required.
The prototypes specified in SOCKPROC and the structure templates in SOCKDEFT have changed
to conform to the native version of the socket library. Function parameter and return value data
types that were specified as INT have been changed to INT(32). Applications converting from
TAL to pTAL must ensure that these data types are reflected accordingly in their code. Variables
of type INT in existing code need to be cast to INT(32), or declared as INT(32), for native
socket library function calls.
Defines in SOCKPROC and SOCKDEFT can be used as is with the following exception. AF_INET
and AF_INET6, defined in SOCKDEFT, are declared as INT(32) for a pTAL compiled application.
When using AF_INET or AF_INET6 within the sockaddr, sockaddr_in, or sockaddr_in6
structure, you must cast AF_INET or AF_INET6 to an INT when assigning it to sa_family,
sin_family, or sin6_family.
CRE Considerations
C applications using the Socket Library are compiled by the D-series C compiler. The C compiler
generates code that runs in the CRE (Common Run-Time Environment). The CRE makes assumptions
about the use of primary global memory, memory management, and trap handling that is
incompatible with certain applications, such as the HP ODBC server. The CRE-Independent Socket
Library (LNETINDL for the large-memory model, LNETINDW for the wide-data model, and
LNETINDN for native mode) has no dependence on the CRE.
For TAL application programs that use the Socket Library, application programs must specify the
ENV compiler directive COMMON for the D-series TAL compiler to generate code that runs in the
CRE.
TAL application programs can specify the directive either in a compilation command or in the
program source code before any declarations. For example, the following compilation command
produces a TAL object file compiled for the CRE:
TAL / IN source, OUT listing /; ENV COMMON
88 Library Routines