Added termkey_get_fd() to API

This commit is contained in:
Paul LeoNerd Evans 2008-12-01 22:36:14 +00:00
parent 8737046c4d
commit f75bdf1516
4 changed files with 27 additions and 1 deletions

View File

@ -283,6 +283,11 @@ void termkey_destroy(termkey_t *tk)
termkey_free(tk); termkey_free(tk);
} }
int termkey_get_fd(termkey_t *tk)
{
return tk->fd;
}
int termkey_get_flags(termkey_t *tk) int termkey_get_flags(termkey_t *tk)
{ {
return tk->flags; return tk->flags;

View File

@ -137,6 +137,8 @@ termkey_t *termkey_new(int fd, int flags);
void termkey_free(termkey_t *tk); void termkey_free(termkey_t *tk);
void termkey_destroy(termkey_t *tk); void termkey_destroy(termkey_t *tk);
int termkey_get_fd(termkey_t *tk);
int termkey_get_flags(termkey_t *tk); int termkey_get_flags(termkey_t *tk);
void termkey_set_flags(termkey_t *tk, int newflags); void termkey_set_flags(termkey_t *tk, int newflags);

18
termkey_get_fd.3 Normal file
View File

@ -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)

View File

@ -48,4 +48,5 @@ If successful, \fBtermkey_new\fP() returns a pointer to the new instance. On fai
.BR termkey_waitkey (3), .BR termkey_waitkey (3),
.BR termkey_advisereadable (3), .BR termkey_advisereadable (3),
.BR termkey_getkey (3), .BR termkey_getkey (3),
.BR termkey_get_flags (3) .BR termkey_get_flags (3),
.BR termkey_get_fd (3)