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