aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libfyaml/src/lib/fy-docstate.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2023-05-05 11:09:01 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2023-05-05 11:09:01 +0300
commitb5a989b16cafa8a3b3bc076f1097a0eda6f48c06 (patch)
tree4da744117a5aab37758921fa43b95a3068e5aec1 /contrib/libs/libfyaml/src/lib/fy-docstate.h
parentfc1cffcfa7f0497a1f97b384a24bcbf23362f3be (diff)
downloadydb-b5a989b16cafa8a3b3bc076f1097a0eda6f48c06.tar.gz
Ydb stable 23-1-2623.1.26
x-stable-origin-commit: 22184a7e157553d447f17a2dffc4ea2d32dfd74d
Diffstat (limited to 'contrib/libs/libfyaml/src/lib/fy-docstate.h')
-rw-r--r--contrib/libs/libfyaml/src/lib/fy-docstate.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/contrib/libs/libfyaml/src/lib/fy-docstate.h b/contrib/libs/libfyaml/src/lib/fy-docstate.h
new file mode 100644
index 0000000000..380c5f0d8c
--- /dev/null
+++ b/contrib/libs/libfyaml/src/lib/fy-docstate.h
@@ -0,0 +1,63 @@
+/*
+ * fy-docstate.h - YAML document state header.
+ *
+ * Copyright (c) 2019 Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+#ifndef FY_DOCSTATE_H
+#define FY_DOCSTATE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <libfyaml.h>
+
+#include "fy-ctype.h"
+#include "fy-list.h"
+#include "fy-typelist.h"
+#include "fy-token.h"
+
+struct fy_document;
+
+struct fy_document_state {
+ int refs;
+ struct fy_version version;
+ bool version_explicit : 1;
+ bool tags_explicit : 1;
+ bool start_implicit : 1;
+ bool end_implicit : 1;
+ bool json_mode : 1;
+ struct fy_mark start_mark;
+ struct fy_mark end_mark;
+ struct fy_token *fyt_vd; /* version directive */
+ struct fy_token_list fyt_td; /* tag directives */
+};
+
+struct fy_document_state *fy_document_state_alloc(void);
+void fy_document_state_free(struct fy_document_state *fyds);
+struct fy_document_state *fy_document_state_ref(struct fy_document_state *fyds);
+void fy_document_state_unref(struct fy_document_state *fyds);
+
+int fy_document_state_append_tag(struct fy_document_state *fyds,
+ const char *handle, const char *prefix,
+ bool is_default);
+
+struct fy_document_state *fy_document_state_default(
+ const struct fy_version *default_version,
+ const struct fy_tag * const *default_tags);
+
+struct fy_document_state *fy_document_state_copy(struct fy_document_state *fyds);
+int fy_document_state_merge(struct fy_document_state *fyds,
+ struct fy_document_state *fydsc);
+
+struct fy_token *fy_document_state_lookup_tag_directive(struct fy_document_state *fyds,
+ const char *handle, size_t handle_size);
+
+#endif