I'll wait a couple more days for input, then I'll change it to return char
* and take an int * parameter to output the length. If we're switching to
C++, we can update this based on whatever consensus we reach for the
switchover strategy.
On Wed, Jan 4, 2023 at 7:03 PM Masakazu Kitajo wrote:
>
> They could make the returned structure a nesting structure in
their structure.
What if the structure is defined by a library and a plugin author can't
modify it? What I'm trying to say is that I don't see the benefit of
limiting how a user receives the pointer and the length where nothing
receiv
There are people at Yahoo who have written plugins in straight C, and don't
want to change to C++.
On Wed, Jan 4, 2023 at 1:10 PM Leif Hedstrom wrote:
> This looks like a string_view to me?
>
> Why don’t we do what we talked about for years now, and stop supporting
> compiling plug-ins with C bu
This looks like a string_view to me?
Why don’t we do what we talked about for years now, and stop supporting
compiling plug-ins with C but require C++? Then we can introduce nice things in
ts.h. The old C plugins just have to be changed to compile with C++, and ABI
compatibility within major v
They could make the returned structure a nesting structure in their
structure. Better to make things more convenient for the typical case, not
the unusual case.
On Tue, Jan 3, 2023 at 12:28 PM Masakazu Kitajo wrote:
> What's the benefit of forcing users to use the structure? A user might want
>
What's the benefit of forcing users to use the structure? A user might want
to store the returned pointer into a user-defined structure.
On Tue, Sep 6, 2022 at 10:24 AM Walt Karas
wrote:
> Presumably we don't need to allow for use of antiquated C compilers that
> don't allow structures as retu
Presumably we don't need to allow for use of antiquated C compilers that
don't allow structures as return values. So this:
typedef struct
{
char *data;
int length;
}
TSVarLenData;
TSVarLenData TSSomething(x, y, z);
Is another alternative.
On Thu, Sep 1, 2022 at 5:32 PM Masakazu Kitajo wrote:
Using encapsulation/data abstraction is fine, but it doesn't seem like
TSHeapBuf makes sense. No TS API receives it. If plugin code is the only
user and it has to deal with a non-const raw pointer and a data length
after all, why do we want to wrap them in the first place?
As for smaller steps, li
As a rule of thumb, I prefer using encapsulation/data abstraction. I think
perhaps that is one reason I've been a poor match to this project. There
doesn't seem to be a consensus that we should follow this rule of thumb.
KIt, that would be my preference. But I am part of the consensus I think