summaryrefslogtreecommitdiff
path: root/src/mcp/json.h
blob: a46e6c720569ab321815e963aa0eee38741ba99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef TINY_CONVMEM_MCP_JSON_H
#define TINY_CONVMEM_MCP_JSON_H

#include <stdbool.h>
#include <stddef.h>

typedef struct tiny_json_buffer
{
  char *data;
  size_t length;
  size_t capacity;
  bool failed;
} tiny_json_buffer_t;

void tiny_json_init(tiny_json_buffer_t *buffer);
void tiny_json_free(tiny_json_buffer_t *buffer);
bool tiny_json_raw(tiny_json_buffer_t *buffer, const char *value);
bool tiny_json_raw_n(tiny_json_buffer_t *buffer, const char *value, size_t length);
bool tiny_json_string(tiny_json_buffer_t *buffer, const char *value);
bool tiny_json_u64(tiny_json_buffer_t *buffer, unsigned long long value);
bool tiny_json_i64(tiny_json_buffer_t *buffer, long long value);

#endif