Skip to content

Commit

Permalink
context: add leafref_linking options
Browse files Browse the repository at this point in the history
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 <steweg@gmail.com>
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
  • Loading branch information
steweg authored and samuel-gauthier committed Aug 2, 2024
1 parent f437bfb commit 47b0f09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cffi/cdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct ly_ctx;
#define LY_CTX_REF_IMPLEMENTED ...
#define LY_CTX_SET_PRIV_PARSED ...
#define LY_CTX_LEAFREF_EXTENDED ...
#define LY_CTX_LEAFREF_LINKING ...


typedef enum {
Expand Down
3 changes: 3 additions & 0 deletions libyang/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(
disable_searchdir_cwd: bool = True,
explicit_compile: Optional[bool] = False,
leafref_extended: bool = False,
leafref_linking: bool = False,
yanglib_path: Optional[str] = None,
yanglib_fmt: str = "json",
cdata=None, # C type: "struct ly_ctx *"
Expand All @@ -47,6 +48,8 @@ def __init__(
options |= lib.LY_CTX_EXPLICIT_COMPILE
if leafref_extended:
options |= lib.LY_CTX_LEAFREF_EXTENDED
if leafref_linking:
options |= lib.LY_CTX_LEAFREF_LINKING
# force priv parsed
options |= lib.LY_CTX_SET_PRIV_PARSED

Expand Down

0 comments on commit 47b0f09

Please sign in to comment.