-
Notifications
You must be signed in to change notification settings - Fork 0
/
ivjson.c
76 lines (61 loc) · 1.31 KB
/
ivjson.c
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "ivjson.h"
#include <assert.h>
#include <stddef.h>
ivjson_array_t
ivjson_add_array(struct ivjson_spec *spec, const char *path, int minv,
int maxv)
{
assert(maxv == -1 || minv <= maxv);
assert(minv >= 0);
return (ivjson_array_t) { .handle = 0 };
}
ivjson_number_t
ivjson_add_number_to_array(struct ivjson_spec *spec, ivjson_array_t arr,
const char *path, int minv, int maxv)
{
assert(arr.handle != 0);
assert(maxv == -1 || minv <= maxv);
assert(minv >= 0);
return (ivjson_number_t) { .handle = 0 };
}
ivjson_string_t
ivjson_add_string_to_array(struct ivjson_spec *spec, ivjson_array_t arr,
const char *path, int minv, int maxv)
{
assert(arr.handle != 0);
assert(maxv == -1 || minv <= maxv);
assert(minv >= 0);
return (ivjson_string_t) { .handle = 0 };
}
int
ivjson_parse(char *json, struct ivjson_spec *spec)
{
assert(json != NULL);
assert(spec != NULL);
return 1;
}
const char*
ivjson_error(int code)
{
return "Unknown error";
}
int
ivjson_array(ivjson_array_t handle)
{
assert(handle.handle != 0);
return 0;
}
int
ivjson_number_from_array(ivjson_array_t arr, int i, ivjson_number_t handle)
{
assert(arr.handle != 0);
assert(i != 0);
return 0;
}
const char*
ivjson_string_from_array(ivjson_array_t arr, int i, ivjson_string_t handle)
{
assert(arr.handle != 0);
assert(i != 0);
return "";
}