aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-29 16:13:38 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-01-29 16:13:38 +0000
commitee12c698da34cb707899e666f7a57cc4bf241623 (patch)
treeb7af31737523f7eaeb7ad46d7c8601d4b68ad9bc /man
parent9b20346dc36e52b8ddefd8b92628440557d57195 (diff)
downloadtermo-ee12c698da34cb707899e666f7a57cc4bf241623.tar.gz
termo-ee12c698da34cb707899e666f7a57cc4bf241623.tar.xz
termo-ee12c698da34cb707899e666f7a57cc4bf241623.zip
Document the errors set by termkey_new(), use errno rather than fprintf() to stderr
Diffstat (limited to 'man')
-rw-r--r--man/termkey_new.311
1 files changed, 10 insertions, 1 deletions
diff --git a/man/termkey_new.3 b/man/termkey_new.3
index c727d22..6aa70a4 100644
--- a/man/termkey_new.3
+++ b/man/termkey_new.3
@@ -25,7 +25,16 @@ If a file handle is provided, the terminfo driver may send a string to initialis
.SH VERSION CHECK MACRO
Before calling any functions in the \fBtermkey\fP library, an application should use the \fBTERMKEY_CHECK_VERSION\fP macro to check that the loaded version of the library is compatible with the version it was compiled against. This should be done early on, ideally just after entering its \fBmain\fP() function.
.SH "RETURN VALUE"
-If successful, \fBtermkey_new\fP() returns a pointer to the new instance. On failure, \fBNULL\fP is returned. \fBtermkey_destroy\fP() returns no value.
+If successful, \fBtermkey_new\fP() returns a pointer to the new instance. On failure, \fBNULL\fP is returned with \fIerrno\fP set to indicate the failure. \fBtermkey_destroy\fP() returns no value.
+.SH ERRORS
+.TP
+.B ENOENT
+No driver was able to recognise the given terminal type.
+.TP
+.B ENOMEM
+A call to \fBmalloc\fP(3) failed to allocate memory.
+.PP
+Additionally, \fBtermkey_new\fP() may fail if \fBfstat\fP(2) or \fBwrite\fP(2) fails on the given file handle.
.SH "SEE ALSO"
.BR termkey_waitkey (3),
.BR termkey_advisereadable (3),