1 //-----------------------------------------------------------------------------
2 // Borrowed initially from
3 // https://github.com/rogerz/jansson/blob/json_path/src/path.c
4 // Copyright (c) 2012 Rogerz Zhang <rogerz.zhang@gmail.com>
5 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // See LICENSE.txt for the text of the license.
18 //-----------------------------------------------------------------------------
20 #ifndef JANSSON_PATH_H
21 #define JANSSON_PATH_H
24 #include <stdlib.h> /* for size_t */
31 json_t
*json_path_get(const json_t
*json
, const char *path
);
32 int json_path_set_new(json_t
*json
, const char *path
, json_t
*value
, size_t flags
, json_error_t
*error
);
35 int json_path_set(json_t
*json
, const char *path
, json_t
*value
, size_t flags
, json_error_t
*error
) {
36 return json_path_set_new(json
, path
, json_incref(value
), flags
, error
);