8 /* signals to be caught */
10 #define ANSISIGS SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM
11 #define UNIXSIGS SIGHUP, SIGQUIT, SIGIOT, SIGALRM
12 #define CATCHSIGS ANSISIGS, UNIXSIGS
14 /* Bit order reversal table. */
16 extern unsigned char normalbits [ ] ;
18 typedef enum ttymodes /* serial port modes: */
20 COMMAND, /* 19200 8N1, no f/c, DTR high */
21 SEND, /* 19200 send-only XON/XOFF f/c */
22 VOICECOMMAND, /* 38400 8N1, no f/c, DTR high */
23 VOICESEND, /* 38400 send-only XON/XOFF f/c*/
24 DROPDTR, /* ", DTR low */
25 ORIGINAL /* restore original settings */
28 /* OS-specific i/o & delay functions */
30 /* We define new stream i/o macros because it's not possible to
31 do non-blocking reads/writes with C stream i/o [UNIX select()
32 gives the status of the file, not the stream buffer].*/
34 #define IBUFSIZE 1024 /* read up to this many bytes at a time from fax */
35 #define OBUFSIZE 1024 /* maximum bytes to write at a time to fax */
37 typedef struct tfilestruct {
39 unsigned char *ip, *iq ;
40 unsigned char ibuf [ IBUFSIZE ] ;
41 unsigned char *ibitorder, *obitorder ;
42 int bytes, pad, lines ;
49 /* tgetc() is a macro like getc(). It evaluates to the next
50 character from the fax device or EOF after idle time t. */
52 #define tgetc(f,t) ( (f)->ip >= (f)->iq && tundrflw(f,t) == EOF ? EOF : \
53 *(unsigned char*)(f)->ip++ )
55 int tundrflw ( TFILE *f, int t ) ;
56 int tgetd ( TFILE *f, int t ) ;
57 int tput ( TFILE *f, unsigned char *p, int n ) ;
58 int tdata ( TFILE *f, int t ) ;
59 void tinit ( TFILE *f, int fd, int reverse, int hwfc ) ;
60 int ttyopen ( TFILE *f, char *fname, int reverse, int hwfc ) ;
61 int ttymode ( TFILE *f, ttymodes mode ) ;
62 void msleep ( int t ) ;
63 long proc_ms ( void ) ;
64 int time_ms ( void ) ;
68 extern int execl ( const char *path, const char *arg , ... ) ;
70 /* UUCP-style device locks */
72 #define BINLKFLAG '#' /* prefix to force binary lock files */
74 /* [un]lock serial port using named files */
75 int lockall ( char **lkfiles, int log ) ;
76 int unlockall ( char **lkfiles ) ;
78 /* extract program name to be used in messages from argv0 */
80 char *efaxbasename ( char *p ) ;
82 /* default fax modem device */
84 #define FAXFILE "/dev/modem"