Debian Codegraph @

crt/aws-c-sdkutils/include/aws/sdkutils/endpoints_bdd_engine.h

raw symbols SCIP
1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #ifndef AWS_SDKUTILS_ENDPOINTS_BDD_ENGINE_H
7 #define AWS_SDKUTILS_ENDPOINTS_BDD_ENGINE_H
8
9 #include <aws/common/byte_buf.h>
10 #include <aws/sdkutils/sdkutils.h>
11
12 AWS_PUSH_SANE_WARNING_LEVEL
13
14 struct aws_endpoints_bdd_engine;
15 struct aws_partitions_config;
16 struct aws_endpoints_request_context;
17 struct aws_endpoints_resolved_endpoint;
18
19 AWS_EXTERN_C_BEGIN
20
21 /**
22 * Create a BDD engine from bytecode.
23 *
24 * @param allocator Memory allocator
25 * @param bytecode Bytecode buffer
26 * @param partitions_config Partition configuration (acquired by engine)
27 * @return New BDD engine or NULL on error
28 */
29 AWS_SDKUTILS_API struct aws_endpoints_bdd_engine *aws_endpoints_bdd_engine_new_from_bytecode(
30 struct aws_allocator *allocator,
31 struct aws_byte_cursor bytecode,
32 struct aws_partitions_config *partitions_config);
33
34 /**
35 * Acquire a reference to the BDD engine.
36 *
37 * @param engine BDD engine
38 * @return The same engine pointer
39 */
40 AWS_SDKUTILS_API struct aws_endpoints_bdd_engine *aws_endpoints_bdd_engine_acquire(
41 struct aws_endpoints_bdd_engine *engine);
42
43 /**
44 * Release a reference to the BDD engine. Destroys the engine when ref count reaches zero.
45 *
46 * @param engine BDD engine
47 * @return NULL
48 */
49 AWS_SDKUTILS_API struct aws_endpoints_bdd_engine *aws_endpoints_bdd_engine_release(
50 struct aws_endpoints_bdd_engine *engine);
51
52 /**
53 * Resolve an endpoint using the BDD engine.
54 *
55 * @param engine BDD engine
56 * @param context Request context with parameter values
57 * @param out_resolved_endpoint Output resolved endpoint or error
58 * @return AWS_OP_SUCCESS on success, AWS_OP_ERR on failure
59 */
60 AWS_SDKUTILS_API int aws_endpoints_bdd_engine_resolve(
61 struct aws_endpoints_bdd_engine *engine,
62 const struct aws_endpoints_request_context *context,
63 struct aws_endpoints_resolved_endpoint **out_resolved_endpoint);
64
65 AWS_EXTERN_C_END
66 AWS_POP_SANE_WARNING_LEVEL
67
68 #endif /* AWS_SDKUTILS_ENDPOINTS_BDD_ENGINE_H */