[BRLTTY] Low-level BrlAPI questions

Samuel Thibault samuel.thibault at ens-lyon.org
Thu Apr 15 06:37:48 EDT 2021


Dave Mielke, le jeu. 15 avril 2021 06:33:10 -0400, a ecrit:
> [quoted lines by Aura Kelloniemi on 2021/04/15 at 13:19 +0300]
> 
> > > I do not really see the use of being able to pass different sizes.
> > > That's most probably a sign of a bug in the application output preparing
> > > code, which the programmer would rather want to catch.
> >
> >You are probably right. The only case where the programmer may not care about
> >the size of the output is when they want to just send some text on the
> >display, and hope that it fits. For example brltty-ttb and apitest work this
> >way in some situations.
> 
> I disagree, but maybe not for an obvious reason. The fact is that bindings like Tcl, Java, Python (and maybe Rust) have arrays, sequences, or whatever. These things are constructed and have a size. This is a common case - the fact that C lacks this is the exception. That's one big reason why I think the write arguments should include optional sizes for the masks. Then the bindings could just set those fields and let some well-defined, common handling take place underneath.

Still. If the end-programmer produced a mask that isn't of the same
size of the text, it'll very probably be due to a bug, and it's better
reported than silently truncated.

Samuel


More information about the BRLTTY mailing list