1#ifndef _EFAXIO_H
2#define _EFAXIO_H
3
4#include "efaxos.h"		/* TFILE definition */
5
6#ifndef uchar
7#define uchar unsigned char
8#endif
9
10#define CMDBUFSIZE 256		/* longest possible command or response */
11#define DLE_ETX "\020\003"	/* DLE-ETX (end of data) string */
12#define CAN_STR "\030"	        /* CAN (cancel reception) string */
13#define TO_RESET  50		/* t/o for modem reset commands (>>2.6s) */
14#define T_CMD     1		/* pause before each modem command */
15#define MAXDCEBUF  32		/* max bytes allowed in buffer when write */
16#define MINWRITE   64		/* minimum bytes to write() to modem */
17
18enum promptcodes {		/* codes for modem prompts */
19   BUSY = 'B', CONNECT = 'C', DATA='D', ERROR = 'E',
20   MODULATION='M', NO = 'N', OK = 'O', RING = 'R', VCONNECT = 'V',
21   PLUS = '+' } ;
22
23		      /* Modem features */
24
25extern int c1, c20 ;		/* use class 1/class 2.0 */
26extern int c2 ;			/* force class 2 */
27extern int cmdpause ;		/* delay before each init command */
28extern int vfc ;		/* virtual flow control */
29extern char startchar ;		/* character to start reception */
30extern int lockpolldelay ;	/* milliseconds between checks of lock files */
31
32				/* response detector lookup tables */
33extern uchar rd_allowed[], rd_nexts[] ;
34#define RD_BEGIN 0x01
35#define RD_END   0x20
36
37		 /* Modem interface routines */
38
39int cmd ( TFILE *f, char *s , int t ) ;
40int ckcmd ( TFILE *f, int *err, char *s, int t, int r ) ;
41int modemsync ( TFILE *f ) ;
42char *sresponse ( char *s, int *ip ) ;
43char *strinresp ( char *s ) ;
44int getresp ( char *s, char *buf, int len ) ;
45
46int setup ( TFILE *f, char **cmds, int ignerr ) ;
47
48int sendbuf ( TFILE *f, uchar *p, int n, int dcecps ) ;
49
50int begin_session ( TFILE *f, char *fname, int reverse, int hwfc, char **lkfile,
51		   ttymodes mode, void (*onsig) (int), int wait ) ;
52
53int end_session ( TFILE *f, char **zcmd,  char **lkfile, int sync ) ;
54
55#endif
56