unstrip-downed Class 2 error messages table
[efax.git] / efaxio.h
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
18 enum 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
22                       /* Modem features */
23
24 #ifndef UCLINUX
25 extern int c1 ;                 /* use class 1 */
26 #else /* UCLINUX */
27 #define c1 (0)
28 #endif /* UCLINUX */
29 extern int c20 ;                /* use class 2.0 */
30 extern int c2 ;                 /* force class 2 */
31 extern int cmdpause ;           /* delay before each init command */
32 extern int vfc ;                /* virtual flow control */
33 extern uchar startchar ;        /* character to start reception */
34 extern int lockpolldelay ;      /* milliseconds between checks of lock files */
35
36                                 /* response detector lookup tables */
37 extern uchar rd_allowed[], rd_nexts[] ; 
38 #define RD_BEGIN 0x01
39 #define RD_END   0x20
40
41                  /* Modem interface routines */
42
43 int cmd ( TFILE *f, char *s , int t ) ;
44 int ckcmd ( TFILE *f, int *err, char *s, int t, int r ) ;
45 char *sresponse ( char *s, int *ip ) ;
46 char *strinresp ( char *s ) ;
47 int getresp ( char *s, char *buf, int len ) ;
48
49 int setup ( TFILE *f, char **cmds, int ignerr ) ;
50
51 int sendbuf ( TFILE *f, uchar *p, int n, int dcecps ) ;
52
53 int begin_session ( TFILE *f, char *fname, int reverse, int hwfc, char **lkfile, 
54                    ttymodes mode, void (*onsig) (int) ) ;
55
56 int end_session ( TFILE *f, char **zcmd,  char **lkfile, int sync ) ;
57
58 #endif