diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-12-01 22:36:14 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2008-12-01 22:36:14 +0000 |
commit | f75bdf1516b031b0f975b77f289ea408e30cb9c9 (patch) | |
tree | 525ffbaa756be06cd82abc009cbce07761c71269 | |
parent | 8737046c4d42c223be6381a66fbee3fbe5cdbb97 (diff) | |
download | termo-f75bdf1516b031b0f975b77f289ea408e30cb9c9.tar.gz termo-f75bdf1516b031b0f975b77f289ea408e30cb9c9.tar.xz termo-f75bdf1516b031b0f975b77f289ea408e30cb9c9.zip |
Added termkey_get_fd() to API
-rw-r--r-- | termkey.c | 5 | ||||
-rw-r--r-- | termkey.h.in | 2 | ||||
-rw-r--r-- | termkey_get_fd.3 | 18 | ||||
-rw-r--r-- | termkey_new.3 | 3 |
4 files changed, 27 insertions, 1 deletions
@@ -283,6 +283,11 @@ void termkey_destroy(termkey_t *tk) termkey_free(tk); } +int termkey_get_fd(termkey_t *tk) +{ + return tk->fd; +} + int termkey_get_flags(termkey_t *tk) { return tk->flags; diff --git a/termkey.h.in b/termkey.h.in index 7f0dc49..95e8aed 100644 --- a/termkey.h.in +++ b/termkey.h.in @@ -137,6 +137,8 @@ termkey_t *termkey_new(int fd, int flags); void termkey_free(termkey_t *tk); void termkey_destroy(termkey_t *tk); +int termkey_get_fd(termkey_t *tk); + int termkey_get_flags(termkey_t *tk); void termkey_set_flags(termkey_t *tk, int newflags); diff --git a/termkey_get_fd.3 b/termkey_get_fd.3 new file mode 100644 index 0000000..d12a872 --- /dev/null +++ b/termkey_get_fd.3 @@ -0,0 +1,18 @@ +.TH TERMKEY_GET_FD 3 +.SH NAME +termkey_get_fd \- obtain the file descriptor for the terminal +.SH SYNOPSIS +.nf +.B #include <termkey.h> +.sp +.BI "void termkey_get_fd(termkey_t *" tk ); +.fi +.sp +Link with \fI-ltermkey\fP. +.SH DESCRIPTION +\fBtermkey_get_fd\fP returns the file descriptor that was passed as the \fIfd\fP argument to \fBtermkey_new\fP(3). +.SH "RETURN VALUE" +\fBtermkey_get_fd\fP() returns the current file descriptor. +.SH "SEE ALSO" +.BR termkey_new (3), +.BR termkey_get_flags (3) diff --git a/termkey_new.3 b/termkey_new.3 index 413d81f..4d099ff 100644 --- a/termkey_new.3 +++ b/termkey_new.3 @@ -48,4 +48,5 @@ If successful, \fBtermkey_new\fP() returns a pointer to the new instance. On fai .BR termkey_waitkey (3), .BR termkey_advisereadable (3), .BR termkey_getkey (3), -.BR termkey_get_flags (3) +.BR termkey_get_flags (3), +.BR termkey_get_fd (3) |