File: zjson.h

package info (click to toggle)
libzia 4.36-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,320 kB
  • sloc: ansic: 24,172; sh: 4,408; makefile: 211
file content (45 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (2)
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
/*
    JSON library
    Copyright (C) 2014 Ladislav Vaiz <ok1zia@nagano.cz>

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    version 2 as published by the Free Software Foundation.

*/

#ifndef __ZJSON_H
#define __ZJSON_H

#include <libziaint.h>
#include <glib.h>

#include <stdint.h>


void zjson_test(void);

// parse
char *zjson_get_str(const char *str, int len, const char *path);
int zjson_get_int(const char *str, int len, const char *path);


// create

void zjson_object_start(GString *gs, char *name);
void zjson_object_end(GString *gs);

void zjson_array_start(GString *gs, char *name);
void zjson_array_end(GString *gs);

void zjson_item_int(GString *gs, char *name, int value);
void zjson_item_int64(GString *gs, char *name, int64_t value);
void zjson_item_double(GString *gs, char *name, double value, int places);
void zjson_item_string(GString *gs, char *name, const char *value);
void zjson_item_bool(GString *gs, char *name, int value);
void zjson_item_null(GString *gs, char *name);
void zjson_strip(GString *gs);



#endif