diff options
author | innokentii <innokentii@yandex-team.com> | 2023-04-13 16:46:20 +0300 |
---|---|---|
committer | innokentii <innokentii@yandex-team.com> | 2023-04-13 16:46:20 +0300 |
commit | 2295e2cd8d1e07682c977d3ef91311fec456ede9 (patch) | |
tree | 6992f864d4bc63b6ba03888fe30f3b382e6a7a3c | |
parent | 4c8a5190c0318e116f4b7defad368f296b2878e7 (diff) | |
download | ydb-2295e2cd8d1e07682c977d3ef91311fec456ede9.tar.gz |
Add libfyaml pr#78
add libfyaml pr#78
-rw-r--r-- | contrib/libs/libfyaml/include/libfyaml.h | 14 | ||||
-rw-r--r-- | contrib/libs/libfyaml/src/lib/fy-doc.c | 12 |
2 files changed, 26 insertions, 0 deletions
diff --git a/contrib/libs/libfyaml/include/libfyaml.h b/contrib/libs/libfyaml/include/libfyaml.h index bb19d89463..5561a7c2f4 100644 --- a/contrib/libs/libfyaml/include/libfyaml.h +++ b/contrib/libs/libfyaml/include/libfyaml.h @@ -2790,6 +2790,20 @@ fy_node_get_style(struct fy_node *fyn) FY_EXPORT; /** + * fy_node_set_style() - Set the node style + * + * Set the node rendering style. + * If current node style is alias it won't be changed + * to save document structure + * + * @fyn: The node + * @style: The node style + */ +void +fy_node_set_style(struct fy_node *fyn, enum fy_node_style style) + FY_EXPORT; + +/** * fy_node_is_scalar() - Check whether the node is a scalar * * Convenience method for checking whether a node is a scalar. diff --git a/contrib/libs/libfyaml/src/lib/fy-doc.c b/contrib/libs/libfyaml/src/lib/fy-doc.c index 2daec904ce..a53934a292 100644 --- a/contrib/libs/libfyaml/src/lib/fy-doc.c +++ b/contrib/libs/libfyaml/src/lib/fy-doc.c @@ -3352,6 +3352,18 @@ enum fy_node_style fy_node_get_style(struct fy_node *fyn) return fyn ? fyn->style : FYNS_PLAIN; } +void fy_node_set_style(struct fy_node *fyn, enum fy_node_style style) +{ + if (!fyn) + return; + + /* ignore alias nodes to save document structure */ + if (fyn->style == FYNS_ALIAS) + return; + + fyn->style = style; +} + bool fy_node_is_null(struct fy_node *fyn) { if (!fyn) |