6100 ADCCP Programming Manual

Application Tasks
Writing Applications that Use ADCCP
069225 Tandem Computers Incorporated 4–3
This example shows how a line could be opened using the C programming language.
short Open_line(open_name)
char *open_name; /* IN - pointer to the line name string
*/
{
struct mask {
unsigned short demountable : 1;
unsigned short audited : 1;
unsigned short undefined : 2;
unsigned short type : 6;
unsigned short subtype : 6;
};
lowmem struct mask devtype;
lowmem short fname[127];
short c_code = 0;
short s_code = 0;
short reclnth;
short rfnum;
int error;
/*
* The line name is converted to Guardian format, and the line is checked
* to make sure it's an ADCCP line. If it is, the line is opened and
* the file number for the line is returned to main.
*/
s_code = extfname_to_intfname(open_name,fname);
if (s_code != 0) {
printf("Error with external-to-internal filename conversion.\n");
}
DEVICEINFO(fname,&devtype,&reclnth);
if (devtype.type != 51 || devtype.subtype != 2) {
printf("%d is not a 6100 ADCCP line.\n",fname);
ABEND();
}
c_code = OPEN(fname,(short *)&rfnum,14);
if (c_code != CCE) {
FILEINFO(rfnum,&error);
printf("OPEN ERROR %d on 1st open.\n",error);
ABEND();
}
else SETMODE(rfnum,20,1);
return(rfnum);
}
Note This subsection provides only descriptions of the procedure call parameters used in the example. These
procedure calls may have optional parameters that are not described because they are not used in the
example. Refer to the System Procedure Calls Reference Manual, Volume 1 and Volume 2, for a
complete and detailed description of these system procedure calls.