X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fjson.h;h=ef2312449b55c49a4ff4b42221f352c10c38a5f7;hb=be556da0566016729da90bae39868752438fed7b;hp=6aa9c49f1e3c7f903757ab8d178b521d8e91c9f2;hpb=7d23a63aa4bc4479bf85b739e5be80ab12c5fc1b;p=cascardo%2Fovs.git diff --git a/lib/json.h b/lib/json.h index 6aa9c49f1..ef2312449 100644 --- a/lib/json.h +++ b/lib/json.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nicira Networks. + * Copyright (c) 2009, 2010, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,12 @@ #include "shash.h" +#ifdef __cplusplus +extern "C" { +#endif + +struct ds; + /* Type of a JSON value. */ enum json_type { JSON_NULL, /* null */ @@ -120,9 +126,16 @@ enum { JSSF_SORT = 1 << 1 /* Object members in sorted order, if true. */ }; char *json_to_string(const struct json *, int flags); +void json_to_ds(const struct json *, int flags, struct ds *); + +size_t json_serialized_length(const struct json *); /* JSON string formatting operations. */ bool json_string_unescape(const char *in, size_t in_len, char **outp); +#ifdef __cplusplus +} +#endif + #endif /* json.h */