Hi Christoph,

On 2018-12-03 10:59, Christoph Lange wrote:
> I have problems using 'chicken-bind'. I'm trying to make 'mosquitto', the
> MQTT library, available to Chicken. But
> 
> *chicken-bind -follow-include mosquitto.h*
> 
> gives me a practically empty 'mosquitto.scm' file:
> 
> Any idea, where I should look for the solution of this?

It's often necessary to tweak header files to some degree before bind
can handle them, since it's not a general-purpose C processor. This
usually means at least stripping preprocessor noise (some of which will
go unevaluated), since that can confuse further parsing.

Attached is a diff against that mosquitto.h file you linked which allows
chicken-bind to work, and the resulting mosquitto.scm file.

Hope that helps,

Evan
diff -ru a/mosquitto.h b/mosquitto.h
--- a/mosquitto.h	2018-12-10 21:33:36.527448557 +1300
+++ b/mosquitto.h	2018-12-10 21:33:07.715295078 +1300
@@ -17,32 +17,9 @@
 #ifndef MOSQUITTO_H
 #define MOSQUITTO_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(WIN32) && !defined(WITH_BROKER) && !defined(LIBMOSQUITTO_STATIC)
-#	ifdef libmosquitto_EXPORTS
-#		define libmosq_EXPORT  __declspec(dllexport)
-#	else
-#		define libmosq_EXPORT  __declspec(dllimport)
-#	endif
-#else
-#	define libmosq_EXPORT
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#	ifndef __cplusplus
-#		define bool char
-#		define true 1
-#		define false 0
-#	endif
-#else
-#	ifndef __cplusplus
-#		include <stdbool.h>
-#	endif
-#endif
+#define libmosq_EXPORT
 
+#include <stdbool.h>
 #include <stddef.h>
 
 #define LIBMOSQUITTO_MAJOR 1
@@ -86,14 +63,14 @@
 	MOSQ_ERR_PLUGIN_DEFER = 17,
 	MOSQ_ERR_MALFORMED_UTF8 = 18,
 	MOSQ_ERR_KEEPALIVE = 19,
-	MOSQ_ERR_LOOKUP = 20,
+	MOSQ_ERR_LOOKUP = 20
 };
 
 /* Error values */
 enum mosq_opt_t {
 	MOSQ_OPT_PROTOCOL_VERSION = 1,
 	MOSQ_OPT_SSL_CTX = 2,
-	MOSQ_OPT_SSL_CTX_WITH_DEFAULTS = 3,
+	MOSQ_OPT_SSL_CTX_WITH_DEFAULTS = 3
 };
 
 /* MQTT specification restricts client ids to a maximum of 23 characters */
@@ -1765,8 +1742,4 @@
  */
 libmosq_EXPORT void *mosquitto_userdata(struct mosquitto *mosq);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
;;; GENERATED BY CHICKEN-BIND FROM mosquitto.h

