forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyajl_gen.h
61 lines (49 loc) · 1.19 KB
/
yajl_gen.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @file
*
* @brief
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifndef YAJL_GEN_H
#define YAJL_GEN_H
#include "yajl.h"
#include <stdio.h>
#include <string.h>
#include <kdberrors.h>
#include <kdbmacros.h>
#include <yajl/yajl_gen.h>
#include "iterator.h"
#include "name.h"
typedef enum
{
/**
* We are at end of string, so no lookahead.
*/
LOOKAHEAD_END = 0,
/**
* We are iterating in the middle of an array (or at least
* certainly not starting it)
*/
LOOKAHEAD_ARRAY = 1,
/**
* We found a special marker for empty arrays.
* @todo not implemented yet
*/
LOOKAHEAD_EMPTY_ARRAY = 3,
/**
* We found a special marker for empty maps.
* @todo not implemented yet
*/
LOOKAHEAD_EMPTY_MAP = 4,
/**
* We are iterating a map or starting it.
*/
LOOKAHEAD_MAP = 5
} lookahead_t;
lookahead_t elektraLookahead (const char * pnext, size_t size);
void elektraGenOpenInitial (yajl_gen g, Key * parentKey, const Key * first);
void elektraGenOpen (yajl_gen g, const Key * cur, const Key * next);
void elektraGenClose (yajl_gen g, const Key * cur, const Key * next);
void elektraGenCloseFinally (yajl_gen g, const Key * cur, const Key * next);
#endif