<commit_before>#ifndef _MQTT_H_
#define _MQTT_H_
#include <stdint.h>
#include <string.h>
#include "mqtt_config.h"
#include "mqtt_msg.h"
#include "ringbuf.h"


#if defined(CONFIG_MQTT_SECURITY_ON)  // ENABLE MQTT OVER SSL
#include "openssl/ssl.h"

  #define ClientRead(buf,num) SSL_read(client->ssl, buf, num)    
  #define ClientWrite(buf,num) SSL_write(client->ssl, buf, num)

#else

  #define ClientRead(buf,num) read(client->socket, buf, num) 
  #define ClientWrite(buf,num) write(client->socket, buf, num)   
#endif


typedef void (* mqtt_callback)(void *, void *);

typedef struct mqtt_settings {
    mqtt_callback connected_cb;
    mqtt_callback disconnected_cb;
    mqtt_callback reconnect_cb;

    mqtt_callback subscribe_cb;
    mqtt_callback publish_cb;
    mqtt_callback data_cb;

    char host[CONFIG_MQTT_MAX_HOST_LEN];
    uint32_t port;
    char client_id[CONFIG_MQTT_MAX_CLIENT_LEN];
    char username[CONFIG_MQTT_MAX_USERNAME_LEN];
    char password[CONFIG_MQTT_MAX_PASSWORD_LEN];<commit_msg>Replace void* with specific types<commit_after>#ifndef _MQTT_H_
#define _MQTT_H_
#include <stdint.h>
#include <string.h>
#include "mqtt_config.h"
#include "mqtt_msg.h"
#include "ringbuf.h"


#if defined(CONFIG_MQTT_SECURITY_ON)  // ENABLE MQTT OVER SSL
#include "openssl/ssl.h"

  #define ClientRead(buf,num) SSL_read(client->ssl, buf, num)    
  #define ClientWrite(buf,num) SSL_write(client->ssl, buf, num)

#else

  #define ClientRead(buf,num) read(client->socket, buf, num) 
  #define ClientWrite(buf,num) write(client->socket, buf, num)   
#endif


typedef struct mqtt_client mqtt_client;
typedef struct mqtt_event_data_t mqtt_event_data_t;

typedef void (* mqtt_event_callback)(mqtt_client *client, mqtt_event_data_t *event_data);

typedef struct mqtt_settings {
    mqtt_event_callback connected_cb;
    mqtt_event_callback disconnected_cb; // unused
    mqtt_event_callback reconnect_cb; // unused

    mqtt_event_callback subscribe_cb;
    mqtt_event_callback publish_cb;
    mqtt_event_callback data_cb;

    char host[CONFIG_MQTT_MAX_HOST_LEN];
    uint32_t port;
    char client_id[CONFIG_MQTT_MAX_CLIENT_LEN];
    char username[CONFIG_MQTT_MAX_USERNAME_LEN];
    char password[CONFIG_MQTT_MAX_PASSWORD_LEN];
{'fraction_non_alphanumeric': 0.09825033647375504, 'fraction_numerical': 0.001794526693584567, 'mean_word_length': 5.482558139534884, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4175364', 'n_tokens_mistral': 877, 'n_tokens_neox': 817, 'n_words': 161}