(begin
  (define-constant LIBMOSQUITTO_MAJOR 1)
  (define-constant LIBMOSQUITTO_MINOR 5)
  (define-constant LIBMOSQUITTO_REVISION 4)
  (define-foreign-variable
    LIBMOSQUITTO_VERSION_NUMBER
    integer
    "LIBMOSQUITTO_VERSION_NUMBER")
  (define-constant MOSQ_LOG_NONE 0)
  (define-constant MOSQ_LOG_INFO 1)
  (define-constant MOSQ_LOG_NOTICE 2)
  (define-constant MOSQ_LOG_WARNING 4)
  (define-constant MOSQ_LOG_ERR 8)
  (define-constant MOSQ_LOG_DEBUG 16)
  (define-constant MOSQ_LOG_SUBSCRIBE 32)
  (define-constant MOSQ_LOG_UNSUBSCRIBE 64)
  (define-constant MOSQ_LOG_WEBSOCKETS 128)
  (define-constant MOSQ_LOG_ALL 65535)
  (define-constant MOSQ_ERR_CONN_PENDING -1)
  (define-constant MOSQ_ERR_SUCCESS 0)
  (define-constant MOSQ_ERR_NOMEM 1)
  (define-constant MOSQ_ERR_PROTOCOL 2)
  (define-constant MOSQ_ERR_INVAL 3)
  (define-constant MOSQ_ERR_NO_CONN 4)
  (define-constant MOSQ_ERR_CONN_REFUSED 5)
  (define-constant MOSQ_ERR_NOT_FOUND 6)
  (define-constant MOSQ_ERR_CONN_LOST 7)
  (define-constant MOSQ_ERR_TLS 8)
  (define-constant MOSQ_ERR_PAYLOAD_SIZE 9)
  (define-constant MOSQ_ERR_NOT_SUPPORTED 10)
  (define-constant MOSQ_ERR_AUTH 11)
  (define-constant MOSQ_ERR_ACL_DENIED 12)
  (define-constant MOSQ_ERR_UNKNOWN 13)
  (define-constant MOSQ_ERR_ERRNO 14)
  (define-constant MOSQ_ERR_EAI 15)
  (define-constant MOSQ_ERR_PROXY 16)
  (define-constant MOSQ_ERR_PLUGIN_DEFER 17)
  (define-constant MOSQ_ERR_MALFORMED_UTF8 18)
  (define-constant MOSQ_ERR_KEEPALIVE 19)
  (define-constant MOSQ_ERR_LOOKUP 20)
  (define-constant MOSQ_OPT_PROTOCOL_VERSION 1)
  (define-constant MOSQ_OPT_SSL_CTX 2)
  (define-constant MOSQ_OPT_SSL_CTX_WITH_DEFAULTS 3)
  (define-constant MOSQ_MQTT_ID_MAX_LENGTH 23)
  (define-constant MQTT_PROTOCOL_V31 3)
  (define-constant MQTT_PROTOCOL_V311 4)
  (define mosquitto_message-mid
    (foreign-lambda*
      integer
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->mid);"))
  (define mosquitto_message-topic
    (foreign-lambda*
      c-string
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->topic);"))
  (define mosquitto_message-payload
    (foreign-lambda*
      (c-pointer void)
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->payload);"))
  (define mosquitto_message-payloadlen
    (foreign-lambda*
      integer
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->payloadlen);"))
  (define mosquitto_message-qos
    (foreign-lambda*
      integer
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->qos);"))
  (define mosquitto_message-retain
    (foreign-lambda*
      bool
      (((c-pointer (struct "mosquitto_message")) s))
      "return(s->retain);"))
  (define make-mosquitto_message
    (foreign-lambda*
      (c-pointer (struct "mosquitto_message"))
      ((integer mid)
       (c-string topic)
       ((c-pointer void) payload)
       (integer payloadlen)
       (integer qos)
       (bool retain))
      "struct mosquitto_message *tmp_ =  (struct mosquitto_message 
*)C_malloc(sizeof(struct mosquitto_message));\ntmp_->mid = mid;\ntmp_->topic = 
topic;\ntmp_->payload = payload;\ntmp_->payloadlen = payloadlen;\ntmp_->qos = 
qos;\ntmp_->retain = retain;\nreturn(tmp_);;\n"))
  (begin
    (define mosquitto_lib_version
      (foreign-lambda*
        integer
        ((s32vector a0) (s32vector a1) (s32vector a2))
        "return(mosquitto_lib_version(a0 , a1 , a2));")))
  (begin
    (define mosquitto_lib_init
      (foreign-lambda* integer () "return(mosquitto_lib_init());")))
  (begin
    (define mosquitto_lib_cleanup
      (foreign-lambda* integer () "return(mosquitto_lib_cleanup());")))
  (begin
    (define mosquitto_new
      (foreign-lambda*
        (c-pointer (struct "mosquitto"))
        ((c-string a0) (bool a1) ((c-pointer void) a2))
        "return(mosquitto_new(a0 , a1 , a2));")))
  (begin
    (define mosquitto_destroy
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0))
        "mosquitto_destroy(a0);")))
  (begin
    (define mosquitto_reinitialise
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (bool a2)
         ((c-pointer void) a3))
        "return(mosquitto_reinitialise(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_will_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         ((c-pointer void) a3)
         (integer a4)
         (bool a5))
        "return(mosquitto_will_set(a0 , a1 , a2 , a3 , a4 , a5));")))
  (begin
    (define mosquitto_will_clear
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_will_clear(a0));")))
  (begin
    (define mosquitto_username_pw_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (c-string a1) (c-string a2))
        "return(mosquitto_username_pw_set(a0 , a1 , a2));")))
  (begin
    (define mosquitto_connect
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (integer a3))
        "return(mosquitto_connect(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_connect_bind
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (integer a3)
         (c-string a4))
        "return(mosquitto_connect_bind(a0 , a1 , a2 , a3 , a4));")))
  (begin
    (define mosquitto_connect_async
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (integer a3))
        "return(mosquitto_connect_async(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_connect_bind_async
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (integer a3)
         (c-string a4))
        "return(mosquitto_connect_bind_async(a0 , a1 , a2 , a3 , a4));")))
  (begin
    (define mosquitto_connect_srv
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (c-string a3))
        "return(mosquitto_connect_srv(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_reconnect
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_reconnect(a0));")))
  (begin
    (define mosquitto_reconnect_async
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_reconnect_async(a0));")))
  (begin
    (define mosquitto_disconnect
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_disconnect(a0));")))
  (begin
    (define mosquitto_publish
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (s32vector a1)
         (c-string a2)
         (integer a3)
         ((c-pointer void) a4)
         (integer a5)
         (bool a6))
        "return(mosquitto_publish(a0 , a1 , a2 , a3 , a4 , a5 , a6));")))
  (begin
    (define mosquitto_subscribe
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (s32vector a1)
         (c-string a2)
         (integer a3))
        "return(mosquitto_subscribe(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_unsubscribe
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (s32vector a1) (c-string a2))
        "return(mosquitto_unsubscribe(a0 , a1 , a2));")))
  (begin
    (define mosquitto_message_copy
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto_message")) a0)
         ((c-pointer (struct "mosquitto_message")) a1))
        "return(mosquitto_message_copy(a0 , a1));")))
  (begin
    (define mosquitto_message_free
      (foreign-lambda*
        void
        (((c-pointer (c-pointer (struct "mosquitto_message"))) a0))
        "mosquitto_message_free(a0);")))
  (begin
    (define mosquitto_message_free_contents
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto_message")) a0))
        "mosquitto_message_free_contents(a0);")))
  (begin
    (define mosquitto_loop
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (integer a1) (integer a2))
        "return(mosquitto_loop(a0 , a1 , a2));")))
  (begin
    (define mosquitto_loop_forever
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (integer a1) (integer a2))
        "return(mosquitto_loop_forever(a0 , a1 , a2));")))
  (begin
    (define mosquitto_loop_start
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_loop_start(a0));")))
  (begin
    (define mosquitto_loop_stop
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (bool a1))
        "return(mosquitto_loop_stop(a0 , a1));")))
  (begin
    (define mosquitto_socket
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_socket(a0));")))
  (begin
    (define mosquitto_loop_read
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (integer a1))
        "return(mosquitto_loop_read(a0 , a1));")))
  (begin
    (define mosquitto_loop_write
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (integer a1))
        "return(mosquitto_loop_write(a0 , a1));")))
  (begin
    (define mosquitto_loop_misc
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_loop_misc(a0));")))
  (begin
    (define mosquitto_want_write
      (foreign-lambda*
        bool
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_want_write(a0));")))
  (begin
    (define mosquitto_threaded_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (bool a1))
        "return(mosquitto_threaded_set(a0 , a1));")))
  (begin
    (define mosquitto_opts_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         ((enum "mosq_opt_t") a1)
         ((c-pointer void) a2))
        "return(mosquitto_opts_set(a0 , a1 , a2));")))
  (begin
    (define mosquitto_tls_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (c-string a2)
         (c-string a3)
         (c-string a4)
         ((function integer (c-string integer integer (c-pointer void))) a5))
        "return(mosquitto_tls_set(a0 , a1 , a2 , a3 , a4 , a5));")))
  (begin
    (define mosquitto_tls_insecure_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (bool a1))
        "return(mosquitto_tls_insecure_set(a0 , a1));")))
  (begin
    (define mosquitto_tls_opts_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (integer a1)
         (c-string a2)
         (c-string a3))
        "return(mosquitto_tls_opts_set(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_tls_psk_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (c-string a2)
         (c-string a3))
        "return(mosquitto_tls_psk_set(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_connect_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto")) (c-pointer void) integer))
          a1))
        "mosquitto_connect_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_connect_with_flags_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto"))
             (c-pointer void)
             integer
             integer))
          a1))
        "mosquitto_connect_with_flags_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_disconnect_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto")) (c-pointer void) integer))
          a1))
        "mosquitto_disconnect_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_publish_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto")) (c-pointer void) integer))
          a1))
        "mosquitto_publish_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_message_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto"))
             (c-pointer void)
             (c-pointer (struct "mosquitto_message"))))
          a1))
        "mosquitto_message_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_subscribe_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto"))
             (c-pointer void)
             integer
             integer
             s32vector))
          a1))
        "mosquitto_subscribe_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_unsubscribe_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto")) (c-pointer void) integer))
          a1))
        "mosquitto_unsubscribe_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_log_callback_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0)
         ((function
            void
            ((c-pointer (struct "mosquitto"))
             (c-pointer void)
             integer
             c-string))
          a1))
        "mosquitto_log_callback_set(a0 , a1);")))
  (begin
    (define mosquitto_reconnect_delay_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (unsigned-integer a1)
         (unsigned-integer a2)
         (bool a3))
        "return(mosquitto_reconnect_delay_set(a0 , a1 , a2 , a3));")))
  (begin
    (define mosquitto_max_inflight_messages_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0) (unsigned-integer a1))
        "return(mosquitto_max_inflight_messages_set(a0 , a1));")))
  (begin
    (define mosquitto_message_retry_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0) (unsigned-integer a1))
        "mosquitto_message_retry_set(a0 , a1);")))
  (begin
    (define mosquitto_user_data_set
      (foreign-lambda*
        void
        (((c-pointer (struct "mosquitto")) a0) ((c-pointer void) a1))
        "mosquitto_user_data_set(a0 , a1);")))
  (begin
    (define mosquitto_socks5_set
      (foreign-lambda*
        integer
        (((c-pointer (struct "mosquitto")) a0)
         (c-string a1)
         (integer a2)
         (c-string a3)
         (c-string a4))
        "return(mosquitto_socks5_set(a0 , a1 , a2 , a3 , a4));")))
  (begin
    (define mosquitto_strerror
      (foreign-lambda*
        c-string
        ((integer a0))
        "return(mosquitto_strerror(a0));")))
  (begin
    (define mosquitto_connack_string
      (foreign-lambda*
        c-string
        ((integer a0))
        "return(mosquitto_connack_string(a0));")))
  (begin
    (define mosquitto_sub_topic_tokenise
      (foreign-lambda*
        integer
        ((c-string a0)
         ((c-pointer (c-pointer (c-pointer char))) a1)
         (s32vector a2))
        "return(mosquitto_sub_topic_tokenise(a0 , a1 , a2));")))
  (begin
    (define mosquitto_sub_topic_tokens_free
      (foreign-lambda*
        integer
        (((c-pointer (c-pointer (c-pointer char))) a0) (integer a1))
        "return(mosquitto_sub_topic_tokens_free(a0 , a1));")))
  (begin
    (define mosquitto_topic_matches_sub
      (foreign-lambda*
        integer
        ((c-string a0) (c-string a1) ((c-pointer bool) a2))
        "return(mosquitto_topic_matches_sub(a0 , a1 , a2));")))
  (begin
    (define mosquitto_topic_matches_sub2
      (foreign-lambda*
        integer
        ((c-string a0)
         (size_t a1)
         (c-string a2)
         (size_t a3)
         ((c-pointer bool) a4))
        "return(mosquitto_topic_matches_sub2(a0 , a1 , a2 , a3 , a4));")))
  (begin
    (define mosquitto_pub_topic_check
      (foreign-lambda*
        integer
        ((c-string a0))
        "return(mosquitto_pub_topic_check(a0));")))
  (begin
    (define mosquitto_pub_topic_check2
      (foreign-lambda*
        integer
        ((c-string a0) (size_t a1))
        "return(mosquitto_pub_topic_check2(a0 , a1));")))
  (begin
    (define mosquitto_sub_topic_check
      (foreign-lambda*
        integer
        ((c-string a0))
        "return(mosquitto_sub_topic_check(a0));")))
  (begin
    (define mosquitto_sub_topic_check2
      (foreign-lambda*
        integer
        ((c-string a0) (size_t a1))
        "return(mosquitto_sub_topic_check2(a0 , a1));")))
  (define libmosquitto_will-topic
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_will")) s))
      "return(s->topic);"))
  (define libmosquitto_will-payload
    (foreign-lambda*
      (c-pointer void)
      (((c-pointer (struct "libmosquitto_will")) s))
      "return(s->payload);"))
  (define libmosquitto_will-payloadlen
    (foreign-lambda*
      integer
      (((c-pointer (struct "libmosquitto_will")) s))
      "return(s->payloadlen);"))
  (define libmosquitto_will-qos
    (foreign-lambda*
      integer
      (((c-pointer (struct "libmosquitto_will")) s))
      "return(s->qos);"))
  (define libmosquitto_will-retain
    (foreign-lambda*
      bool
      (((c-pointer (struct "libmosquitto_will")) s))
      "return(s->retain);"))
  (define make-libmosquitto_will
    (foreign-lambda*
      (c-pointer (struct "libmosquitto_will"))
      ((c-string topic)
       ((c-pointer void) payload)
       (integer payloadlen)
       (integer qos)
       (bool retain))
      "struct libmosquitto_will *tmp_ =  (struct libmosquitto_will 
*)C_malloc(sizeof(struct libmosquitto_will));\ntmp_->topic = 
topic;\ntmp_->payload = payload;\ntmp_->payloadlen = payloadlen;\ntmp_->qos = 
qos;\ntmp_->retain = retain;\nreturn(tmp_);;\n"))
  (define libmosquitto_auth-username
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_auth")) s))
      "return(s->username);"))
  (define libmosquitto_auth-password
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_auth")) s))
      "return(s->password);"))
  (define make-libmosquitto_auth
    (foreign-lambda*
      (c-pointer (struct "libmosquitto_auth"))
      ((c-string username) (c-string password))
      "struct libmosquitto_auth *tmp_ =  (struct libmosquitto_auth 
*)C_malloc(sizeof(struct libmosquitto_auth));\ntmp_->username = 
username;\ntmp_->password = password;\nreturn(tmp_);;\n"))
  (define libmosquitto_tls-cafile
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->cafile);"))
  (define libmosquitto_tls-capath
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->capath);"))
  (define libmosquitto_tls-certfile
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->certfile);"))
  (define libmosquitto_tls-keyfile
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->keyfile);"))
  (define libmosquitto_tls-ciphers
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->ciphers);"))
  (define libmosquitto_tls-tls_version
    (foreign-lambda*
      c-string
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->tls_version);"))
  (define libmosquitto_tls-cert_reqs
    (foreign-lambda*
      integer
      (((c-pointer (struct "libmosquitto_tls")) s))
      "return(s->cert_reqs);"))
  (define make-libmosquitto_tls
    (foreign-lambda*
      (c-pointer (struct "libmosquitto_tls"))
      ((c-string cafile)
       (c-string capath)
       (c-string certfile)
       (c-string keyfile)
       (c-string ciphers)
       (c-string tls_version)
       (integer cert_reqs))
      "struct libmosquitto_tls *tmp_ =  (struct libmosquitto_tls 
*)C_malloc(sizeof(struct libmosquitto_tls));\ntmp_->cafile = 
cafile;\ntmp_->capath = capath;\ntmp_->certfile = certfile;\ntmp_->keyfile = 
keyfile;\ntmp_->ciphers = ciphers;\ntmp_->tls_version = 
tls_version;\ntmp_->cert_reqs = cert_reqs;\nreturn(tmp_);;\n"))
  (begin
    (define mosquitto_subscribe_simple
      (foreign-lambda*
        integer
        (((c-pointer (c-pointer (struct "mosquitto_message"))) a0)
         (integer a1)
         (bool a2)
         (c-string a3)
         (integer a4)
         (c-string a5)
         (integer a6)
         (c-string a7)
         (integer a8)
         (bool a9)
         (c-string a10)
         (c-string a11)
         ((c-pointer (struct "libmosquitto_will")) a12)
         ((c-pointer (struct "libmosquitto_tls")) a13))
        "return(mosquitto_subscribe_simple(a0 , a1 , a2 , a3 , a4 , a5 , a6 , 
a7 , a8 , a9 , a10 , a11 , a12 , a13));")))
  (begin
    (define mosquitto_subscribe_callback
      (foreign-lambda*
        integer
        (((function
            integer
            ((c-pointer (struct "mosquitto"))
             (c-pointer void)
             (c-pointer (struct "mosquitto_message"))))
          a0)
         ((c-pointer void) a1)
         (c-string a2)
         (integer a3)
         (c-string a4)
         (integer a5)
         (c-string a6)
         (integer a7)
         (bool a8)
         (c-string a9)
         (c-string a10)
         ((c-pointer (struct "libmosquitto_will")) a11)
         ((c-pointer (struct "libmosquitto_tls")) a12))
        "return(mosquitto_subscribe_callback(a0 , a1 , a2 , a3 , a4 , a5 , a6 , 
a7 , a8 , a9 , a10 , a11 , a12));")))
  (begin
    (define mosquitto_validate_utf8
      (foreign-lambda*
        integer
        ((c-string a0) (integer a1))
        "return(mosquitto_validate_utf8(a0 , a1));")))
  (begin
    (define mosquitto_userdata
      (foreign-lambda*
        (c-pointer void)
        (((c-pointer (struct "mosquitto")) a0))
        "return(mosquitto_userdata(a0));"))))

;;; END OF FILE
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to