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

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