[BRLTTY] Low-level BrlAPI questions

Samuel Thibault samuel.thibault at ens-lyon.org
Thu Apr 15 19:04:23 EDT 2021


Aura Kelloniemi, le jeu. 15 avril 2021 13:19:26 +0300, a ecrit:
> These are the
> cases where teh client programmer does not necessarily know (or want to know)
> how many characters their output contains, and in these situations they call
> brlapi__writeText, which pads/truncates the output as necessary.
> 
> But this function cannot be called safely from languages that are Unicode
> only.

But with the proposal I made:

“
- just apply the flag (as a high bit) to the regionSize field. Older
  servers will simply reject it with an invalid value exception.
”
(or it could be a special value, 0 may not be the best choice since we
may rather see it just write nothing)

Such languages can then use brlapi__write with setting the charset, the
textSize, regionBegin set to 0, and regionSize with that flag or special
value. Is there something missing here?

> If brlapi__writeTextUtf8 is added so that it does not rely on the
> NUL-terminator but has a size parameter, I am done with this discussion.

AIUI, with the padding/truncating flag/special value proposed above,
that answers this need?

> I don't see any difference regardless of who does the padding

> Why do you think the library should not pad/truncate text?

I mean the library padding is useless since the server will have to do
it anyway in the case where the library didn't notice the size change
soon enough.

> just to make sure that the application notices the size change.

That is rather handled through the display size parameter change
notification. The application then writes the content again, to be
padded/truncated differently.

Samuel


More information about the BRLTTY mailing list