summaryrefslogtreecommitdiffstats
path: root/contrib/libs/libfyaml/src/lib/fy-dump.h
diff options
context:
space:
mode:
authorDaniil Cherednik <[email protected]>2023-05-05 11:09:01 +0300
committerDaniil Cherednik <[email protected]>2023-05-05 11:09:01 +0300
commitb5a989b16cafa8a3b3bc076f1097a0eda6f48c06 (patch)
tree4da744117a5aab37758921fa43b95a3068e5aec1 /contrib/libs/libfyaml/src/lib/fy-dump.h
parentfc1cffcfa7f0497a1f97b384a24bcbf23362f3be (diff)
Ydb stable 23-1-2623.1.26
x-stable-origin-commit: 22184a7e157553d447f17a2dffc4ea2d32dfd74d
Diffstat (limited to 'contrib/libs/libfyaml/src/lib/fy-dump.h')
-rw-r--r--contrib/libs/libfyaml/src/lib/fy-dump.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/contrib/libs/libfyaml/src/lib/fy-dump.h b/contrib/libs/libfyaml/src/lib/fy-dump.h
new file mode 100644
index 00000000000..13b1c9a8236
--- /dev/null
+++ b/contrib/libs/libfyaml/src/lib/fy-dump.h
@@ -0,0 +1,92 @@
+/*
+ * fy-dump.h - dumps for various internal structures
+ *
+ * Copyright (c) 2019 Pantelis Antoniou <[email protected]>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+#ifndef FY_DUMP_H
+#define FY_DUMP_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-list.h"
+#include "fy-diag.h"
+
+struct fy_parser;
+struct fy_token;
+struct fy_token_list;
+struct fy_simple_key;
+struct fy_simple_key_list;
+struct fy_input_cfg;
+
+extern const char *fy_token_type_txt[];
+
+char *fy_token_dump_format(struct fy_token *fyt, char *buf, size_t bufsz);
+char *fy_token_list_dump_format(struct fy_token_list *fytl,
+ struct fy_token *fyt_highlight, char *buf, size_t bufsz);
+
+char *fy_simple_key_dump_format(struct fy_parser *fyp, struct fy_simple_key *fysk, char *buf, size_t bufsz);
+char *fy_simple_key_list_dump_format(struct fy_parser *fyp, struct fy_simple_key_list *fyskl,
+ struct fy_simple_key *fysk_highlight, char *buf, size_t bufsz);
+
+#ifdef FY_DEVMODE
+
+void fyp_debug_dump_token_list(struct fy_parser *fyp, struct fy_token_list *fytl,
+ struct fy_token *fyt_highlight, const char *banner);
+void fyp_debug_dump_token(struct fy_parser *fyp, struct fy_token *fyt, const char *banner);
+
+void fyp_debug_dump_simple_key_list(struct fy_parser *fyp, struct fy_simple_key_list *fyskl,
+ struct fy_simple_key *fysk_highlight, const char *banner);
+void fyp_debug_dump_simple_key(struct fy_parser *fyp, struct fy_simple_key *fysk, const char *banner);
+
+void fyp_debug_dump_input(struct fy_parser *fyp, const struct fy_input_cfg *fyic,
+ const char *banner);
+
+#else
+
+static inline void
+fyp_debug_dump_token_list(struct fy_parser *fyp, struct fy_token_list *fytl,
+ struct fy_token *fyt_highlight, const char *banner)
+{
+ /* nothing */
+}
+
+static inline void
+fyp_debug_dump_token(struct fy_parser *fyp, struct fy_token *fyt, const char *banner)
+{
+ /* nothing */
+}
+
+static inline void
+fyp_debug_dump_simple_key_list(struct fy_parser *fyp, struct fy_simple_key_list *fyskl,
+ struct fy_simple_key *fysk_highlight, const char *banner)
+{
+ /* nothing */
+}
+
+static inline void
+fyp_debug_dump_simple_key(struct fy_parser *fyp, struct fy_simple_key *fysk, const char *banner)
+{
+ /* nothing */
+}
+
+static inline void
+fy_debug_dump_input(struct fy_parser *fyp, const struct fy_input_cfg *fyic,
+ const char *banner)
+{
+ /* nothing */
+}
+
+#endif
+
+#endif