home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
TCOMM6.ZIP
/
LCLIB.EXE
/
LCPROTO.H
< prev
next >
Wrap
Text File
|
1991-08-27
|
3KB
|
110 lines
/*
** lcproto.h - Copyright (c) 1991 - Information Technology, Ltd.
** All Rights Reserved
**
** Revisions
** 00 05/30/91 Original Version
*/
#include <io.h>
#ifndef LITECOMM_H
#include "litecomm.h"
#endif
#ifndef LCPROTO_H
#define LCPROTO_H
/*
** constants for protocol definition
*/
#define XMODEM 0x01
#define XMODEM1K 0x02
#define YMODEM 0x04
#define WXMODEM 0x08
#define ZMODEM 0x10
/*
** type definitions
*/
typedef int (*ABORTFUNC)(void);
typedef void(*STATFUNC)(int, int, void *);
/*
** the arguments passed to the users status function
** are:
** the status code
** the retry count
** a pointer to the PROTOCOL CONTROL BLOCK
*/
typedef struct
{
unsigned port; /* port related to this block */
unsigned char protocol; /* protocol in use */
unsigned char handshake[3]; /* handshake to use */
unsigned char init; /* true if init required */
unsigned char timeout; /* timeout value in seconds */
unsigned char sigtowatch; /* signal to watch */
char *buff; /* pointer to i-o buffer */
int rbsize; /* size of received blocks */
int errors; /* total session errors */
int handle; /* handle of file being xferred */
unsigned rec; /* record counter */
int crcmode; /* crcmode for ?Modem */
unsigned crc16; /* crc-16 accumulator */
unsigned char checksum; /* checksum accumulator */
int sentblks; /* blocks sent (wxmodem) */
int ackblks; /* block acknowledged (wxmodem) */
int maxpanes; /* maximum panes, current window */
int lastseq; /* state variable (wxmodem) */
unsigned int harderr;
} PROTO;
#ifdef __TURBOC__
typedef struct
{
long filelength;
struct ftime filetime;
char filename[16];
unsigned char version;
char programname[16];
} TELINK;
#else
struct ftime
{
int ft_tsec : 5;
int ft_hour : 6;
int ft_min : 5;
int ft_day : 5;
int ft_month : 4;
int ft_year : 7;
};
typedef struct
{
long filelength;
struct ftime filetime;
char filename[16];
unsigned char version;
char programname[16];
} TELINK;
#endif
#define lcp_setsignal(x,y) (x->sigtowatch = y);
PROTO *lcp_alloc(unsigned port);
void lcp_free(PROTO *p);
int lcp_setproto(PROTO *p, unsigned char protocol, int usecrc);
int pwait(unsigned, int, unsigned char);
int dummyabort(void);
void dummystatus(int, int, void *);
void secstodate(unsigned long, unsigned, struct ftime *);
unsigned long datetosecs(struct ftime *, unsigned);
int lc_build_yzheader(int handle, char *filename, char *buff);
void interpretblock(char *b, TELINK *t);
extern ABORTFUNC lcp_abort;
extern STATFUNC lcp_status;
#endif