Debian Codegraph @

crt/aws-c-s3/source/s3_endpoint_resolver/s3_endpoint_resolver.c

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 #include "aws/s3/private/s3_endpoint_resolver.h"
7 #include <aws/s3/s3_endpoint_resolver.h>
8 #include <aws/sdkutils/endpoints_rule_engine.h>
9 #include <aws/sdkutils/partitions.h>
10
11 struct aws_endpoints_rule_engine *aws_s3_endpoint_resolver_new(struct aws_allocator *allocator) {
12 struct aws_endpoints_ruleset *ruleset = NULL;
13 struct aws_partitions_config *partitions = NULL;
14 struct aws_endpoints_rule_engine *rule_engine = NULL;
15
16 ruleset = aws_endpoints_ruleset_new_from_string(allocator, aws_s3_endpoint_rule_set);
17 if (!ruleset) {
18 goto cleanup;
19 }
20
21 partitions = aws_partitions_config_new_from_string(allocator, aws_s3_endpoint_resolver_partitions);
22 if (!partitions) {
23 goto cleanup;
24 }
25
26 rule_engine = aws_endpoints_rule_engine_new(allocator, ruleset, partitions);
27
28 cleanup:
29 aws_endpoints_ruleset_release(ruleset);
30 aws_partitions_config_release(partitions);
31 return rule_engine;
32 }