// Zmodlib.h
#include <stdio.h>
#include <windows.h>
#include <time.h>

#include "zmcore.h"

// Function prototypes
int InitCom(void);
void CloseCom(void);
BOOL WriteSerPort(char *lpBuf, DWORD dwToWrite);
BOOL ReadSerPort(char *lpBuf, DWORD dwToRead, DWORD *dwRead);
void sleep(clock_t seconds);


void extModemClearInbound(ZMCORE *zmcore);
void extModemResponseSent(ZMCORE *zmcore);
void extModemGetBlock(ZMCORE *zmcore, 
                      void *buf, 
                      size_t max, 
                      size_t *actual);
void extModemRegisterBad(ZMCORE *zmcore);
void extModemRegisterGood(ZMCORE *zmcore);
void extModemGetBlockImm(ZMCORE *zmcore,
                         void *buf, 
                         size_t max, 
                         size_t *actual);
void extModemWriteBlock(ZMCORE *zmcore, void *buf, size_t max);
void extFileSetInfo(ZMCORE *zmcore,
                    unsigned char *filename, 
                    unsigned char *fileinfo,
                    long *offset,
                    int *skip);
void extFileWriteData(ZMCORE *zmcore, void *buf, size_t bytes);
void extFileFinish(ZMCORE *zmcore);
int extFileGetFile(ZMCORE *zmcore, 
                   unsigned char *buf, 
                   long *filesize);
void extFileSetPos(ZMCORE *zmcore, long offset);
int extFileGetData(ZMCORE *zmcore, 
                   void *buf, 
                   size_t max, 
                   size_t *bytes);

