Create a json_pointer_private.h and move a few things there, fix test warnings, note array_list_insert_idx is private.

This commit is contained in:
Eric Hawicz
2023-07-16 10:48:20 -04:00
parent 3b8363fcdc
commit efc530594b
8 changed files with 56 additions and 26 deletions

42
json_pointer_private.h Normal file
View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2023 Eric Hawicz
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*/
/**
* @file
* @brief Do not use, json-c internal, may be changed or removed at any time.
*/
#ifndef _json_pointer_private_h_
#define _json_pointer_private_h_
#ifdef __cplusplus
extern "C" {
#endif
struct json_pointer_get_result {
struct json_object *parent;
struct json_object *obj;
union {
const char *key;
uint32_t index;
} id;
};
int json_pointer_get_internal(struct json_object *obj, const char *path,
struct json_pointer_get_result *res);
typedef int(*json_pointer_array_set_cb)(json_object *parent, size_t idx,
json_object *value, void *priv);
int json_pointer_set_with_array_cb(struct json_object **obj, const char *path,
struct json_object *value,
json_pointer_array_set_cb array_set_cb, void *priv);
#ifdef __cplusplus
}
#endif
#endif