| 1 | package Games::Rezrov::ZReceiver; | ||||||||||
| 2 | # stub ZIO used for redirecting output. | ||||||||||
| 3 | |||||||||||
| 4 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 5 | 0 | my ($type) = @_; | |||||||||
| 6 | 0 | my $self = {}; | |||||||||
| 7 | 0 | bless $self, $type; | |||||||||
| 8 | 0 | $self->reset(); | |||||||||
| 9 | 0 | return $self; | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub write_zchar { | ||||||||
|
Subroutine
write_zchar: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | # print STDERR "received: " . chr($_[1]); | ||||||||||
| 14 | 0 | $_[0]->{"buffer"} .= chr($_[1]); | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub buffer { | ||||||||
|
Subroutine
buffer: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 18 | 0 | return $_[0]->{"buffer"}; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub reset { | ||||||||
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 22 | 0 | $_[0]->{"buffer"} = ""; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub misc { | ||||||||
|
Subroutine
misc: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 26 | # misc info for this object; hack used in stream3 redirection | ||||||||||
| 27 | 0 | ▶ | $_[0]->{"misc"} = $_[1] if defined $_[1]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | return $_[0]->{"misc"}; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub buffer_zchar { | ||||||||
|
Subroutine
buffer_zchar: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | $_[0]->{"buffer"} .= chr($_[1]); | |||||||||
| 33 | # printf STDERR "redirect: %s\n", chr($_[1]); | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub buffer_zchunk { | ||||||||
|
Subroutine
buffer_zchunk: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 37 | 0 | $_[0]->{"buffer"} .= ${$_[1]}; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | sub flush { | ||||||||
|
Subroutine
flush: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 41 | # $_[0]->{"buffer"} .= $_; | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub newline { | ||||||||
|
Subroutine
newline: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 45 | # z-char for newline | ||||||||||
| 46 | 0 | $_[0]->{"buffer"} .= chr(Games::Rezrov::ZConst::Z_NEWLINE()); | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 1 | 1; | |||||||||
| 50 | |||||||||||