diff options
| author | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-02-07 14:29:54 -0800 | 
|---|---|---|
| committer | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-02-07 14:29:54 -0800 | 
| commit | 6333c54822e964afe723f1e923064079fb330075 (patch) | |
| tree | 5c5125b99e162f7b9ff0d64b306e1aa183fb971f /lib/vty.c | |
| parent | 5bec85d971a4ab4252c680d5002c64fa8e78c7d9 (diff) | |
lib: Helper function to print empty JSON
Introduced a helper function to print empty JSON object.
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 7 | 
1 files changed, 7 insertions, 0 deletions
@@ -312,6 +312,13 @@ int vty_json_no_pretty(struct vty *vty, struct json_object *json)  	return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE);  } +void vty_json_empty(struct vty *vty) +{ +	json_object *json = json_object_new_object(); + +	vty_json(vty, json); +} +  /* Output current time to the vty. */  void vty_time_print(struct vty *vty, int cr)  {  | 
