#ifndef _EFAXOS_H
#define _EFAXOS_H
#include <time.h>
#include "efaxlib.h"
#define ANSISIGS SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM
#define UNIXSIGS SIGHUP, SIGQUIT, SIGIOT, SIGALRM
#define CATCHSIGS ANSISIGS, UNIXSIGS
extern unsigned char normalbits [ ] ;
typedef enum ttymodes
{
COMMAND,
SEND,
VOICECOMMAND,
VOICESEND,
DROPDTR,
ORIGINAL
} ttymodes ;
#define IBUFSIZE 1024
#define OBUFSIZE 1024
typedef struct tfilestruct {
int fd ;
unsigned char *ip, *iq ;
unsigned char ibuf [ IBUFSIZE ] ;
unsigned char *ibitorder, *obitorder ;
int bytes, pad, lines ;
int hwfc ;
time_t start ;
long mstart ;
int rd_state ;
} TFILE ;
#define tgetc(f,t) ( (f)->ip >= (f)->iq && tundrflw(f,t) == EOF ? EOF : \
*(unsigned char*)(f)->ip++ )
int tundrflw ( TFILE *f, int t ) ;
int tgetd ( TFILE *f, int t ) ;
int tput ( TFILE *f, unsigned char *p, int n ) ;
int tdata ( TFILE *f, int t ) ;
void tinit ( TFILE *f, int fd, int reverse, int hwfc ) ;
int ttyopen ( TFILE *f, char *fname, int reverse, int hwfc ) ;
int ttymode ( TFILE *f, ttymodes mode ) ;
void msleep ( int t ) ;
long proc_ms ( void ) ;
int time_ms ( void ) ;
extern int execl ( const char *path, const char *arg , ... ) ;
#define BINLKFLAG '#'
int lockall ( TFILE *f, char **lkfiles, int log ) ;
int unlockall ( TFILE *f, char **lkfiles ) ;
char *efaxbasename ( char *p ) ;
#define FAXFILE "/dev/modem"
#endif