1 // Copyright 2022 The BoringSSL Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "rust_wrapper.h"
16
17
ERR_GET_LIB_RUST(uint32_t packed_error)18 int ERR_GET_LIB_RUST(uint32_t packed_error) {
19 return ERR_GET_LIB(packed_error);
20 }
21
ERR_GET_REASON_RUST(uint32_t packed_error)22 int ERR_GET_REASON_RUST(uint32_t packed_error) {
23 return ERR_GET_REASON(packed_error);
24 }
25
ERR_GET_FUNC_RUST(uint32_t packed_error)26 int ERR_GET_FUNC_RUST(uint32_t packed_error) {
27 return ERR_GET_FUNC(packed_error);
28 }
29
CBS_init_RUST(CBS * cbs,const uint8_t * data,size_t len)30 void CBS_init_RUST(CBS *cbs, const uint8_t *data, size_t len) {
31 CBS_init(cbs, data, len);
32 }
33
CBS_len_RUST(const CBS * cbs)34 size_t CBS_len_RUST(const CBS *cbs) {
35 return CBS_len(cbs);
36 }
37