forked from SinclairQL/sQLux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QSerial.h
68 lines (55 loc) · 1.54 KB
/
QSerial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* UQLX */
#ifndef QSERIAL_H
#define QSERIAL_H
#include <sys/types.h>
Cond SetBaudRate(short);
void InstallSerial(void);
#if defined(SERIAL) || defined(NEWPTY)
void InitSerial(void);
void CloseSerial(void);
typedef struct _FakeRec *FakeTerm;
typedef struct _FakeRec
{
char *command; /* command name */
char **command_args; /* command arguments */
char *term_type; /* terminal type */
char utmp_inhibit; /* don't add utmp entries */
char login_shell; /* invoke shell as login shell */
char *tname; /* name of allocated PTY */
pid_t pid; /* process ID of child process */
uid_t uid; /* uid of invoking user */
gid_t gid; /* gid of invoking user */
int master; /* pty master file descriptor */
int slave; /* pty slave file descriptor */
struct SERDEV *sd;
FakeTerm next;
int job_control;
} FakeRec;
typedef struct SERDEV
{
long unit;
long parity;
long hshake;
long xlate;
long baud;
int fd;
#ifdef NO_FIONREAD
int bfc_valid;
char bfc;
#endif
/* some pty special values */
FakeTerm w;
int killed;
int teof; /* chr$(26) occured and should cause 1 EOF*/
} serdev_t;
void tty_baud(serdev_t *);
int tty_open(const char *, serdev_t *);
void tty_close(int );
int pty_open(int, void **);
void pty_close(int, void *);
int pendingio (int f);
int writeio (serdev_t * sd, char *buf, long *pno);
int readio (serdev_t * sd, char *buf, long *pno, short tc);
#define MAXSERIAL 4
#endif /* defined(SERIAL) || defined(NEWPTY) */
#endif /* QSERIAL_H */