mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 12:44:55 +00:00
lib: add more convenient boolean adder for json
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
929c5fb33a
commit
e91c9247eb
@ -64,6 +64,11 @@ void json_object_boolean_true_add(struct json_object *obj, const char *key)
|
|||||||
json_object_object_add(obj, key, json_object_new_boolean(1));
|
json_object_object_add(obj, key, json_object_new_boolean(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void json_object_boolean_add(struct json_object *obj, const char *key, bool val)
|
||||||
|
{
|
||||||
|
json_object_object_add(obj, key, json_object_new_boolean(val));
|
||||||
|
}
|
||||||
|
|
||||||
struct json_object *json_object_lock(struct json_object *obj)
|
struct json_object *json_object_lock(struct json_object *obj)
|
||||||
{
|
{
|
||||||
return json_object_get(obj);
|
return json_object_get(obj);
|
||||||
|
@ -61,6 +61,7 @@ extern void json_object_string_add(struct json_object *obj, const char *key,
|
|||||||
const char *s);
|
const char *s);
|
||||||
extern void json_object_int_add(struct json_object *obj, const char *key,
|
extern void json_object_int_add(struct json_object *obj, const char *key,
|
||||||
int64_t i);
|
int64_t i);
|
||||||
|
void json_object_boolean_add(struct json_object *obj, const char *key, bool val);
|
||||||
extern void json_object_boolean_false_add(struct json_object *obj,
|
extern void json_object_boolean_false_add(struct json_object *obj,
|
||||||
const char *key);
|
const char *key);
|
||||||
extern void json_object_boolean_true_add(struct json_object *obj,
|
extern void json_object_boolean_true_add(struct json_object *obj,
|
||||||
|
Loading…
Reference in New Issue
Block a user