mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 16:25:17 +00:00
json: New function json_nullable_clone().
Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
This commit is contained in:
@@ -102,6 +102,7 @@ int64_t json_integer(const struct json *);
|
|||||||
|
|
||||||
struct json *json_deep_clone(const struct json *);
|
struct json *json_deep_clone(const struct json *);
|
||||||
struct json *json_clone(const struct json *);
|
struct json *json_clone(const struct json *);
|
||||||
|
struct json *json_nullable_clone(const struct json *);
|
||||||
void json_destroy(struct json *);
|
void json_destroy(struct json *);
|
||||||
|
|
||||||
size_t json_hash(const struct json *, size_t basis);
|
size_t json_hash(const struct json *, size_t basis);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009, 2010, 2011, 2012, 2014, 2015 Nicira, Inc.
|
* Copyright (c) 2009-2012, 2014-2017 Nicira, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -430,6 +430,12 @@ json_clone(const struct json *json_)
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct json *
|
||||||
|
json_nullable_clone(const struct json *json)
|
||||||
|
{
|
||||||
|
return json ? json_clone(json) : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static struct json *
|
static struct json *
|
||||||
json_clone_object(const struct shash *object)
|
json_clone_object(const struct shash *object)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user