[Gambas-user] external functions and structs

gen braga genbraga1 at gmail.com
Wed Nov 28 19:09:38 CET 2018


Well, i have some notes,

1. I tried to chage P in sixbit to every suitable datatype: byte, string,
pointer, etc. No good.
2. I "unested" the structs, so I got no segfault but obviously I still cant
get any suitable value in ais_state1 after I call the method assemble_vdm.
By "unested" I mean I made only one struct with both contents. If you look
at the contents using the debuger, there will be garbage.

You can check assemble_vdm is ok by changing any character in the sSentence
string, so Handler will return something between 1 and 5, based on wich
field  was changed. By using the debuger you can see it cleary, as well as
the mess at ais_state1.

I really have no clue...

The library's authors made a simple example here
https://github.com/bcl/aisparser/blob/master/c/examples/text/main.c but it
does nothing more than my souces at all.

Em qua, 28 de nov de 2018 às 15:39, T Lee Davidson <t.lee.davidson at gmail.com>
escreveu:

> Well, in a rare flash of inspiration, I thought to simply change the name
> of the library file on disk and use 'Library "libais"'
> (duh). I also successfully loaded the library using the syntax specified
> at the External Function Declaration wiki page [0] as
> was mentioned (ie: Library "./libais:1.9").
>
> I get a segfault no matter whether 'p' in the sixbit structure is defined
> as a String, as a Pointer, or as a Byte.
>
>
> ___
> Lee
>
> [0] http://gambaswiki.org/wiki/lang/extdecl
>
>
> On 11/28/18 12:05 PM, gen braga wrote:
> > Hi Lee
> >
> > I just copied the aislib to /usr/lib and also tried to use pointer at
> sixbit, but wasnt better.
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20181128/742ec754/attachment.html>


More information about the User mailing list