[Top][All Lists]

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

C library

From: Mario Beaulieu
Subject: C library
Date: Thu, 28 Sep 2023 14:00:34 -0400


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:

I get the information about GForth’s C Interface from

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                     -- 
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?"


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 

Any help will be appreciated 

Thank you


Envoyé de mon iPad

reply via email to

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