mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
pty: initial implementation
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
#define DEVICE_BUFFER_SIZE 512
|
||||
#define READ_BUFFER_SIZE 4096
|
||||
|
||||
typedef void (*ttydevicewritefn_t)(char *str, size_t size);
|
||||
typedef size_t (*ttydevicewritefn_t)(void *internal, char *str, size_t size);
|
||||
typedef void (*ttyinactivefn_t)(void *internal);
|
||||
|
||||
typedef struct {
|
||||
pollheader_t pollheader;
|
||||
@@ -19,17 +20,19 @@ typedef struct {
|
||||
mutex_t readmutex;
|
||||
mutex_t writemutex;
|
||||
termios_t termios;
|
||||
void *deviceinternal;
|
||||
char *devicebuffer;
|
||||
int devicepos;
|
||||
ttydevicewritefn_t writetodevice;
|
||||
ttyinactivefn_t inactivedevice;
|
||||
int minor;
|
||||
winsize_t winsize;
|
||||
vnode_t *mastervnode;
|
||||
} tty_t;
|
||||
|
||||
void tty_init();
|
||||
tty_t *tty_create(char *name, ttydevicewritefn_t fn);
|
||||
void tty_destroy(char *name, tty_t *tty);
|
||||
tty_t *tty_create(char *name, ttydevicewritefn_t writefn, ttyinactivefn_t inactivefn, void *internal);
|
||||
void tty_process(tty_t *tty, char c);
|
||||
void tty_unregister(tty_t *tty);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user