IBM 4J manual Writing Custom C Programs, ++ Function Description

Page 67

Platform

C Compile Command

 

 

HP

 

 

 

32-bit

/opt/ansic/bin/cc -I../include -o apicheck apicheck.c ../lib/ndmapi.a -lrpcsoc -lnsl -ldld -Wl,+s -lcl

 

-lstd_v2 -lCsup_v2

 

 

64-bit

/opt/ansic/bin/cc +DD64 -I../include -o apicheck apicheck.c ../lib/ndmapi64.a -L/usr/lib/pa20_64 -lnsl

 

-ldld -Wl,+s -lcl -lstd_v2 -lCsup_v2

 

 

HP-Itanium

 

 

32-bit

/opt/ansic/bin/cc -I../include -o apicheck apicheck.c ../lib/ndmapi.a -lrpcsoc -lnsl -ldld -Wl,+s -lcl

 

-lstd_v2 -lCsup -lunwind

 

 

64-bit

/opt/ansic/bin/cc +DD64 -I../include -o apicheck apicheck.c ../lib/ndmapi64.a -L/usr/lib/hpux64

 

-lrpcsvc -lnsl -ldld -Wl,+s -lcl -lstd_v2 -lCsup -lunwind

 

 

Linux

 

 

 

32-bit

gcc -m32 -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi.a -ldl -lnss_nis

 

/usr/lib/libstdc++.so.5

 

 

64-bit

gcc -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi64.a -ldl -lnss_nis /usr/lib64/

 

libstdc++.so.5

 

Note: A 64-bit Linux OS installation is required to compile 64-bit binaries.

 

 

LinuxS390

 

 

32-bit

gcc -m31 -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi.a -ldl -lnss_nis

 

/usr/lib/libstdc++.so.5

 

 

64-bit

gcc -I../include -O -DLINUX -o apicheck apicheck.c ../lib/ndmapi64.a -ldl -lnss_nis /usr/lib64/

 

libstdc++.so.5

 

Note: A 64-bit Linux OS installation is required to compile 64-bit binaries.

 

 

Writing Custom C Programs

If you write a custom program using the C API calls, you must include the header file ndmapi.h and link it with ndmapi.a. A sample program called apicheck.c is provided.

For Java programming, you can call the C API functions by using the JNI and the libndmapi shared objects: libndmapi.sl for HP and libndmapi.so for the other supported platforms. Although the JNI is supported, the Sterling Connect:Direct Java Application Interface is recommended for Java programs that invoke the services of Sterling Connect:Direct.

Note: The environment variable NDMAPICFG must be set to the pathname of the client configuration file. Refer to “Overview of the Command Line Interface” on page 1 for instructions on setting the environment variable.

Use the following Sterling Connect:Direct API functions for C and C++ programs:

C++ Function

C Function

Description

 

 

 

ndmapi_connect()

ndmapi_connect_c()

Establishes a connection with the server.

 

 

Specify the node to connect to in the

 

 

ndm_nodespec pointer or in the CLI/API

 

 

Configuration Information file. If the call is

 

 

successful, NDM_NO_ERROR is returned.

 

 

Control returns to the application when the

 

 

connection is established and is ready for the

 

 

first API request.

 

 

 

Chapter 4. Writing Custom Programs 61

