diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-09 00:11:10 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-09 00:11:10 -0400 |
commit | 6beb7818efb57851a042953937af72163f1bde6c (patch) | |
tree | 6abc8763d6182f4c3de6da8567d05f995fd53db0 /pty-unix.h | |
parent | ef5cd6e10e93ef973536d2df2ad57ac42a2118ea (diff) | |
download | runes-6beb7818efb57851a042953937af72163f1bde6c.tar.gz runes-6beb7818efb57851a042953937af72163f1bde6c.zip |
spawn a shell process and run it on a pty
not at all convinced that this is correct, but it at least does things
Diffstat (limited to 'pty-unix.h')
-rw-r--r-- | pty-unix.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pty-unix.h b/pty-unix.h new file mode 100644 index 0000000..ab5acc2 --- /dev/null +++ b/pty-unix.h @@ -0,0 +1,23 @@ +#ifndef _RUNES_PTY_H +#define _RUNES_PTY_H + +#define RUNES_PTY_BUFFER_LENGTH 4096 + +struct runes_pty { + int master; + int slave; + pid_t child_pid; +}; + +typedef struct { + RunesLoopData data; + size_t len; + char buf[RUNES_PTY_BUFFER_LENGTH]; +} RunesPtyLoopData; + +void runes_pty_backend_init(RunesTerm *t); +void runes_pty_backend_loop_init(RunesTerm *t); +void runes_pty_backend_write(RunesTerm *t, char *buf, size_t len); +void runes_pty_backend_cleanup(RunesTerm *t); + +#endif |