/**
***  IPDial - IPDial.h
***
***  Main include file with prototypes
***
***
***  This program is free software; you can redistribute it and/or modify
***  it under the terms of the GNU General Public License as published by
***  the Free Software Foundation; either version 2 of the License, or
***  (at your option) any later version.
***
***  This program is distributed in the hope that it will be useful,
***  but WITHOUT ANY WARRANTY; without even the implied warranty of
***  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
***  GNU General Public License for more details.
***
***  You should have received a copy of the GNU General Public License
***  along with this program; if not, write to the Free Software
***  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***
***  Authors: Jochen Wiedmann <wiedmann@neckar-alb.de>
***           Stefan Gybas <cab@studbox.uni-stuttgart.de>
**/


#ifndef IPDIAL_H
#define IPDIAL_H


/*** Version defintions ***/

#define VERS "IPDial 2.1"
#define DATE "16.04.96"
#define VSTRING VERS " (" DATE ")"
#define VERSTAG "\\0$VER: " VERS " (" DATE ")"


/*** Program definitions ***/

#define DELAY_AFTER_IO 0               /*  use Delay() after DoIO() */
#define ScBufSize 1024                 /*  size of scratch buffer  */
#undef USE_ABORTPKT                    /*  currently not implemented in OS  */
#undef SETCMD                          /*  enable SET command?  */
#undef SHOWPARMSCMD                    /*  enable SHOWPARAMS command?  */


/*** Default values for serial settings ***/

#define DEFAULT_UNIT 0
#define DEFAULT_BAUD 9600
#define DEFAULT_PROTOCOL (STRPTR) "RTSCTS"
#define DEFAULT_BUFSIZE 4096


/*** other dafaule values ***/

#define DEFAULT_TIMEOUT 5              /*  default timout for WAIT command  */


/*** Include files ***/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#ifdef __SASC_60
#include <proto/exec.h>
#include <proto/dos.h>
#else
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <exec/types.h>
#endif

#ifdef __GNUC__
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif


/*** Prototypes ***/


/* IPDial.c */

extern ULONG EchoMode;
extern ULONG VerboseMode;
extern UBYTE ScratchBuffer[ScBufSize];
extern VOID PrintError(ULONG, STRPTR);
extern VOID CleanupAndExit(int);


/* DeviceIO.c */

extern BYTE DeviceIOWait(APTR);
extern VOID DeviceIOAbort(APTR);
extern VOID DeviceIOSend(APTR, UWORD);
extern BYTE DeviceIODo(APTR, UWORD);
extern ULONG DeviceIOSignal(APTR);
extern struct IORequest *DeviceIOReq(APTR);
extern APTR DeviceIOCreate(ULONG);
extern VOID DeviceIODelete(APTR);
extern BYTE DeviceIOOpen(STRPTR, ULONG, APTR, ULONG);


/* Serial.c */

extern VOID SerialCleanup(VOID);
extern ULONG SerialOpen(STRPTR, LONG, LONG, STRPTR);
extern VOID SerialSend(STRPTR);
extern LONG SerialWait(STRPTR *, LONG);
extern VOID SerialSetBaud(ULONG);
extern VOID SerialSetBufSize(ULONG);
extern VOID SerialTerminal(STRPTR, ULONG, ULONG);
extern STRPTR SerialWaitBuffer(VOID);
extern LONG TimerWait(LONG, LONG);

#ifdef SHOWPARMSCMD
extern VOID SerialShowParms(VOID);
#endif

#ifdef SETCMD
extern VOID SerialSetDataBits(UBYTE);
extern VOID SerialSetStopBits(UBYTE);
extern ULONG SerialSetParity(STRPTR);
extern ULONG SerialSetProtocol(STRPTR);
#endif

/* Buffer.c */

extern APTR BufferCreate(VOID);
extern VOID BufferClear(APTR);
extern VOID BufferExtend(APTR, const UBYTE*, ULONG);
extern LONG BufferCheck(APTR, STRPTR *);
extern STRPTR BufferBuffer(APTR);


/* StrReadArgs.c */

extern ULONG StrReadArgs(STRPTR, LONG *, STRPTR);
extern VOID StrReadArgsFree(VOID);


/* Vsscanf.c */

extern LONG Vsscanf(STRPTR, STRPTR, ULONG);


/* SanaConfig.c */

extern STRPTR ReadSanaConfig(STRPTR);

#endif
