Sending a Command to Sterling Connect:Direct Using ndmapi_sendcmd() or ndmapi_sendcmd_c()

Use ndmapi_sendcmd() or ndmapi_sendcmd_c() to allow a command to be sent to a Sterling Connect:Direct application. Following is the format of ndmapi_sendcmd() or ndmapi_sendcmd_c():

int32 rc, resp_moreflag; struct sendcmd_data ret_data; rc=ndmapi_sendcmd (error,

"select process pnumber=2,", &resp_moreflag,

&ret_data );

Following are the parameters for ndmapi_sendcmd() or ndmapi_sendcmd_c():

Parameter

Description

Value

 

 

 

error

A pointer to a Sterling Connect:Direct-defined structure

Pointer

 

that contains error information or status information.

 

 

 

 

cmd_text

A pointer to the null-terminated text string that specifies

Pointer to a text

 

the command to send to Sterling Connect:Direct. The

string

 

command text must be followed by a semicolon and

 

 

terminated with a null.

 

 

When you use the submit=filename command from the

 

 

API, ensure that you allocate enough storage for the

 

 

Process text. The text of the Process submitted is

 

 

returned in the text string associated with this parameter

 

 

when the function completes. If you do not allocate

 

 

enough storage for the Process text, a core dump can

 

 

result.

 

 

 

 

resp_moreflag

A pointer to the flag that indicates that more responses

Pointer to a flag

 

are pending for the command just executed. Invoke

 

 

ndmapi_recvresp() or ndmapi_recvresp_c() to retrieve

 

 

the extra responses.

 

 

 

 

ret_data

A pointer to a structure containing internal response

Pointer to a

 

information for a command. The structure is:

structure

 

struct sendcmd_data {

 

 

char * cmd_name;

 

 

ulong cmd_id;

 

 

long data1;

 

 

long data2;

 

 

long data3;

 

 

};

 

 

 

 

sendcmd_data

Provides the caller with some information about the user

Information

 

request. Because parsing of command text occurs at the

about the user

 

CMGR, the End User Application (EUA) has no way to

request

 

identify the command that was submitted, unless it

 

 

generated the text.

 

 

 

 

cmd_name

A pointer to a string with the name of the command

Pointer to name

 

submitted. The CLI uses this pointer to display

of command

 

completion messages. This field enables you to display

 

 

unique completion messages without any knowledge of

 

 

a specific command in the EUA.

 

 

 

 

68Sterling Connect:Direct for UNIX: User Guide

Page 74
Image 74
IBM 4J manual Ndmapirecvresp or ndmapirecvrespc to retrieve