Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/rust-lang/libc
/ functions
Functions
806 in github.com/rust-lang/libc
⨍
Functions
806
◇
Types & classes
129
↓ 258 callers
Method
ident
Return the identifier of the union as a string.
ctest/src/ast/union.rs:16
↓ 36 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/tests/input/simple.out.with-renames.rs:29
↓ 35 callers
Method
flag
Add a flag to the C compiler invocation. # Examples ```no_run use std::env; use std::path::PathBuf; use ctest::TestGenerator; let mut cfg = TestGe
ctest/src/generator.rs:668
↓ 33 callers
Function
assert_decl
(ty: &CTy, expected: &str)
ctest/src/cdecl.rs:264
↓ 30 callers
Function
generate_test
( generator: &mut TestGenerator, crate_path: impl AsRef<Path>, output_file_path: impl AsRef<Path>,
ctest/src/runner.rs:26
↓ 26 callers
Method
skip_const
Configures whether the tests for a constant's value are generated. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(
ctest/src/generator.rs:574
↓ 24 callers
Method
define
Set a `-D` flag for the C compiler being called. This can be used to define various global variables to configure how header files are included or wh
ctest/src/generator.rs:687
↓ 23 callers
Function
ctest_cfg
()
libc-test/build.rs:84
↓ 23 callers
Method
skip_alias
Configures whether all tests for a typedef are skipped or not. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(); c
ctest/src/generator.rs:551
↓ 23 callers
Method
skip_fn
Configures whether tests for a function definition are generated. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new()
ctest/src/generator.rs:620
↓ 22 callers
Function
eprint
(*args, **kw)
ci/verify-build.py:219
↓ 22 callers
Function
ptr
Create a pointer to a type, specifying constness of the pointer.
ctest/src/cdecl.rs:204
↓ 22 callers
Method
rename_struct_ty
Configures how a Rust struct type is translated to a C struct type. # Examples This method can be used to remove the `struct` keyword from types in
ctest/src/generator.rs:942
↓ 22 callers
Method
skip_struct
Configures whether the tests for a struct are emitted. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(); cfg.skip_
ctest/src/generator.rs:456
↓ 17 callers
Function
mut_int
()
ctest/src/cdecl.rs:281
↓ 17 callers
Function
named
Create a named type with a certain constness.
ctest/src/cdecl.rs:183
↓ 17 callers
Function
set_cfg
(cfg: &str)
build.rs:330
↓ 16 callers
Function
array
Create an array of some type and optional length.
ctest/src/cdecl.rs:224
↓ 16 callers
Function
assert_r2cdecl
(rust: &str, expected: &str)
ctest/src/tests.rs:60
↓ 16 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/tests/input/macro.out.edition-2024.rs:29
↓ 16 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/tests/input/macro.out.rs:29
↓ 16 callers
Method
check_string
(&mut self, contents: String)
libc-test/tests/style_lib/mod.rs:144
↓ 16 callers
Method
header
Add a header to be included as part of the generated C file. The generated C test will be compiled by a C compiler, and this can be used to ensure th
ctest/src/generator.rs:128
↓ 16 callers
Function
run
( args: Sequence[str | Path], *, env: Optional[dict[str, str]] = None, check: bool = True, )
ci/verify-build.py:241
↓ 16 callers
Method
skip_struct_field
Configures whether all tests for a struct field are skipped or not. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new
ctest/src/generator.rs:502
↓ 14 callers
Function
_IO
(g: c_ulong, n: c_ulong)
src/unix/bsd/netbsdlike/mod.rs:420
↓ 14 callers
Function
issecure_mask
(x: c_int)
src/unix/linux_like/linux/mod.rs:3080
↓ 13 callers
Method
rename_struct_field
Configures how a Rust struct field is translated to a C struct field. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::n
ctest/src/generator.rs:821
↓ 13 callers
Method
skip_union
Configures whether the tests for a union are emitted. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(); cfg.skip_u
ctest/src/generator.rs:479
↓ 12 callers
Method
c_type
Returns the equivalent C/Cpp type of the Rust item.
ctest/src/template.rs:692
↓ 12 callers
Method
cfg
Set a `--cfg` option with which to expand the Rust FFI crate. By default the Rust code is run through expansion to determine what C APIs are exposed
ctest/src/generator.rs:220
↓ 12 callers
Method
translate_type
Translate a Rust type into its equivalent C type.
ctest/src/translator.rs:110
↓ 11 callers
Method
include
Add a path to the C compiler header lookup path. This is useful for if the C library is installed to a nonstandard location to ensure that compiling
ctest/src/generator.rs:242
↓ 11 callers
Method
rename_type
Configures how a Rust type is translated to a C type. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(); cfg.rename
ctest/src/generator.rs:915
↓ 10 callers
Function
compare
(major: c_uint, minor: c_uint)
libc-test/tests/makedev.rs:64
↓ 10 callers
Function
eprint
(*args, **kw)
ci/style.py:177
↓ 10 callers
Method
parse
(input: ParseStream)
libc-test/tests/style_lib/mod.rs:434
↓ 9 callers
Function
const_int
()
ctest/src/cdecl.rs:285
↓ 9 callers
Function
func_ptr
Create a function pointer with the given arguments and return type. By default the function pointer is mutable, with `volatile` and `restrict` keywor
ctest/src/cdecl.rs:243
↓ 9 callers
Method
skip_static
Configures whether the tests for a static definition are generated. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new
ctest/src/generator.rs:597
↓ 9 callers
Method
skip_struct_field_type
Configures whether tests for the type of a field is skipped or not. The closure is given a Rust struct as well as a field within that struct. A flag
ctest/src/generator.rs:714
↓ 8 callers
Function
bail
(fdm: c_int, fds: c_int)
src/unix/solarish/compat.rs:46
↓ 8 callers
Method
c_ident
Returns the equivalent C/Cpp identifier of the Rust item.
ctest/src/template.rs:687
↓ 8 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/templates/test.rs:33
↓ 7 callers
Method
alias_is_c_enum
Indicate that a type alias is actually a C enum. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new(); cfg.alias_is_c_e
ctest/src/generator.rs:316
↓ 7 callers
Function
config_gnu_bits
(target: &str, cfg: &mut ctest::TestGenerator)
libc-test/build.rs:3623
↓ 7 callers
Method
finalize
Collect all errors into a single error, reporting them if any.
libc-test/tests/style_lib/mod.rs:159
↓ 7 callers
Function
is_visible
Determine whether an item is visible to other crates. This function assumes that if the visibility is restricted then it is not meant to be accessed.
ctest/src/ffi_items.rs:87
↓ 7 callers
Method
set_state
(&mut self, new_state: State, span: Span)
libc-test/tests/style_lib/mod.rs:192
↓ 7 callers
Method
sidata
(&self)
src/unix/solarish/mod.rs:707
↓ 7 callers
Method
skip_roundtrip
Configures whether the ABI roundtrip tests for a type are emitted. The closure is passed the name of a Rust type and returns whether the tests are ge
ctest/src/generator.rs:998
↓ 6 callers
Method
check_status
(&mut self)
ci/ios/deploy_and_run_on_ios_simulator.rs:167
↓ 6 callers
Function
default_generator
Create a test generator configured to useful settings. The files will be generated in a unique temporary directory that gets deleted when it goes out
ctest/tests/basic.rs:26
↓ 6 callers
Function
func
(args: Vec<CTy>, ret: CTy)
ctest/src/cdecl.rs:233
↓ 6 callers
Method
generate_files
Generate the Rust and C testing files. Returns the path to the generated file.
ctest/src/generator.rs:1052
↓ 6 callers
Function
process_semver_file
(output: &mut W, path: &mut PathBuf, file: P)
libc-test/build.rs:141
↓ 6 callers
Method
rename_union_ty
Configures how a Rust union type is translated to a C union type. # Examples This method can be used to remove the `union` keyword from types in the
ctest/src/generator.rs:969
↓ 6 callers
Function
run
(args: list[str], **kw)
ci/style.py:167
↓ 6 callers
Method
skip_signededness
Configures whether a type's signededness is tested or not. The closure is given the name of a Rust type, and returns whether the type should be teste
ctest/src/generator.rs:1020
↓ 6 callers
Method
volatile_struct_field
Indicate that a struct field should be marked `volatile`. # Examples ```no_run use ctest::{TestGenerator, VolatileItemKind}; let mut cfg = TestGene
ctest/src/generator.rs:333
↓ 5 callers
Function
check_entrypoint
Generate test files for the given header and crate path and compare with pregenerated test files. If LIBC_BLESS is set, it will overwrite the pregene
ctest/tests/basic.rs:65
↓ 5 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/tests/input/hierarchy.out.rs:29
↓ 5 callers
Method
error
(&mut self, title: String, span: Span, msg: String, help: HelpMsg)
libc-test/tests/style_lib/mod.rs:299
↓ 5 callers
Method
sifields
(&self)
src/unix/linux_like/l4re/uclibc/mod.rs:334
↓ 5 callers
Method
sifields
(&self)
src/unix/linux_like/android/mod.rs:3770
↓ 5 callers
Method
sifields
(&self)
src/unix/linux_like/linux/gnu/mod.rs:445
↓ 5 callers
Method
sifields
(&self)
src/unix/linux_like/linux/musl/mod.rs:107
↓ 5 callers
Method
sifields
(&self)
src/unix/linux_like/linux/uclibc/mod.rs:210
↓ 5 callers
Function
space_if
We do this a surprising number of times.
ctest/src/cdecl.rs:176
↓ 5 callers
Method
structs
Return a list of all structs found.
ctest/src/ffi_items.rs:58
↓ 5 callers
Function
translate_primitive_type
Translate a Rust primitive type into its C equivalent.
ctest/src/translator.rs:314
↓ 5 callers
Method
unions
Return a list of all unions found.
ctest/src/ffi_items.rs:63
↓ 4 callers
Function
_IOC
(inout: c_ulong, group: c_ulong, num: c_ulong, len: c_ulong)
src/unix/bsd/netbsdlike/netbsd/mod.rs:1301
↓ 4 callers
Method
aliases
Return a list of all type aliases found.
ctest/src/ffi_items.rs:53
↓ 4 callers
Function
ctest_size_of__VecU16
ctest/tests/input/macro.out.c:41
↓ 4 callers
Function
ctest_size_of__VecU8
ctest/tests/input/macro.out.c:38
↓ 4 callers
Function
ctest_size_of__volatile_char
ctest/tests/input/simple.out.with-skips.c:35
↓ 4 callers
Function
ptr_qual
Create a pointer to a type, specifying the qualifiers of the pointer.
ctest/src/cdecl.rs:216
↓ 3 callers
Method
add_roundtrip_test
( &mut self, helper: &TranslateHelper, ident: &str, fields: &[Field],
ctest/src/template.rs:306
↓ 3 callers
Function
cdecl
Create a C declaration for a type. Given a type `cty` (e.g. array of pointers to int) and a `name` (e.g. "foo"), turn `name` into a valid declaration
ctest/src/cdecl.rs:90
↓ 3 callers
Function
check_same
Check that the value returned from the Rust and C side in a certain test is equivalent. Internally it will remember which checks failed and how many
ctest/tests/input/simple.out.with-skips.rs:29
↓ 3 callers
Function
check_same_bytes
(rust: &[u8], c: &[u8], attr: &str)
ctest/tests/input/simple.out.with-renames.rs:38
↓ 3 callers
Function
collect_fields
Collect fields in a syn grammar into ctest's equivalent structure.
ctest/src/ffi_items.rs:95
↓ 3 callers
Method
link_name
Return the name of the function to be linked C side with.
ctest/src/ast/function.rs:30
↓ 3 callers
Method
nightly
(self)
ci/verify-build.py:56
↓ 3 callers
Method
out_dir
Configures the output directory of the generated Rust and C code. # Examples ```no_run use ctest::TestGenerator; let mut cfg = TestGenerator::new()
ctest/src/generator.rs:272
↓ 3 callers
Function
ptr_with_inner
Construct a CTy and modify the constness of the inner type. Basically, `syn` always gives us the `constness` of the inner type of a pointer. However
ctest/src/translator.rs:352
↓ 3 callers
Method
rty_to_cty
Maps Rust identifiers or types to C counterparts, or defaults to the original name.
ctest/src/generator.rs:1106
↓ 3 callers
Method
rust_ident
Return the identifier escaped for Rust source output when needed.
ctest/src/ast/field.rs:18
↓ 3 callers
Function
size_align_test_ident
(ident: &str)
ctest/src/template.rs:571
↓ 3 callers
Method
skip_fn_ptrcheck
Configures whether tests for a function pointer's value are generated. The closure is given a Rust FFI function and returns whether the test will be
ctest/src/generator.rs:1044
↓ 2 callers
Function
__compile_test
( output_dir: impl AsRef<Path>, crate_path: impl AsRef<Path>, library_file: impl AsRef<Path>, )
ctest/src/runner.rs:98
↓ 2 callers
Function
__run_test
(test_binary: P)
ctest/src/runner.rs:166
↓ 2 callers
Function
bless_equal
Assert whether the contents of two files match. If the contents do not match and LIBC_BLESS is set, overwrite the test file with the content of the g
ctest/tests/basic.rs:46
↓ 2 callers
Function
check_output
(args: list[str], **kw)
ci/style.py:162
↓ 2 callers
Function
check_output
( args: Sequence[str | Path], *, env: Optional[dict[str, str]] = None )
ci/verify-build.py:234
↓ 2 callers
Function
cmd
Create a command that starts in the `target/debug` or `target/release` directory.
ctest-test/tests/all.rs:12
↓ 2 callers
Function
ctest_align_of__VecU16
ctest/tests/input/macro.out.c:42
↓ 2 callers
Function
ctest_align_of__VecU8
ctest/tests/input/macro.out.c:39
↓ 2 callers
Function
ctest_align_of__volatile_char
ctest/tests/input/simple.out.with-skips.c:36
next →
1–100 of 806, ranked by callers