IO-Tty
view release on metacpan or search on metacpan
void
pty_allocate()
INIT:
int ptyfd, ttyfd, ret;
char name[256];
#ifdef PTY_DEBUG
SV *debug;
#endif
PPCODE:
#ifdef PTY_DEBUG
debug = get_sv("IO::Tty::DEBUG", FALSE);
if (SvTRUE(debug))
print_debug = 1;
#endif
ret = allocate_pty(&ptyfd, &ttyfd, name, sizeof(name));
if (ret) {
name[sizeof(name)-1] = 0;
EXTEND(SP,3);
PUSHs(sv_2mortal(newSViv(ptyfd)));
ws.ws_ypixel = ypixel;
RETVAL = newSVpvn((char *)&ws, sizeof(ws));
OUTPUT:
RETVAL
void
unpack_winsize(winsize)
SV *winsize;
INIT:
struct winsize ws;
PPCODE:
if(SvCUR(winsize) != sizeof(ws))
croak("IO::Tty::unpack_winsize(): Bad arg length - got %zd, expected %zd",
SvCUR(winsize), sizeof(ws));
Copy(SvPV_nolen(winsize), &ws, sizeof(ws), char);
EXTEND(SP, 4);
PUSHs(sv_2mortal(newSViv(ws.ws_row)));
PUSHs(sv_2mortal(newSViv(ws.ws_col)));
PUSHs(sv_2mortal(newSViv(ws.ws_xpixel)));
PUSHs(sv_2mortal(newSViv(ws.ws_ypixel)));
( run in 0.482 second using v1.01-cache-2.11-cpan-71847e10f99 )