Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sudo-project
GitHub Repository: sudo-project/sudo
Path: blob/main/lib/eventlog/parse_json.h
1532 views
1
/*
2
* SPDX-License-Identifier: ISC
3
*
4
* Copyright (c) 2020, 2023 Todd C. Miller <[email protected]>
5
*
6
* Permission to use, copy, modify, and distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
9
*
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
19
#ifndef PARSE_JSON_H
20
#define PARSE_JSON_H
21
22
#include <sudo_json.h>
23
#include <sudo_queue.h>
24
25
TAILQ_HEAD(json_item_list, json_item);
26
27
struct eventlog_json_object {
28
struct json_item *parent;
29
struct json_item_list items;
30
};
31
32
struct json_item {
33
TAILQ_ENTRY(json_item) entries;
34
char *name; /* may be NULL for first brace */
35
unsigned int lineno;
36
enum json_value_type type;
37
union {
38
struct eventlog_json_object child;
39
char *string;
40
long long number;
41
id_t id;
42
bool boolean;
43
} u;
44
};
45
46
#endif /* PARSE_JSON_H */
47
48