diff --git a/src/xrt/auxiliary/util/u_json.c b/src/xrt/auxiliary/util/u_json.c index 25bde6d36..a052b83fc 100644 --- a/src/xrt/auxiliary/util/u_json.c +++ b/src/xrt/auxiliary/util/u_json.c @@ -27,6 +27,12 @@ get(const cJSON *json, const char *f) return cJSON_GetObjectItemCaseSensitive(json, f); } +const cJSON * +u_json_get(const cJSON *json, const char *f) +{ + return get(json, f); +} + bool u_json_get_string_into_array(const cJSON *json, char *out_str, size_t max_size) { diff --git a/src/xrt/auxiliary/util/u_json.h b/src/xrt/auxiliary/util/u_json.h index 939585ac3..94c2a1740 100644 --- a/src/xrt/auxiliary/util/u_json.h +++ b/src/xrt/auxiliary/util/u_json.h @@ -20,6 +20,13 @@ extern "C" { #endif // __cplusplus +/*! + * @brief Get a JSON object by string from a JSON object. + * + * @return The JSON object with the given name if successful, NULL if not. + */ +const cJSON * +u_json_get(const cJSON *json, const char *f); /*! * @brief Parse a string from a JSON object into a char array.