Skip to content

Commit 456e389

Browse files
authored
docs: document the required C functions for the -sys crate (#114)
1 parent 1683991 commit 456e389

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

mbedtls-rs-sys/src/lib.rs

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,61 @@
1-
//! Raw bindings to the MbedTLS library
1+
//! Raw bindings to the MbedTLS library.
2+
//!
3+
//! # External dependencies
4+
//!
5+
//! MbedTLS depends on the following functions from the C standard library:
6+
//!
7+
//! - `calloc`
8+
//! - `free`
9+
//! - `memchr`
10+
//! - `memcmp`
11+
//! - `memcpy`
12+
//! - `memmove`
13+
//! - `memset`
14+
//! - `printf`
15+
//! - `putchar`
16+
//! - `puts`
17+
//! - `rand`
18+
//! - `snprintf`
19+
//! - `strchr`
20+
//! - `strcmp`
21+
//! - `strlen`
22+
//! - `strncmp`
23+
//! - `strncpy`
24+
//! - `strstr`
25+
//! - `vsnprintf`
26+
//!
27+
//! This crate does not provide implementations of these functions. It's up to
28+
//! the consumer to ensure that they are available at link time. On most
29+
//! platforms, these functions are provided by the host environment's libc
30+
//! implementation, so no additional work is needed.
31+
//! On embedded platforms, you may need to link a suitable libc implementation
32+
//! like [tinyrlibc](https://github.com/rust-embedded-community/tinyrlibc).
33+
//!
34+
//! Note that depending on what features of MbedTLS you use, you won't need
35+
//! all of these functions. The list represents the full set of functions that
36+
//! MbedTLS may call.
37+
//! The linker error messages will indicate which specific functions are
38+
//! missing, so you can focus on providing those first.
39+
//!
40+
//! Additionally, the following list of MbedTLS functions are left
41+
//! unimplemented in this crate:
42+
//!
43+
//! - `mbedtls_platform_zeroize`
44+
//! - `mbedtls_psa_external_get_random`
45+
//!
46+
//! These functions are provided by `mbedtls-rs`. If you're building C code
47+
//! that depends on MbedTLS, make sure to link against `mbedtls-rs` to get
48+
//! these implementations.
249
350
#![no_std]
451
#![allow(clippy::uninlined_format_args)]
52+
#![allow(
53+
rustdoc::bare_urls,
54+
rustdoc::broken_intra_doc_links,
55+
rustdoc::invalid_html_tags,
56+
rustdoc::invalid_rust_codeblocks,
57+
reason = "Documentation is generated from the C header files"
58+
)]
559
#![allow(unknown_lints)]
660

761
pub use bindings::*;

0 commit comments

Comments
 (0)