gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C library


From: Mark J. Reed
Subject: Re: C library
Date: Thu, 28 Sep 2023 14:30:00 -0400

All Forth really cares about is the size of the returned value. I'd expect
a pointer to have type "a" (address).

On Thu, Sep 28, 2023 at 2:01 PM Mario Beaulieu via Gforth discussion and
announcements <gforth@gnu.org> wrote:

> Hi,
>
> I'm trying to use a C library to handle mqtt messages from GForth. I use
> Mosquitto as a message broker (on a Raspberry Pi 3).
>
> The header file for mosquito can be found here:
> https://mosquitto.org/api/files/mosquitto-h.html
>
> I get the information about GForth’s C Interface from
> https://gforth.org/manual/C-Interface.html
>
>
> At the moment, I'm struggling on the function ‘mosquitto_new’. More
> precisely, my issue is that this function returns a pointer to a struct («
> Pointer to a struct mosquitto on success »), which I can't figure out how
> to code.
>
> Here's my code:
> *********
> c-library libmosquitto
>
> \c #include <sys/types.h>
> \c #include <mosquitto.h>
>
> c-function mosquitto_lib_init         mosquittoLibInit
>  -- void
> c-function mosquitto_connect      mosquittoConnect    a a n n -- void
> c-function mosquitto_subscribe   mosquittoSubscribe  a n a a -- void
> c-function mosquitto_loop             mosquittoLoop           a n n    --
> void
>
> c-function mosquitto_new   mosquittoNew a n void -- "What do I put here?"
>
> end-c-library
> *******
>
> I get an « Invalid name argument » error for every type I try.
>
> Note that I'm not a C programmer, so I might be struggling with something
> obvious.
>
> Any help will be appreciated
>
> Thank you
>
> Mario
>
> Envoyé de mon iPad



-- 
Mark J. Reed <markjreed@gmail.com>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]