diff options
author | Daniil Cherednik <[email protected]> | 2023-05-05 11:09:01 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2023-05-05 11:09:01 +0300 |
commit | b5a989b16cafa8a3b3bc076f1097a0eda6f48c06 (patch) | |
tree | 4da744117a5aab37758921fa43b95a3068e5aec1 /contrib/libs/libfyaml/src/lib/fy-composer.h | |
parent | fc1cffcfa7f0497a1f97b384a24bcbf23362f3be (diff) |
Ydb stable 23-1-2623.1.26
x-stable-origin-commit: 22184a7e157553d447f17a2dffc4ea2d32dfd74d
Diffstat (limited to 'contrib/libs/libfyaml/src/lib/fy-composer.h')
-rw-r--r-- | contrib/libs/libfyaml/src/lib/fy-composer.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/libs/libfyaml/src/lib/fy-composer.h b/contrib/libs/libfyaml/src/lib/fy-composer.h new file mode 100644 index 00000000000..d690f22622f --- /dev/null +++ b/contrib/libs/libfyaml/src/lib/fy-composer.h @@ -0,0 +1,57 @@ +/* + * fy-composer.h - YAML composer + * + * Copyright (c) 2021 Pantelis Antoniou <[email protected]> + * + * SPDX-License-Identifier: MIT + */ +#ifndef FY_COMPOSER_H +#define FY_COMPOSER_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdbool.h> + +#include <libfyaml.h> + +#include "fy-list.h" +#include "fy-typelist.h" + +#include "fy-emit-accum.h" +#include "fy-path.h" + +struct fy_composer; +struct fy_token; +struct fy_diag; +struct fy_event; +struct fy_eventp; +struct fy_document_builder; + +struct fy_composer_ops { + /* single process event callback */ + enum fy_composer_return (*process_event)(struct fy_composer *fyc, struct fy_path *path, struct fy_event *fye); + struct fy_document_builder *(*create_document_builder)(struct fy_composer *fyc); +}; + +struct fy_composer_cfg { + const struct fy_composer_ops *ops; + void *userdata; + struct fy_diag *diag; +}; + +struct fy_composer { + struct fy_composer_cfg cfg; + struct fy_path_list paths; +}; + +struct fy_composer *fy_composer_create(struct fy_composer_cfg *cfg); +void fy_composer_destroy(struct fy_composer *fyc); +int fy_composer_process_event(struct fy_composer *fyc, struct fy_event *fye); + +struct fy_composer_cfg *fy_composer_get_cfg(struct fy_composer *fyc); +void *fy_composer_get_cfg_userdata(struct fy_composer *fyc); +struct fy_diag *fy_composer_get_diag(struct fy_composer *fyc); + +#endif |