[BRLTTY] Low-level BrlAPI questions
Samuel Thibault
samuel.thibault at ens-lyon.org
Fri Mar 26 17:51:47 EDT 2021
Aura Kelloniemi, le ven. 26 mars 2021 22:45:43 +0200, a ecrit:
> - Is BrlAPI thread-safe in the sense, that I can call all BrlAPI functions
> from different threads with the same handle in parallel?
Yes.
> - What is the best way to write to the display if the input text is always
> UTF-8 encoded? (This is how Rust's strings work).
You can just emit UTF-8. Applications may prefer to use liblouis before
sending dots, to have better control over contraction etc.
> - What is the intended use of enterTtyModeWithPath?
It is meant for screen readers, that take control of a whole desktop.
For more rationale, see the “A pile of "paper sheets"” section of the
brlapi documentation.
> How to use it?
Just like brlapi_enterTtyMode, except that you can set an ttys array,
which thus allows to get control of the whole desktop.
> What does its return value mean?
Ah, that wasn't documented indeed, now submitted:
\return 0 on success, -1 on error.
> - Shouldn't enterTtyModeWithPath take the ttys argument as conast int* instead
> of just int*?
Indeed, now submitted.
> - It is not always clear who owns the date returned by BrlAPI functions.
For which function is this not clear?
> - Does BrlAPI leak memory that is used by thread-local storage?
Not that I am aware of.
> To me it looks like brlapi_error_location allocates new memory for
> each thread, but it is never freed.
It uses pthread_once(&error_key_once, error_key_alloc); that calls
pthread_key_create(&error_key, error_key_free);
which thus registers the free function.
Samuel
More information about the BRLTTY
mailing list