diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-09-02 17:05:51 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-09-09 17:38:37 +1000 |
commit | 685edd21efef7311ad8ef7dcb4023db30201b99f (patch) | |
tree | 9e587fa0a7fbcf21ae4d780b8c1e9c41548ef0b2 /jim-tty.h | |
parent | 4baa884e739b59dfd50cbf606786c41de1d289a8 (diff) | |
download | jimtcl-685edd21efef7311ad8ef7dcb4023db30201b99f.zip jimtcl-685edd21efef7311ad8ef7dcb4023db30201b99f.tar.gz jimtcl-685edd21efef7311ad8ef7dcb4023db30201b99f.tar.bz2 |
aio: add tty settings support (via termios)
Enough to make serial ports work and support raw and cooked input/output
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-tty.h')
-rw-r--r-- | jim-tty.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/jim-tty.h b/jim-tty.h new file mode 100644 index 0000000..d052d73 --- /dev/null +++ b/jim-tty.h @@ -0,0 +1,30 @@ +#ifndef JIM_TTY_H +#define JIM_TTY_H + +#include <jim.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Return the tty settings for the given file descriptor as a dictionary + * with a zero reference count. + * + * Returns NULL and sets errno file descriptor is not a valid tty. + */ +Jim_Obj *Jim_GetTtySettings(Jim_Interp *interp, int fd); + +/** + * Sets the tty settings given in 'dictObjPtr' + * + * Returns JIM_OK if OK, JIM_ERR if any settings are invalid, + * or -1 (and sets errno) if the file descriptor is not a valid tty. + */ +int Jim_SetTtySettings(Jim_Interp *interp, int fd, Jim_Obj *dictObjPtr); + +#ifdef __cplusplus +} +#endif + +#endif |