6100 ADCCP Programming Manual
ADCCP Programming Example Using C
069225 Tandem Computers Incorporated C–5
return(rfnum);
}
/*
*-----------------------------------------------------------------
* Close_line
*
* Closes the line that the Open_line function opened.
*
* Results:
*
* Closes the line specified by the file number returned
* from an OPEN.
*
* Side effects:
*
* None.
*-------------------------------------------------------------------
*/
void Close_line(file_number,close_name)
short file_number; /* IN - file number from OPEN.
*/
char *close_name; /* IN - Name of line closed.
*/
{
CLOSE(file_number);
printf("Line %s closed.\n",close_name);
}
/*-------------------------------------------------------------------
*
* Receive
*
* Makes the ADCCP request/response.
*
* Results:
*
* Calls WRITEREAD and puts the specified message in the
* WRITEREAD buffer.
*
* Side effects:
*
* Changes the contents of the WRITEREAD buffer to whatever
* dPtr points to.
*
*--------------------------------------------------------------------
*/
void Receive(rfnum,function_code,textout,textin,length,dPtr)
short rfnum; /* IN - file number from OPEN returned from
* Open_line.
*/
short function_code; /* IN - Request number.
*/
short textout; /* IN - text out length for request.
*/
short textin; /* IN - text in length for response.
short length; /* IN - length of the WRITEREAD buffer
* calculated in the calling function.
*/
struct message *dPtr; /* IN/OUT - Points to the structured variable
* that contains the request/response data
* for the WRITEREAD buffer.
*/
{
short c_code = 0;