lib: constify yang_resolve_snode_xpath results

Signed-off-by: Christian Hopps <chopps@labn.net>

ang
This commit is contained in:
Christian Hopps 2024-07-27 01:07:57 -04:00
parent aab2946088
commit 0913d9fc0e
4 changed files with 5 additions and 6 deletions

View file

@ -178,7 +178,7 @@ struct nb_node *nb_node_find(const char *path)
struct nb_node **nb_nodes_find(const char *xpath)
{
struct lysc_node **snodes = NULL;
const struct lysc_node **snodes = NULL;
struct nb_node **nb_nodes = NULL;
bool simple;
LY_ERR err;

View file

@ -286,7 +286,7 @@ void yang_snode_get_path(const struct lysc_node *snode,
}
LY_ERR yang_resolve_snode_xpath(struct ly_ctx *ly_ctx, const char *xpath,
struct lysc_node ***snodes, bool *simple)
const struct lysc_node ***snodes, bool *simple)
{
struct lysc_node *snode;
struct ly_set *set;

View file

@ -827,7 +827,8 @@ extern int yang_xpath_pop_node(char *xpath);
* Return: a libyang error or LY_SUCCESS.
*/
extern LY_ERR yang_resolve_snode_xpath(struct ly_ctx *ly_ctx, const char *xpath,
struct lysc_node ***snodes, bool *simple);
const struct lysc_node ***snodes,
bool *simple);
/*
* Libyang future functions

View file

@ -1282,8 +1282,7 @@ static void fe_adapter_handle_get_data(struct mgmt_fe_session_ctx *session,
void *__msg, size_t msg_len)
{
struct mgmt_msg_get_data *msg = __msg;
struct lysc_node **snodes = NULL;
char *xpath_resolved = NULL;
const struct lysc_node **snodes = NULL;
uint64_t req_id = msg->req_id;
Mgmtd__DatastoreId ds_id;
uint64_t clients;
@ -1395,7 +1394,6 @@ static void fe_adapter_handle_get_data(struct mgmt_fe_session_ctx *session,
}
done:
darr_free(snodes);
darr_free(xpath_resolved);
}
static void fe_adapter_handle_edit(struct mgmt_fe_session_ctx *session,