mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-27 22:29:31 +08:00
Formatting: Double space before functions.
This commit is contained in:
@@ -26,15 +26,18 @@
|
||||
static int run = 1;
|
||||
static MYSQL_STMT *stmt = NULL;
|
||||
|
||||
|
||||
void handle_signal(int s)
|
||||
{
|
||||
run = 0;
|
||||
}
|
||||
|
||||
|
||||
void connect_callback(struct mosquitto *mosq, void *obj, int result)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_message *message)
|
||||
{
|
||||
MYSQL_BIND bind[2];
|
||||
@@ -55,6 +58,7 @@ void message_callback(struct mosquitto *mosq, void *obj, const struct mosquitto_
|
||||
mysql_stmt_execute(stmt);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
MYSQL *connection;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# define UNUSED(A) (void)(A)
|
||||
#endif
|
||||
|
||||
|
||||
/* Callback called when the client receives a CONNACK message from the broker. */
|
||||
void on_connect(struct mosquitto *mosq, void *obj, int reason_code)
|
||||
{
|
||||
@@ -54,6 +55,7 @@ int get_temperature(void)
|
||||
return (int)random()%100;
|
||||
}
|
||||
|
||||
|
||||
/* This function pretends to read some data from a sensor and publish it.*/
|
||||
void publish_sensor_data(struct mosquitto *mosq)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# define UNUSED(A) (void)(A)
|
||||
#endif
|
||||
|
||||
|
||||
/* Callback called when the client receives a CONNACK message from the broker. */
|
||||
void on_connect(struct mosquitto *mosq, void *obj, int reason_code)
|
||||
{
|
||||
@@ -56,6 +57,7 @@ int get_temperature(void)
|
||||
return (int)random()%100;
|
||||
}
|
||||
|
||||
|
||||
/* This function pretends to read some data from a sensor and publish it.*/
|
||||
void publish_sensor_data(struct mosquitto *mosq)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include "mosquitto.h"
|
||||
|
||||
|
||||
int on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *msg)
|
||||
{
|
||||
printf("%s %s (%d)\n", msg->topic, (const char *)msg->payload, msg->payloadlen);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#define COUNT 3
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include "mosquitto.h"
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int rc;
|
||||
|
||||
Reference in New Issue
Block a user