[BRLTTY] Low-level BrlAPI questions

Aura Kelloniemi kaura.dev at sange.fi
Thu Apr 15 08:36:55 EDT 2021


On 2021-04-15 at 06:44 -0400, Dave Mielke <Dave at mielke.cc> wrote:
 > [quoted lines by Samuel Thibault on 2021/04/15 at 12:37 +0200]

 > >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.

 > But that could be part of the common handling. It's still better for the binding to be able to provide, without modification, it's sizes and let the underlying C code reject it in a common way. This, to me, is a separate issue from allowing the text and masks to need to match the region size.

There are two requirements going on at the same time. On one hand the question
is about BrlAPI's usability from C. From a C programmers view it is complete
waste of resources to pass regionSize, andMaskSize and orMaskSize to
brlapi__write, if they have the same value anyways. From the binding writer's
perspective this makes much more sense.

Similarly for a C programmer it makes sense to use NUL-terminated strings, but
for all other languages it is pointless.

In my opinion it is not a bad idea to sometimes have both interfaces – those
that are most convenient for C programmers, and those that are easiest for the
ones who call C through FFI. We don't need to change brlapi__write, if adding
another function makes sense.

But whether it makes sense, I'm no more sure.

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.

The reason why I initially said that I don't need it was that I didn't yet
know all the semantics of brlapi__write.

-- 
Aura


More information about the BRLTTY mailing list