Image 67
Contents User Guide Page User Guide Copyright IBM Corporation 1999 Contents Iv Sterling ConnectDirect for Unix User Guide Stopping the CLI Overview of the Command Line InterfaceCLI Commands Starting the CLIOption Description Value Entry Sample CommandCdpnum CLI Job ControlCommand Abbreviation Description CLI History CommandsOverview of Sterling ConnectDirect Commands CommandParameter Abbreviation Abbreviations for Common Sterling ConnectDirect CommandsPname = A?PROD5 Submitting a ProcessParameter Description Values Parameter Description Values Id , pswd Username@hostname or user@localhostName nnnnn Name host name nnn.nnn.nnn.nnn orSnodeid field Id ,pswd ,newpswdSpecify retain=initial Following command submits the Process named copyfil Following command submits the Process named payrollName generic list Following command submits the Process named copy.cdpChanging Process Parameters Parameter Description ValueNode specification, userid generic list Remote node specification generic listDeleting a Process from the TCQ Number list Removing a Process from the Execution Queue Stopping Sterling ConnectDirect Flush process command has the following optional parametersParameter Description Viewing a Process in the TCQPname Locate the Process to view EX HC HE HI HO HR HS PE Monitoring Process Status in the TCQ Following command displays the specified Process numberAll EX HC HE HI HO HR HS PE Output from the command is displayed in the following table Dest=/path/file name Determining the Outcome of a ProcessRecord id list Caev Capr CAEV, CaprParameter Description Value Parameter Description Value Parameter Description Value Date day , hhmmss ampm Srcf=/path/file nameGenerating a Detailed Output Report for a Process Recid LOG Timepname Pnumber Stepname Ccod Fdbk Msgid Running System DiagnosticsGenerating a Summary Report for a Process Select StatisticsCOMM.TRC Smgr Trace smgr pnode tnode=ath3500ry level=2 file=Smgp.trc Scheduling Parameter Queue Comments Command DefinitionOverview of the Transmission Control Queue Scheduling Sterling ConnectDirect ActivityProgression of a Process Through the TCQ Execution Queue Element Comment Wait QueueStatus Comment Hold Queue Timer QueueHeld for Call indicates that the Process was Creating a Translation Table Introduction to Translation TablesExample-Creating a Translation Table Compiling a Translation Table Using the ndmxlt UtilityExample-Modifying a Model Translation Table Using Translation During File Transfer OperationsDiagnostic Number Description Translation Table Error MessagesAccessing Sterling ConnectDirect Messages Message File ContentFollowing are the parameters for the message file record Following is a sample ndmmsg commandMessage File Record Format Displaying Message TextSterling ConnectDirect for Unix User Guide Memory-The amount Using the Standalone Batch Compression UtilityFollowing are the parameters for the cdsacomp utility Level-Compression levelCodepage Source codepage, destinationNnnnn Example-Decompress a Text File Example-Precompress a Text FileExample-Precompress a Text File With Codepage Conversion Example-Precompress a Binary FileExamples-csdacomp Command Help Argument Description Validate Configuration FilesConfiguration Reports Cfgcheck command has the following argumentsType the following command at a Unix prompt Generating a Configuration Report on the Base InstallationSterling ConnectDirect Utilities Following example shows an excerpt from a sample report Sterling ConnectDirect Utilities Sterling ConnectDirect for Unix User Guide Compiler version to use for each platform Program using the C++ API callsIntroduction to Writing Custom Programs Compiling Custom ProgramsYou want to create such as apicheck Platform Compile Command++ Function Description Writing Custom C ProgramsNdmerrenth Ndmerror NdmnoerrorNdmapirecvresp or Receiving Responses Using ndmapirecvresp or ndmapirecvrespcNdmapirecvrespc Parameter Description Value PNOD-PNODE Truncated Following is a sample ndmapirecvresp functionSNOD-SNODE Return Code DescriptionNdmapirecvresp or ndmapirecvrespc to retrieve Selectstatistics or Selectprocess , the CLI Writing Custom C++ ProgramsNdmapisendcmdc function call has the following return codes Following is a sample ndmapisendcmd functionSterling ConnectDirect for Unix User Guide Cdfailure Method Description Parameter Return ValuesCdsuccess = 0, Cdfailure = Following is the ConnectDirectSession class headerWriting Custom Programs Sterling ConnectDirect for Unix User Guide Chown root exitskeleton User Exit ProgramsUser Exit Functions Program DescriptionReturn Code Goodrc ErrorrcExitprogram Waiting for a Message Using recvexitmsg or recvexitmsgcHeader Following are the parameters for sendexitmsg or sendexitmsgcStatistics Exit Message Overview of User Exit MessagesFile Open Exit Messages Fileopenoutputreplymsg Security Exit MessagesValidatemsg Validatereplymsg GeneratemsgCopy Control Block User Exit Stop MessageExit Log Files Copyright IBM Corp IBM Corporation J46A/G4 Bailey Avenue San Jose, CA Trademarks Sterling ConnectDirect for Unix User Guide Index Special characters Generatemsg Generatereplymsg Validatemsg Validatereplymsg Page Sterling ConnectDirect for Unix User Guide Page Product Number 5725-C99