VCOM Linux Driver
Advantech Inc.
Loading...
Searching...
No Matches
jstree.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include "jsmn.h"
#include "jstree.h"

Functions

int jstree_string_encode (char *out, int outlen, char *data)
 
int jstree_string_decode (char *out, int outlen, char *data)
 
_tree_node_alloc_tree_node_type (int type)
 
_tree_node_alloc_tree_node_data (int type, const char *data)
 
_tree_node_alloc_tree_node_len (int type, const char *data, int datalen)
 
int dumptree (_tree_node *tree, int indent)
 
int dump (const char *js, jsmntok_t *t, size_t count, int indent)
 
jstreeret js2tree (const char *js, jsmntok_t *t, size_t count)
 
_tree_nodefind_node (_tree_node *tree, char *key)
 
_tree_nodenext_node (_tree_node *node, int step)
 
int get_node_string (_tree_node *node, char *buf, int bufsize)
 
_tree_node ** end_node (_tree_node **node)
 
int tree2js (_tree_node *tree, char *out, int outlen, int indent)
 
int tree2json (_tree_node *tree, char *buf, int bufsize)
 
void freejstree (_tree_node *tree)
 

Function Documentation

◆ _alloc_tree_node_data()

_tree_node * _alloc_tree_node_data ( int type,
const char * data )

◆ _alloc_tree_node_len()

_tree_node * _alloc_tree_node_len ( int type,
const char * data,
int datalen )

◆ _alloc_tree_node_type()

_tree_node * _alloc_tree_node_type ( int type)

◆ dump()

int dump ( const char * js,
jsmntok_t * t,
size_t count,
int indent )

◆ dumptree()

int dumptree ( _tree_node * tree,
int indent )

◆ end_node()

_tree_node ** end_node ( _tree_node ** node)

◆ find_node()

_tree_node * find_node ( _tree_node * tree,
char * key )

◆ freejstree()

void freejstree ( _tree_node * tree)

◆ get_node_string()

int get_node_string ( _tree_node * node,
char * buf,
int bufsize )

◆ js2tree()

jstreeret js2tree ( const char * js,
jsmntok_t * t,
size_t count )

◆ jstree_string_decode()

int jstree_string_decode ( char * out,
int outlen,
char * data )

◆ jstree_string_encode()

int jstree_string_encode ( char * out,
int outlen,
char * data )

◆ next_node()

_tree_node * next_node ( _tree_node * node,
int step )

◆ tree2js()

int tree2js ( _tree_node * tree,
char * out,
int outlen,
int indent )

◆ tree2json()

int tree2json ( _tree_node * tree,
char * buf,
int bufsize )