[BRLTTY] Low-level BrlAPI questions

Aura Kelloniemi kaura.dev at sange.fi
Wed Apr 14 09:22:34 EDT 2021


On 2021-04-14 at 13:48 +0200, Samuel Thibault <samuel.thibault at ens-lyon.org> wrote:
 > Aura Kelloniemi, le mer. 14 avril 2021 13:28:35 +0300, a ecrit:
 > > Would it mean that everything starting from regionBegin until the end of
 > > the display is written, and the masks (if given) will need to hold
 > > (displaySize - regionBegin) bytes?

 > strlen(text) would provide the length of the masks.

I am strongly against this, because

1) It explodes if text is in a multi-byte encoding (which it always is in case
   of Rust).

2) Because it requires text to be NUL-terminated (which it is not in Rust, so
   an allocation and a copy would be required for appending the terminator).

The real number of code points in text could be used to detect the lengths of
the masks, but then we are almost back where we left.

Perhaps the idea of not-exact-length-masks is too complex to be expressed
without a new function, that allows the caller to explicitly provide the
lengths. However, not-exact-length text should be feasible with regionSize ==
0, but with the requirement that the masks are not applied.

-- 
Aura


More information about the BRLTTY mailing list