Size.xs

filter: Statementstmt 0.0% 0 / 12 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 36 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Term/Size.pm ↑ Summary
1 #ifdef __cplusplus
2 extern "C" {
3 #endif
4  
5 #include "EXTERN.h"
6 #include "perl.h"
7 #include "XSUB.h"
8  
9 #ifndef _AIX
10 #include <sys/termios.h>
11 #else
12 #include <termios.h>
13 #endif
14  
15 #ifdef __cplusplus
16 }
17 #endif
18  
19 MODULE = Term::Size PACKAGE = Term::Size
20  
21 PROTOTYPES: DISABLE
22  
23 void
24 chars( f = PerlIO_stdin() )
25 PerlIO *f;
26  
27 PREINIT:
28 0 ▶ struct winsize w = { 0, 0, 0, 0 };
Branch: 1 branch
BranchTrueFalseTotal
struct winsize w = { 0, 0, 0, 0 }; 0 0 0
29  
30 PPCODE:
31 0 ▶ if (ioctl(PerlIO_fileno(f), TIOCGWINSZ, &w) == -1)
Branch: 1 branch
BranchTrueFalseTotal
if (ioctl(PerlIO_fileno(f), TIOCGWINSZ, &w) == -1) 0 0 0
32 0 XSRETURN(0);
33  
34 0 ▶ XPUSHs(sv_2mortal(newSViv(w.ws_col)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSViv(w.ws_col))); 0 0 0
35 0 ▶ if (GIMME != G_SCALAR)
Branch: 2 branches
BranchTrueFalseTotal
if (GIMME != G_SCALAR) 0 0 0
if (GIMME != G_SCALAR) 0 0 0
36 0 ▶ XPUSHs(sv_2mortal(newSViv(w.ws_row)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSViv(w.ws_row))); 0 0 0
37  
38 void
39 pixels( f = PerlIO_stdin() )
40 PerlIO *f;
41  
42 PREINIT:
43 0 ▶ struct winsize w = { 0, 0, 0, 0 };
Branch: 1 branch
BranchTrueFalseTotal
struct winsize w = { 0, 0, 0, 0 }; 0 0 0
44  
45 PPCODE:
46 0 ▶ if (ioctl(PerlIO_fileno(f), TIOCGWINSZ, &w) == -1)
Branch: 1 branch
BranchTrueFalseTotal
if (ioctl(PerlIO_fileno(f), TIOCGWINSZ, &w) == -1) 0 0 0
47 0 XSRETURN(0);
48  
49 0 ▶ XPUSHs(sv_2mortal(newSViv(w.ws_xpixel)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSViv(w.ws_xpixel))); 0 0 0
50 0 ▶ if (GIMME != G_SCALAR)
Branch: 2 branches
BranchTrueFalseTotal
if (GIMME != G_SCALAR) 0 0 0
if (GIMME != G_SCALAR) 0 0 0
51 0 ▶ XPUSHs(sv_2mortal(newSViv(w.ws_ypixel)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSViv(w.ws_ypixel))); 0 0 0
« blib/lib/Term/Size.pm ↑ Summary