mirror of
https://github.com/json-c/json-c.git
synced 2026-03-26 16:39:06 +08:00
Really use prefix JSON_C_OBJECT_ADD_*
This change introduces JSON_C_OBJECT_ADD_CONSTANT_KEY as a replacement of JSON_C_OBJECT_KEY_IS_CONSTANT. The description of json_object_object_add_ex tells to look at the flags JSON_C_OBJECT_ADD_* but it is not for JSON_C_OBJECT_KEY_IS_CONSTANT. From the point of vue of a developper using json-c, the function json_object_object_add_ex is mainly used, not the hash facility, it seems more natural to provide a regular naming of prefix JSON_C_OBJECT_ADD_CONSTANT_KEY.
This commit is contained in:
@@ -100,9 +100,17 @@ extern "C" {
|
||||
* key is given as a real constant value in the function
|
||||
* call, e.g. as in
|
||||
* json_object_object_add_ex(obj, "ip", json,
|
||||
* JSON_C_OBJECT_KEY_IS_CONSTANT);
|
||||
* JSON_C_OBJECT_ADD_CONSTANT_KEY);
|
||||
*/
|
||||
#define JSON_C_OBJECT_KEY_IS_CONSTANT (1 << 2)
|
||||
#define JSON_C_OBJECT_ADD_CONSTANT_KEY (1 << 2)
|
||||
/**
|
||||
* This flag is an alias to JSON_C_OBJECT_ADD_CONSTANT_KEY.
|
||||
* Historically, this flag was used first and the new name
|
||||
* JSON_C_OBJECT_ADD_CONSTANT_KEY was introduced for version
|
||||
* 0.16.00 in order to have regular naming.
|
||||
* Use of this flag is now legacy.
|
||||
*/
|
||||
#define JSON_C_OBJECT_KEY_IS_CONSTANT JSON_C_OBJECT_ADD_CONSTANT_KEY
|
||||
|
||||
/**
|
||||
* Set the global value of an option, which will apply to all
|
||||
|
||||
Reference in New Issue
Block a user