#include "nortlib.h" #include "cmdalgo.h" int ci_sendcmd(const char *cmdtext, int mode);
ci_sendcmd() is the basic method to send a command to a CMDGEN-generated Command Server. cmdtext is a NUL-terminated ASCII string. It should include any terminating newline (e.g. "Quit\n") or the command will not actually be executed. The string must conform to the syntax specified in the CMDGEN input for the particular server or a syntax error will occur.
If cmdtext is NULL, a syntax-independent quit request is sent to the server.
The mode argument takes on the following values:
Returns zero on success. If the command server cannot be located (and nl_response is set below 3) returns 1. Otherwise, the return value is the sum of a type code and a value. The possible types are CMDREP_QUIT, CMDREP_SYNERR and CMDREP_EXECERR. CMDREP_QUIT indicates that the command you sent was a quit request, which probably means the client should shut down also. CMDREP_SYNERR indicates there was a syntax error in the command you sent. The value portion of the return code is the offset within the command where the error occurred. CMDREP_EXECERR indicates that an error occurred when the server was executing the instructions associated with the command. The value portion of the return code is the error code.
ci_sendfcmd(), ci_settime(), ci_time_str(), and Command Server and Client functions.