$main::build += $VERSION;
$main::branch += $BRANCH;
+use vars qw($sentencelth);
+
+$sentencelth = 180;
+
#
# All the PCxx generation routines
#
my $ncall = $node->call;
my @out;
- while (@_) {
- my $str = "PC16^$ncall";
- for ( ; @_ && length $str < 200; ) {
- my $ref = shift;
- $str .= sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;
+ my $s = "";
+ for (@_) {
+ next unless $_;
+ my $ref = $_;
+ my $str = sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;
+ if (length($s) + length($str) > $sentencelth) {
+ push @out, "PC16^$ncall" . $s . sprintf "^%s^", get_hops(16);
+ $s = "";
}
- $str .= sprintf "^%s^", get_hops(16);
- push @out, $str;
+ $s .= $str;
}
+ push @out, "PC16^$ncall" . $s . sprintf "^%s^", get_hops(16);
return @out;
}
sub pc19
{
my @out;
-
- while(@_) {
- my $str = "PC19";
- for (; @_ && length $str < 200;) {
- my $ref = shift;
- my $call = $ref->call;
- my $here = $ref->here;
- my $conf = $ref->conf;
- my $version = $ref->version;
- $str .= "^$here^$call^$conf^$version";
+ my @in;
+
+ my $s = "";
+ for (@_) {
+ next unless $_;
+ my $ref = $_;
+ my $call = $ref->call;
+ my $here = $ref->here;
+ my $conf = $ref->conf;
+ my $version = $ref->version;
+ my $str = "^$here^$call^$conf^$version";
+ if (length($s) + length($str) > $sentencelth) {
+ push @out, "PC19" . $s . sprintf "^%s^", get_hops(19);
+ $s = "";
}
- $str .= sprintf "^%s^", get_hops(19);
- push @out, $str;
+ $s .= $str;
}
+ push @out, "PC19" . $s . sprintf "^%s^", get_hops(19);
return @out;
}