Skip to content

Commit 47b0f09

Browse files
stewegsamuel-gauthier
authored andcommitted
context: add leafref_linking options
This patch adds leafref_linking context option, which allows the usage of lyd_leafref_get_links and lyd_leafref_link_node_tree functions, whose support will be added in the next commit. Closes: #108 Signed-off-by: Stefan Gula <[email protected]> Signed-off-by: Samuel Gauthier <[email protected]>
1 parent f437bfb commit 47b0f09

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cffi/cdefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct ly_ctx;
1515
#define LY_CTX_REF_IMPLEMENTED ...
1616
#define LY_CTX_SET_PRIV_PARSED ...
1717
#define LY_CTX_LEAFREF_EXTENDED ...
18+
#define LY_CTX_LEAFREF_LINKING ...
1819

1920

2021
typedef enum {

libyang/context.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def __init__(
3030
disable_searchdir_cwd: bool = True,
3131
explicit_compile: Optional[bool] = False,
3232
leafref_extended: bool = False,
33+
leafref_linking: bool = False,
3334
yanglib_path: Optional[str] = None,
3435
yanglib_fmt: str = "json",
3536
cdata=None, # C type: "struct ly_ctx *"
@@ -47,6 +48,8 @@ def __init__(
4748
options |= lib.LY_CTX_EXPLICIT_COMPILE
4849
if leafref_extended:
4950
options |= lib.LY_CTX_LEAFREF_EXTENDED
51+
if leafref_linking:
52+
options |= lib.LY_CTX_LEAFREF_LINKING
5053
# force priv parsed
5154
options |= lib.LY_CTX_SET_PRIV_PARSED
5255

0 commit comments

Comments
 (0)