You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

json_pointer_private.h 1.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2023 Eric Hawicz
  3. *
  4. * This library is free software; you can redistribute it and/or modify
  5. * it under the terms of the MIT license. See COPYING for details.
  6. */
  7. /**
  8. * @file
  9. * @brief Do not use, json-c internal, may be changed or removed at any time.
  10. */
  11. #ifndef _json_pointer_private_h_
  12. #define _json_pointer_private_h_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. struct json_pointer_get_result {
  17. struct json_object *parent;
  18. struct json_object *obj;
  19. // The key of the found object; only valid when parent is json_type_object
  20. // Caution: re-uses tail end of the `path` argument to json_pointer_get_internal
  21. const char *key_in_parent;
  22. // the index of the found object; only valid when parent is json_type_array
  23. uint32_t index_in_parent;
  24. };
  25. int json_pointer_get_internal(struct json_object *obj, const char *path,
  26. struct json_pointer_get_result *res);
  27. typedef int(*json_pointer_array_set_cb)(json_object *parent, size_t idx,
  28. json_object *value, void *priv);
  29. int json_pointer_set_with_array_cb(struct json_object **obj, const char *path,
  30. struct json_object *value,
  31. json_pointer_array_set_cb array_set_cb, void *priv);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif