Re: [rfa] Clarify remote protocol RLE example

Eli Zaretskii
2007-11-03T18:43:50Z

> Date: Sat, 3 Nov 2007 12:19:56 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, ukleinek@informatik.uni-freiburg.de
>
> Uwe pointed out that the example in the GDB manual for run-length
> encoding is a bit confusing. It suggests that "0* " should expand
> to 000, but in fact it expands to 0000, because the initial zero
> is counted separately.
>
> Is this version clearer? OK to commit?

Well, I still needed to read the text 2 or 3 times before I understood
what it tries to say.

How about this version instead:

Response @var{data} can be run-length encoded to save space.
Run-length encoding replaces runs of identical characters

> Response @var{data} can be run-length encoded to save space. A @samp{*}
> means that the next character is an @sc{ascii} encoding giving a repeat count
> -which stands for that many repetitions of the character preceding the
> +which stands for that many additional repetitions of the character preceding the
> @samp{*}. The encoding is @code{n+29}, yielding a printable character
> where @code{n >=3} (which is where rle starts to win). The printable
> characters @samp{$}, @samp{#}, @samp{+} and @samp{-} or with a numeric
> value greater than 126 should not be used.
>
> So:
> @smallexample
> "@code{0* }"
> @end smallexample
> @noindent
> -means the same as "0000".
> +means the same as "0000". The initial @code{0} contributes one zero,
> +and the space (@sc{ascii} 32) contributes a repeat count of three
> +additional zeros.
>
> The error response returned for some packets includes a two character
> error number. That number is not well defined.
>
> @cindex empty response, for unsupported packets
>