DR_ApCommand

DR_ApCommand — sends ASCII commands and returns replies.

Syntax

#include <cogent.h>
int DR_ApCommand(char*  command,
 char*  reply,
 int  max_length,
 char**  error);

Arguments

command

A string containing the command to be sent.

reply

A pointer to the buffer to receive the reply from the driver.

max_length

The length of the reply buffer in bytes.

error

The address of a string pointer. In case of error (non-zero return), the string pointer is set to the corresponding error description string. The error string is contained in a static buffer and remains valid only until the next API call. The parameter may be NULL if no error string is required.

Returns

The integer value 0 if the command exchange was successful, otherwise the following errors may be reported:

DR_API_STATUS_ERRORS 
DR_API_IPC_ERRORS

Description

This function sends an ASCII script command to the driver, returning the ASCII reply. You will need to interpret the response (see Configuration File in the CIF Driver manual). This function provides an all-purpose interface to the driver and is required infrequently.

Example

int		result;
char	data[1024];
char	*error_str;

if (!(result = DR_ApCommand ("(apropos *)", data, 1024,
                             &error_str)))
	printf ("   Driver commands available:\n%s\n", data);
else
	printf ("     Error@ApCommand (%d, %s)\n",
            result, error_str);