X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-73
Text of C Example
/*
*----------------------------------------------------------------------
* GLOBAL DECLARATIONS
*----------------------------------------------------------------------
*/
#define FALSE 0
#define TRUE ~FALSE
#define MAX_COMM_READ 40 /* largest comm read */
#define MAX_TERM_READ 39 /* largest terminal read */
#define MAX_INT_FNAME_LEN 12 /* internal file name length */
#define END_OF_FILE 1
#define BREAK_ACCESS_ONLY 110
#define BREAK_HIT 111
#define MODEM_ERROR 140
#define READ_TAG 55L /* read tag value */
#define WRITE_TAG 77L /* write tag value */
#define O_RDWR_DEPTH_1 1 /* nowait I/O, sync depth 1 */
#define O_RDWR_DEPTH_2 2 /* nowait I/O, sync depth 2 */
#define CALL_OP "CALL" /* place a call operation */
#define WAIT_OP "WAIT" /* wait for a call operation */
#define EOS '\0' /* End-Of-String (null) char */
short end_program_flag; /* flag to terminate program */
short call_sent_flag; /* call sent flag */
short file; /* file waited on */
short comm_file; /* X.25 line file number */
short term_file; /* terminal file number */
short term_buff[MAX_TERM_READ]; /* terminal I/O buffer */
short comm_buffR[MAX_COMM_READ]; /* line I/O buffer for reads */
short comm_buffW[MAX_COMM_READ]; /* line I/O buffer for writes*/
long tag; /* read/write completion tag */
char *term_buffs = /* pointer to terminal buff */
(char *) &term_buff;
char *comm_buffRs = /* pointer to line read buff */
(char *) &comm_buffR;
char *comm_buffWs = /* pointer to line write buff*/
(char *) &comm_buffW;
char *prog_name; /* pointer to this prog name */
/*