1TERMKEY_PUSH_BYTES(3)      Library Functions Manual      TERMKEY_PUSH_BYTES(3)
2
3
4

NAME

6       termkey_push_bytes - supply more bytes to the input buffer
7

SYNOPSIS

9       #include <termkey.h>
10
11       size_t termkey_push_bytes(TermKey *tk, const char *bytes, size_t len);
12
13       Link with -ltermkey.
14

DESCRIPTION

16       termkey_push_bytes() allows more bytes of input to be supplied directly
17       into the input buffer of the termkey(7) instance. If there was no  buf‐
18       fer space remaining then -1 is returned with errno set to ENOMEM.
19
20       This  function,  along with termkey_getkey(3), makes it possible to use
21       the termkey instance with a source of bytes other than from  reading  a
22       filehandle.
23
24       For  synchronous  usage, termkey_waitkey(3) performs the input blocking
25       task. For  use  against  a  regular  stream  filehandle  that  supports
26       read(2), see termkey_advisereadable(3).
27

RETURN VALUE

29       termkey_push_bytes() the number of bytes consumed from the input (which
30       may be smaller than the length provided, if  the  buffer  runs  out  of
31       space)  or -1 cast to size_t if an error occurs, in which case errno is
32       set accordingly.
33

SEE ALSO

35       termkey_getkey(3), termkey_advisereadable(3), termkey(7)
36
37
38
39                                                         TERMKEY_PUSH_BYTES(3)
Impressum