forked from Yurik72/ESPHap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson.h
37 lines (28 loc) · 924 Bytes
/
json.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <stdbool.h>
#include "port_x.h"
#ifdef ARDUINO8266_SERVER_CPP
#ifdef __cplusplus
extern "C" {
#endif
#endif
struct json_stream;
typedef struct json_stream json_stream;
typedef void(*json_flush_callback)(uint8_t *buffer, size_t size, void *context);
json_stream *json_new(size_t buffer_size, json_flush_callback on_flush, void *context);
void json_free(json_stream *json);
void json_flush(json_stream *json);
void json_object_start(json_stream *json);
void json_object_end(json_stream *json);
void json_array_start(json_stream *json);
void json_array_end(json_stream *json);
void json_integer(json_stream *json, long long x);
void json_float(json_stream *json, float x);
void json_string(json_stream *json, const char *x);
void json_boolean(json_stream *json, bool x);
void json_null(json_stream *json);
#ifdef ARDUINO8266_SERVER_CPP
#ifdef __cplusplus
} //extern c
#endif
#endif