home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
OS2UTIL.ZIP
/
OS2ASY.H
< prev
next >
Wrap
Text File
|
1990-05-21
|
2KB
|
77 lines
/* os2asy.h */
/* define NULL pointer value */
#if (defined(M_I86SM) || defined(M_I86MM))
#define NULL 0
#elif (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
#define NULL 0L
#endif
#define INCL_SUB
#define INCL_DOSPROCESS
#define INCL_DOSINFOSEG
#define INCL_DOSDEVICES
#define OK 0
#define COM1 1
#define COM2 2
#define MAX_PORTS 2
#define LF 10
#define CR 13
#define INCL_DOSINFOSEG
#include <os2.h>
#if (defined(OS2ASY))
#include <stdio.h>
#include <string.h>
typedef struct {
BYTE data_bits;
BYTE parity;
BYTE stop_bits;
} ComCntl;
typedef struct {
int chrs_in_q;
int q_size;
} QInfo;
typedef struct {
int write_timeout, read_timeout;
BYTE f1, f2, f3, err_chr, brk_chr, xon, xoff;
} DCBInfo;
DCBInfo di;
ComCntl comm_ctl = { 0x08, 0x00, 0x00 };
typedef struct {
HFILE porthf[MAX_PORTS+1];
char commbuff[MAX_PORTS+1][4096]; /* main buffers for com ports */
char buff[MAX_PORTS+1][4096]; /* buffers for com ports */
char *curptr[MAX_PORTS+1], /* main buffer pointers */
*bufptr[MAX_PORTS+1]; /* pointers for com ports */
} asycom;
asycom asy;
static int iqsize[MAX_PORTS+1], hi_q[MAX_PORTS+1] = { 0, 0, 0 };
#endif
int port_open(int port,int baud,int xon);
int port_close(int port);
int port_close_all(void );
int send_line(int port,char *str);
int send_asy(int port, char *str);
int asy_chr(int port,char chr);
int asyget(int port);
int asy_stream(int port, int chrs, char *string, long time_limit);
int inqsize(int port);
int asy_get(int port,char *string);
int fasy_get(int port,char *string);
int rdch(int port, char *ch, int cnt, int *numread);
int flushib(int port);
int flushob(int port);
unsigned long dostime(void);