Showing preview only (481K chars total). Download the full file or copy to clipboard to get everything.
Repository: diwic/alsa-rs
Branch: master
Commit: 62722db312fe
Files: 31
Total size: 464.6 KB
Directory structure:
gitextract_kduojn30/
├── .github/
│ └── workflows/
│ └── rust.yml
├── .gitignore
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── examples/
│ ├── ctl_list.rs
│ ├── midi_enumerate.rs
│ ├── pcm_enumerate.rs
│ ├── pcm_record.rs
│ └── trigger_hstamp.rs
├── src/
│ ├── card.rs
│ ├── chmap.rs
│ ├── config.rs
│ ├── ctl_int.rs
│ ├── device_name.rs
│ ├── direct/
│ │ ├── asound_ioctl.rs
│ │ ├── ffi.rs
│ │ └── pcm.rs
│ ├── direct.rs
│ ├── error.rs
│ ├── hctl.rs
│ ├── io.rs
│ ├── lib.rs
│ ├── mixer.rs
│ ├── pcm.rs
│ ├── poll.rs
│ ├── rawmidi.rs
│ └── seq.rs
└── synth-example/
├── Cargo.toml
└── src/
└── main.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/rust.yml
================================================
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - name: Load loopback driver
# run: sudo modprobe snd-aloop
- name: Install dependencies 1
run: sudo apt-get update
- name: Install dependencies 2
run: sudo apt-get install --no-install-recommends -y libasound2-dev
- name: Build
run: cargo check --verbose --all
- name: Build no-std
run: cargo check --no-default-features --verbose --all
# - name: Run tests
# run: cargo test --verbose --all
================================================
FILE: .gitignore
================================================
target/
**/*.rs.bk
Cargo.lock
.idea/
================================================
FILE: Cargo.toml
================================================
[package]
name = "alsa"
version = "0.11.0"
authors = ["David Henningsson <coding@diwic.se>"]
description = "Thin but safe wrappers for ALSA (Linux sound API)"
repository = "https://github.com/diwic/alsa-rs"
documentation = "http://docs.rs/alsa"
keywords = ["ALSA", "audio", "sound"]
license = "Apache-2.0/MIT"
categories = ["multimedia::audio", "api-bindings"]
readme = "README.md"
edition = "2021"
include = ["README.md", "LICENSE-*", "Cargo.toml", "src/"]
exclude = ["examples/"]
[dependencies]
libc = "0.2.178"
alsa-sys = "0.4.0"
bitflags = "2.4.0"
cfg-if = "1.0"
[dev-dependencies]
anyhow = "1.0"
[badges]
is-it-maintained-issue-resolution = { repository = "diwic/alsa-rs" }
is-it-maintained-open-issues = { repository = "diwic/alsa-rs" }
[features]
default = ["std"]
std = []
[lints.rust]
missing-debug-implementations = "warn"
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: LICENSE-MIT
================================================
MIT License
Copyright (c) 2015-2021 David Henningsson, and other contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
ALSA bindings for Rust
=======================
Thin but safe wrappers for [ALSA](https://alsa-project.org), the most
common API for accessing audio devices on Linux.
[](https://crates.io/crates/alsa)
[](https://docs.rs/alsa)
[](https://crates.io/crates/alsa)
The ALSA API is rather big, so everything is not covered yet, but expect the following to work:
* Audio Playback (example in `pcm` module docs)
* Audio Recording
* Mixer controls
* HCtl API (jack detection example in `hctl` module docs)
* Raw midi
* Midi sequencer (most of it)
* Ctl API
* Device name hints (example in `device_name` module docs)
* Enumerations of all of the above
* Poll and/or wait for all of the above
The following is not yet implemented (mostly because nobody asked for them) :
* Separate timer API (snd_timer_*)
* Config API (snd_config_*)
* Plug-in API
Quickstart guide / API design:
* Most functions map 1-to-1 to alsa-lib functions, e g, `ctl::CardInfo::get_id()` is a wrapper around
`snd_ctl_card_info_get_id` and the [alsa-lib documentation](https://www.alsa-project.org/alsa-doc/alsa-lib/)
can be consulted for additional information.
* Structs are RAII and closed/freed on drop, e g, when a `PCM` struct is dropped, `snd_pcm_close` is called.
* To read and write buffers, call the `io_*` methods. It will return a separate struct from which you can
read or write, and which can also be used for mmap (if supported by the driver).
* Error handling - most alsa-lib functions can return errors, so the return value from these is a `Result`.
* Enumeration of cards, devices etc is done through structs implementing `Iterator`.
* Many structs implement `poll::Descriptors`, to combine with your favorite async framework.
Or just use `wait` if you don't need non-blocking functionality.
Notes:
* To run the tests successfully, there must be a "default" sound card configured. This is usually not a problem when running on normal hardware, but some CI systems, docker images etc, might not have that configured by default.
================================================
FILE: examples/ctl_list.rs
================================================
//! Example that enumerates controls for a device.
use alsa::Card;
use alsa::card::Iter;
use alsa::ctl::Ctl;
use alsa::Error;
fn list_controls_for_card(card: &Card) -> Result<(), Error>{
// Get a Ctl for the card
let ctl_id = format!("hw:{}", card.get_index());
let ctl = Ctl::new(&ctl_id, false)?;
println!("card {}", ctl_id);
// Query the elements
let elems = ctl.elem_list()?;
for list_index in 0..elems.get_used() {
let numeric_id = elems.get_numid(list_index)?;
let name = elems.get_name(list_index)?;
println!(" {}: {}", numeric_id, name);
}
Ok(())
}
fn main() {
let cards = Iter::new();
cards.for_each(|card| if let Ok(c) = card { list_controls_for_card(&c).unwrap_or_default() });
}
================================================
FILE: examples/midi_enumerate.rs
================================================
//! Example that enumerates hardware and PCM devices.
use alsa::Card;
use alsa::card::Iter as CardIter;
use alsa::ctl::{Ctl};
use alsa::{Error};
use alsa::rawmidi::Iter as MidiIter;
use alsa::seq::{ClientIter, Seq, PortIter, PortSubscribeIter, QuerySubsType, Addr};
pub fn list_rawmidi_for_card(card: &Card) -> Result<(), Error> {
// Get a Ctl for the card
let ctl_id = format!("hw:{}", card.get_index());
let ctl = Ctl::new(&ctl_id, false)?;
// Read card id and name
let cardinfo = ctl.card_info()?;
let card_id = cardinfo.get_id()?;
let card_name = cardinfo.get_name()?;
let subdevices:Vec<_> = MidiIter::new(&ctl).filter_map(|d| d.ok()).collect();
if !subdevices.is_empty() {
println!("card_id: {:?} card_name {:?} ", card_id, card_name);
for info in &subdevices {
println!("subdevice: {:?} {:?} {:?}", info.get_subdevice(), info.get_subdevice_name().unwrap(), info.get_stream());
}
println!();
}
Ok(())
}
pub fn list_rawmidi_devices() {
let cards = CardIter::new();
cards.for_each(|card| if let Ok(c) = card { list_rawmidi_for_card(&c).unwrap_or_default() });
}
pub fn list_sequencer_port() {
let seq = Seq::open(None, None, false).unwrap();
println!("Seq client {:?}", seq.client_id().unwrap());
println!();
seq.set_client_name(&c"ALSA_RS_EXAMPLE").unwrap();
for client in ClientIter::new(&seq) {
println!("Client {:?} {:?}", client.get_client(), client.get_name().unwrap());
for port in PortIter::new(&seq, client.get_client()) {
println!(" Port {:?} {:?}", port.get_port(), port.get_name().unwrap());
for sub in PortSubscribeIter::new(&seq, Addr { client: client.get_client(), port: port.get_port() } , QuerySubsType::READ) {
println!(" READ {:?}", sub.get_dest());
}
for sub in PortSubscribeIter::new(&seq, Addr { client: client.get_client(), port: port.get_port() } , QuerySubsType::WRITE) {
println!(" WRITE {:?}", sub.get_dest());
}
}
println!();
}
}
fn main() {
println!("\n--- Raw MIDI devices ---");
list_rawmidi_devices();
println!("\n--- MIDI Sequencer Clients, Ports and Subscribers ---");
list_sequencer_port();
}
================================================
FILE: examples/pcm_enumerate.rs
================================================
//! Example that enumerates hardware and PCM devices.
use alsa::Card;
use alsa::card::Iter;
use alsa::device_name::HintIter;
use alsa::ctl::{Ctl, DeviceIter};
use alsa::{Direction, Error};
// Each card can have multiple devices and subdevices, list them all
fn list_devices_for_card(card: &Card, direction: Direction) -> Result<(), Error>{
// Get a Ctl for the card
let ctl_id = format!("hw:{}", card.get_index());
let ctl = Ctl::new(&ctl_id, false)?;
// Read card id and name
let cardinfo = ctl.card_info()?;
let card_id = cardinfo.get_id()?;
let card_name = cardinfo.get_name()?;
for device in DeviceIter::new(&ctl) {
// Read info from Ctl
let pcm_info = match ctl.pcm_info(device as u32, 0, direction) {
// If pcm_info returns ENOENT, there are no streams in this direction
Err(x) if x.errno() == libc::ENOENT => continue,
x => x,
}?;
// Read PCM name
let pcm_name = pcm_info.get_name()?.to_string();
println!("card: {:<2} id: {:<10} device: {:<2} card name: '{}' PCM name: '{}'", card.get_index(), card_id, device, card_name, pcm_name);
// Loop through subdevices and get their names
let subdevs = pcm_info.get_subdevices_count();
for subdev in 0..subdevs {
// Get subdevice name
let pcm_info = ctl.pcm_info(device as u32, subdev, direction)?;
let subdev_name = pcm_info.get_subdevice_name()?;
println!(" subdevice: {:<2} name: '{}'", subdev, subdev_name);
}
}
Ok(())
}
pub fn list_hw_devices(direction: Direction) {
let cards = Iter::new();
cards.for_each(|card| if let Ok(c) = card { list_devices_for_card(&c, direction).unwrap_or_default() });
}
pub fn list_pcm_devices(direction: Direction) {
let hints = HintIter::new_str(None, "pcm").unwrap();
for hint in hints {
// When Direction is None it means that both the PCM supports both playback and capture
if hint.name.is_some() && hint.desc.is_some() && (hint.direction.is_none() || hint.direction.map(|dir| dir == direction).unwrap_or_default()) {
println!("name: {:<35} desc: {:?}", hint.name.unwrap(), hint.desc.unwrap());
}
}
}
fn main() {
println!("\n--- Hardware playback devices ---");
list_hw_devices(Direction::Playback);
println!("\n--- Hardware capture devices ---");
list_hw_devices(Direction::Capture);
println!("\n--- PCM playback devices ---");
list_pcm_devices(Direction::Playback);
println!("\n--- PCM capture devices ---");
list_pcm_devices(Direction::Capture);
}
================================================
FILE: examples/pcm_record.rs
================================================
//! Example that continously reads data and displays its RMS volume.
use alsa::pcm::*;
use alsa::{Direction, ValueOr, Error};
fn start_capture(device: &str) -> Result<PCM, Error> {
let pcm = PCM::new(device, Direction::Capture, false)?;
{
// For this example, we assume 44100Hz, one channel, 16 bit audio.
let hwp = HwParams::any(&pcm)?;
hwp.set_channels(1)?;
hwp.set_rate(44100, ValueOr::Nearest)?;
hwp.set_format(Format::s16())?;
hwp.set_access(Access::RWInterleaved)?;
pcm.hw_params(&hwp)?;
}
pcm.start()?;
Ok(pcm)
}
// Calculates RMS (root mean square) as a way to determine volume
fn rms(buf: &[i16]) -> f64 {
if buf.len() == 0 { return 0f64; }
let mut sum = 0f64;
for &x in buf {
sum += (x as f64) * (x as f64);
}
let r = (sum / (buf.len() as f64)).sqrt();
// Convert value to decibels
20.0 * (r / (i16::MAX as f64)).log10()
}
fn read_loop(pcm: &PCM) -> Result<(), Error> {
let io = pcm.io_i16()?;
let mut buf = [0i16; 8192];
loop {
// Block while waiting for 8192 samples to be read from the device.
assert_eq!(io.readi(&mut buf)?, buf.len());
let r = rms(&buf);
println!("RMS: {:.1} dB", r);
}
}
fn main() {
// The "default" device is usually directed to the sound server process,
// e g PulseAudio or PipeWire.
let capture = start_capture("default").unwrap();
read_loop(&capture).unwrap();
}
================================================
FILE: examples/trigger_hstamp.rs
================================================
use alsa::{
pcm::{Access, Format, HwParams},
Direction, ValueOr, PCM,
};
use anyhow::Result; // Sorry for the extra dep :D
fn main() -> Result<()> {
// Also tried specifying the hw card name, but it doesn't matter
let pcm = PCM::new("default", Direction::Capture, false)?;
{
let hwp = HwParams::any(&pcm)?;
hwp.set_channels(2)?;
hwp.set_rate(16000, ValueOr::Nearest)?;
hwp.set_format(Format::s32())?;
hwp.set_access(Access::RWInterleaved)?;
pcm.hw_params(&hwp)?;
}
{
let swp = pcm.sw_params_current()?;
swp.set_tstamp_mode(true)?;
swp.set_tstamp_type(alsa::pcm::TstampType::Monotonic)?; // Tried with every kind of timestamp type, it doesn't matter
pcm.sw_params(&swp)?;
}
let mut buffer = [0i32; 8000];
pcm.start()?;
let pcm_io = pcm.io_i32()?;
loop {
// Debug: check if timestamps are enabled (it returns true as expected)
let params = pcm.sw_params_current()?;
println!("timestamps enabled: {}", params.get_tstamp_mode()?);
let read_bytes = pcm_io.readi(&mut buffer)?;
assert!(read_bytes > 0);
// I've also tried to construct the status object just once outside the loop but nothing changes
let status = pcm.status()?;
dbg!(&status);
// The following "htstamp" functions all wrongly return a timespec struct with 0 seconds and 0 nanoseconds
// when using Rust >=1.88 (even tried on Nightly to check if it worked on there)
let audio_htstamp = status.get_audio_htstamp();
println!("{} {}", audio_htstamp.tv_sec, audio_htstamp.tv_nsec);
let htstamp = status.get_htstamp();
println!("{} {}", htstamp.tv_sec, htstamp.tv_nsec);
let trigger_htstamp = status.get_trigger_htstamp();
println!("{} {}", trigger_htstamp.tv_sec, trigger_htstamp.tv_nsec);
}
}
================================================
FILE: src/card.rs
================================================
//! Sound card enumeration
use libc::{c_int, c_char};
use super::error::*;
use crate::alsa;
use core::ffi::CStr;
use ::alloc::string::String;
/// An ALSA sound card, uniquely identified by its index.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct Card(c_int);
/// Iterate over existing sound cards.
#[derive(Debug)]
pub struct Iter(c_int);
impl Iter {
pub fn new() -> Iter { Iter(-1) }
}
impl Iterator for Iter {
type Item = Result<Card>;
fn next(&mut self) -> Option<Result<Card>> {
match acheck!(snd_card_next(&mut self.0)) {
Ok(_) if self.0 == -1 => None,
Ok(_) => Some(Ok(Card(self.0))),
Err(e) => Some(Err(e)),
}
}
}
impl Card {
pub fn new(index: c_int) -> Card { Card(index) }
pub fn from_str(s: &CStr) -> Result<Card> {
acheck!(snd_card_get_index(s.as_ptr())).map(Card)
}
pub fn get_name(&self) -> Result<String> {
let mut c: *mut c_char = ::core::ptr::null_mut();
acheck!(snd_card_get_name(self.0, &mut c))
.and_then(|_| from_alloc("snd_card_get_name", c))
}
pub fn get_longname(&self) -> Result<String> {
let mut c: *mut c_char = ::core::ptr::null_mut();
acheck!(snd_card_get_longname(self.0, &mut c))
.and_then(|_| from_alloc("snd_card_get_longname", c))
}
pub fn get_index(&self) -> c_int { self.0 }
}
#[test]
fn print_cards() {
extern crate std;
for a in Iter::new().map(|a| a.unwrap()) {
std::println!("Card #{}: {} ({})", a.get_index(), a.get_name().unwrap(), a.get_longname().unwrap())
}
}
================================================
FILE: src/chmap.rs
================================================
use crate::alsa;
use core::{fmt, mem, slice};
use super::error::*;
use ::alloc::vec::Vec;
use ::alloc::vec;
alsa_enum!(
/// [SND_CHMAP_TYPE_xxx](http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html) constants
ChmapType, ALL_CHMAP_TYPES[4],
None = SND_CHMAP_TYPE_NONE,
Fixed = SND_CHMAP_TYPE_FIXED,
Var = SND_CHMAP_TYPE_VAR,
Paired = SND_CHMAP_TYPE_PAIRED,
);
alsa_enum!(
/// [SND_CHMAP_xxx](http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html) constants
ChmapPosition, ALL_CHMAP_POSITIONS[37],
Unknown = SND_CHMAP_UNKNOWN,
NA = SND_CHMAP_NA,
Mono = SND_CHMAP_MONO,
FL = SND_CHMAP_FL,
FR = SND_CHMAP_FR,
RL = SND_CHMAP_RL,
RR = SND_CHMAP_RR,
FC = SND_CHMAP_FC,
LFE = SND_CHMAP_LFE,
SL = SND_CHMAP_SL,
SR = SND_CHMAP_SR,
RC = SND_CHMAP_RC,
FLC = SND_CHMAP_FLC,
FRC = SND_CHMAP_FRC,
RLC = SND_CHMAP_RLC,
RRC = SND_CHMAP_RRC,
FLW = SND_CHMAP_FLW,
FRW = SND_CHMAP_FRW,
FLH = SND_CHMAP_FLH,
FCH = SND_CHMAP_FCH,
FRH = SND_CHMAP_FRH,
TC = SND_CHMAP_TC,
TFL = SND_CHMAP_TFL,
TFR = SND_CHMAP_TFR,
TFC = SND_CHMAP_TFC,
TRL = SND_CHMAP_TRL,
TRR = SND_CHMAP_TRR,
TRC = SND_CHMAP_TRC,
TFLC = SND_CHMAP_TFLC,
TFRC = SND_CHMAP_TFRC,
TSL = SND_CHMAP_TSL,
TSR = SND_CHMAP_TSR,
LLFE = SND_CHMAP_LLFE,
RLFE = SND_CHMAP_RLFE,
BC = SND_CHMAP_BC,
BLC = SND_CHMAP_BLC,
BRC = SND_CHMAP_BRC,
);
impl fmt::Display for ChmapPosition {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let s = unsafe { alsa::snd_pcm_chmap_long_name(*self as libc::c_uint) };
let s = from_const("snd_pcm_chmap_long_name", s)?;
write!(f, "{}", s)
}
}
/// [snd_pcm_chmap_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html) wrapper
#[derive(Debug)]
pub struct Chmap(*mut alsa::snd_pcm_chmap_t, bool);
impl Drop for Chmap {
fn drop(&mut self) { if self.1 { unsafe { libc::free(self.0 as *mut libc::c_void) }}}
}
impl Chmap {
fn set_channels(&mut self, c: libc::c_uint) { unsafe { (*self.0) .channels = c }}
fn as_slice_mut(&mut self) -> &mut [libc::c_uint] {
unsafe { slice::from_raw_parts_mut((*self.0).pos.as_mut_ptr(), (*self.0).channels as usize) }
}
fn as_slice(&self) -> &[libc::c_uint] {
unsafe { slice::from_raw_parts((*self.0).pos.as_ptr(), (*self.0).channels as usize) }
}
}
impl fmt::Display for Chmap {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut buf: Vec<libc::c_char> = vec![0; 512];
acheck!(snd_pcm_chmap_print(self.0, buf.len() as libc::size_t, buf.as_mut_ptr()))?;
let s = from_const("snd_pcm_chmap_print", buf.as_mut_ptr())?;
write!(f, "{}", s)
}
}
impl<'a> From<&'a [ChmapPosition]> for Chmap {
fn from(a: &'a [ChmapPosition]) -> Chmap {
let p = unsafe { libc::malloc((mem::size_of::<alsa::snd_pcm_chmap_t>() + mem::size_of::<libc::c_uint>() * a.len()) as libc::size_t) };
if p.is_null() { panic!("Out of memory") }
let mut r = Chmap(p as *mut alsa::snd_pcm_chmap_t, true);
r.set_channels(a.len() as libc::c_uint);
for (i,v) in r.as_slice_mut().iter_mut().enumerate() { *v = a[i] as libc::c_uint }
r
}
}
impl<'a> From<&'a Chmap> for Vec<ChmapPosition> {
fn from(a: &'a Chmap) -> Vec<ChmapPosition> {
a.as_slice().iter().map(|&v| ChmapPosition::from_c_int(v as libc::c_int, "").unwrap()).collect()
}
}
pub fn chmap_new(a: *mut alsa::snd_pcm_chmap_t) -> Chmap { Chmap(a, true) }
pub fn chmap_handle(a: &Chmap) -> *mut alsa::snd_pcm_chmap_t { a.0 }
/// Iterator over available channel maps - see [snd_pcm_chmap_query_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html)
#[derive(Debug)]
pub struct ChmapsQuery(*mut *mut alsa::snd_pcm_chmap_query_t, isize);
impl Drop for ChmapsQuery {
fn drop(&mut self) { unsafe { alsa::snd_pcm_free_chmaps(self.0) }}
}
pub fn chmaps_query_new(a: *mut *mut alsa::snd_pcm_chmap_query_t) -> ChmapsQuery { ChmapsQuery(a, 0) }
impl Iterator for ChmapsQuery {
type Item = (ChmapType, Chmap);
fn next(&mut self) -> Option<Self::Item> {
if self.0.is_null() { return None; }
let p = unsafe { *self.0.offset(self.1) };
if p.is_null() { return None; }
self.1 += 1;
let t = ChmapType::from_c_int(unsafe { (*p).type_ } as libc::c_int, "snd_pcm_query_chmaps").unwrap();
let m = Chmap(unsafe { &mut (*p).map }, false);
Some((t, m))
}
}
#[test]
fn chmap_for_first_pcm() {
extern crate std;
use super::*;
use ::alloc::ffi::CString;
use crate::device_name::HintIter;
use crate::Output;
let output = Output::local_error_handler().unwrap();
let i = HintIter::new(None, &*CString::new("pcm").unwrap()).unwrap();
for p in i.map(|n| n.name.unwrap()) {
std::println!("Chmaps for {:?}:", p);
match PCM::open(&CString::new(p).unwrap(), Direction::Playback, false) {
Ok(a) => for c in a.query_chmaps() {
std::println!(" {:?}, {}", c.0, c.1);
},
Err(a) => std::println!(" {}", a) // It's okay to have entries in the name hint array that can't be opened
}
}
output.borrow_mut().buffer_string(|buf| {
let str = CString::new(buf).unwrap();
std::println!("Errors:\n{}", str.to_str().unwrap());
});
}
================================================
FILE: src/config.rs
================================================
//! Configuration file API
//!
//! For now, just contains functions regarding the global configuration
//! stored as a cache inside alsa-lib. Calling `update_free_global` might help
//! against valgrind reporting memory leaks.
use crate::{alsa};
use super::error::*;
use super::Output;
use core::ptr;
pub fn update() -> Result<bool> {
acheck!(snd_config_update()).map(|x| x != 0)
}
pub fn update_free_global() -> Result<()> {
acheck!(snd_config_update_free_global()).map(|_| ())
}
/// [snd_config_t](https://alsa-project.org/alsa-doc/alsa-lib/group___config.html) wrapper
#[derive(Debug)]
pub struct Config(*mut alsa::snd_config_t);
impl Drop for Config {
fn drop(&mut self) { unsafe { alsa::snd_config_unref(self.0) }; }
}
pub fn update_ref() -> Result<Config> {
let mut top = ptr::null_mut();
acheck!(snd_config_update_ref(&mut top)).map(|_| Config(top))
}
impl Config {
pub fn save(&self, o: &mut Output) -> Result<()> {
acheck!(snd_config_save(self.0, super::io::output_handle(o))).map(|_| ())
}
}
#[test]
fn config_save() {
extern crate std;
let c = update_ref().unwrap();
let mut outp = Output::buffer_open().unwrap();
c.save(&mut outp).unwrap();
std::println!("== Config save ==\n{}", outp);
}
================================================
FILE: src/ctl_int.rs
================================================
use crate::alsa;
use super::pcm::Info;
use core::ffi::CStr;
use ::alloc::ffi::CString;
use super::Direction;
use super::error::*;
use super::mixer::MilliBel;
use super::Round;
use core::{ptr, mem, fmt, cmp};
use crate::{Card, poll};
use core::cell::UnsafeCell;
use libc::{c_uint, c_void, size_t, c_long, c_int, pollfd, c_short};
/// We prefer not to allocate for every ElemId, ElemInfo or ElemValue.
/// But we don't know if these will increase in the future or on other platforms.
/// Unfortunately, Rust does not support alloca, so hard-code the sizes for now.
const ELEM_ID_SIZE: usize = 64;
// const ELEM_VALUE_SIZE: usize = 1224;
// const ELEM_INFO_SIZE: usize = 272;
/// [snd_ctl_pcm_next_device](https://www.alsa-project.org/alsa-doc/alsa-lib/control_8c.html#accbb0be6e5ca7361ffec0ea304ed1b05) wrapper.
/// Iterate over devices of a card.
#[derive(Debug)]
pub struct DeviceIter<'a>(&'a Ctl, c_int);
impl<'a> DeviceIter<'a>{
pub fn new(ctl: &'a Ctl) -> DeviceIter<'a> {
DeviceIter(ctl, -1)
}
}
impl<'a> Iterator for DeviceIter<'a> {
type Item = c_int;
fn next(&mut self) -> Option<c_int> {
match acheck!(snd_ctl_pcm_next_device(self.0.0, &mut self.1)) {
Ok(_) if self.1 == -1 => None,
Ok(_) => Some(self.1),
Err(_) => None,
}
}
}
/// [snd_ctl_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct Ctl(*mut alsa::snd_ctl_t);
unsafe impl Send for Ctl {}
impl Ctl {
/// Wrapper around open that takes a &str instead of a &CStr
pub fn new(c: &str, nonblock: bool) -> Result<Self> {
Self::open(&CString::new(c).unwrap(), nonblock)
}
/// Open does not support async mode (it's not very Rustic anyway)
pub fn open(c: &CStr, nonblock: bool) -> Result<Ctl> {
let mut r = ptr::null_mut();
let flags = if nonblock { 1 } else { 0 }; // FIXME: alsa::SND_CTL_NONBLOCK does not exist in alsa-sys
acheck!(snd_ctl_open(&mut r, c.as_ptr(), flags)).map(|_| Ctl(r))
}
pub fn from_card(c: &Card, nonblock: bool) -> Result<Ctl> {
let s = ::alloc::format!("hw:{}", c.get_index());
Ctl::open(&CString::new(s).unwrap(), nonblock)
}
pub fn card_info(&self) -> Result<CardInfo> { CardInfo::new().and_then(|c|
acheck!(snd_ctl_card_info(self.0, c.0)).map(|_| c)) }
pub fn wait(&self, timeout_ms: Option<u32>) -> Result<bool> {
acheck!(snd_ctl_wait(self.0, timeout_ms.map(|x| x as c_int).unwrap_or(-1))).map(|i| i == 1) }
pub fn get_db_range(&self, id: &ElemId) -> Result<(MilliBel, MilliBel)> {
let mut min: c_long = 0;
let mut max: c_long = 0;
acheck!(snd_ctl_get_dB_range(self.0, elem_id_ptr(id), &mut min, &mut max))
.map(|_| (MilliBel(min as i64), MilliBel(max as i64)))
}
pub fn convert_to_db(&self, id: &ElemId, volume: i64) -> Result<MilliBel> {
let mut m: c_long = 0;
acheck!(snd_ctl_convert_to_dB(self.0, elem_id_ptr(id), volume as c_long, &mut m))
.map(|_| MilliBel(m as i64))
}
pub fn convert_from_db(&self, id: &ElemId, mb: MilliBel, dir: Round) -> Result<i64> {
let mut m: c_long = 0;
acheck!(snd_ctl_convert_from_dB(self.0, elem_id_ptr(id), mb.0 as c_long, &mut m, dir as c_int))
.map(|_| m as i64)
}
pub fn elem_read(&self, val: &mut ElemValue) -> Result<()> {
acheck!(snd_ctl_elem_read(self.0, elem_value_ptr(val))).map(|_| ())
}
pub fn elem_write(&self, val: &ElemValue) -> Result<()> {
acheck!(snd_ctl_elem_write(self.0, elem_value_ptr(val))).map(|_| ())
}
pub fn elem_lock(&self, id: &ElemId) -> Result<i32> {
acheck!(snd_ctl_elem_lock(self.0, elem_id_ptr(id)))
}
pub fn elem_unlock(&self, id: &ElemId) -> Result<i32> {
acheck!(snd_ctl_elem_unlock(self.0, elem_id_ptr(id)))
}
pub fn elem_list(&self) -> Result<ElemList> {
// obtain the list of all the elements now that we know how many there are
let list = elem_list_new(|list| {
acheck!(snd_ctl_elem_list(self.0, list.0))?;
Ok(list.get_count())
})?;
acheck!(snd_ctl_elem_list(self.0, list.0))?;
Ok(list)
}
/// Note: According to alsa-lib documentation, you're also supposed to have functionality for
/// returning whether or not you are subscribed. This does not work in practice, so I'm not
/// including that here.
pub fn subscribe_events(&self, subscribe: bool) -> Result<()> {
acheck!(snd_ctl_subscribe_events(self.0, if subscribe { 1 } else { 0 })).map(|_| ())
}
pub fn read(&self) -> Result<Option<Event>> {
let e = event_new()?;
acheck!(snd_ctl_read(self.0, e.0)).map(|r| if r == 1 { Some(e) } else { None })
}
pub fn pcm_info(&self, device: u32, subdevice: u32, direction: Direction) -> Result<Info> {
Info::new().and_then(|mut info| {
info.set_device(device);
info.set_subdevice(subdevice);
info.set_stream(direction);
acheck!(snd_ctl_pcm_info(self.0, info.0)).map(|_| info )
})
}
}
impl Drop for Ctl {
fn drop(&mut self) { unsafe { alsa::snd_ctl_close(self.0) }; }
}
impl poll::Descriptors for Ctl {
fn count(&self) -> usize {
unsafe { alsa::snd_ctl_poll_descriptors_count(self.0) as usize }
}
fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
let z = unsafe { alsa::snd_ctl_poll_descriptors(self.0, p.as_mut_ptr(), p.len() as c_uint) };
from_code("snd_ctl_poll_descriptors", z).map(|_| z as usize)
}
fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
let mut r = 0;
let z = unsafe { alsa::snd_ctl_poll_descriptors_revents(self.0, p.as_ptr() as *mut pollfd, p.len() as c_uint, &mut r) };
from_code("snd_ctl_poll_descriptors_revents", z).map(|_| poll::Flags::from_bits_truncate(r as c_short))
}
}
pub fn ctl_ptr(a: &Ctl) -> *mut alsa::snd_ctl_t { a.0 }
/// [snd_ctl_card_info_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct CardInfo(*mut alsa::snd_ctl_card_info_t);
impl Drop for CardInfo {
fn drop(&mut self) { unsafe { alsa::snd_ctl_card_info_free(self.0) }}
}
impl CardInfo {
fn new() -> Result<CardInfo> {
let mut p = ptr::null_mut();
acheck!(snd_ctl_card_info_malloc(&mut p)).map(|_| CardInfo(p))
}
pub fn get_id(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_id", unsafe { alsa::snd_ctl_card_info_get_id(self.0) })}
pub fn get_driver(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_driver", unsafe { alsa::snd_ctl_card_info_get_driver(self.0) })}
pub fn get_components(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_components", unsafe { alsa::snd_ctl_card_info_get_components(self.0) })}
pub fn get_longname(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_longname", unsafe { alsa::snd_ctl_card_info_get_longname(self.0) })}
pub fn get_name(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_name", unsafe { alsa::snd_ctl_card_info_get_name(self.0) })}
pub fn get_mixername(&self) -> Result<&str> {
from_const("snd_ctl_card_info_get_mixername", unsafe { alsa::snd_ctl_card_info_get_mixername(self.0) })}
pub fn get_card(&self) -> Card { Card::new(unsafe { alsa::snd_ctl_card_info_get_card(self.0) })}
}
alsa_enum!(
/// [SND_CTL_ELEM_IFACE_xxx](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) constants
ElemIface, ALL_ELEMIFACE[7],
Card = SND_CTL_ELEM_IFACE_CARD,
Hwdep = SND_CTL_ELEM_IFACE_HWDEP,
Mixer = SND_CTL_ELEM_IFACE_MIXER,
PCM = SND_CTL_ELEM_IFACE_PCM,
Rawmidi = SND_CTL_ELEM_IFACE_RAWMIDI,
Timer = SND_CTL_ELEM_IFACE_TIMER,
Sequencer = SND_CTL_ELEM_IFACE_SEQUENCER,
);
alsa_enum!(
/// [SND_CTL_ELEM_TYPE_xxx](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) constants
ElemType, ALL_ELEMTYPE[7],
None = SND_CTL_ELEM_TYPE_NONE,
Boolean = SND_CTL_ELEM_TYPE_BOOLEAN,
Integer = SND_CTL_ELEM_TYPE_INTEGER,
Enumerated = SND_CTL_ELEM_TYPE_ENUMERATED,
Bytes = SND_CTL_ELEM_TYPE_BYTES,
IEC958 = SND_CTL_ELEM_TYPE_IEC958,
Integer64 = SND_CTL_ELEM_TYPE_INTEGER64,
);
/// [snd_ctl_elem_value_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
pub struct ElemValue {
ptr: *mut alsa::snd_ctl_elem_value_t,
etype: ElemType,
count: u32,
}
impl Drop for ElemValue {
fn drop(&mut self) { unsafe { alsa::snd_ctl_elem_value_free(self.ptr) }; }
}
pub fn elem_value_ptr(a: &ElemValue) -> *mut alsa::snd_ctl_elem_value_t { a.ptr }
pub fn elem_value_new(t: ElemType, count: u32) -> Result<ElemValue> {
let mut p = ptr::null_mut();
acheck!(snd_ctl_elem_value_malloc(&mut p))
.map(|_| ElemValue { ptr: p, etype: t, count })
}
impl ElemValue {
pub fn set_id(&mut self, id: &ElemId) {
unsafe { alsa::snd_ctl_elem_value_set_id(self.ptr, elem_id_ptr(id)) }
}
// Note: The get_bytes hands out a reference to inside the object. Therefore, we can't treat
// the content as "cell"ed, but must take a "&mut self" (to make sure the reference
// from get_bytes has been dropped when calling a set_* function).
pub fn get_boolean(&self, idx: u32) -> Option<bool> {
if self.etype != ElemType::Boolean || idx >= self.count { None }
else { Some( unsafe { alsa::snd_ctl_elem_value_get_boolean(self.ptr, idx as c_uint) } != 0) }
}
pub fn set_boolean(&mut self, idx: u32, val: bool) -> Option<()> {
if self.etype != ElemType::Boolean || idx >= self.count { None }
else { unsafe { alsa::snd_ctl_elem_value_set_boolean(self.ptr, idx as c_uint, if val {1} else {0}) }; Some(()) }
}
pub fn get_integer(&self, idx: u32) -> Option<i32> {
if self.etype != ElemType::Integer || idx >= self.count { None }
else { Some( unsafe { alsa::snd_ctl_elem_value_get_integer(self.ptr, idx as c_uint) } as i32) }
}
pub fn set_integer(&mut self, idx: u32, val: i32) -> Option<()> {
if self.etype != ElemType::Integer || idx >= self.count { None }
else { unsafe { alsa::snd_ctl_elem_value_set_integer(self.ptr, idx as c_uint, val as c_long) }; Some(()) }
}
pub fn get_integer64(&self, idx: u32) -> Option<i64> {
if self.etype != ElemType::Integer64 || idx >= self.count { None }
else { Some( unsafe { alsa::snd_ctl_elem_value_get_integer64(self.ptr, idx as c_uint) } as i64) }
}
pub fn set_integer64(&mut self, idx: u32, val: i64) -> Option<()> {
if self.etype != ElemType::Integer || idx >= self.count { None }
else { unsafe { alsa::snd_ctl_elem_value_set_integer64(self.ptr, idx as c_uint, val) }; Some(()) }
}
pub fn get_enumerated(&self, idx: u32) -> Option<u32> {
if self.etype != ElemType::Enumerated || idx >= self.count { None }
else { Some( unsafe { alsa::snd_ctl_elem_value_get_enumerated(self.ptr, idx as c_uint) } as u32) }
}
pub fn set_enumerated(&mut self, idx: u32, val: u32) -> Option<()> {
if self.etype != ElemType::Enumerated || idx >= self.count { None }
else { unsafe { alsa::snd_ctl_elem_value_set_enumerated(self.ptr, idx as c_uint, val as c_uint) }; Some(()) }
}
pub fn get_byte(&self, idx: u32) -> Option<u8> {
if self.etype != ElemType::Bytes || idx >= self.count { None }
else { Some( unsafe { alsa::snd_ctl_elem_value_get_byte(self.ptr, idx as c_uint) } as u8) }
}
pub fn set_byte(&mut self, idx: u32, val: u8) -> Option<()> {
if self.etype != ElemType::Bytes || idx >= self.count { None }
else { unsafe { alsa::snd_ctl_elem_value_set_byte(self.ptr, idx as c_uint, val) }; Some(()) }
}
pub fn get_bytes(&self) -> Option<&[u8]> {
if self.etype != ElemType::Bytes { None }
else { Some( unsafe { ::core::slice::from_raw_parts(
alsa::snd_ctl_elem_value_get_bytes(self.ptr) as *const u8, self.count as usize) } ) }
}
pub fn set_bytes(&mut self, val: &[u8]) -> Option<()> {
if self.etype != ElemType::Bytes || val.len() != self.count as usize { None }
// Note: the alsa-lib function definition is broken. First, the pointer is declared as mut even
// though it's const, and second, there is a "value" missing between "elem" and "set_bytes".
else { unsafe { alsa::snd_ctl_elem_set_bytes(self.ptr, val.as_ptr() as *mut c_void, val.len() as size_t) }; Some(()) }
}
/// Creates a new ElemValue.
pub fn new(t: ElemType) -> Result<ElemValue> {
// See max length in include/uapi/sound/asound.h in linux kernel for these values
let count = match t {
ElemType::None => 1,
ElemType::Boolean => 128,
ElemType::Integer => 128,
ElemType::Enumerated => 128,
ElemType::Bytes => 512,
ElemType::IEC958 => 1,
ElemType::Integer64 => 64,
};
// if count > maxcount { return Err(Error::new(Some("ElemValue::new - count too large".into()), 1)) }
let ev = elem_value_new(t, count)?;
unsafe { alsa::snd_ctl_elem_value_clear(elem_value_ptr(&ev)) };
Ok(ev)
}
}
impl fmt::Debug for ElemValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use self::ElemType::*;
write!(f, "ElemValue({:?}", self.etype)?;
for a in 0..self.count { match self.etype {
Boolean => write!(f, ",{:?}", self.get_boolean(a).unwrap()),
Integer => write!(f, ",{:?}", self.get_integer(a).unwrap()),
Integer64 => write!(f, ",{:?}", self.get_integer64(a).unwrap()),
Enumerated => write!(f, ",{:?}", self.get_enumerated(a).unwrap()),
Bytes => write!(f, ",{:?}", self.get_byte(a).unwrap()),
_ => Ok(()),
}?};
write!(f, ")")
}
}
/// [snd_ctl_elem_info_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct ElemInfo(*mut alsa::snd_ctl_elem_info_t);
pub fn elem_info_ptr(a: &ElemInfo) -> *mut alsa::snd_ctl_elem_info_t { a.0 }
impl Drop for ElemInfo {
fn drop(&mut self) { unsafe { alsa::snd_ctl_elem_info_free(self.0) }; }
}
pub fn elem_info_new() -> Result<ElemInfo> {
let mut p = ptr::null_mut();
acheck!(snd_ctl_elem_info_malloc(&mut p)).map(|_| ElemInfo(p))
}
impl ElemInfo {
pub fn get_type(&self) -> ElemType { ElemType::from_c_int(
unsafe { alsa::snd_ctl_elem_info_get_type(self.0) } as c_int, "snd_ctl_elem_info_get_type").unwrap() }
pub fn get_count(&self) -> u32 { unsafe { alsa::snd_ctl_elem_info_get_count(self.0) as u32 } }
}
//
// Non-allocating version of ElemId
//
/// [snd_ctl_elem_id_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
pub struct ElemId(UnsafeCell<[u8; ELEM_ID_SIZE]>);
pub fn elem_id_new() -> Result<ElemId> {
assert!(unsafe { alsa::snd_ctl_elem_id_sizeof() } as usize <= ELEM_ID_SIZE);
Ok(ElemId(UnsafeCell::new(unsafe { mem::zeroed() })))
}
#[inline]
pub fn elem_id_ptr(a: &ElemId) -> *mut alsa::snd_ctl_elem_id_t { a.0.get() as *mut _ as *mut alsa::snd_ctl_elem_id_t }
unsafe impl Send for ElemId {}
impl Clone for ElemId {
fn clone(&self) -> Self {
ElemId(UnsafeCell::new(unsafe { *self.0.get() }))
}
}
//
// Allocating version of ElemId
//
/*
/// [snd_ctl_elem_id_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
pub struct ElemId(*mut alsa::snd_ctl_elem_id_t);
impl Drop for ElemId {
fn drop(&mut self) { unsafe { alsa::snd_ctl_elem_id_free(self.0) }; }
}
pub fn elem_id_new() -> Result<ElemId> {
let mut p = ptr::null_mut();
acheck!(snd_ctl_elem_id_malloc(&mut p)).map(|_| ElemId(p))
}
pub fn elem_id_ptr(a: &ElemId) -> *mut alsa::snd_ctl_elem_id_t { a.0 }
*/
impl ElemId {
pub fn get_name(&self) -> Result<&str> {
from_const("snd_hctl_elem_id_get_name", unsafe { alsa::snd_ctl_elem_id_get_name(elem_id_ptr(self)) })}
pub fn get_device(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_device(elem_id_ptr(self)) as u32 }}
pub fn get_subdevice(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_subdevice(elem_id_ptr(self)) as u32 }}
pub fn get_numid(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_numid(elem_id_ptr(self)) as u32 }}
pub fn get_index(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_index(elem_id_ptr(self)) as u32 }}
pub fn get_interface(&self) -> ElemIface { ElemIface::from_c_int(
unsafe { alsa::snd_ctl_elem_id_get_interface(elem_id_ptr(self)) } as c_int, "snd_ctl_elem_id_get_interface").unwrap() }
pub fn set_device(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_set_device(elem_id_ptr(self), v) }}
pub fn set_subdevice(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_set_subdevice(elem_id_ptr(self), v) }}
pub fn set_numid(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_set_numid(elem_id_ptr(self), v) }}
pub fn set_index(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_set_index(elem_id_ptr(self), v) }}
pub fn set_interface(&mut self, v: ElemIface) { unsafe { alsa::snd_ctl_elem_id_set_interface(elem_id_ptr(self), v as u32) }}
pub fn set_name(&mut self, v: &CStr) { unsafe { alsa::snd_ctl_elem_id_set_name(elem_id_ptr(self), v.as_ptr()) }}
/// Creates a new ElemId.
///
/// To ensure safety (i e make sure we never have an invalid interface enum), we need to supply it to the "new" function.
pub fn new(iface: ElemIface) -> Self {
let mut r = elem_id_new().unwrap();
r.set_interface(iface);
r
}
}
impl cmp::Eq for ElemId {}
impl cmp::PartialEq for ElemId {
fn eq(&self, a: &ElemId) -> bool {
self.get_numid() == a.get_numid() && self.get_interface() == a.get_interface() &&
self.get_index() == a.get_index() && self.get_device() == a.get_device() &&
self.get_subdevice() == a.get_subdevice() && self.get_name().ok() == a.get_name().ok()
}
}
impl fmt::Debug for ElemId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let index = self.get_index();
let device = self.get_device();
let subdevice = self.get_subdevice();
write!(f, "ElemId(#{}, {:?}, {:?}", self.get_numid(), self.get_interface(), self.get_name())?;
if index > 0 { write!(f, ", index={}", index)? };
if device > 0 || subdevice > 0 { write!(f, ", device={}", device)? };
if subdevice > 0 { write!(f, ", subdevice={}", device)? };
write!(f, ")")
}
}
/// [snd_ctl_elem_list_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct ElemList(*mut alsa::snd_ctl_elem_list_t);
impl Drop for ElemList {
fn drop(&mut self) {
unsafe { alsa::snd_ctl_elem_list_free_space(self.0) };
unsafe { alsa::snd_ctl_elem_list_free(self.0) };
}
}
fn elem_list_new<F: FnOnce(&ElemList) -> Result<u32>>(f: F) -> Result<ElemList> {
let mut p = ptr::null_mut();
let list = acheck!(snd_ctl_elem_list_malloc(&mut p)).map(|_| ElemList(p))?;
let count = f(&list)?;
if count > 0 {
acheck!(snd_ctl_elem_list_alloc_space(list.0, count))?;
}
Ok(list)
}
impl ElemList {
#[inline]
fn ensure_valid_index(&self, index: u32) -> Result<()> {
if index >= self.get_used() {
Err(Error::new("snd_ctl_elem_list_*", libc::EINVAL))
} else {
Ok(())
}
}
pub(crate) fn get_count(&self) -> u32 { unsafe { alsa::snd_ctl_elem_list_get_count(self.0) } }
pub fn get_used(&self) -> u32 { unsafe { alsa::snd_ctl_elem_list_get_used(self.0) } }
pub fn get_id(&self, index: u32) -> Result<ElemId> {
self.ensure_valid_index(index)?;
let elem_id = elem_id_new()?;
unsafe { alsa::snd_ctl_elem_list_get_id(self.0, index, elem_id_ptr(&elem_id)) };
Ok(elem_id)
}
pub fn get_numid(&self, index: u32) -> Result<u32> { self.ensure_valid_index(index)?; Ok(unsafe { alsa::snd_ctl_elem_list_get_numid(self.0, index) }) }
pub fn get_interface(&self, index: u32) -> Result<ElemIface> {
self.ensure_valid_index(index)?;
ElemIface::from_c_int(unsafe { alsa::snd_ctl_elem_list_get_interface(self.0, index) } as c_int, "snd_ctl_elem_list_get_interface")
}
pub fn get_device(&self, index: u32) -> Result<u32> { self.ensure_valid_index(index)?; Ok(unsafe { alsa::snd_ctl_elem_list_get_device(self.0, index) }) }
pub fn get_subdevice(&self, index: u32) -> Result<u32> { self.ensure_valid_index(index)?; Ok(unsafe { alsa::snd_ctl_elem_list_get_subdevice(self.0, index) }) }
pub fn get_name(&self, index: u32) -> Result<&str> {
self.ensure_valid_index(index)?;
from_const("snd_ctl_elem_list_get_name", unsafe { alsa::snd_ctl_elem_list_get_name(self.0, index) })
}
pub fn get_index(&self, index: u32) -> Result<u32> { self.ensure_valid_index(index)?; Ok(unsafe { alsa::snd_ctl_elem_list_get_index(self.0, index) }) }
}
/// [snd_ctl_event_t](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct Event(*mut alsa::snd_ctl_event_t);
impl Drop for Event {
fn drop(&mut self) { unsafe { alsa::snd_ctl_event_free(self.0) }; }
}
pub fn event_new() -> Result<Event> {
let mut p = ptr::null_mut();
acheck!(snd_ctl_event_malloc(&mut p)).map(|_| Event(p))
}
impl Event {
pub fn get_mask(&self) -> EventMask { EventMask(unsafe { alsa::snd_ctl_event_elem_get_mask(self.0) as u32 })}
pub fn get_id(&self) -> ElemId {
let r = elem_id_new().unwrap();
unsafe { alsa::snd_ctl_event_elem_get_id(self.0, elem_id_ptr(&r)) };
r
}
}
/// [SND_CTL_EVENT_MASK_XXX](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) bitmask
#[derive(Default, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct EventMask(pub u32);
impl EventMask {
pub fn remove(&self) -> bool { return self.0 & 0xffffffff == 0xffffffff }
pub fn value(&self) -> bool { return (!self.remove()) && (self.0 & (1 << 0) != 0); }
pub fn info(&self) -> bool { return (!self.remove()) && (self.0 & (1 << 1) != 0); }
pub fn add(&self) -> bool { return (!self.remove()) && (self.0 & (1 << 2) != 0); }
pub fn tlv(&self) -> bool { return (!self.remove()) && (self.0 & (1 << 3) != 0); }
}
#[test]
fn print_sizeof() {
extern crate std;
let elemid = unsafe { alsa::snd_ctl_elem_id_sizeof() } as usize;
let elemvalue = unsafe { alsa::snd_ctl_elem_value_sizeof() } as usize;
let eleminfo = unsafe { alsa::snd_ctl_elem_info_sizeof() } as usize;
assert!(elemid <= ELEM_ID_SIZE);
// assert!(elemvalue <= ELEM_VALUE_SIZE);
// assert!(eleminfo <= ELEM_INFO_SIZE);
std::println!("Elem id: {}, Elem value: {}, Elem info: {}", elemid, elemvalue, eleminfo);
}
================================================
FILE: src/device_name.rs
================================================
//! Enumerate devices in the alsa library configuration
//!
//! # Example
//! Print all devices found in various categories.
//!
//! ```
//! use std::ffi::CString;
//! use alsa::device_name::HintIter;
//!
//! for t in &["pcm", "ctl", "rawmidi", "timer", "seq", "hwdep"] {
//! println!("{} devices:", t);
//! let i = HintIter::new(None, &*CString::new(*t).unwrap()).unwrap();
//! for a in i { println!(" {:?}", a) }
//! }
//! ```
use core::ptr;
use libc::{c_void, c_int};
use crate::alsa;
use super::{Card, Direction};
use super::error::*;
use core::ffi::CStr;
use ::alloc::ffi::CString;
use ::alloc::string::String;
/// [snd_device_name_hint](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug)]
pub struct HintIter(*mut *mut c_void, isize);
impl Drop for HintIter {
fn drop(&mut self) { unsafe { alsa::snd_device_name_free_hint(self.0); }}
}
impl HintIter {
/// typical interfaces are: "pcm", "ctl", "rawmidi", "timer", "seq" and "hwdep".
pub fn new(card: Option<&Card>, iface: &CStr) -> Result<HintIter> {
let mut p = ptr::null_mut();
let cnr = card.map(|c| c.get_index()).unwrap_or(-1) as c_int;
acheck!(snd_device_name_hint(cnr, iface.as_ptr(), &mut p))
.map(|_| HintIter(p, 0))
}
/// A constructor variant that takes the interface as a Rust string slice.
pub fn new_str(card: Option<&Card>, iface: &str) -> Result<HintIter> {
HintIter::new(card, &CString::new(iface).unwrap())
}
}
impl Iterator for HintIter {
type Item = Hint;
fn next(&mut self) -> Option<Hint> {
if self.0.is_null() { return None; }
let p = unsafe { *self.0.offset(self.1) };
if p.is_null() { return None; }
self.1 += 1;
Some(Hint::new(p))
}
}
/// [snd_device_name_get_hint](http://www.alsa-project.org/alsa-doc/alsa-lib/group___control.html) wrapper
#[derive(Debug, Clone)]
pub struct Hint {
pub name: Option<String>,
pub desc: Option<String>,
pub direction: Option<Direction>,
}
impl Hint {
fn get_str(p: *const c_void, name: &str) -> Option<String> {
let name = CString::new(name).unwrap();
let c = unsafe { alsa::snd_device_name_get_hint(p, name.as_ptr()) };
from_alloc("snd_device_name_get_hint", c).ok()
}
fn new(p: *const c_void) -> Hint {
let d = Hint::get_str(p, "IOID").and_then(|x| match &*x {
"Input" => Some(Direction::Capture),
"Output" => Some(Direction::Playback),
_ => None,
});
Hint { name: Hint::get_str(p, "NAME"), desc: Hint::get_str(p, "DESC"), direction: d }
}
}
#[test]
fn print_hints() {
extern crate std;
for t in &["pcm", "ctl", "rawmidi", "timer", "seq", "hwdep"] {
std::println!("{} devices:", t);
let i = HintIter::new(None, &*CString::new(*t).unwrap()).unwrap();
for a in i { std::println!(" {:?}", a) }
}
}
================================================
FILE: src/direct/asound_ioctl.rs
================================================
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
storage: Storage,
align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn new(storage: Storage) -> Self {
Self { storage, align: [] }
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
let bit_index = index % 8;
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = index % 8;
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
}
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
val |= 1 << i;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
self.set_bit(i + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub fn new() -> Self {
__IncompleteArrayField(::core::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ptr(&self) -> *const T {
::core::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
::core::mem::transmute(self)
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::core::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
impl<T> ::core::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
}
}
impl<T> ::core::marker::Copy for __IncompleteArrayField<T> {}
pub const __BITS_PER_LONG: u32 = 64;
pub const __FD_SETSIZE: u32 = 1024;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_ISO_10646__: u32 = 201505;
pub const __STDC_NO_THREADS__: u32 = 1;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 23;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const _STDLIB_H: u32 = 1;
pub const WNOHANG: u32 = 1;
pub const WUNTRACED: u32 = 2;
pub const WSTOPPED: u32 = 2;
pub const WEXITED: u32 = 4;
pub const WCONTINUED: u32 = 8;
pub const WNOWAIT: u32 = 16777216;
pub const __WNOTHREAD: u32 = 536870912;
pub const __WALL: u32 = 1073741824;
pub const __WCLONE: u32 = 2147483648;
pub const __ENUM_IDTYPE_T: u32 = 1;
pub const __W_CONTINUED: u32 = 65535;
pub const __WCOREFLAG: u32 = 128;
pub const _ENDIAN_H: u32 = 1;
pub const __LITTLE_ENDIAN: u32 = 1234;
pub const __BIG_ENDIAN: u32 = 4321;
pub const __PDP_ENDIAN: u32 = 3412;
pub const __BYTE_ORDER: u32 = 1234;
pub const __FLOAT_WORD_ORDER: u32 = 1234;
pub const LITTLE_ENDIAN: u32 = 1234;
pub const BIG_ENDIAN: u32 = 4321;
pub const PDP_ENDIAN: u32 = 3412;
pub const BYTE_ORDER: u32 = 1234;
pub const _BITS_BYTESWAP_H: u32 = 1;
pub const _BITS_TYPES_H: u32 = 1;
pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __ldiv_t_defined: u32 = 1;
pub const __lldiv_t_defined: u32 = 1;
pub const RAND_MAX: u32 = 2147483647;
pub const EXIT_FAILURE: u32 = 1;
pub const EXIT_SUCCESS: u32 = 0;
pub const _SYS_TYPES_H: u32 = 1;
pub const __clock_t_defined: u32 = 1;
pub const __time_t_defined: u32 = 1;
pub const __clockid_t_defined: u32 = 1;
pub const __timer_t_defined: u32 = 1;
pub const __BIT_TYPES_DEFINED__: u32 = 1;
pub const _SYS_SELECT_H: u32 = 1;
pub const __FD_ZERO_STOS: &'static [u8; 6usize] = b"stosq\0";
pub const _SIGSET_H_types: u32 = 1;
pub const __timespec_defined: u32 = 1;
pub const _STRUCT_TIMEVAL: u32 = 1;
pub const FD_SETSIZE: u32 = 1024;
pub const _SYS_SYSMACROS_H: u32 = 1;
pub const _BITS_PTHREADTYPES_H: u32 = 1;
pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4;
pub const __SIZEOF_PTHREAD_COND_T: u32 = 48;
pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8;
pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4;
pub const __have_pthread_attr_t: u32 = 1;
pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1;
pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1;
pub const _ALLOCA_H: u32 = 1;
pub const SNDRV_PCM_INFO_MMAP: u32 = 1;
pub const SNDRV_PCM_INFO_MMAP_VALID: u32 = 2;
pub const SNDRV_PCM_INFO_DOUBLE: u32 = 4;
pub const SNDRV_PCM_INFO_BATCH: u32 = 16;
pub const SNDRV_PCM_INFO_SYNC_APPLPTR: u32 = 32;
pub const SNDRV_PCM_INFO_INTERLEAVED: u32 = 256;
pub const SNDRV_PCM_INFO_NONINTERLEAVED: u32 = 512;
pub const SNDRV_PCM_INFO_COMPLEX: u32 = 1024;
pub const SNDRV_PCM_INFO_BLOCK_TRANSFER: u32 = 65536;
pub const SNDRV_PCM_INFO_OVERRANGE: u32 = 131072;
pub const SNDRV_PCM_INFO_RESUME: u32 = 262144;
pub const SNDRV_PCM_INFO_PAUSE: u32 = 524288;
pub const SNDRV_PCM_INFO_HALF_DUPLEX: u32 = 1048576;
pub const SNDRV_PCM_INFO_JOINT_DUPLEX: u32 = 2097152;
pub const SNDRV_PCM_INFO_SYNC_START: u32 = 4194304;
pub const SNDRV_PCM_INFO_NO_PERIOD_WAKEUP: u32 = 8388608;
pub const SNDRV_PCM_INFO_HAS_WALL_CLOCK: u32 = 16777216;
pub const SNDRV_PCM_INFO_HAS_LINK_ATIME: u32 = 16777216;
pub const SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME: u32 = 33554432;
pub const SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME: u32 = 67108864;
pub const SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME: u32 = 134217728;
pub const SNDRV_PCM_INFO_DRAIN_TRIGGER: u32 = 1073741824;
pub const SNDRV_PCM_INFO_FIFO_IN_FRAMES: u32 = 2147483648;
pub const SNDRV_PCM_HW_PARAM_ACCESS: u32 = 0;
pub const SNDRV_PCM_HW_PARAM_FORMAT: u32 = 1;
pub const SNDRV_PCM_HW_PARAM_SUBFORMAT: u32 = 2;
pub const SNDRV_PCM_HW_PARAM_FIRST_MASK: u32 = 0;
pub const SNDRV_PCM_HW_PARAM_LAST_MASK: u32 = 2;
pub const SNDRV_PCM_HW_PARAM_SAMPLE_BITS: u32 = 8;
pub const SNDRV_PCM_HW_PARAM_FRAME_BITS: u32 = 9;
pub const SNDRV_PCM_HW_PARAM_CHANNELS: u32 = 10;
pub const SNDRV_PCM_HW_PARAM_RATE: u32 = 11;
pub const SNDRV_PCM_HW_PARAM_PERIOD_TIME: u32 = 12;
pub const SNDRV_PCM_HW_PARAM_PERIOD_SIZE: u32 = 13;
pub const SNDRV_PCM_HW_PARAM_PERIOD_BYTES: u32 = 14;
pub const SNDRV_PCM_HW_PARAM_PERIODS: u32 = 15;
pub const SNDRV_PCM_HW_PARAM_BUFFER_TIME: u32 = 16;
pub const SNDRV_PCM_HW_PARAM_BUFFER_SIZE: u32 = 17;
pub const SNDRV_PCM_HW_PARAM_BUFFER_BYTES: u32 = 18;
pub const SNDRV_PCM_HW_PARAM_TICK_TIME: u32 = 19;
pub const SNDRV_PCM_HW_PARAM_FIRST_INTERVAL: u32 = 8;
pub const SNDRV_PCM_HW_PARAM_LAST_INTERVAL: u32 = 19;
pub const SNDRV_PCM_HW_PARAMS_NORESAMPLE: u32 = 1;
pub const SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER: u32 = 2;
pub const SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP: u32 = 4;
pub const SNDRV_MASK_MAX: u32 = 256;
pub const SNDRV_PCM_SYNC_PTR_HWSYNC: u32 = 1;
pub const SNDRV_PCM_SYNC_PTR_APPL: u32 = 2;
pub const SNDRV_PCM_SYNC_PTR_AVAIL_MIN: u32 = 4;
pub const SNDRV_CHMAP_POSITION_MASK: u32 = 65535;
pub const SNDRV_CHMAP_PHASE_INVERSE: u32 = 65536;
pub const SNDRV_CHMAP_DRIVER_SPEC: u32 = 131072;
pub const SNDRV_RAWMIDI_INFO_OUTPUT: u32 = 1;
pub const SNDRV_RAWMIDI_INFO_INPUT: u32 = 2;
pub const SNDRV_RAWMIDI_INFO_DUPLEX: u32 = 4;
pub const SNDRV_TIMER_GLOBAL_SYSTEM: u32 = 0;
pub const SNDRV_TIMER_GLOBAL_RTC: u32 = 1;
pub const SNDRV_TIMER_GLOBAL_HPET: u32 = 2;
pub const SNDRV_TIMER_GLOBAL_HRTIMER: u32 = 3;
pub const SNDRV_TIMER_FLG_SLAVE: u32 = 1;
pub const SNDRV_TIMER_PSFLG_AUTO: u32 = 1;
pub const SNDRV_TIMER_PSFLG_EXCLUSIVE: u32 = 2;
pub const SNDRV_TIMER_PSFLG_EARLY_EVENT: u32 = 4;
pub const SNDRV_CTL_ELEM_ACCESS_READ: u32 = 1;
pub const SNDRV_CTL_ELEM_ACCESS_WRITE: u32 = 2;
pub const SNDRV_CTL_ELEM_ACCESS_READWRITE: u32 = 3;
pub const SNDRV_CTL_ELEM_ACCESS_VOLATILE: u32 = 4;
pub const SNDRV_CTL_ELEM_ACCESS_TIMESTAMP: u32 = 8;
pub const SNDRV_CTL_ELEM_ACCESS_TLV_READ: u32 = 16;
pub const SNDRV_CTL_ELEM_ACCESS_TLV_WRITE: u32 = 32;
pub const SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE: u32 = 48;
pub const SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND: u32 = 64;
pub const SNDRV_CTL_ELEM_ACCESS_INACTIVE: u32 = 256;
pub const SNDRV_CTL_ELEM_ACCESS_LOCK: u32 = 512;
pub const SNDRV_CTL_ELEM_ACCESS_OWNER: u32 = 1024;
pub const SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK: u32 = 268435456;
pub const SNDRV_CTL_ELEM_ACCESS_USER: u32 = 536870912;
pub const SNDRV_CTL_POWER_D0: u32 = 0;
pub const SNDRV_CTL_POWER_D1: u32 = 256;
pub const SNDRV_CTL_POWER_D2: u32 = 512;
pub const SNDRV_CTL_POWER_D3: u32 = 768;
pub const SNDRV_CTL_POWER_D3hot: u32 = 768;
pub const SNDRV_CTL_POWER_D3cold: u32 = 769;
pub const SNDRV_CTL_ELEM_ID_NAME_MAXLEN: u32 = 44;
pub const SNDRV_CTL_EVENT_MASK_VALUE: u32 = 1;
pub const SNDRV_CTL_EVENT_MASK_INFO: u32 = 2;
pub const SNDRV_CTL_EVENT_MASK_ADD: u32 = 4;
pub const SNDRV_CTL_EVENT_MASK_TLV: u32 = 8;
pub const SNDRV_CTL_EVENT_MASK_REMOVE: i32 = -1;
pub const SNDRV_CTL_NAME_NONE: &'static [u8; 1usize] = b"\0";
pub const SNDRV_CTL_NAME_PLAYBACK: &'static [u8; 10usize] = b"Playback \0";
pub const SNDRV_CTL_NAME_CAPTURE: &'static [u8; 9usize] = b"Capture \0";
pub const SNDRV_CTL_NAME_IEC958_NONE: &'static [u8; 1usize] = b"\0";
pub const SNDRV_CTL_NAME_IEC958_SWITCH: &'static [u8; 7usize] = b"Switch\0";
pub const SNDRV_CTL_NAME_IEC958_VOLUME: &'static [u8; 7usize] = b"Volume\0";
pub const SNDRV_CTL_NAME_IEC958_DEFAULT: &'static [u8; 8usize] = b"Default\0";
pub const SNDRV_CTL_NAME_IEC958_MASK: &'static [u8; 5usize] = b"Mask\0";
pub const SNDRV_CTL_NAME_IEC958_CON_MASK: &'static [u8; 9usize] = b"Con Mask\0";
pub const SNDRV_CTL_NAME_IEC958_PRO_MASK: &'static [u8; 9usize] = b"Pro Mask\0";
pub const SNDRV_CTL_NAME_IEC958_PCM_STREAM: &'static [u8; 11usize] = b"PCM Stream\0";
pub type __s8 = ::core::ffi::c_schar;
pub type __u8 = ::core::ffi::c_uchar;
pub type __s16 = ::core::ffi::c_short;
pub type __u16 = ::core::ffi::c_ushort;
pub type __s32 = ::core::ffi::c_int;
pub type __u32 = ::core::ffi::c_uint;
pub type __s64 = ::core::ffi::c_longlong;
pub type __u64 = ::core::ffi::c_ulonglong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_fd_set {
pub fds_bits: [::core::ffi::c_ulong; 16usize],
}
#[test]
fn bindgen_test_layout___kernel_fd_set() {
assert_eq!(
::core::mem::size_of::<__kernel_fd_set>(),
128usize,
concat!("Size of: ", stringify!(__kernel_fd_set))
);
assert_eq!(
::core::mem::align_of::<__kernel_fd_set>(),
8usize,
concat!("Alignment of ", stringify!(__kernel_fd_set))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__kernel_fd_set),
"::",
stringify!(fds_bits)
)
);
}
pub type __kernel_sighandler_t =
::core::option::Option<unsafe extern "C" fn(arg1: ::core::ffi::c_int)>;
pub type __kernel_key_t = ::core::ffi::c_int;
pub type __kernel_mqd_t = ::core::ffi::c_int;
pub type __kernel_old_uid_t = ::core::ffi::c_ushort;
pub type __kernel_old_gid_t = ::core::ffi::c_ushort;
pub type __kernel_old_dev_t = ::core::ffi::c_ulong;
pub type __kernel_long_t = ::core::ffi::c_long;
pub type __kernel_ulong_t = ::core::ffi::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = ::core::ffi::c_uint;
pub type __kernel_pid_t = ::core::ffi::c_int;
pub type __kernel_ipc_pid_t = ::core::ffi::c_int;
pub type __kernel_uid_t = ::core::ffi::c_uint;
pub type __kernel_gid_t = ::core::ffi::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = ::core::ffi::c_int;
pub type __kernel_uid32_t = ::core::ffi::c_uint;
pub type __kernel_gid32_t = ::core::ffi::c_uint;
pub type __kernel_size_t = __kernel_ulong_t;
pub type __kernel_ssize_t = __kernel_long_t;
pub type __kernel_ptrdiff_t = __kernel_long_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_fsid_t {
pub val: [::core::ffi::c_int; 2usize],
}
#[test]
fn bindgen_test_layout___kernel_fsid_t() {
assert_eq!(
::core::mem::size_of::<__kernel_fsid_t>(),
8usize,
concat!("Size of: ", stringify!(__kernel_fsid_t))
);
assert_eq!(
::core::mem::align_of::<__kernel_fsid_t>(),
4usize,
concat!("Alignment of ", stringify!(__kernel_fsid_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__kernel_fsid_t),
"::",
stringify!(val)
)
);
}
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = ::core::ffi::c_longlong;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = ::core::ffi::c_int;
pub type __kernel_clockid_t = ::core::ffi::c_int;
pub type __kernel_caddr_t = *mut ::core::ffi::c_char;
pub type __kernel_uid16_t = ::core::ffi::c_ushort;
pub type __kernel_gid16_t = ::core::ffi::c_ushort;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type wchar_t = ::core::ffi::c_int;
pub const idtype_t_P_ALL: idtype_t = 0;
pub const idtype_t_P_PID: idtype_t = 1;
pub const idtype_t_P_PGID: idtype_t = 2;
pub type idtype_t = u32;
pub type __u_char = ::core::ffi::c_uchar;
pub type __u_short = ::core::ffi::c_ushort;
pub type __u_int = ::core::ffi::c_uint;
pub type __u_long = ::core::ffi::c_ulong;
pub type __int8_t = ::core::ffi::c_schar;
pub type __uint8_t = ::core::ffi::c_uchar;
pub type __int16_t = ::core::ffi::c_short;
pub type __uint16_t = ::core::ffi::c_ushort;
pub type __int32_t = ::core::ffi::c_int;
pub type __uint32_t = ::core::ffi::c_uint;
pub type __int64_t = ::core::ffi::c_long;
pub type __uint64_t = ::core::ffi::c_ulong;
pub type __quad_t = ::core::ffi::c_long;
pub type __u_quad_t = ::core::ffi::c_ulong;
pub type __dev_t = ::core::ffi::c_ulong;
pub type __uid_t = ::core::ffi::c_uint;
pub type __gid_t = ::core::ffi::c_uint;
pub type __ino_t = ::core::ffi::c_ulong;
pub type __ino64_t = ::core::ffi::c_ulong;
pub type __mode_t = ::core::ffi::c_uint;
pub type __nlink_t = ::core::ffi::c_ulong;
pub type __off_t = ::core::ffi::c_long;
pub type __off64_t = ::core::ffi::c_long;
pub type __pid_t = ::core::ffi::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __fsid_t {
pub __val: [::core::ffi::c_int; 2usize],
}
#[test]
fn bindgen_test_layout___fsid_t() {
assert_eq!(
::core::mem::size_of::<__fsid_t>(),
8usize,
concat!("Size of: ", stringify!(__fsid_t))
);
assert_eq!(
::core::mem::align_of::<__fsid_t>(),
4usize,
concat!("Alignment of ", stringify!(__fsid_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__fsid_t>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__fsid_t),
"::",
stringify!(__val)
)
);
}
pub type __clock_t = ::core::ffi::c_long;
pub type __rlim_t = ::core::ffi::c_ulong;
pub type __rlim64_t = ::core::ffi::c_ulong;
pub type __id_t = ::core::ffi::c_uint;
pub type __time_t = ::core::ffi::c_long;
pub type __useconds_t = ::core::ffi::c_uint;
pub type __suseconds_t = ::core::ffi::c_long;
pub type __daddr_t = ::core::ffi::c_int;
pub type __key_t = ::core::ffi::c_int;
pub type __clockid_t = ::core::ffi::c_int;
pub type __timer_t = *mut ::core::ffi::c_void;
pub type __blksize_t = ::core::ffi::c_long;
pub type __blkcnt_t = ::core::ffi::c_long;
pub type __blkcnt64_t = ::core::ffi::c_long;
pub type __fsblkcnt_t = ::core::ffi::c_ulong;
pub type __fsblkcnt64_t = ::core::ffi::c_ulong;
pub type __fsfilcnt_t = ::core::ffi::c_ulong;
pub type __fsfilcnt64_t = ::core::ffi::c_ulong;
pub type __fsword_t = ::core::ffi::c_long;
pub type __ssize_t = ::core::ffi::c_long;
pub type __syscall_slong_t = ::core::ffi::c_long;
pub type __syscall_ulong_t = ::core::ffi::c_ulong;
pub type __loff_t = __off64_t;
pub type __qaddr_t = *mut __quad_t;
pub type __caddr_t = *mut ::core::ffi::c_char;
pub type __intptr_t = ::core::ffi::c_long;
pub type __socklen_t = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub union wait {
pub w_status: ::core::ffi::c_int,
pub __wait_terminated: wait__bindgen_ty_1,
pub __wait_stopped: wait__bindgen_ty_2,
_bindgen_union_align: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wait__bindgen_ty_1 {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
pub __bindgen_align: [u32; 0usize],
}
#[test]
fn bindgen_test_layout_wait__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<wait__bindgen_ty_1>(),
4usize,
concat!("Size of: ", stringify!(wait__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<wait__bindgen_ty_1>(),
4usize,
concat!("Alignment of ", stringify!(wait__bindgen_ty_1))
);
}
impl wait__bindgen_ty_1 {
#[inline]
pub fn __w_termsig(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) }
}
#[inline]
pub fn set___w_termsig(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 7u8, val as u64)
}
}
#[inline]
pub fn __w_coredump(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
}
#[inline]
pub fn set___w_coredump(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(7usize, 1u8, val as u64)
}
}
#[inline]
pub fn __w_retcode(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) }
}
#[inline]
pub fn set___w_retcode(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 8u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
__w_termsig: ::core::ffi::c_uint,
__w_coredump: ::core::ffi::c_uint,
__w_retcode: ::core::ffi::c_uint,
) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 7u8, {
let __w_termsig: u32 = unsafe { ::core::mem::transmute(__w_termsig) };
__w_termsig as u64
});
__bindgen_bitfield_unit.set(7usize, 1u8, {
let __w_coredump: u32 = unsafe { ::core::mem::transmute(__w_coredump) };
__w_coredump as u64
});
__bindgen_bitfield_unit.set(8usize, 8u8, {
let __w_retcode: u32 = unsafe { ::core::mem::transmute(__w_retcode) };
__w_retcode as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct wait__bindgen_ty_2 {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
pub __bindgen_align: [u32; 0usize],
}
#[test]
fn bindgen_test_layout_wait__bindgen_ty_2() {
assert_eq!(
::core::mem::size_of::<wait__bindgen_ty_2>(),
4usize,
concat!("Size of: ", stringify!(wait__bindgen_ty_2))
);
assert_eq!(
::core::mem::align_of::<wait__bindgen_ty_2>(),
4usize,
concat!("Alignment of ", stringify!(wait__bindgen_ty_2))
);
}
impl wait__bindgen_ty_2 {
#[inline]
pub fn __w_stopval(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) }
}
#[inline]
pub fn set___w_stopval(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 8u8, val as u64)
}
}
#[inline]
pub fn __w_stopsig(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) }
}
#[inline]
pub fn set___w_stopsig(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(8usize, 8u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
__w_stopval: ::core::ffi::c_uint,
__w_stopsig: ::core::ffi::c_uint,
) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 8u8, {
let __w_stopval: u32 = unsafe { ::core::mem::transmute(__w_stopval) };
__w_stopval as u64
});
__bindgen_bitfield_unit.set(8usize, 8u8, {
let __w_stopsig: u32 = unsafe { ::core::mem::transmute(__w_stopsig) };
__w_stopsig as u64
});
__bindgen_bitfield_unit
}
}
#[test]
fn bindgen_test_layout_wait() {
assert_eq!(
::core::mem::size_of::<wait>(),
4usize,
concat!("Size of: ", stringify!(wait))
);
assert_eq!(
::core::mem::align_of::<wait>(),
4usize,
concat!("Alignment of ", stringify!(wait))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<wait>())).w_status as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(wait),
"::",
stringify!(w_status)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<wait>())).__wait_terminated as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(wait),
"::",
stringify!(__wait_terminated)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<wait>())).__wait_stopped as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(wait),
"::",
stringify!(__wait_stopped)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union __WAIT_STATUS {
pub __uptr: *mut wait,
pub __iptr: *mut ::core::ffi::c_int,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout___WAIT_STATUS() {
assert_eq!(
::core::mem::size_of::<__WAIT_STATUS>(),
8usize,
concat!("Size of: ", stringify!(__WAIT_STATUS))
);
assert_eq!(
::core::mem::align_of::<__WAIT_STATUS>(),
8usize,
concat!("Alignment of ", stringify!(__WAIT_STATUS))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__WAIT_STATUS>())).__uptr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__WAIT_STATUS),
"::",
stringify!(__uptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__WAIT_STATUS>())).__iptr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__WAIT_STATUS),
"::",
stringify!(__iptr)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct div_t {
pub quot: ::core::ffi::c_int,
pub rem: ::core::ffi::c_int,
}
#[test]
fn bindgen_test_layout_div_t() {
assert_eq!(
::core::mem::size_of::<div_t>(),
8usize,
concat!("Size of: ", stringify!(div_t))
);
assert_eq!(
::core::mem::align_of::<div_t>(),
4usize,
concat!("Alignment of ", stringify!(div_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<div_t>())).quot as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(div_t),
"::",
stringify!(quot)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<div_t>())).rem as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(div_t),
"::",
stringify!(rem)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ldiv_t {
pub quot: ::core::ffi::c_long,
pub rem: ::core::ffi::c_long,
}
#[test]
fn bindgen_test_layout_ldiv_t() {
assert_eq!(
::core::mem::size_of::<ldiv_t>(),
16usize,
concat!("Size of: ", stringify!(ldiv_t))
);
assert_eq!(
::core::mem::align_of::<ldiv_t>(),
8usize,
concat!("Alignment of ", stringify!(ldiv_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<ldiv_t>())).quot as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ldiv_t),
"::",
stringify!(quot)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<ldiv_t>())).rem as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ldiv_t),
"::",
stringify!(rem)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct lldiv_t {
pub quot: ::core::ffi::c_longlong,
pub rem: ::core::ffi::c_longlong,
}
#[test]
fn bindgen_test_layout_lldiv_t() {
assert_eq!(
::core::mem::size_of::<lldiv_t>(),
16usize,
concat!("Size of: ", stringify!(lldiv_t))
);
assert_eq!(
::core::mem::align_of::<lldiv_t>(),
8usize,
concat!("Alignment of ", stringify!(lldiv_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<lldiv_t>())).quot as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lldiv_t),
"::",
stringify!(quot)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<lldiv_t>())).rem as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(lldiv_t),
"::",
stringify!(rem)
)
);
}
extern "C" {
pub fn __ctype_get_mb_cur_max() -> usize;
}
extern "C" {
pub fn atof(__nptr: *const ::core::ffi::c_char) -> f64;
}
extern "C" {
pub fn atoi(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn atol(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
}
extern "C" {
pub fn atoll(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_longlong;
}
extern "C" {
pub fn strtod(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
) -> f64;
}
extern "C" {
pub fn strtof(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
) -> f32;
}
extern "C" {
pub fn strtold(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
) -> f64;
}
extern "C" {
pub fn strtol(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_long;
}
extern "C" {
pub fn strtoul(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_ulong;
}
extern "C" {
pub fn strtoq(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_longlong;
}
extern "C" {
pub fn strtouq(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_ulonglong;
}
extern "C" {
pub fn strtoll(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_longlong;
}
extern "C" {
pub fn strtoull(
__nptr: *const ::core::ffi::c_char,
__endptr: *mut *mut ::core::ffi::c_char,
__base: ::core::ffi::c_int,
) -> ::core::ffi::c_ulonglong;
}
extern "C" {
pub fn l64a(__n: ::core::ffi::c_long) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn a64l(__s: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
}
pub type u_char = __u_char;
pub type u_short = __u_short;
pub type u_int = __u_int;
pub type u_long = __u_long;
pub type quad_t = __quad_t;
pub type u_quad_t = __u_quad_t;
pub type fsid_t = __fsid_t;
pub type loff_t = __loff_t;
pub type ino_t = __ino_t;
pub type dev_t = __dev_t;
pub type gid_t = __gid_t;
pub type mode_t = __mode_t;
pub type nlink_t = __nlink_t;
pub type uid_t = __uid_t;
pub type off_t = __off_t;
pub type pid_t = __pid_t;
pub type id_t = __id_t;
pub type daddr_t = __daddr_t;
pub type caddr_t = __caddr_t;
pub type key_t = __key_t;
pub type clock_t = __clock_t;
pub type time_t = __time_t;
pub type clockid_t = __clockid_t;
pub type timer_t = __timer_t;
pub type ulong = ::core::ffi::c_ulong;
pub type ushort = ::core::ffi::c_ushort;
pub type uint = ::core::ffi::c_uint;
pub type u_int8_t = ::core::ffi::c_uchar;
pub type u_int16_t = ::core::ffi::c_ushort;
pub type u_int32_t = ::core::ffi::c_uint;
pub type u_int64_t = ::core::ffi::c_ulong;
pub type register_t = ::core::ffi::c_long;
pub type __sig_atomic_t = ::core::ffi::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __sigset_t {
pub __val: [::core::ffi::c_ulong; 16usize],
}
#[test]
fn bindgen_test_layout___sigset_t() {
assert_eq!(
::core::mem::size_of::<__sigset_t>(),
128usize,
concat!("Size of: ", stringify!(__sigset_t))
);
assert_eq!(
::core::mem::align_of::<__sigset_t>(),
8usize,
concat!("Alignment of ", stringify!(__sigset_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__sigset_t>())).__val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__sigset_t),
"::",
stringify!(__val)
)
);
}
pub type sigset_t = __sigset_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timespec {
pub tv_sec: __time_t,
pub tv_nsec: __syscall_slong_t,
}
#[test]
fn bindgen_test_layout_timespec() {
assert_eq!(
::core::mem::size_of::<timespec>(),
16usize,
concat!("Size of: ", stringify!(timespec))
);
assert_eq!(
::core::mem::align_of::<timespec>(),
8usize,
concat!("Alignment of ", stringify!(timespec))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<timespec>())).tv_sec as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<timespec>())).tv_nsec as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_nsec)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct timeval {
pub tv_sec: __time_t,
pub tv_usec: __suseconds_t,
}
#[test]
fn bindgen_test_layout_timeval() {
assert_eq!(
::core::mem::size_of::<timeval>(),
16usize,
concat!("Size of: ", stringify!(timeval))
);
assert_eq!(
::core::mem::align_of::<timeval>(),
8usize,
concat!("Alignment of ", stringify!(timeval))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<timeval>())).tv_sec as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<timeval>())).tv_usec as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_usec)
)
);
}
pub type suseconds_t = __suseconds_t;
pub type __fd_mask = ::core::ffi::c_long;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fd_set {
pub __fds_bits: [__fd_mask; 16usize],
}
#[test]
fn bindgen_test_layout_fd_set() {
assert_eq!(
::core::mem::size_of::<fd_set>(),
128usize,
concat!("Size of: ", stringify!(fd_set))
);
assert_eq!(
::core::mem::align_of::<fd_set>(),
8usize,
concat!("Alignment of ", stringify!(fd_set))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<fd_set>())).__fds_bits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(fd_set),
"::",
stringify!(__fds_bits)
)
);
}
pub type fd_mask = __fd_mask;
extern "C" {
pub fn select(
__nfds: ::core::ffi::c_int,
__readfds: *mut fd_set,
__writefds: *mut fd_set,
__exceptfds: *mut fd_set,
__timeout: *mut timeval,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn pselect(
__nfds: ::core::ffi::c_int,
__readfds: *mut fd_set,
__writefds: *mut fd_set,
__exceptfds: *mut fd_set,
__timeout: *const timespec,
__sigmask: *const __sigset_t,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn gnu_dev_major(__dev: ::core::ffi::c_ulonglong) -> ::core::ffi::c_uint;
}
extern "C" {
pub fn gnu_dev_minor(__dev: ::core::ffi::c_ulonglong) -> ::core::ffi::c_uint;
}
extern "C" {
pub fn gnu_dev_makedev(
__major: ::core::ffi::c_uint,
__minor: ::core::ffi::c_uint,
) -> ::core::ffi::c_ulonglong;
}
pub type blksize_t = __blksize_t;
pub type blkcnt_t = __blkcnt_t;
pub type fsblkcnt_t = __fsblkcnt_t;
pub type fsfilcnt_t = __fsfilcnt_t;
pub type pthread_t = ::core::ffi::c_ulong;
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_attr_t {
pub __size: [::core::ffi::c_char; 56usize],
pub __align: ::core::ffi::c_long,
_bindgen_union_align: [u64; 7usize],
}
#[test]
fn bindgen_test_layout_pthread_attr_t() {
assert_eq!(
::core::mem::size_of::<pthread_attr_t>(),
56usize,
concat!("Size of: ", stringify!(pthread_attr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_attr_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_attr_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_attr_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_attr_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __pthread_internal_list {
pub __prev: *mut __pthread_internal_list,
pub __next: *mut __pthread_internal_list,
}
#[test]
fn bindgen_test_layout___pthread_internal_list() {
assert_eq!(
::core::mem::size_of::<__pthread_internal_list>(),
16usize,
concat!("Size of: ", stringify!(__pthread_internal_list))
);
assert_eq!(
::core::mem::align_of::<__pthread_internal_list>(),
8usize,
concat!("Alignment of ", stringify!(__pthread_internal_list))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__pthread_internal_list>())).__prev as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__pthread_internal_list),
"::",
stringify!(__prev)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<__pthread_internal_list>())).__next as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(__pthread_internal_list),
"::",
stringify!(__next)
)
);
}
pub type __pthread_list_t = __pthread_internal_list;
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_mutex_t {
pub __data: pthread_mutex_t___pthread_mutex_s,
pub __size: [::core::ffi::c_char; 40usize],
pub __align: ::core::ffi::c_long,
_bindgen_union_align: [u64; 5usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pthread_mutex_t___pthread_mutex_s {
pub __lock: ::core::ffi::c_int,
pub __count: ::core::ffi::c_uint,
pub __owner: ::core::ffi::c_int,
pub __nusers: ::core::ffi::c_uint,
pub __kind: ::core::ffi::c_int,
pub __spins: ::core::ffi::c_short,
pub __elision: ::core::ffi::c_short,
pub __list: __pthread_list_t,
}
#[test]
fn bindgen_test_layout_pthread_mutex_t___pthread_mutex_s() {
assert_eq!(
::core::mem::size_of::<pthread_mutex_t___pthread_mutex_s>(),
40usize,
concat!("Size of: ", stringify!(pthread_mutex_t___pthread_mutex_s))
);
assert_eq!(
::core::mem::align_of::<pthread_mutex_t___pthread_mutex_s>(),
8usize,
concat!(
"Alignment of ",
stringify!(pthread_mutex_t___pthread_mutex_s)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__lock as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__lock)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__count as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__count)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__owner as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__owner)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__nusers as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__nusers)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__kind as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__kind)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__spins as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__spins)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__elision as *const _
as usize
},
22usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__elision)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__list as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t___pthread_mutex_s),
"::",
stringify!(__list)
)
);
}
#[test]
fn bindgen_test_layout_pthread_mutex_t() {
assert_eq!(
::core::mem::size_of::<pthread_mutex_t>(),
40usize,
concat!("Size of: ", stringify!(pthread_mutex_t))
);
assert_eq!(
::core::mem::align_of::<pthread_mutex_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_mutex_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_mutex_t>())).__data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t),
"::",
stringify!(__data)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_mutex_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_mutex_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_mutexattr_t {
pub __size: [::core::ffi::c_char; 4usize],
pub __align: ::core::ffi::c_int,
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout_pthread_mutexattr_t() {
assert_eq!(
::core::mem::size_of::<pthread_mutexattr_t>(),
4usize,
concat!("Size of: ", stringify!(pthread_mutexattr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_mutexattr_t>(),
4usize,
concat!("Alignment of ", stringify!(pthread_mutexattr_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_mutexattr_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutexattr_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_mutexattr_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutexattr_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_cond_t {
pub __data: pthread_cond_t__bindgen_ty_1,
pub __size: [::core::ffi::c_char; 48usize],
pub __align: ::core::ffi::c_longlong,
_bindgen_union_align: [u64; 6usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pthread_cond_t__bindgen_ty_1 {
pub __lock: ::core::ffi::c_int,
pub __futex: ::core::ffi::c_uint,
pub __total_seq: ::core::ffi::c_ulonglong,
pub __wakeup_seq: ::core::ffi::c_ulonglong,
pub __woken_seq: ::core::ffi::c_ulonglong,
pub __mutex: *mut ::core::ffi::c_void,
pub __nwaiters: ::core::ffi::c_uint,
pub __broadcast_seq: ::core::ffi::c_uint,
}
#[test]
fn bindgen_test_layout_pthread_cond_t__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<pthread_cond_t__bindgen_ty_1>(),
48usize,
concat!("Size of: ", stringify!(pthread_cond_t__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<pthread_cond_t__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(pthread_cond_t__bindgen_ty_1))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__lock as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__lock)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__futex as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__futex)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__total_seq as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__total_seq)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__wakeup_seq as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__wakeup_seq)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__woken_seq as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__woken_seq)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__mutex as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__mutex)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__nwaiters as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__nwaiters)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__broadcast_seq as *const _
as usize
},
44usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t__bindgen_ty_1),
"::",
stringify!(__broadcast_seq)
)
);
}
#[test]
fn bindgen_test_layout_pthread_cond_t() {
assert_eq!(
::core::mem::size_of::<pthread_cond_t>(),
48usize,
concat!("Size of: ", stringify!(pthread_cond_t))
);
assert_eq!(
::core::mem::align_of::<pthread_cond_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_cond_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_cond_t>())).__data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t),
"::",
stringify!(__data)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_cond_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_cond_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_cond_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_condattr_t {
pub __size: [::core::ffi::c_char; 4usize],
pub __align: ::core::ffi::c_int,
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout_pthread_condattr_t() {
assert_eq!(
::core::mem::size_of::<pthread_condattr_t>(),
4usize,
concat!("Size of: ", stringify!(pthread_condattr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_condattr_t>(),
4usize,
concat!("Alignment of ", stringify!(pthread_condattr_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_condattr_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_condattr_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_condattr_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_condattr_t),
"::",
stringify!(__align)
)
);
}
pub type pthread_key_t = ::core::ffi::c_uint;
pub type pthread_once_t = ::core::ffi::c_int;
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_rwlock_t {
pub __data: pthread_rwlock_t__bindgen_ty_1,
pub __size: [::core::ffi::c_char; 56usize],
pub __align: ::core::ffi::c_long,
_bindgen_union_align: [u64; 7usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pthread_rwlock_t__bindgen_ty_1 {
pub __lock: ::core::ffi::c_int,
pub __nr_readers: ::core::ffi::c_uint,
pub __readers_wakeup: ::core::ffi::c_uint,
pub __writer_wakeup: ::core::ffi::c_uint,
pub __nr_readers_queued: ::core::ffi::c_uint,
pub __nr_writers_queued: ::core::ffi::c_uint,
pub __writer: ::core::ffi::c_int,
pub __shared: ::core::ffi::c_int,
pub __rwelision: ::core::ffi::c_schar,
pub __pad1: [::core::ffi::c_uchar; 7usize],
pub __pad2: ::core::ffi::c_ulong,
pub __flags: ::core::ffi::c_uint,
}
#[test]
fn bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<pthread_rwlock_t__bindgen_ty_1>(),
56usize,
concat!("Size of: ", stringify!(pthread_rwlock_t__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<pthread_rwlock_t__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(pthread_rwlock_t__bindgen_ty_1))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__lock as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__lock)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_readers as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__nr_readers)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__readers_wakeup as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__readers_wakeup)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__writer_wakeup as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__writer_wakeup)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_readers_queued
as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__nr_readers_queued)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_writers_queued
as *const _ as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__nr_writers_queued)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__writer as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__writer)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__shared as *const _ as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__shared)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__rwelision as *const _
as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__rwelision)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__pad1 as *const _ as usize
},
33usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__pad1)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__pad2 as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__pad2)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__flags as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t__bindgen_ty_1),
"::",
stringify!(__flags)
)
);
}
#[test]
fn bindgen_test_layout_pthread_rwlock_t() {
assert_eq!(
::core::mem::size_of::<pthread_rwlock_t>(),
56usize,
concat!("Size of: ", stringify!(pthread_rwlock_t))
);
assert_eq!(
::core::mem::align_of::<pthread_rwlock_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_rwlock_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_rwlock_t>())).__data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t),
"::",
stringify!(__data)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_rwlock_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_rwlock_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlock_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_rwlockattr_t {
pub __size: [::core::ffi::c_char; 8usize],
pub __align: ::core::ffi::c_long,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_pthread_rwlockattr_t() {
assert_eq!(
::core::mem::size_of::<pthread_rwlockattr_t>(),
8usize,
concat!("Size of: ", stringify!(pthread_rwlockattr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_rwlockattr_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_rwlockattr_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_rwlockattr_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlockattr_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_rwlockattr_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_rwlockattr_t),
"::",
stringify!(__align)
)
);
}
pub type pthread_spinlock_t = ::core::ffi::c_int;
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_barrier_t {
pub __size: [::core::ffi::c_char; 32usize],
pub __align: ::core::ffi::c_long,
_bindgen_union_align: [u64; 4usize],
}
#[test]
fn bindgen_test_layout_pthread_barrier_t() {
assert_eq!(
::core::mem::size_of::<pthread_barrier_t>(),
32usize,
concat!("Size of: ", stringify!(pthread_barrier_t))
);
assert_eq!(
::core::mem::align_of::<pthread_barrier_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_barrier_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_barrier_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_barrier_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_barrier_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_barrier_t),
"::",
stringify!(__align)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_barrierattr_t {
pub __size: [::core::ffi::c_char; 4usize],
pub __align: ::core::ffi::c_int,
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout_pthread_barrierattr_t() {
assert_eq!(
::core::mem::size_of::<pthread_barrierattr_t>(),
4usize,
concat!("Size of: ", stringify!(pthread_barrierattr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_barrierattr_t>(),
4usize,
concat!("Alignment of ", stringify!(pthread_barrierattr_t))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_barrierattr_t>())).__size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_barrierattr_t),
"::",
stringify!(__size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<pthread_barrierattr_t>())).__align as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_barrierattr_t),
"::",
stringify!(__align)
)
);
}
extern "C" {
pub fn random() -> ::core::ffi::c_long;
}
extern "C" {
pub fn srandom(__seed: ::core::ffi::c_uint);
}
extern "C" {
pub fn initstate(
__seed: ::core::ffi::c_uint,
__statebuf: *mut ::core::ffi::c_char,
__statelen: usize,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn setstate(__statebuf: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct random_data {
pub fptr: *mut i32,
pub rptr: *mut i32,
pub state: *mut i32,
pub rand_type: ::core::ffi::c_int,
pub rand_deg: ::core::ffi::c_int,
pub rand_sep: ::core::ffi::c_int,
pub end_ptr: *mut i32,
}
#[test]
fn bindgen_test_layout_random_data() {
assert_eq!(
::core::mem::size_of::<random_data>(),
48usize,
concat!("Size of: ", stringify!(random_data))
);
assert_eq!(
::core::mem::align_of::<random_data>(),
8usize,
concat!("Alignment of ", stringify!(random_data))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).fptr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(fptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).rptr as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(rptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).state as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(state)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).rand_type as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(rand_type)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).rand_deg as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(rand_deg)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).rand_sep as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(rand_sep)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<random_data>())).end_ptr as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(random_data),
"::",
stringify!(end_ptr)
)
);
}
extern "C" {
pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::core::ffi::c_int;
}
extern "C" {
pub fn srandom_r(
__seed: ::core::ffi::c_uint,
__buf: *mut random_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn initstate_r(
__seed: ::core::ffi::c_uint,
__statebuf: *mut ::core::ffi::c_char,
__statelen: usize,
__buf: *mut random_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn setstate_r(
__statebuf: *mut ::core::ffi::c_char,
__buf: *mut random_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn rand() -> ::core::ffi::c_int;
}
extern "C" {
pub fn srand(__seed: ::core::ffi::c_uint);
}
extern "C" {
pub fn rand_r(__seed: *mut ::core::ffi::c_uint) -> ::core::ffi::c_int;
}
extern "C" {
pub fn drand48() -> f64;
}
extern "C" {
pub fn erand48(__xsubi: *mut ::core::ffi::c_ushort) -> f64;
}
extern "C" {
pub fn lrand48() -> ::core::ffi::c_long;
}
extern "C" {
pub fn nrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
}
extern "C" {
pub fn mrand48() -> ::core::ffi::c_long;
}
extern "C" {
pub fn jrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
}
extern "C" {
pub fn srand48(__seedval: ::core::ffi::c_long);
}
extern "C" {
pub fn seed48(__seed16v: *mut ::core::ffi::c_ushort) -> *mut ::core::ffi::c_ushort;
}
extern "C" {
pub fn lcong48(__param: *mut ::core::ffi::c_ushort);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct drand48_data {
pub __x: [::core::ffi::c_ushort; 3usize],
pub __old_x: [::core::ffi::c_ushort; 3usize],
pub __c: ::core::ffi::c_ushort,
pub __init: ::core::ffi::c_ushort,
pub __a: ::core::ffi::c_ulonglong,
}
#[test]
fn bindgen_test_layout_drand48_data() {
assert_eq!(
::core::mem::size_of::<drand48_data>(),
24usize,
concat!("Size of: ", stringify!(drand48_data))
);
assert_eq!(
::core::mem::align_of::<drand48_data>(),
8usize,
concat!("Alignment of ", stringify!(drand48_data))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<drand48_data>())).__x as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(drand48_data),
"::",
stringify!(__x)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<drand48_data>())).__old_x as *const _ as usize },
6usize,
concat!(
"Offset of field: ",
stringify!(drand48_data),
"::",
stringify!(__old_x)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<drand48_data>())).__c as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(drand48_data),
"::",
stringify!(__c)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<drand48_data>())).__init as *const _ as usize },
14usize,
concat!(
"Offset of field: ",
stringify!(drand48_data),
"::",
stringify!(__init)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<drand48_data>())).__a as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(drand48_data),
"::",
stringify!(__a)
)
);
}
extern "C" {
pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::core::ffi::c_int;
}
extern "C" {
pub fn erand48_r(
__xsubi: *mut ::core::ffi::c_ushort,
__buffer: *mut drand48_data,
__result: *mut f64,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn lrand48_r(
__buffer: *mut drand48_data,
__result: *mut ::core::ffi::c_long,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn nrand48_r(
__xsubi: *mut ::core::ffi::c_ushort,
__buffer: *mut drand48_data,
__result: *mut ::core::ffi::c_long,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mrand48_r(
__buffer: *mut drand48_data,
__result: *mut ::core::ffi::c_long,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn jrand48_r(
__xsubi: *mut ::core::ffi::c_ushort,
__buffer: *mut drand48_data,
__result: *mut ::core::ffi::c_long,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn srand48_r(
__seedval: ::core::ffi::c_long,
__buffer: *mut drand48_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn seed48_r(
__seed16v: *mut ::core::ffi::c_ushort,
__buffer: *mut drand48_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn lcong48_r(
__param: *mut ::core::ffi::c_ushort,
__buffer: *mut drand48_data,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn malloc(__size: usize) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn calloc(__nmemb: usize, __size: usize) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn realloc(
__ptr: *mut ::core::ffi::c_void,
__size: usize,
) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn free(__ptr: *mut ::core::ffi::c_void);
}
extern "C" {
pub fn cfree(__ptr: *mut ::core::ffi::c_void);
}
extern "C" {
pub fn alloca(__size: usize) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn valloc(__size: usize) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn posix_memalign(
__memptr: *mut *mut ::core::ffi::c_void,
__alignment: usize,
__size: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn abort();
}
extern "C" {
pub fn atexit(__func: ::core::option::Option<unsafe extern "C" fn()>) -> ::core::ffi::c_int;
}
extern "C" {
pub fn at_quick_exit(
__func: ::core::option::Option<unsafe extern "C" fn()>,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn on_exit(
__func: ::core::option::Option<
unsafe extern "C" fn(
__status: ::core::ffi::c_int,
__arg: *mut ::core::ffi::c_void,
),
>,
__arg: *mut ::core::ffi::c_void,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn exit(__status: ::core::ffi::c_int);
}
extern "C" {
pub fn quick_exit(__status: ::core::ffi::c_int);
}
extern "C" {
pub fn _Exit(__status: ::core::ffi::c_int);
}
extern "C" {
pub fn getenv(__name: *const ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn putenv(__string: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn setenv(
__name: *const ::core::ffi::c_char,
__value: *const ::core::ffi::c_char,
__replace: ::core::ffi::c_int,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn unsetenv(__name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn clearenv() -> ::core::ffi::c_int;
}
extern "C" {
pub fn mktemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn mkstemp(__template: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mkstemps(
__template: *mut ::core::ffi::c_char,
__suffixlen: ::core::ffi::c_int,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mkdtemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn system(__command: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn realpath(
__name: *const ::core::ffi::c_char,
__resolved: *mut ::core::ffi::c_char,
) -> *mut ::core::ffi::c_char;
}
pub type __compar_fn_t = ::core::option::Option<
unsafe extern "C" fn(arg1: *const ::core::ffi::c_void, arg2: *const ::core::ffi::c_void)
-> ::core::ffi::c_int,
>;
extern "C" {
pub fn bsearch(
__key: *const ::core::ffi::c_void,
__base: *const ::core::ffi::c_void,
__nmemb: usize,
__size: usize,
__compar: __compar_fn_t,
) -> *mut ::core::ffi::c_void;
}
extern "C" {
pub fn qsort(
__base: *mut ::core::ffi::c_void,
__nmemb: usize,
__size: usize,
__compar: __compar_fn_t,
);
}
extern "C" {
pub fn abs(__x: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
extern "C" {
pub fn labs(__x: ::core::ffi::c_long) -> ::core::ffi::c_long;
}
extern "C" {
pub fn llabs(__x: ::core::ffi::c_longlong) -> ::core::ffi::c_longlong;
}
extern "C" {
pub fn div(__numer: ::core::ffi::c_int, __denom: ::core::ffi::c_int) -> div_t;
}
extern "C" {
pub fn ldiv(__numer: ::core::ffi::c_long, __denom: ::core::ffi::c_long) -> ldiv_t;
}
extern "C" {
pub fn lldiv(
__numer: ::core::ffi::c_longlong,
__denom: ::core::ffi::c_longlong,
) -> lldiv_t;
}
extern "C" {
pub fn ecvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn fcvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn gcvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn qecvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn qfcvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn qgcvt(
__value: f64,
__ndigit: ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
) -> *mut ::core::ffi::c_char;
}
extern "C" {
pub fn ecvt_r(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
__len: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn fcvt_r(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
__len: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn qecvt_r(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
__len: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn qfcvt_r(
__value: f64,
__ndigit: ::core::ffi::c_int,
__decpt: *mut ::core::ffi::c_int,
__sign: *mut ::core::ffi::c_int,
__buf: *mut ::core::ffi::c_char,
__len: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mblen(__s: *const ::core::ffi::c_char, __n: usize) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mbtowc(
__pwc: *mut wchar_t,
__s: *const ::core::ffi::c_char,
__n: usize,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn wctomb(__s: *mut ::core::ffi::c_char, __wchar: wchar_t) -> ::core::ffi::c_int;
}
extern "C" {
pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::core::ffi::c_char, __n: usize) -> usize;
}
extern "C" {
pub fn wcstombs(__s: *mut ::core::ffi::c_char, __pwcs: *const wchar_t, __n: usize) -> usize;
}
extern "C" {
pub fn rpmatch(__response: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
extern "C" {
pub fn getsubopt(
__optionp: *mut *mut ::core::ffi::c_char,
__tokens: *const *const ::core::ffi::c_char,
__valuep: *mut *mut ::core::ffi::c_char,
) -> ::core::ffi::c_int;
}
extern "C" {
pub fn getloadavg(__loadavg: *mut f64, __nelem: ::core::ffi::c_int)
-> ::core::ffi::c_int;
}
/// *
/// Digital audio interface *
/// *
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_aes_iec958 {
pub status: [::core::ffi::c_uchar; 24usize],
pub subcode: [::core::ffi::c_uchar; 147usize],
pub pad: ::core::ffi::c_uchar,
pub dig_subframe: [::core::ffi::c_uchar; 4usize],
}
#[test]
fn bindgen_test_layout_snd_aes_iec958() {
assert_eq!(
::core::mem::size_of::<snd_aes_iec958>(),
176usize,
concat!("Size of: ", stringify!(snd_aes_iec958))
);
assert_eq!(
::core::mem::align_of::<snd_aes_iec958>(),
1usize,
concat!("Alignment of ", stringify!(snd_aes_iec958))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_aes_iec958>())).status as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_aes_iec958),
"::",
stringify!(status)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_aes_iec958>())).subcode as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(snd_aes_iec958),
"::",
stringify!(subcode)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_aes_iec958>())).pad as *const _ as usize },
171usize,
concat!(
"Offset of field: ",
stringify!(snd_aes_iec958),
"::",
stringify!(pad)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_aes_iec958>())).dig_subframe as *const _ as usize },
172usize,
concat!(
"Offset of field: ",
stringify!(snd_aes_iec958),
"::",
stringify!(dig_subframe)
)
);
}
/// *
/// CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
/// *
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_cea_861_aud_if {
pub db1_ct_cc: ::core::ffi::c_uchar,
pub db2_sf_ss: ::core::ffi::c_uchar,
pub db3: ::core::ffi::c_uchar,
pub db4_ca: ::core::ffi::c_uchar,
pub db5_dminh_lsv: ::core::ffi::c_uchar,
}
#[test]
fn bindgen_test_layout_snd_cea_861_aud_if() {
assert_eq!(
::core::mem::size_of::<snd_cea_861_aud_if>(),
5usize,
concat!("Size of: ", stringify!(snd_cea_861_aud_if))
);
assert_eq!(
::core::mem::align_of::<snd_cea_861_aud_if>(),
1usize,
concat!("Alignment of ", stringify!(snd_cea_861_aud_if))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_cea_861_aud_if>())).db1_ct_cc as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_cea_861_aud_if),
"::",
stringify!(db1_ct_cc)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_cea_861_aud_if>())).db2_sf_ss as *const _ as usize },
1usize,
concat!(
"Offset of field: ",
stringify!(snd_cea_861_aud_if),
"::",
stringify!(db2_sf_ss)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_cea_861_aud_if>())).db3 as *const _ as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(snd_cea_861_aud_if),
"::",
stringify!(db3)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_cea_861_aud_if>())).db4_ca as *const _ as usize },
3usize,
concat!(
"Offset of field: ",
stringify!(snd_cea_861_aud_if),
"::",
stringify!(db4_ca)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_cea_861_aud_if>())).db5_dminh_lsv as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(snd_cea_861_aud_if),
"::",
stringify!(db5_dminh_lsv)
)
);
}
pub const SNDRV_HWDEP_IFACE_OPL2: _bindgen_ty_1 = 0;
pub const SNDRV_HWDEP_IFACE_OPL3: _bindgen_ty_1 = 1;
pub const SNDRV_HWDEP_IFACE_OPL4: _bindgen_ty_1 = 2;
pub const SNDRV_HWDEP_IFACE_SB16CSP: _bindgen_ty_1 = 3;
pub const SNDRV_HWDEP_IFACE_EMU10K1: _bindgen_ty_1 = 4;
pub const SNDRV_HWDEP_IFACE_YSS225: _bindgen_ty_1 = 5;
pub const SNDRV_HWDEP_IFACE_ICS2115: _bindgen_ty_1 = 6;
pub const SNDRV_HWDEP_IFACE_SSCAPE: _bindgen_ty_1 = 7;
pub const SNDRV_HWDEP_IFACE_VX: _bindgen_ty_1 = 8;
pub const SNDRV_HWDEP_IFACE_MIXART: _bindgen_ty_1 = 9;
pub const SNDRV_HWDEP_IFACE_USX2Y: _bindgen_ty_1 = 10;
pub const SNDRV_HWDEP_IFACE_EMUX_WAVETABLE: _bindgen_ty_1 = 11;
pub const SNDRV_HWDEP_IFACE_BLUETOOTH: _bindgen_ty_1 = 12;
pub const SNDRV_HWDEP_IFACE_USX2Y_PCM: _bindgen_ty_1 = 13;
pub const SNDRV_HWDEP_IFACE_PCXHR: _bindgen_ty_1 = 14;
pub const SNDRV_HWDEP_IFACE_SB_RC: _bindgen_ty_1 = 15;
pub const SNDRV_HWDEP_IFACE_HDA: _bindgen_ty_1 = 16;
pub const SNDRV_HWDEP_IFACE_USB_STREAM: _bindgen_ty_1 = 17;
pub const SNDRV_HWDEP_IFACE_FW_DICE: _bindgen_ty_1 = 18;
pub const SNDRV_HWDEP_IFACE_FW_FIREWORKS: _bindgen_ty_1 = 19;
pub const SNDRV_HWDEP_IFACE_FW_BEBOB: _bindgen_ty_1 = 20;
pub const SNDRV_HWDEP_IFACE_FW_OXFW: _bindgen_ty_1 = 21;
pub const SNDRV_HWDEP_IFACE_FW_DIGI00X: _bindgen_ty_1 = 22;
pub const SNDRV_HWDEP_IFACE_FW_TASCAM: _bindgen_ty_1 = 23;
pub const SNDRV_HWDEP_IFACE_LINE6: _bindgen_ty_1 = 24;
pub const SNDRV_HWDEP_IFACE_FW_MOTU: _bindgen_ty_1 = 25;
pub const SNDRV_HWDEP_IFACE_FW_FIREFACE: _bindgen_ty_1 = 26;
pub const SNDRV_HWDEP_IFACE_LAST: _bindgen_ty_1 = 26;
pub type _bindgen_ty_1 = u32;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_hwdep_info {
pub device: ::core::ffi::c_uint,
pub card: ::core::ffi::c_int,
pub id: [::core::ffi::c_uchar; 64usize],
pub name: [::core::ffi::c_uchar; 80usize],
pub iface: ::core::ffi::c_int,
pub reserved: [::core::ffi::c_uchar; 64usize],
}
#[test]
fn bindgen_test_layout_snd_hwdep_info() {
assert_eq!(
::core::mem::size_of::<snd_hwdep_info>(),
220usize,
concat!("Size of: ", stringify!(snd_hwdep_info))
);
assert_eq!(
::core::mem::align_of::<snd_hwdep_info>(),
4usize,
concat!("Alignment of ", stringify!(snd_hwdep_info))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).device as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(device)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).card as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(card)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).id as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).name as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).iface as *const _ as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(iface)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_info>())).reserved as *const _ as usize },
156usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_info),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_hwdep_dsp_status {
pub version: ::core::ffi::c_uint,
pub id: [::core::ffi::c_uchar; 32usize],
pub num_dsps: ::core::ffi::c_uint,
pub dsp_loaded: ::core::ffi::c_uint,
pub chip_ready: ::core::ffi::c_uint,
pub reserved: [::core::ffi::c_uchar; 16usize],
}
#[test]
fn bindgen_test_layout_snd_hwdep_dsp_status() {
assert_eq!(
::core::mem::size_of::<snd_hwdep_dsp_status>(),
64usize,
concat!("Size of: ", stringify!(snd_hwdep_dsp_status))
);
assert_eq!(
::core::mem::align_of::<snd_hwdep_dsp_status>(),
4usize,
concat!("Alignment of ", stringify!(snd_hwdep_dsp_status))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).id as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).num_dsps as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(num_dsps)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).dsp_loaded as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(dsp_loaded)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).chip_ready as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(chip_ready)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_status>())).reserved as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_status),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_hwdep_dsp_image {
pub index: ::core::ffi::c_uint,
pub name: [::core::ffi::c_uchar; 64usize],
pub image: *mut ::core::ffi::c_uchar,
pub length: usize,
pub driver_data: ::core::ffi::c_ulong,
}
#[test]
fn bindgen_test_layout_snd_hwdep_dsp_image() {
assert_eq!(
::core::mem::size_of::<snd_hwdep_dsp_image>(),
96usize,
concat!("Size of: ", stringify!(snd_hwdep_dsp_image))
);
assert_eq!(
::core::mem::align_of::<snd_hwdep_dsp_image>(),
8usize,
concat!("Alignment of ", stringify!(snd_hwdep_dsp_image))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_image>())).index as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_image),
"::",
stringify!(index)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_image>())).name as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_image),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_image>())).image as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_image),
"::",
stringify!(image)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_image>())).length as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_image),
"::",
stringify!(length)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_hwdep_dsp_image>())).driver_data as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(snd_hwdep_dsp_image),
"::",
stringify!(driver_data)
)
);
}
pub type snd_pcm_uframes_t = ::core::ffi::c_ulong;
pub type snd_pcm_sframes_t = ::core::ffi::c_long;
pub const SNDRV_PCM_CLASS_GENERIC: _bindgen_ty_2 = 0;
pub const SNDRV_PCM_CLASS_MULTI: _bindgen_ty_2 = 1;
pub const SNDRV_PCM_CLASS_MODEM: _bindgen_ty_2 = 2;
pub const SNDRV_PCM_CLASS_DIGITIZER: _bindgen_ty_2 = 3;
pub const SNDRV_PCM_CLASS_LAST: _bindgen_ty_2 = 3;
pub type _bindgen_ty_2 = u32;
pub const SNDRV_PCM_SUBCLASS_GENERIC_MIX: _bindgen_ty_3 = 0;
pub const SNDRV_PCM_SUBCLASS_MULTI_MIX: _bindgen_ty_3 = 1;
pub const SNDRV_PCM_SUBCLASS_LAST: _bindgen_ty_3 = 1;
pub type _bindgen_ty_3 = u32;
pub const SNDRV_PCM_STREAM_PLAYBACK: _bindgen_ty_4 = 0;
pub const SNDRV_PCM_STREAM_CAPTURE: _bindgen_ty_4 = 1;
pub const SNDRV_PCM_STREAM_LAST: _bindgen_ty_4 = 1;
pub type _bindgen_ty_4 = u32;
pub type snd_pcm_access_t = ::core::ffi::c_int;
pub type snd_pcm_format_t = ::core::ffi::c_int;
pub type snd_pcm_subformat_t = ::core::ffi::c_int;
pub type snd_pcm_state_t = ::core::ffi::c_int;
pub const SNDRV_PCM_MMAP_OFFSET_DATA: _bindgen_ty_5 = 0;
pub const SNDRV_PCM_MMAP_OFFSET_STATUS: _bindgen_ty_5 = 2147483648;
pub const SNDRV_PCM_MMAP_OFFSET_CONTROL: _bindgen_ty_5 = 2164260864;
pub type _bindgen_ty_5 = u32;
#[repr(C)]
#[derive(Copy, Clone)]
pub union snd_pcm_sync_id {
pub id: [::core::ffi::c_uchar; 16usize],
pub id16: [::core::ffi::c_ushort; 8usize],
pub id32: [::core::ffi::c_uint; 4usize],
_bindgen_union_align: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_sync_id() {
assert_eq!(
::core::mem::size_of::<snd_pcm_sync_id>(),
16usize,
concat!("Size of: ", stringify!(snd_pcm_sync_id))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_sync_id>(),
4usize,
concat!("Alignment of ", stringify!(snd_pcm_sync_id))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_id>())).id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_id),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_id>())).id16 as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_id),
"::",
stringify!(id16)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_id>())).id32 as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_id),
"::",
stringify!(id32)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_pcm_info {
pub device: ::core::ffi::c_uint,
pub subdevice: ::core::ffi::c_uint,
pub stream: ::core::ffi::c_int,
pub card: ::core::ffi::c_int,
pub id: [::core::ffi::c_uchar; 64usize],
pub name: [::core::ffi::c_uchar; 80usize],
pub subname: [::core::ffi::c_uchar; 32usize],
pub dev_class: ::core::ffi::c_int,
pub dev_subclass: ::core::ffi::c_int,
pub subdevices_count: ::core::ffi::c_uint,
pub subdevices_avail: ::core::ffi::c_uint,
pub sync: snd_pcm_sync_id,
pub reserved: [::core::ffi::c_uchar; 64usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_info() {
assert_eq!(
::core::mem::size_of::<snd_pcm_info>(),
288usize,
concat!("Size of: ", stringify!(snd_pcm_info))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_info>(),
4usize,
concat!("Alignment of ", stringify!(snd_pcm_info))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).device as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(device)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).subdevice as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(subdevice)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).stream as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(stream)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).card as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(card)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).id as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).name as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).subname as *const _ as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(subname)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).dev_class as *const _ as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(dev_class)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).dev_subclass as *const _ as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(dev_subclass)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).subdevices_count as *const _ as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(subdevices_count)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).subdevices_avail as *const _ as usize },
204usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(subdevices_avail)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).sync as *const _ as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(sync)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_info>())).reserved as *const _ as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_info),
"::",
stringify!(reserved)
)
);
}
pub type snd_pcm_hw_param_t = ::core::ffi::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_interval {
pub min: ::core::ffi::c_uint,
pub max: ::core::ffi::c_uint,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub __bindgen_padding_0: [u8; 3usize],
}
#[test]
fn bindgen_test_layout_snd_interval() {
assert_eq!(
::core::mem::size_of::<snd_interval>(),
12usize,
concat!("Size of: ", stringify!(snd_interval))
);
assert_eq!(
::core::mem::align_of::<snd_interval>(),
4usize,
concat!("Alignment of ", stringify!(snd_interval))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_interval>())).min as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_interval),
"::",
stringify!(min)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_interval>())).max as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_interval),
"::",
stringify!(max)
)
);
}
impl snd_interval {
#[inline]
pub fn openmin(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_openmin(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn openmax(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
#[inline]
pub fn set_openmax(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub fn integer(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
}
#[inline]
pub fn set_integer(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub fn empty(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
}
#[inline]
pub fn set_empty(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(3usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
openmin: ::core::ffi::c_uint,
openmax: ::core::ffi::c_uint,
integer: ::core::ffi::c_uint,
empty: ::core::ffi::c_uint,
) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let openmin: u32 = unsafe { ::core::mem::transmute(openmin) };
openmin as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let openmax: u32 = unsafe { ::core::mem::transmute(openmax) };
openmax as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let integer: u32 = unsafe { ::core::mem::transmute(integer) };
integer as u64
});
__bindgen_bitfield_unit.set(3usize, 1u8, {
let empty: u32 = unsafe { ::core::mem::transmute(empty) };
empty as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_mask {
pub bits: [__u32; 8usize],
}
#[test]
fn bindgen_test_layout_snd_mask() {
assert_eq!(
::core::mem::size_of::<snd_mask>(),
32usize,
concat!("Size of: ", stringify!(snd_mask))
);
assert_eq!(
::core::mem::align_of::<snd_mask>(),
4usize,
concat!("Alignment of ", stringify!(snd_mask))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_mask>())).bits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_mask),
"::",
stringify!(bits)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_pcm_hw_params {
pub flags: ::core::ffi::c_uint,
pub masks: [snd_mask; 3usize],
pub mres: [snd_mask; 5usize],
pub intervals: [snd_interval; 12usize],
pub ires: [snd_interval; 9usize],
pub rmask: ::core::ffi::c_uint,
pub cmask: ::core::ffi::c_uint,
pub info: ::core::ffi::c_uint,
pub msbits: ::core::ffi::c_uint,
pub rate_num: ::core::ffi::c_uint,
pub rate_den: ::core::ffi::c_uint,
pub fifo_size: snd_pcm_uframes_t,
pub reserved: [::core::ffi::c_uchar; 64usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_hw_params() {
assert_eq!(
::core::mem::size_of::<snd_pcm_hw_params>(),
608usize,
concat!("Size of: ", stringify!(snd_pcm_hw_params))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_hw_params>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_hw_params))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).masks as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(masks)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).mres as *const _ as usize },
100usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(mres)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).intervals as *const _ as usize },
260usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(intervals)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).ires as *const _ as usize },
404usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(ires)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).rmask as *const _ as usize },
512usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(rmask)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).cmask as *const _ as usize },
516usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(cmask)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).info as *const _ as usize },
520usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(info)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).msbits as *const _ as usize },
524usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(msbits)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).rate_num as *const _ as usize },
528usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(rate_num)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).rate_den as *const _ as usize },
532usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(rate_den)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).fifo_size as *const _ as usize },
536usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(fifo_size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_hw_params>())).reserved as *const _ as usize },
544usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_hw_params),
"::",
stringify!(reserved)
)
);
}
pub const SNDRV_PCM_TSTAMP_NONE: _bindgen_ty_6 = 0;
pub const SNDRV_PCM_TSTAMP_ENABLE: _bindgen_ty_6 = 1;
pub const SNDRV_PCM_TSTAMP_LAST: _bindgen_ty_6 = 1;
pub type _bindgen_ty_6 = u32;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_pcm_sw_params {
pub tstamp_mode: ::core::ffi::c_int,
pub period_step: ::core::ffi::c_uint,
pub sleep_min: ::core::ffi::c_uint,
pub avail_min: snd_pcm_uframes_t,
pub xfer_align: snd_pcm_uframes_t,
pub start_threshold: snd_pcm_uframes_t,
pub stop_threshold: snd_pcm_uframes_t,
pub silence_threshold: snd_pcm_uframes_t,
pub silence_size: snd_pcm_uframes_t,
pub boundary: snd_pcm_uframes_t,
pub proto: ::core::ffi::c_uint,
pub tstamp_type: ::core::ffi::c_uint,
pub reserved: [::core::ffi::c_uchar; 56usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_sw_params() {
assert_eq!(
::core::mem::size_of::<snd_pcm_sw_params>(),
136usize,
concat!("Size of: ", stringify!(snd_pcm_sw_params))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_sw_params>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_sw_params))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).tstamp_mode as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(tstamp_mode)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).period_step as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(period_step)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).sleep_min as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(sleep_min)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).avail_min as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(avail_min)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).xfer_align as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(xfer_align)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sw_params>())).start_threshold as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(start_threshold)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sw_params>())).stop_threshold as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(stop_threshold)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sw_params>())).silence_threshold as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(silence_threshold)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).silence_size as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(silence_size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).boundary as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(boundary)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).proto as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(proto)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).tstamp_type as *const _ as usize },
76usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(tstamp_type)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sw_params>())).reserved as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sw_params),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_pcm_channel_info {
pub channel: ::core::ffi::c_uint,
pub offset: __kernel_off_t,
pub first: ::core::ffi::c_uint,
pub step: ::core::ffi::c_uint,
}
#[test]
fn bindgen_test_layout_snd_pcm_channel_info() {
assert_eq!(
::core::mem::size_of::<snd_pcm_channel_info>(),
24usize,
concat!("Size of: ", stringify!(snd_pcm_channel_info))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_channel_info>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_channel_info))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_channel_info>())).channel as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_channel_info),
"::",
stringify!(channel)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_channel_info>())).offset as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_channel_info),
"::",
stringify!(offset)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_channel_info>())).first as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_channel_info),
"::",
stringify!(first)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_channel_info>())).step as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_channel_info),
"::",
stringify!(step)
)
);
}
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT: _bindgen_ty_7 = 0;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT: _bindgen_ty_7 = 1;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK: _bindgen_ty_7 = 2;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE: _bindgen_ty_7 = 3;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED: _bindgen_ty_7 = 4;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED: _bindgen_ty_7 = 5;
pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST: _bindgen_ty_7 = 5;
pub type _bindgen_ty_7 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_pcm_status {
pub state: snd_pcm_state_t,
pub trigger_tstamp: timespec,
pub tstamp: timespec,
pub appl_ptr: snd_pcm_uframes_t,
pub hw_ptr: snd_pcm_uframes_t,
pub delay: snd_pcm_sframes_t,
pub avail: snd_pcm_uframes_t,
pub avail_max: snd_pcm_uframes_t,
pub overrange: snd_pcm_uframes_t,
pub suspended_state: snd_pcm_state_t,
pub audio_tstamp_data: __u32,
pub audio_tstamp: timespec,
pub driver_tstamp: timespec,
pub audio_tstamp_accuracy: __u32,
pub reserved: [::core::ffi::c_uchar; 20usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_status() {
assert_eq!(
::core::mem::size_of::<snd_pcm_status>(),
152usize,
concat!("Size of: ", stringify!(snd_pcm_status))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_status>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_status))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).state as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(state)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).trigger_tstamp as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(trigger_tstamp)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).tstamp as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(tstamp)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).appl_ptr as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(appl_ptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).hw_ptr as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(hw_ptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).delay as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(delay)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).avail as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(avail)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).avail_max as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(avail_max)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).overrange as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(overrange)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).suspended_state as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(suspended_state)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_status>())).audio_tstamp_data as *const _ as usize
},
92usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(audio_tstamp_data)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).audio_tstamp as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(audio_tstamp)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).driver_tstamp as *const _ as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(driver_tstamp)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_status>())).audio_tstamp_accuracy as *const _ as usize
},
128usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(audio_tstamp_accuracy)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_status>())).reserved as *const _ as usize },
132usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_status),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_pcm_mmap_status {
pub state: snd_pcm_state_t,
pub pad1: ::core::ffi::c_int,
pub hw_ptr: snd_pcm_uframes_t,
pub tstamp: timespec,
pub suspended_state: snd_pcm_state_t,
pub audio_tstamp: timespec,
}
#[test]
fn bindgen_test_layout_snd_pcm_mmap_status() {
assert_eq!(
::core::mem::size_of::<snd_pcm_mmap_status>(),
56usize,
concat!("Size of: ", stringify!(snd_pcm_mmap_status))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_mmap_status>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_mmap_status))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_status>())).state as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(state)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_status>())).pad1 as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(pad1)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_status>())).hw_ptr as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(hw_ptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_status>())).tstamp as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(tstamp)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_mmap_status>())).suspended_state as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(suspended_state)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_mmap_status>())).audio_tstamp as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_status),
"::",
stringify!(audio_tstamp)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_pcm_mmap_control {
pub appl_ptr: snd_pcm_uframes_t,
pub avail_min: snd_pcm_uframes_t,
}
#[test]
fn bindgen_test_layout_snd_pcm_mmap_control() {
assert_eq!(
::core::mem::size_of::<snd_pcm_mmap_control>(),
16usize,
concat!("Size of: ", stringify!(snd_pcm_mmap_control))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_mmap_control>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_mmap_control))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_control>())).appl_ptr as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_control),
"::",
stringify!(appl_ptr)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_mmap_control>())).avail_min as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_mmap_control),
"::",
stringify!(avail_min)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_pcm_sync_ptr {
pub flags: ::core::ffi::c_uint,
pub s: snd_pcm_sync_ptr__bindgen_ty_1,
pub c: snd_pcm_sync_ptr__bindgen_ty_2,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union snd_pcm_sync_ptr__bindgen_ty_1 {
pub status: snd_pcm_mmap_status,
pub reserved: [::core::ffi::c_uchar; 64usize],
_bindgen_union_align: [u64; 8usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_1() {
assert_eq!(
::core::mem::size_of::<snd_pcm_sync_ptr__bindgen_ty_1>(),
64usize,
concat!("Size of: ", stringify!(snd_pcm_sync_ptr__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_sync_ptr__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_sync_ptr__bindgen_ty_1))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sync_ptr__bindgen_ty_1>())).status as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr__bindgen_ty_1),
"::",
stringify!(status)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sync_ptr__bindgen_ty_1>())).reserved as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr__bindgen_ty_1),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union snd_pcm_sync_ptr__bindgen_ty_2 {
pub control: snd_pcm_mmap_control,
pub reserved: [::core::ffi::c_uchar; 64usize],
_bindgen_union_align: [u64; 8usize],
}
#[test]
fn bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_2() {
assert_eq!(
::core::mem::size_of::<snd_pcm_sync_ptr__bindgen_ty_2>(),
64usize,
concat!("Size of: ", stringify!(snd_pcm_sync_ptr__bindgen_ty_2))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_sync_ptr__bindgen_ty_2>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_sync_ptr__bindgen_ty_2))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sync_ptr__bindgen_ty_2>())).control as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr__bindgen_ty_2),
"::",
stringify!(control)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_pcm_sync_ptr__bindgen_ty_2>())).reserved as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr__bindgen_ty_2),
"::",
stringify!(reserved)
)
);
}
#[test]
fn bindgen_test_layout_snd_pcm_sync_ptr() {
assert_eq!(
::core::mem::size_of::<snd_pcm_sync_ptr>(),
136usize,
concat!("Size of: ", stringify!(snd_pcm_sync_ptr))
);
assert_eq!(
::core::mem::align_of::<snd_pcm_sync_ptr>(),
8usize,
concat!("Alignment of ", stringify!(snd_pcm_sync_ptr))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_ptr>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_ptr>())).s as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr),
"::",
stringify!(s)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_pcm_sync_ptr>())).c as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(snd_pcm_sync_ptr),
"::",
stringify!(c)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_xferi {
pub result: snd_pcm_sframes_t,
pub buf: *mut ::core::ffi::c_void,
pub frames: snd_pcm_uframes_t,
}
#[test]
fn bindgen_test_layout_snd_xferi() {
assert_eq!(
::core::mem::size_of::<snd_xferi>(),
24usize,
concat!("Size of: ", stringify!(snd_xferi))
);
assert_eq!(
::core::mem::align_of::<snd_xferi>(),
8usize,
concat!("Alignment of ", stringify!(snd_xferi))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xferi>())).result as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_xferi),
"::",
stringify!(result)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xferi>())).buf as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_xferi),
"::",
stringify!(buf)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xferi>())).frames as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_xferi),
"::",
stringify!(frames)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_xfern {
pub result: snd_pcm_sframes_t,
pub bufs: *mut *mut ::core::ffi::c_void,
pub frames: snd_pcm_uframes_t,
}
#[test]
fn bindgen_test_layout_snd_xfern() {
assert_eq!(
::core::mem::size_of::<snd_xfern>(),
24usize,
concat!("Size of: ", stringify!(snd_xfern))
);
assert_eq!(
::core::mem::align_of::<snd_xfern>(),
8usize,
concat!("Alignment of ", stringify!(snd_xfern))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xfern>())).result as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_xfern),
"::",
stringify!(result)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xfern>())).bufs as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_xfern),
"::",
stringify!(bufs)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_xfern>())).frames as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_xfern),
"::",
stringify!(frames)
)
);
}
pub const SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY: _bindgen_ty_8 = 0;
pub const SNDRV_PCM_TSTAMP_TYPE_MONOTONIC: _bindgen_ty_8 = 1;
pub const SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW: _bindgen_ty_8 = 2;
pub const SNDRV_PCM_TSTAMP_TYPE_LAST: _bindgen_ty_8 = 2;
pub type _bindgen_ty_8 = u32;
pub const SNDRV_CHMAP_UNKNOWN: _bindgen_ty_9 = 0;
pub const SNDRV_CHMAP_NA: _bindgen_ty_9 = 1;
pub const SNDRV_CHMAP_MONO: _bindgen_ty_9 = 2;
pub const SNDRV_CHMAP_FL: _bindgen_ty_9 = 3;
pub const SNDRV_CHMAP_FR: _bindgen_ty_9 = 4;
pub const SNDRV_CHMAP_RL: _bindgen_ty_9 = 5;
pub const SNDRV_CHMAP_RR: _bindgen_ty_9 = 6;
pub const SNDRV_CHMAP_FC: _bindgen_ty_9 = 7;
pub const SNDRV_CHMAP_LFE: _bindgen_ty_9 = 8;
pub const SNDRV_CHMAP_SL: _bindgen_ty_9 = 9;
pub const SNDRV_CHMAP_SR: _bindgen_ty_9 = 10;
pub const SNDRV_CHMAP_RC: _bindgen_ty_9 = 11;
pub const SNDRV_CHMAP_FLC: _bindgen_ty_9 = 12;
pub const SNDRV_CHMAP_FRC: _bindgen_ty_9 = 13;
pub const SNDRV_CHMAP_RLC: _bindgen_ty_9 = 14;
pub const SNDRV_CHMAP_RRC: _bindgen_ty_9 = 15;
pub const SNDRV_CHMAP_FLW: _bindgen_ty_9 = 16;
pub const SNDRV_CHMAP_FRW: _bindgen_ty_9 = 17;
pub const SNDRV_CHMAP_FLH: _bindgen_ty_9 = 18;
pub const SNDRV_CHMAP_FCH: _bindgen_ty_9 = 19;
pub const SNDRV_CHMAP_FRH: _bindgen_ty_9 = 20;
pub const SNDRV_CHMAP_TC: _bindgen_ty_9 = 21;
pub const SNDRV_CHMAP_TFL: _bindgen_ty_9 = 22;
pub const SNDRV_CHMAP_TFR: _bindgen_ty_9 = 23;
pub const SNDRV_CHMAP_TFC: _bindgen_ty_9 = 24;
pub const SNDRV_CHMAP_TRL: _bindgen_ty_9 = 25;
pub const SNDRV_CHMAP_TRR: _bindgen_ty_9 = 26;
pub const SNDRV_CHMAP_TRC: _bindgen_ty_9 = 27;
pub const SNDRV_CHMAP_TFLC: _bindgen_ty_9 = 28;
pub const SNDRV_CHMAP_TFRC: _bindgen_ty_9 = 29;
pub const SNDRV_CHMAP_TSL: _bindgen_ty_9 = 30;
pub const SNDRV_CHMAP_TSR: _bindgen_ty_9 = 31;
pub const SNDRV_CHMAP_LLFE: _bindgen_ty_9 = 32;
pub const SNDRV_CHMAP_RLFE: _bindgen_ty_9 = 33;
pub const SNDRV_CHMAP_BC: _bindgen_ty_9 = 34;
pub const SNDRV_CHMAP_BLC: _bindgen_ty_9 = 35;
pub const SNDRV_CHMAP_BRC: _bindgen_ty_9 = 36;
pub const SNDRV_CHMAP_LAST: _bindgen_ty_9 = 36;
pub type _bindgen_ty_9 = u32;
pub const SNDRV_RAWMIDI_STREAM_OUTPUT: _bindgen_ty_10 = 0;
pub const SNDRV_RAWMIDI_STREAM_INPUT: _bindgen_ty_10 = 1;
pub const SNDRV_RAWMIDI_STREAM_LAST: _bindgen_ty_10 = 1;
pub type _bindgen_ty_10 = u32;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_rawmidi_info {
pub device: ::core::ffi::c_uint,
pub subdevice: ::core::ffi::c_uint,
pub stream: ::core::ffi::c_int,
pub card: ::core::ffi::c_int,
pub flags: ::core::ffi::c_uint,
pub id: [::core::ffi::c_uchar; 64usize],
pub name: [::core::ffi::c_uchar; 80usize],
pub subname: [::core::ffi::c_uchar; 32usize],
pub subdevices_count: ::core::ffi::c_uint,
pub subdevices_avail: ::core::ffi::c_uint,
pub reserved: [::core::ffi::c_uchar; 64usize],
}
#[test]
fn bindgen_test_layout_snd_rawmidi_info() {
assert_eq!(
::core::mem::size_of::<snd_rawmidi_info>(),
268usize,
concat!("Size of: ", stringify!(snd_rawmidi_info))
);
assert_eq!(
::core::mem::align_of::<snd_rawmidi_info>(),
4usize,
concat!("Alignment of ", stringify!(snd_rawmidi_info))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).device as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(device)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).subdevice as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(subdevice)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).stream as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(stream)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).card as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(card)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).flags as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).id as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).name as *const _ as usize },
84usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).subname as *const _ as usize },
164usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(subname)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_rawmidi_info>())).subdevices_count as *const _ as usize
},
196usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(subdevices_count)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<snd_rawmidi_info>())).subdevices_avail as *const _ as usize
},
200usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(subdevices_avail)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_info>())).reserved as *const _ as usize },
204usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_info),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_rawmidi_params {
pub stream: ::core::ffi::c_int,
pub buffer_size: usize,
pub avail_min: usize,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub reserved: [::core::ffi::c_uchar; 16usize],
}
#[test]
fn bindgen_test_layout_snd_rawmidi_params() {
assert_eq!(
::core::mem::size_of::<snd_rawmidi_params>(),
48usize,
concat!("Size of: ", stringify!(snd_rawmidi_params))
);
assert_eq!(
::core::mem::align_of::<snd_rawmidi_params>(),
8usize,
concat!("Alignment of ", stringify!(snd_rawmidi_params))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_params>())).stream as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_params),
"::",
stringify!(stream)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_params>())).buffer_size as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_params),
"::",
stringify!(buffer_size)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_params>())).avail_min as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_params),
"::",
stringify!(avail_min)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_params>())).reserved as *const _ as usize },
25usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_params),
"::",
stringify!(reserved)
)
);
}
impl snd_rawmidi_params {
#[inline]
pub fn no_active_sensing(&self) -> ::core::ffi::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_no_active_sensing(&mut self, val: ::core::ffi::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
no_active_sensing: ::core::ffi::c_uint,
) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let no_active_sensing: u32 = unsafe { ::core::mem::transmute(no_active_sensing) };
no_active_sensing as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct snd_rawmidi_status {
pub stream: ::core::ffi::c_int,
pub tstamp: timespec,
pub avail: usize,
pub xruns: usize,
pub reserved: [::core::ffi::c_uchar; 16usize],
}
#[test]
fn bindgen_test_layout_snd_rawmidi_status() {
assert_eq!(
::core::mem::size_of::<snd_rawmidi_status>(),
56usize,
concat!("Size of: ", stringify!(snd_rawmidi_status))
);
assert_eq!(
::core::mem::align_of::<snd_rawmidi_status>(),
8usize,
concat!("Alignment of ", stringify!(snd_rawmidi_status))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_status>())).stream as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_status),
"::",
stringify!(stream)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_status>())).tstamp as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_status),
"::",
stringify!(tstamp)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_status>())).avail as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_status),
"::",
stringify!(avail)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_status>())).xruns as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(snd_rawmidi_status),
"::",
stringify!(xruns)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<snd_rawmidi_status>())).reserved as *const _ as usize },
40usize,
concat!(
gitextract_kduojn30/
├── .github/
│ └── workflows/
│ └── rust.yml
├── .gitignore
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── examples/
│ ├── ctl_list.rs
│ ├── midi_enumerate.rs
│ ├── pcm_enumerate.rs
│ ├── pcm_record.rs
│ └── trigger_hstamp.rs
├── src/
│ ├── card.rs
│ ├── chmap.rs
│ ├── config.rs
│ ├── ctl_int.rs
│ ├── device_name.rs
│ ├── direct/
│ │ ├── asound_ioctl.rs
│ │ ├── ffi.rs
│ │ └── pcm.rs
│ ├── direct.rs
│ ├── error.rs
│ ├── hctl.rs
│ ├── io.rs
│ ├── lib.rs
│ ├── mixer.rs
│ ├── pcm.rs
│ ├── poll.rs
│ ├── rawmidi.rs
│ └── seq.rs
└── synth-example/
├── Cargo.toml
└── src/
└── main.rs
SYMBOL INDEX (1750 symbols across 23 files)
FILE: examples/ctl_list.rs
function list_controls_for_card (line 8) | fn list_controls_for_card(card: &Card) -> Result<(), Error>{
function main (line 26) | fn main() {
FILE: examples/midi_enumerate.rs
function list_rawmidi_for_card (line 11) | pub fn list_rawmidi_for_card(card: &Card) -> Result<(), Error> {
function list_rawmidi_devices (line 32) | pub fn list_rawmidi_devices() {
function list_sequencer_port (line 37) | pub fn list_sequencer_port() {
function main (line 58) | fn main() {
FILE: examples/pcm_enumerate.rs
function list_devices_for_card (line 10) | fn list_devices_for_card(card: &Card, direction: Direction) -> Result<()...
function list_hw_devices (line 46) | pub fn list_hw_devices(direction: Direction) {
function list_pcm_devices (line 51) | pub fn list_pcm_devices(direction: Direction) {
function main (line 61) | fn main() {
FILE: examples/pcm_record.rs
function start_capture (line 6) | fn start_capture(device: &str) -> Result<PCM, Error> {
function rms (line 22) | fn rms(buf: &[i16]) -> f64 {
function read_loop (line 34) | fn read_loop(pcm: &PCM) -> Result<(), Error> {
function main (line 45) | fn main() {
FILE: examples/trigger_hstamp.rs
function main (line 8) | fn main() -> Result<()> {
FILE: src/card.rs
type Card (line 10) | pub struct Card(c_int);
method new (line 33) | pub fn new(index: c_int) -> Card { Card(index) }
method from_str (line 34) | pub fn from_str(s: &CStr) -> Result<Card> {
method get_name (line 37) | pub fn get_name(&self) -> Result<String> {
method get_longname (line 42) | pub fn get_longname(&self) -> Result<String> {
method get_index (line 48) | pub fn get_index(&self) -> c_int { self.0 }
type Iter (line 14) | pub struct Iter(c_int);
method new (line 17) | pub fn new() -> Iter { Iter(-1) }
type Item (line 21) | type Item = Result<Card>;
method next (line 23) | fn next(&mut self) -> Option<Result<Card>> {
function print_cards (line 52) | fn print_cards() {
FILE: src/chmap.rs
method fmt (line 61) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
type Chmap (line 71) | pub struct Chmap(*mut alsa::snd_pcm_chmap_t, bool);
method set_channels (line 78) | fn set_channels(&mut self, c: libc::c_uint) { unsafe { (*self.0) .chan...
method as_slice_mut (line 79) | fn as_slice_mut(&mut self) -> &mut [libc::c_uint] {
method as_slice (line 82) | fn as_slice(&self) -> &[libc::c_uint] {
method fmt (line 88) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method from (line 97) | fn from(a: &'a [ChmapPosition]) -> Chmap {
method drop (line 74) | fn drop(&mut self) { if self.1 { unsafe { libc::free(self.0 as *mut libc...
function from (line 108) | fn from(a: &'a Chmap) -> Vec<ChmapPosition> {
function chmap_new (line 113) | pub fn chmap_new(a: *mut alsa::snd_pcm_chmap_t) -> Chmap { Chmap(a, true) }
function chmap_handle (line 114) | pub fn chmap_handle(a: &Chmap) -> *mut alsa::snd_pcm_chmap_t { a.0 }
type ChmapsQuery (line 119) | pub struct ChmapsQuery(*mut *mut alsa::snd_pcm_chmap_query_t, isize);
method drop (line 122) | fn drop(&mut self) { unsafe { alsa::snd_pcm_free_chmaps(self.0) }}
function chmaps_query_new (line 125) | pub fn chmaps_query_new(a: *mut *mut alsa::snd_pcm_chmap_query_t) -> Chm...
type Item (line 128) | type Item = (ChmapType, Chmap);
method next (line 129) | fn next(&mut self) -> Option<Self::Item> {
function chmap_for_first_pcm (line 142) | fn chmap_for_first_pcm() {
FILE: src/config.rs
function update (line 11) | pub fn update() -> Result<bool> {
function update_free_global (line 15) | pub fn update_free_global() -> Result<()> {
type Config (line 21) | pub struct Config(*mut alsa::snd_config_t);
method save (line 33) | pub fn save(&self, o: &mut Output) -> Result<()> {
method drop (line 24) | fn drop(&mut self) { unsafe { alsa::snd_config_unref(self.0) }; }
function update_ref (line 27) | pub fn update_ref() -> Result<Config> {
function config_save (line 39) | fn config_save() {
FILE: src/ctl_int.rs
constant ELEM_ID_SIZE (line 19) | const ELEM_ID_SIZE: usize = 64;
type DeviceIter (line 26) | pub struct DeviceIter<'a>(&'a Ctl, c_int);
function new (line 29) | pub fn new(ctl: &'a Ctl) -> DeviceIter<'a> {
type Item (line 35) | type Item = c_int;
method next (line 37) | fn next(&mut self) -> Option<c_int> {
type Ctl (line 48) | pub struct Ctl(*mut alsa::snd_ctl_t);
method new (line 54) | pub fn new(c: &str, nonblock: bool) -> Result<Self> {
method open (line 59) | pub fn open(c: &CStr, nonblock: bool) -> Result<Ctl> {
method from_card (line 65) | pub fn from_card(c: &Card, nonblock: bool) -> Result<Ctl> {
method card_info (line 70) | pub fn card_info(&self) -> Result<CardInfo> { CardInfo::new().and_then...
method wait (line 73) | pub fn wait(&self, timeout_ms: Option<u32>) -> Result<bool> {
method get_db_range (line 76) | pub fn get_db_range(&self, id: &ElemId) -> Result<(MilliBel, MilliBel)> {
method convert_to_db (line 83) | pub fn convert_to_db(&self, id: &ElemId, volume: i64) -> Result<MilliB...
method convert_from_db (line 89) | pub fn convert_from_db(&self, id: &ElemId, mb: MilliBel, dir: Round) -...
method elem_read (line 95) | pub fn elem_read(&self, val: &mut ElemValue) -> Result<()> {
method elem_write (line 99) | pub fn elem_write(&self, val: &ElemValue) -> Result<()> {
method elem_lock (line 103) | pub fn elem_lock(&self, id: &ElemId) -> Result<i32> {
method elem_unlock (line 107) | pub fn elem_unlock(&self, id: &ElemId) -> Result<i32> {
method elem_list (line 111) | pub fn elem_list(&self) -> Result<ElemList> {
method subscribe_events (line 124) | pub fn subscribe_events(&self, subscribe: bool) -> Result<()> {
method read (line 128) | pub fn read(&self) -> Result<Option<Event>> {
method pcm_info (line 133) | pub fn pcm_info(&self, device: u32, subdevice: u32, direction: Directi...
method count (line 148) | fn count(&self) -> usize {
method fill (line 151) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
method revents (line 155) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
method drop (line 144) | fn drop(&mut self) { unsafe { alsa::snd_ctl_close(self.0) }; }
function ctl_ptr (line 163) | pub fn ctl_ptr(a: &Ctl) -> *mut alsa::snd_ctl_t { a.0 }
type CardInfo (line 167) | pub struct CardInfo(*mut alsa::snd_ctl_card_info_t);
method new (line 174) | fn new() -> Result<CardInfo> {
method get_id (line 179) | pub fn get_id(&self) -> Result<&str> {
method get_driver (line 181) | pub fn get_driver(&self) -> Result<&str> {
method get_components (line 183) | pub fn get_components(&self) -> Result<&str> {
method get_longname (line 185) | pub fn get_longname(&self) -> Result<&str> {
method get_name (line 187) | pub fn get_name(&self) -> Result<&str> {
method get_mixername (line 189) | pub fn get_mixername(&self) -> Result<&str> {
method get_card (line 191) | pub fn get_card(&self) -> Card { Card::new(unsafe { alsa::snd_ctl_card...
method drop (line 170) | fn drop(&mut self) { unsafe { alsa::snd_ctl_card_info_free(self.0) }}
type ElemValue (line 221) | pub struct ElemValue {
method set_id (line 241) | pub fn set_id(&mut self, id: &ElemId) {
method get_boolean (line 249) | pub fn get_boolean(&self, idx: u32) -> Option<bool> {
method set_boolean (line 254) | pub fn set_boolean(&mut self, idx: u32, val: bool) -> Option<()> {
method get_integer (line 259) | pub fn get_integer(&self, idx: u32) -> Option<i32> {
method set_integer (line 264) | pub fn set_integer(&mut self, idx: u32, val: i32) -> Option<()> {
method get_integer64 (line 269) | pub fn get_integer64(&self, idx: u32) -> Option<i64> {
method set_integer64 (line 274) | pub fn set_integer64(&mut self, idx: u32, val: i64) -> Option<()> {
method get_enumerated (line 279) | pub fn get_enumerated(&self, idx: u32) -> Option<u32> {
method set_enumerated (line 284) | pub fn set_enumerated(&mut self, idx: u32, val: u32) -> Option<()> {
method get_byte (line 289) | pub fn get_byte(&self, idx: u32) -> Option<u8> {
method set_byte (line 294) | pub fn set_byte(&mut self, idx: u32, val: u8) -> Option<()> {
method get_bytes (line 299) | pub fn get_bytes(&self) -> Option<&[u8]> {
method set_bytes (line 305) | pub fn set_bytes(&mut self, val: &[u8]) -> Option<()> {
method new (line 314) | pub fn new(t: ElemType) -> Result<ElemValue> {
method fmt (line 334) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method drop (line 228) | fn drop(&mut self) { unsafe { alsa::snd_ctl_elem_value_free(self.ptr) }; }
function elem_value_ptr (line 231) | pub fn elem_value_ptr(a: &ElemValue) -> *mut alsa::snd_ctl_elem_value_t ...
function elem_value_new (line 233) | pub fn elem_value_new(t: ElemType, count: u32) -> Result<ElemValue> {
type ElemInfo (line 351) | pub struct ElemInfo(*mut alsa::snd_ctl_elem_info_t);
method get_type (line 365) | pub fn get_type(&self) -> ElemType { ElemType::from_c_int(
method get_count (line 367) | pub fn get_count(&self) -> u32 { unsafe { alsa::snd_ctl_elem_info_get_...
function elem_info_ptr (line 353) | pub fn elem_info_ptr(a: &ElemInfo) -> *mut alsa::snd_ctl_elem_info_t { a...
method drop (line 356) | fn drop(&mut self) { unsafe { alsa::snd_ctl_elem_info_free(self.0) }; }
function elem_info_new (line 359) | pub fn elem_info_new() -> Result<ElemInfo> {
type ElemId (line 375) | pub struct ElemId(UnsafeCell<[u8; ELEM_ID_SIZE]>);
method get_name (line 416) | pub fn get_name(&self) -> Result<&str> {
method get_device (line 418) | pub fn get_device(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_d...
method get_subdevice (line 419) | pub fn get_subdevice(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_ge...
method get_numid (line 420) | pub fn get_numid(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_nu...
method get_index (line 421) | pub fn get_index(&self) -> u32 { unsafe { alsa::snd_ctl_elem_id_get_in...
method get_interface (line 422) | pub fn get_interface(&self) -> ElemIface { ElemIface::from_c_int(
method set_device (line 425) | pub fn set_device(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_...
method set_subdevice (line 426) | pub fn set_subdevice(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_...
method set_numid (line 427) | pub fn set_numid(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_s...
method set_index (line 428) | pub fn set_index(&mut self, v: u32) { unsafe { alsa::snd_ctl_elem_id_s...
method set_interface (line 429) | pub fn set_interface(&mut self, v: ElemIface) { unsafe { alsa::snd_ctl...
method set_name (line 430) | pub fn set_name(&mut self, v: &CStr) { unsafe { alsa::snd_ctl_elem_id_...
method new (line 435) | pub fn new(iface: ElemIface) -> Self {
method eq (line 445) | fn eq(&self, a: &ElemId) -> bool {
method fmt (line 453) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
function elem_id_new (line 377) | pub fn elem_id_new() -> Result<ElemId> {
function elem_id_ptr (line 383) | pub fn elem_id_ptr(a: &ElemId) -> *mut alsa::snd_ctl_elem_id_t { a.0.get...
method clone (line 388) | fn clone(&self) -> Self {
type ElemList (line 468) | pub struct ElemList(*mut alsa::snd_ctl_elem_list_t);
method ensure_valid_index (line 489) | fn ensure_valid_index(&self, index: u32) -> Result<()> {
method get_count (line 497) | pub(crate) fn get_count(&self) -> u32 { unsafe { alsa::snd_ctl_elem_li...
method get_used (line 498) | pub fn get_used(&self) -> u32 { unsafe { alsa::snd_ctl_elem_list_get_u...
method get_id (line 499) | pub fn get_id(&self, index: u32) -> Result<ElemId> {
method get_numid (line 505) | pub fn get_numid(&self, index: u32) -> Result<u32> { self.ensure_valid...
method get_interface (line 506) | pub fn get_interface(&self, index: u32) -> Result<ElemIface> {
method get_device (line 510) | pub fn get_device(&self, index: u32) -> Result<u32> { self.ensure_vali...
method get_subdevice (line 511) | pub fn get_subdevice(&self, index: u32) -> Result<u32> { self.ensure_v...
method get_name (line 512) | pub fn get_name(&self, index: u32) -> Result<&str> {
method get_index (line 516) | pub fn get_index(&self, index: u32) -> Result<u32> { self.ensure_valid...
method drop (line 471) | fn drop(&mut self) {
function elem_list_new (line 477) | fn elem_list_new<F: FnOnce(&ElemList) -> Result<u32>>(f: F) -> Result<El...
type Event (line 521) | pub struct Event(*mut alsa::snd_ctl_event_t);
method get_mask (line 533) | pub fn get_mask(&self) -> EventMask { EventMask(unsafe { alsa::snd_ctl...
method get_id (line 534) | pub fn get_id(&self) -> ElemId {
method drop (line 524) | fn drop(&mut self) { unsafe { alsa::snd_ctl_event_free(self.0) }; }
function event_new (line 527) | pub fn event_new() -> Result<Event> {
type EventMask (line 544) | pub struct EventMask(pub u32);
method remove (line 547) | pub fn remove(&self) -> bool { return self.0 & 0xffffffff == 0xffffffff }
method value (line 548) | pub fn value(&self) -> bool { return (!self.remove()) && (self.0 & (1 ...
method info (line 549) | pub fn info(&self) -> bool { return (!self.remove()) && (self.0 & (1 <...
method add (line 550) | pub fn add(&self) -> bool { return (!self.remove()) && (self.0 & (1 <<...
method tlv (line 551) | pub fn tlv(&self) -> bool { return (!self.remove()) && (self.0 & (1 <<...
function print_sizeof (line 555) | fn print_sizeof() {
FILE: src/device_name.rs
type HintIter (line 28) | pub struct HintIter(*mut *mut c_void, isize);
method new (line 36) | pub fn new(card: Option<&Card>, iface: &CStr) -> Result<HintIter> {
method new_str (line 44) | pub fn new_str(card: Option<&Card>, iface: &str) -> Result<HintIter> {
method drop (line 31) | fn drop(&mut self) { unsafe { alsa::snd_device_name_free_hint(self.0); }}
type Item (line 50) | type Item = Hint;
method next (line 51) | fn next(&mut self) -> Option<Hint> {
type Hint (line 63) | pub struct Hint {
method get_str (line 70) | fn get_str(p: *const c_void, name: &str) -> Option<String> {
method new (line 76) | fn new(p: *const c_void) -> Hint {
function print_hints (line 87) | fn print_hints() {
FILE: src/direct/asound_ioctl.rs
type __BindgenBitfieldUnit (line 5) | pub struct __BindgenBitfieldUnit<Storage, Align>
function new (line 18) | pub fn new(storage: Storage) -> Self {
function get_bit (line 23) | pub fn get_bit(&self, index: usize) -> bool {
function set_bit (line 36) | pub fn set_bit(&mut self, index: usize, val: bool) {
function get (line 53) | pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
function set (line 70) | pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
type __IncompleteArrayField (line 84) | pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>);
function new (line 87) | pub fn new() -> Self {
function as_ptr (line 91) | pub unsafe fn as_ptr(&self) -> *const T {
function as_mut_ptr (line 95) | pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
function as_slice (line 99) | pub unsafe fn as_slice(&self, len: usize) -> &[T] {
function as_mut_slice (line 103) | pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
function fmt (line 108) | fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
function clone (line 114) | fn clone(&self) -> Self {
constant __BITS_PER_LONG (line 119) | pub const __BITS_PER_LONG: u32 = 64;
constant __FD_SETSIZE (line 120) | pub const __FD_SETSIZE: u32 = 1024;
constant _FEATURES_H (line 121) | pub const _FEATURES_H: u32 = 1;
constant _DEFAULT_SOURCE (line 122) | pub const _DEFAULT_SOURCE: u32 = 1;
constant __USE_ISOC11 (line 123) | pub const __USE_ISOC11: u32 = 1;
constant __USE_ISOC99 (line 124) | pub const __USE_ISOC99: u32 = 1;
constant __USE_ISOC95 (line 125) | pub const __USE_ISOC95: u32 = 1;
constant __USE_POSIX_IMPLICITLY (line 126) | pub const __USE_POSIX_IMPLICITLY: u32 = 1;
constant _POSIX_SOURCE (line 127) | pub const _POSIX_SOURCE: u32 = 1;
constant _POSIX_C_SOURCE (line 128) | pub const _POSIX_C_SOURCE: u32 = 200809;
constant __USE_POSIX (line 129) | pub const __USE_POSIX: u32 = 1;
constant __USE_POSIX2 (line 130) | pub const __USE_POSIX2: u32 = 1;
constant __USE_POSIX199309 (line 131) | pub const __USE_POSIX199309: u32 = 1;
constant __USE_POSIX199506 (line 132) | pub const __USE_POSIX199506: u32 = 1;
constant __USE_XOPEN2K (line 133) | pub const __USE_XOPEN2K: u32 = 1;
constant __USE_XOPEN2K8 (line 134) | pub const __USE_XOPEN2K8: u32 = 1;
constant _ATFILE_SOURCE (line 135) | pub const _ATFILE_SOURCE: u32 = 1;
constant __USE_MISC (line 136) | pub const __USE_MISC: u32 = 1;
constant __USE_ATFILE (line 137) | pub const __USE_ATFILE: u32 = 1;
constant __USE_FORTIFY_LEVEL (line 138) | pub const __USE_FORTIFY_LEVEL: u32 = 0;
constant _STDC_PREDEF_H (line 139) | pub const _STDC_PREDEF_H: u32 = 1;
constant __STDC_IEC_559__ (line 140) | pub const __STDC_IEC_559__: u32 = 1;
constant __STDC_IEC_559_COMPLEX__ (line 141) | pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
constant __STDC_ISO_10646__ (line 142) | pub const __STDC_ISO_10646__: u32 = 201505;
constant __STDC_NO_THREADS__ (line 143) | pub const __STDC_NO_THREADS__: u32 = 1;
constant __GNU_LIBRARY__ (line 144) | pub const __GNU_LIBRARY__: u32 = 6;
constant __GLIBC__ (line 145) | pub const __GLIBC__: u32 = 2;
constant __GLIBC_MINOR__ (line 146) | pub const __GLIBC_MINOR__: u32 = 23;
constant _SYS_CDEFS_H (line 147) | pub const _SYS_CDEFS_H: u32 = 1;
constant __WORDSIZE (line 148) | pub const __WORDSIZE: u32 = 64;
constant __WORDSIZE_TIME64_COMPAT32 (line 149) | pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
constant __SYSCALL_WORDSIZE (line 150) | pub const __SYSCALL_WORDSIZE: u32 = 64;
constant _STDLIB_H (line 151) | pub const _STDLIB_H: u32 = 1;
constant WNOHANG (line 152) | pub const WNOHANG: u32 = 1;
constant WUNTRACED (line 153) | pub const WUNTRACED: u32 = 2;
constant WSTOPPED (line 154) | pub const WSTOPPED: u32 = 2;
constant WEXITED (line 155) | pub const WEXITED: u32 = 4;
constant WCONTINUED (line 156) | pub const WCONTINUED: u32 = 8;
constant WNOWAIT (line 157) | pub const WNOWAIT: u32 = 16777216;
constant __WNOTHREAD (line 158) | pub const __WNOTHREAD: u32 = 536870912;
constant __WALL (line 159) | pub const __WALL: u32 = 1073741824;
constant __WCLONE (line 160) | pub const __WCLONE: u32 = 2147483648;
constant __ENUM_IDTYPE_T (line 161) | pub const __ENUM_IDTYPE_T: u32 = 1;
constant __W_CONTINUED (line 162) | pub const __W_CONTINUED: u32 = 65535;
constant __WCOREFLAG (line 163) | pub const __WCOREFLAG: u32 = 128;
constant _ENDIAN_H (line 164) | pub const _ENDIAN_H: u32 = 1;
constant __LITTLE_ENDIAN (line 165) | pub const __LITTLE_ENDIAN: u32 = 1234;
constant __BIG_ENDIAN (line 166) | pub const __BIG_ENDIAN: u32 = 4321;
constant __PDP_ENDIAN (line 167) | pub const __PDP_ENDIAN: u32 = 3412;
constant __BYTE_ORDER (line 168) | pub const __BYTE_ORDER: u32 = 1234;
constant __FLOAT_WORD_ORDER (line 169) | pub const __FLOAT_WORD_ORDER: u32 = 1234;
constant LITTLE_ENDIAN (line 170) | pub const LITTLE_ENDIAN: u32 = 1234;
constant BIG_ENDIAN (line 171) | pub const BIG_ENDIAN: u32 = 4321;
constant PDP_ENDIAN (line 172) | pub const PDP_ENDIAN: u32 = 3412;
constant BYTE_ORDER (line 173) | pub const BYTE_ORDER: u32 = 1234;
constant _BITS_BYTESWAP_H (line 174) | pub const _BITS_BYTESWAP_H: u32 = 1;
constant _BITS_TYPES_H (line 175) | pub const _BITS_TYPES_H: u32 = 1;
constant _BITS_TYPESIZES_H (line 176) | pub const _BITS_TYPESIZES_H: u32 = 1;
constant __OFF_T_MATCHES_OFF64_T (line 177) | pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
constant __INO_T_MATCHES_INO64_T (line 178) | pub const __INO_T_MATCHES_INO64_T: u32 = 1;
constant __ldiv_t_defined (line 179) | pub const __ldiv_t_defined: u32 = 1;
constant __lldiv_t_defined (line 180) | pub const __lldiv_t_defined: u32 = 1;
constant RAND_MAX (line 181) | pub const RAND_MAX: u32 = 2147483647;
constant EXIT_FAILURE (line 182) | pub const EXIT_FAILURE: u32 = 1;
constant EXIT_SUCCESS (line 183) | pub const EXIT_SUCCESS: u32 = 0;
constant _SYS_TYPES_H (line 184) | pub const _SYS_TYPES_H: u32 = 1;
constant __clock_t_defined (line 185) | pub const __clock_t_defined: u32 = 1;
constant __time_t_defined (line 186) | pub const __time_t_defined: u32 = 1;
constant __clockid_t_defined (line 187) | pub const __clockid_t_defined: u32 = 1;
constant __timer_t_defined (line 188) | pub const __timer_t_defined: u32 = 1;
constant __BIT_TYPES_DEFINED__ (line 189) | pub const __BIT_TYPES_DEFINED__: u32 = 1;
constant _SYS_SELECT_H (line 190) | pub const _SYS_SELECT_H: u32 = 1;
constant __FD_ZERO_STOS (line 191) | pub const __FD_ZERO_STOS: &'static [u8; 6usize] = b"stosq\0";
constant _SIGSET_H_types (line 192) | pub const _SIGSET_H_types: u32 = 1;
constant __timespec_defined (line 193) | pub const __timespec_defined: u32 = 1;
constant _STRUCT_TIMEVAL (line 194) | pub const _STRUCT_TIMEVAL: u32 = 1;
constant FD_SETSIZE (line 195) | pub const FD_SETSIZE: u32 = 1024;
constant _SYS_SYSMACROS_H (line 196) | pub const _SYS_SYSMACROS_H: u32 = 1;
constant _BITS_PTHREADTYPES_H (line 197) | pub const _BITS_PTHREADTYPES_H: u32 = 1;
constant __SIZEOF_PTHREAD_ATTR_T (line 198) | pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56;
constant __SIZEOF_PTHREAD_MUTEX_T (line 199) | pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40;
constant __SIZEOF_PTHREAD_MUTEXATTR_T (line 200) | pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4;
constant __SIZEOF_PTHREAD_COND_T (line 201) | pub const __SIZEOF_PTHREAD_COND_T: u32 = 48;
constant __SIZEOF_PTHREAD_CONDATTR_T (line 202) | pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4;
constant __SIZEOF_PTHREAD_RWLOCK_T (line 203) | pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56;
constant __SIZEOF_PTHREAD_RWLOCKATTR_T (line 204) | pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8;
constant __SIZEOF_PTHREAD_BARRIER_T (line 205) | pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32;
constant __SIZEOF_PTHREAD_BARRIERATTR_T (line 206) | pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4;
constant __have_pthread_attr_t (line 207) | pub const __have_pthread_attr_t: u32 = 1;
constant __PTHREAD_MUTEX_HAVE_PREV (line 208) | pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1;
constant __PTHREAD_RWLOCK_INT_FLAGS_SHARED (line 209) | pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1;
constant _ALLOCA_H (line 210) | pub const _ALLOCA_H: u32 = 1;
constant SNDRV_PCM_INFO_MMAP (line 211) | pub const SNDRV_PCM_INFO_MMAP: u32 = 1;
constant SNDRV_PCM_INFO_MMAP_VALID (line 212) | pub const SNDRV_PCM_INFO_MMAP_VALID: u32 = 2;
constant SNDRV_PCM_INFO_DOUBLE (line 213) | pub const SNDRV_PCM_INFO_DOUBLE: u32 = 4;
constant SNDRV_PCM_INFO_BATCH (line 214) | pub const SNDRV_PCM_INFO_BATCH: u32 = 16;
constant SNDRV_PCM_INFO_SYNC_APPLPTR (line 215) | pub const SNDRV_PCM_INFO_SYNC_APPLPTR: u32 = 32;
constant SNDRV_PCM_INFO_INTERLEAVED (line 216) | pub const SNDRV_PCM_INFO_INTERLEAVED: u32 = 256;
constant SNDRV_PCM_INFO_NONINTERLEAVED (line 217) | pub const SNDRV_PCM_INFO_NONINTERLEAVED: u32 = 512;
constant SNDRV_PCM_INFO_COMPLEX (line 218) | pub const SNDRV_PCM_INFO_COMPLEX: u32 = 1024;
constant SNDRV_PCM_INFO_BLOCK_TRANSFER (line 219) | pub const SNDRV_PCM_INFO_BLOCK_TRANSFER: u32 = 65536;
constant SNDRV_PCM_INFO_OVERRANGE (line 220) | pub const SNDRV_PCM_INFO_OVERRANGE: u32 = 131072;
constant SNDRV_PCM_INFO_RESUME (line 221) | pub const SNDRV_PCM_INFO_RESUME: u32 = 262144;
constant SNDRV_PCM_INFO_PAUSE (line 222) | pub const SNDRV_PCM_INFO_PAUSE: u32 = 524288;
constant SNDRV_PCM_INFO_HALF_DUPLEX (line 223) | pub const SNDRV_PCM_INFO_HALF_DUPLEX: u32 = 1048576;
constant SNDRV_PCM_INFO_JOINT_DUPLEX (line 224) | pub const SNDRV_PCM_INFO_JOINT_DUPLEX: u32 = 2097152;
constant SNDRV_PCM_INFO_SYNC_START (line 225) | pub const SNDRV_PCM_INFO_SYNC_START: u32 = 4194304;
constant SNDRV_PCM_INFO_NO_PERIOD_WAKEUP (line 226) | pub const SNDRV_PCM_INFO_NO_PERIOD_WAKEUP: u32 = 8388608;
constant SNDRV_PCM_INFO_HAS_WALL_CLOCK (line 227) | pub const SNDRV_PCM_INFO_HAS_WALL_CLOCK: u32 = 16777216;
constant SNDRV_PCM_INFO_HAS_LINK_ATIME (line 228) | pub const SNDRV_PCM_INFO_HAS_LINK_ATIME: u32 = 16777216;
constant SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME (line 229) | pub const SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME: u32 = 33554432;
constant SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME (line 230) | pub const SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME: u32 = 67108864;
constant SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME (line 231) | pub const SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME: u32 = 134217728;
constant SNDRV_PCM_INFO_DRAIN_TRIGGER (line 232) | pub const SNDRV_PCM_INFO_DRAIN_TRIGGER: u32 = 1073741824;
constant SNDRV_PCM_INFO_FIFO_IN_FRAMES (line 233) | pub const SNDRV_PCM_INFO_FIFO_IN_FRAMES: u32 = 2147483648;
constant SNDRV_PCM_HW_PARAM_ACCESS (line 234) | pub const SNDRV_PCM_HW_PARAM_ACCESS: u32 = 0;
constant SNDRV_PCM_HW_PARAM_FORMAT (line 235) | pub const SNDRV_PCM_HW_PARAM_FORMAT: u32 = 1;
constant SNDRV_PCM_HW_PARAM_SUBFORMAT (line 236) | pub const SNDRV_PCM_HW_PARAM_SUBFORMAT: u32 = 2;
constant SNDRV_PCM_HW_PARAM_FIRST_MASK (line 237) | pub const SNDRV_PCM_HW_PARAM_FIRST_MASK: u32 = 0;
constant SNDRV_PCM_HW_PARAM_LAST_MASK (line 238) | pub const SNDRV_PCM_HW_PARAM_LAST_MASK: u32 = 2;
constant SNDRV_PCM_HW_PARAM_SAMPLE_BITS (line 239) | pub const SNDRV_PCM_HW_PARAM_SAMPLE_BITS: u32 = 8;
constant SNDRV_PCM_HW_PARAM_FRAME_BITS (line 240) | pub const SNDRV_PCM_HW_PARAM_FRAME_BITS: u32 = 9;
constant SNDRV_PCM_HW_PARAM_CHANNELS (line 241) | pub const SNDRV_PCM_HW_PARAM_CHANNELS: u32 = 10;
constant SNDRV_PCM_HW_PARAM_RATE (line 242) | pub const SNDRV_PCM_HW_PARAM_RATE: u32 = 11;
constant SNDRV_PCM_HW_PARAM_PERIOD_TIME (line 243) | pub const SNDRV_PCM_HW_PARAM_PERIOD_TIME: u32 = 12;
constant SNDRV_PCM_HW_PARAM_PERIOD_SIZE (line 244) | pub const SNDRV_PCM_HW_PARAM_PERIOD_SIZE: u32 = 13;
constant SNDRV_PCM_HW_PARAM_PERIOD_BYTES (line 245) | pub const SNDRV_PCM_HW_PARAM_PERIOD_BYTES: u32 = 14;
constant SNDRV_PCM_HW_PARAM_PERIODS (line 246) | pub const SNDRV_PCM_HW_PARAM_PERIODS: u32 = 15;
constant SNDRV_PCM_HW_PARAM_BUFFER_TIME (line 247) | pub const SNDRV_PCM_HW_PARAM_BUFFER_TIME: u32 = 16;
constant SNDRV_PCM_HW_PARAM_BUFFER_SIZE (line 248) | pub const SNDRV_PCM_HW_PARAM_BUFFER_SIZE: u32 = 17;
constant SNDRV_PCM_HW_PARAM_BUFFER_BYTES (line 249) | pub const SNDRV_PCM_HW_PARAM_BUFFER_BYTES: u32 = 18;
constant SNDRV_PCM_HW_PARAM_TICK_TIME (line 250) | pub const SNDRV_PCM_HW_PARAM_TICK_TIME: u32 = 19;
constant SNDRV_PCM_HW_PARAM_FIRST_INTERVAL (line 251) | pub const SNDRV_PCM_HW_PARAM_FIRST_INTERVAL: u32 = 8;
constant SNDRV_PCM_HW_PARAM_LAST_INTERVAL (line 252) | pub const SNDRV_PCM_HW_PARAM_LAST_INTERVAL: u32 = 19;
constant SNDRV_PCM_HW_PARAMS_NORESAMPLE (line 253) | pub const SNDRV_PCM_HW_PARAMS_NORESAMPLE: u32 = 1;
constant SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (line 254) | pub const SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER: u32 = 2;
constant SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (line 255) | pub const SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP: u32 = 4;
constant SNDRV_MASK_MAX (line 256) | pub const SNDRV_MASK_MAX: u32 = 256;
constant SNDRV_PCM_SYNC_PTR_HWSYNC (line 257) | pub const SNDRV_PCM_SYNC_PTR_HWSYNC: u32 = 1;
constant SNDRV_PCM_SYNC_PTR_APPL (line 258) | pub const SNDRV_PCM_SYNC_PTR_APPL: u32 = 2;
constant SNDRV_PCM_SYNC_PTR_AVAIL_MIN (line 259) | pub const SNDRV_PCM_SYNC_PTR_AVAIL_MIN: u32 = 4;
constant SNDRV_CHMAP_POSITION_MASK (line 260) | pub const SNDRV_CHMAP_POSITION_MASK: u32 = 65535;
constant SNDRV_CHMAP_PHASE_INVERSE (line 261) | pub const SNDRV_CHMAP_PHASE_INVERSE: u32 = 65536;
constant SNDRV_CHMAP_DRIVER_SPEC (line 262) | pub const SNDRV_CHMAP_DRIVER_SPEC: u32 = 131072;
constant SNDRV_RAWMIDI_INFO_OUTPUT (line 263) | pub const SNDRV_RAWMIDI_INFO_OUTPUT: u32 = 1;
constant SNDRV_RAWMIDI_INFO_INPUT (line 264) | pub const SNDRV_RAWMIDI_INFO_INPUT: u32 = 2;
constant SNDRV_RAWMIDI_INFO_DUPLEX (line 265) | pub const SNDRV_RAWMIDI_INFO_DUPLEX: u32 = 4;
constant SNDRV_TIMER_GLOBAL_SYSTEM (line 266) | pub const SNDRV_TIMER_GLOBAL_SYSTEM: u32 = 0;
constant SNDRV_TIMER_GLOBAL_RTC (line 267) | pub const SNDRV_TIMER_GLOBAL_RTC: u32 = 1;
constant SNDRV_TIMER_GLOBAL_HPET (line 268) | pub const SNDRV_TIMER_GLOBAL_HPET: u32 = 2;
constant SNDRV_TIMER_GLOBAL_HRTIMER (line 269) | pub const SNDRV_TIMER_GLOBAL_HRTIMER: u32 = 3;
constant SNDRV_TIMER_FLG_SLAVE (line 270) | pub const SNDRV_TIMER_FLG_SLAVE: u32 = 1;
constant SNDRV_TIMER_PSFLG_AUTO (line 271) | pub const SNDRV_TIMER_PSFLG_AUTO: u32 = 1;
constant SNDRV_TIMER_PSFLG_EXCLUSIVE (line 272) | pub const SNDRV_TIMER_PSFLG_EXCLUSIVE: u32 = 2;
constant SNDRV_TIMER_PSFLG_EARLY_EVENT (line 273) | pub const SNDRV_TIMER_PSFLG_EARLY_EVENT: u32 = 4;
constant SNDRV_CTL_ELEM_ACCESS_READ (line 274) | pub const SNDRV_CTL_ELEM_ACCESS_READ: u32 = 1;
constant SNDRV_CTL_ELEM_ACCESS_WRITE (line 275) | pub const SNDRV_CTL_ELEM_ACCESS_WRITE: u32 = 2;
constant SNDRV_CTL_ELEM_ACCESS_READWRITE (line 276) | pub const SNDRV_CTL_ELEM_ACCESS_READWRITE: u32 = 3;
constant SNDRV_CTL_ELEM_ACCESS_VOLATILE (line 277) | pub const SNDRV_CTL_ELEM_ACCESS_VOLATILE: u32 = 4;
constant SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (line 278) | pub const SNDRV_CTL_ELEM_ACCESS_TIMESTAMP: u32 = 8;
constant SNDRV_CTL_ELEM_ACCESS_TLV_READ (line 279) | pub const SNDRV_CTL_ELEM_ACCESS_TLV_READ: u32 = 16;
constant SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (line 280) | pub const SNDRV_CTL_ELEM_ACCESS_TLV_WRITE: u32 = 32;
constant SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (line 281) | pub const SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE: u32 = 48;
constant SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (line 282) | pub const SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND: u32 = 64;
constant SNDRV_CTL_ELEM_ACCESS_INACTIVE (line 283) | pub const SNDRV_CTL_ELEM_ACCESS_INACTIVE: u32 = 256;
constant SNDRV_CTL_ELEM_ACCESS_LOCK (line 284) | pub const SNDRV_CTL_ELEM_ACCESS_LOCK: u32 = 512;
constant SNDRV_CTL_ELEM_ACCESS_OWNER (line 285) | pub const SNDRV_CTL_ELEM_ACCESS_OWNER: u32 = 1024;
constant SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (line 286) | pub const SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK: u32 = 268435456;
constant SNDRV_CTL_ELEM_ACCESS_USER (line 287) | pub const SNDRV_CTL_ELEM_ACCESS_USER: u32 = 536870912;
constant SNDRV_CTL_POWER_D0 (line 288) | pub const SNDRV_CTL_POWER_D0: u32 = 0;
constant SNDRV_CTL_POWER_D1 (line 289) | pub const SNDRV_CTL_POWER_D1: u32 = 256;
constant SNDRV_CTL_POWER_D2 (line 290) | pub const SNDRV_CTL_POWER_D2: u32 = 512;
constant SNDRV_CTL_POWER_D3 (line 291) | pub const SNDRV_CTL_POWER_D3: u32 = 768;
constant SNDRV_CTL_POWER_D3hot (line 292) | pub const SNDRV_CTL_POWER_D3hot: u32 = 768;
constant SNDRV_CTL_POWER_D3cold (line 293) | pub const SNDRV_CTL_POWER_D3cold: u32 = 769;
constant SNDRV_CTL_ELEM_ID_NAME_MAXLEN (line 294) | pub const SNDRV_CTL_ELEM_ID_NAME_MAXLEN: u32 = 44;
constant SNDRV_CTL_EVENT_MASK_VALUE (line 295) | pub const SNDRV_CTL_EVENT_MASK_VALUE: u32 = 1;
constant SNDRV_CTL_EVENT_MASK_INFO (line 296) | pub const SNDRV_CTL_EVENT_MASK_INFO: u32 = 2;
constant SNDRV_CTL_EVENT_MASK_ADD (line 297) | pub const SNDRV_CTL_EVENT_MASK_ADD: u32 = 4;
constant SNDRV_CTL_EVENT_MASK_TLV (line 298) | pub const SNDRV_CTL_EVENT_MASK_TLV: u32 = 8;
constant SNDRV_CTL_EVENT_MASK_REMOVE (line 299) | pub const SNDRV_CTL_EVENT_MASK_REMOVE: i32 = -1;
constant SNDRV_CTL_NAME_NONE (line 300) | pub const SNDRV_CTL_NAME_NONE: &'static [u8; 1usize] = b"\0";
constant SNDRV_CTL_NAME_PLAYBACK (line 301) | pub const SNDRV_CTL_NAME_PLAYBACK: &'static [u8; 10usize] = b"Playback \0";
constant SNDRV_CTL_NAME_CAPTURE (line 302) | pub const SNDRV_CTL_NAME_CAPTURE: &'static [u8; 9usize] = b"Capture \0";
constant SNDRV_CTL_NAME_IEC958_NONE (line 303) | pub const SNDRV_CTL_NAME_IEC958_NONE: &'static [u8; 1usize] = b"\0";
constant SNDRV_CTL_NAME_IEC958_SWITCH (line 304) | pub const SNDRV_CTL_NAME_IEC958_SWITCH: &'static [u8; 7usize] = b"Switch...
constant SNDRV_CTL_NAME_IEC958_VOLUME (line 305) | pub const SNDRV_CTL_NAME_IEC958_VOLUME: &'static [u8; 7usize] = b"Volume...
constant SNDRV_CTL_NAME_IEC958_DEFAULT (line 306) | pub const SNDRV_CTL_NAME_IEC958_DEFAULT: &'static [u8; 8usize] = b"Defau...
constant SNDRV_CTL_NAME_IEC958_MASK (line 307) | pub const SNDRV_CTL_NAME_IEC958_MASK: &'static [u8; 5usize] = b"Mask\0";
constant SNDRV_CTL_NAME_IEC958_CON_MASK (line 308) | pub const SNDRV_CTL_NAME_IEC958_CON_MASK: &'static [u8; 9usize] = b"Con ...
constant SNDRV_CTL_NAME_IEC958_PRO_MASK (line 309) | pub const SNDRV_CTL_NAME_IEC958_PRO_MASK: &'static [u8; 9usize] = b"Pro ...
constant SNDRV_CTL_NAME_IEC958_PCM_STREAM (line 310) | pub const SNDRV_CTL_NAME_IEC958_PCM_STREAM: &'static [u8; 11usize] = b"P...
type __s8 (line 311) | pub type __s8 = ::core::ffi::c_schar;
type __u8 (line 312) | pub type __u8 = ::core::ffi::c_uchar;
type __s16 (line 313) | pub type __s16 = ::core::ffi::c_short;
type __u16 (line 314) | pub type __u16 = ::core::ffi::c_ushort;
type __s32 (line 315) | pub type __s32 = ::core::ffi::c_int;
type __u32 (line 316) | pub type __u32 = ::core::ffi::c_uint;
type __s64 (line 317) | pub type __s64 = ::core::ffi::c_longlong;
type __u64 (line 318) | pub type __u64 = ::core::ffi::c_ulonglong;
type __kernel_fd_set (line 321) | pub struct __kernel_fd_set {
function bindgen_test_layout___kernel_fd_set (line 325) | fn bindgen_test_layout___kernel_fd_set() {
type __kernel_sighandler_t (line 347) | pub type __kernel_sighandler_t =
type __kernel_key_t (line 349) | pub type __kernel_key_t = ::core::ffi::c_int;
type __kernel_mqd_t (line 350) | pub type __kernel_mqd_t = ::core::ffi::c_int;
type __kernel_old_uid_t (line 351) | pub type __kernel_old_uid_t = ::core::ffi::c_ushort;
type __kernel_old_gid_t (line 352) | pub type __kernel_old_gid_t = ::core::ffi::c_ushort;
type __kernel_old_dev_t (line 353) | pub type __kernel_old_dev_t = ::core::ffi::c_ulong;
type __kernel_long_t (line 354) | pub type __kernel_long_t = ::core::ffi::c_long;
type __kernel_ulong_t (line 355) | pub type __kernel_ulong_t = ::core::ffi::c_ulong;
type __kernel_ino_t (line 356) | pub type __kernel_ino_t = __kernel_ulong_t;
type __kernel_mode_t (line 357) | pub type __kernel_mode_t = ::core::ffi::c_uint;
type __kernel_pid_t (line 358) | pub type __kernel_pid_t = ::core::ffi::c_int;
type __kernel_ipc_pid_t (line 359) | pub type __kernel_ipc_pid_t = ::core::ffi::c_int;
type __kernel_uid_t (line 360) | pub type __kernel_uid_t = ::core::ffi::c_uint;
type __kernel_gid_t (line 361) | pub type __kernel_gid_t = ::core::ffi::c_uint;
type __kernel_suseconds_t (line 362) | pub type __kernel_suseconds_t = __kernel_long_t;
type __kernel_daddr_t (line 363) | pub type __kernel_daddr_t = ::core::ffi::c_int;
type __kernel_uid32_t (line 364) | pub type __kernel_uid32_t = ::core::ffi::c_uint;
type __kernel_gid32_t (line 365) | pub type __kernel_gid32_t = ::core::ffi::c_uint;
type __kernel_size_t (line 366) | pub type __kernel_size_t = __kernel_ulong_t;
type __kernel_ssize_t (line 367) | pub type __kernel_ssize_t = __kernel_long_t;
type __kernel_ptrdiff_t (line 368) | pub type __kernel_ptrdiff_t = __kernel_long_t;
type __kernel_fsid_t (line 371) | pub struct __kernel_fsid_t {
function bindgen_test_layout___kernel_fsid_t (line 375) | fn bindgen_test_layout___kernel_fsid_t() {
type __kernel_off_t (line 397) | pub type __kernel_off_t = __kernel_long_t;
type __kernel_loff_t (line 398) | pub type __kernel_loff_t = ::core::ffi::c_longlong;
type __kernel_time_t (line 399) | pub type __kernel_time_t = __kernel_long_t;
type __kernel_clock_t (line 400) | pub type __kernel_clock_t = __kernel_long_t;
type __kernel_timer_t (line 401) | pub type __kernel_timer_t = ::core::ffi::c_int;
type __kernel_clockid_t (line 402) | pub type __kernel_clockid_t = ::core::ffi::c_int;
type __kernel_caddr_t (line 403) | pub type __kernel_caddr_t = *mut ::core::ffi::c_char;
type __kernel_uid16_t (line 404) | pub type __kernel_uid16_t = ::core::ffi::c_ushort;
type __kernel_gid16_t (line 405) | pub type __kernel_gid16_t = ::core::ffi::c_ushort;
type __le16 (line 406) | pub type __le16 = __u16;
type __be16 (line 407) | pub type __be16 = __u16;
type __le32 (line 408) | pub type __le32 = __u32;
type __be32 (line 409) | pub type __be32 = __u32;
type __le64 (line 410) | pub type __le64 = __u64;
type __be64 (line 411) | pub type __be64 = __u64;
type __sum16 (line 412) | pub type __sum16 = __u16;
type __wsum (line 413) | pub type __wsum = __u32;
type wchar_t (line 414) | pub type wchar_t = ::core::ffi::c_int;
constant idtype_t_P_ALL (line 415) | pub const idtype_t_P_ALL: idtype_t = 0;
constant idtype_t_P_PID (line 416) | pub const idtype_t_P_PID: idtype_t = 1;
constant idtype_t_P_PGID (line 417) | pub const idtype_t_P_PGID: idtype_t = 2;
type idtype_t (line 418) | pub type idtype_t = u32;
type __u_char (line 419) | pub type __u_char = ::core::ffi::c_uchar;
type __u_short (line 420) | pub type __u_short = ::core::ffi::c_ushort;
type __u_int (line 421) | pub type __u_int = ::core::ffi::c_uint;
type __u_long (line 422) | pub type __u_long = ::core::ffi::c_ulong;
type __int8_t (line 423) | pub type __int8_t = ::core::ffi::c_schar;
type __uint8_t (line 424) | pub type __uint8_t = ::core::ffi::c_uchar;
type __int16_t (line 425) | pub type __int16_t = ::core::ffi::c_short;
type __uint16_t (line 426) | pub type __uint16_t = ::core::ffi::c_ushort;
type __int32_t (line 427) | pub type __int32_t = ::core::ffi::c_int;
type __uint32_t (line 428) | pub type __uint32_t = ::core::ffi::c_uint;
type __int64_t (line 429) | pub type __int64_t = ::core::ffi::c_long;
type __uint64_t (line 430) | pub type __uint64_t = ::core::ffi::c_ulong;
type __quad_t (line 431) | pub type __quad_t = ::core::ffi::c_long;
type __u_quad_t (line 432) | pub type __u_quad_t = ::core::ffi::c_ulong;
type __dev_t (line 433) | pub type __dev_t = ::core::ffi::c_ulong;
type __uid_t (line 434) | pub type __uid_t = ::core::ffi::c_uint;
type __gid_t (line 435) | pub type __gid_t = ::core::ffi::c_uint;
type __ino_t (line 436) | pub type __ino_t = ::core::ffi::c_ulong;
type __ino64_t (line 437) | pub type __ino64_t = ::core::ffi::c_ulong;
type __mode_t (line 438) | pub type __mode_t = ::core::ffi::c_uint;
type __nlink_t (line 439) | pub type __nlink_t = ::core::ffi::c_ulong;
type __off_t (line 440) | pub type __off_t = ::core::ffi::c_long;
type __off64_t (line 441) | pub type __off64_t = ::core::ffi::c_long;
type __pid_t (line 442) | pub type __pid_t = ::core::ffi::c_int;
type __fsid_t (line 445) | pub struct __fsid_t {
function bindgen_test_layout___fsid_t (line 449) | fn bindgen_test_layout___fsid_t() {
type __clock_t (line 471) | pub type __clock_t = ::core::ffi::c_long;
type __rlim_t (line 472) | pub type __rlim_t = ::core::ffi::c_ulong;
type __rlim64_t (line 473) | pub type __rlim64_t = ::core::ffi::c_ulong;
type __id_t (line 474) | pub type __id_t = ::core::ffi::c_uint;
type __time_t (line 475) | pub type __time_t = ::core::ffi::c_long;
type __useconds_t (line 476) | pub type __useconds_t = ::core::ffi::c_uint;
type __suseconds_t (line 477) | pub type __suseconds_t = ::core::ffi::c_long;
type __daddr_t (line 478) | pub type __daddr_t = ::core::ffi::c_int;
type __key_t (line 479) | pub type __key_t = ::core::ffi::c_int;
type __clockid_t (line 480) | pub type __clockid_t = ::core::ffi::c_int;
type __timer_t (line 481) | pub type __timer_t = *mut ::core::ffi::c_void;
type __blksize_t (line 482) | pub type __blksize_t = ::core::ffi::c_long;
type __blkcnt_t (line 483) | pub type __blkcnt_t = ::core::ffi::c_long;
type __blkcnt64_t (line 484) | pub type __blkcnt64_t = ::core::ffi::c_long;
type __fsblkcnt_t (line 485) | pub type __fsblkcnt_t = ::core::ffi::c_ulong;
type __fsblkcnt64_t (line 486) | pub type __fsblkcnt64_t = ::core::ffi::c_ulong;
type __fsfilcnt_t (line 487) | pub type __fsfilcnt_t = ::core::ffi::c_ulong;
type __fsfilcnt64_t (line 488) | pub type __fsfilcnt64_t = ::core::ffi::c_ulong;
type __fsword_t (line 489) | pub type __fsword_t = ::core::ffi::c_long;
type __ssize_t (line 490) | pub type __ssize_t = ::core::ffi::c_long;
type __syscall_slong_t (line 491) | pub type __syscall_slong_t = ::core::ffi::c_long;
type __syscall_ulong_t (line 492) | pub type __syscall_ulong_t = ::core::ffi::c_ulong;
type __loff_t (line 493) | pub type __loff_t = __off64_t;
type __qaddr_t (line 494) | pub type __qaddr_t = *mut __quad_t;
type __caddr_t (line 495) | pub type __caddr_t = *mut ::core::ffi::c_char;
type __intptr_t (line 496) | pub type __intptr_t = ::core::ffi::c_long;
type __socklen_t (line 497) | pub type __socklen_t = ::core::ffi::c_uint;
type wait__bindgen_ty_1 (line 508) | pub struct wait__bindgen_ty_1 {
method __w_termsig (line 527) | pub fn __w_termsig(&self) -> ::core::ffi::c_uint {
method set___w_termsig (line 531) | pub fn set___w_termsig(&mut self, val: ::core::ffi::c_uint) {
method __w_coredump (line 538) | pub fn __w_coredump(&self) -> ::core::ffi::c_uint {
method set___w_coredump (line 542) | pub fn set___w_coredump(&mut self, val: ::core::ffi::c_uint) {
method __w_retcode (line 549) | pub fn __w_retcode(&self) -> ::core::ffi::c_uint {
method set___w_retcode (line 553) | pub fn set___w_retcode(&mut self, val: ::core::ffi::c_uint) {
method new_bitfield_1 (line 560) | pub fn new_bitfield_1(
function bindgen_test_layout_wait__bindgen_ty_1 (line 513) | fn bindgen_test_layout_wait__bindgen_ty_1() {
type wait__bindgen_ty_2 (line 584) | pub struct wait__bindgen_ty_2 {
method __w_stopval (line 603) | pub fn __w_stopval(&self) -> ::core::ffi::c_uint {
method set___w_stopval (line 607) | pub fn set___w_stopval(&mut self, val: ::core::ffi::c_uint) {
method __w_stopsig (line 614) | pub fn __w_stopsig(&self) -> ::core::ffi::c_uint {
method set___w_stopsig (line 618) | pub fn set___w_stopsig(&mut self, val: ::core::ffi::c_uint) {
method new_bitfield_1 (line 625) | pub fn new_bitfield_1(
function bindgen_test_layout_wait__bindgen_ty_2 (line 589) | fn bindgen_test_layout_wait__bindgen_ty_2() {
function bindgen_test_layout_wait (line 643) | fn bindgen_test_layout_wait() {
function bindgen_test_layout___WAIT_STATUS (line 693) | fn bindgen_test_layout___WAIT_STATUS() {
type div_t (line 727) | pub struct div_t {
function bindgen_test_layout_div_t (line 732) | fn bindgen_test_layout_div_t() {
type ldiv_t (line 766) | pub struct ldiv_t {
function bindgen_test_layout_ldiv_t (line 771) | fn bindgen_test_layout_ldiv_t() {
type lldiv_t (line 805) | pub struct lldiv_t {
function bindgen_test_layout_lldiv_t (line 810) | fn bindgen_test_layout_lldiv_t() {
function __ctype_get_mb_cur_max (line 843) | pub fn __ctype_get_mb_cur_max() -> usize;
function atof (line 846) | pub fn atof(__nptr: *const ::core::ffi::c_char) -> f64;
function atoi (line 849) | pub fn atoi(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
function atol (line 852) | pub fn atol(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
function atoll (line 855) | pub fn atoll(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_longl...
function strtod (line 858) | pub fn strtod(
function strtof (line 864) | pub fn strtof(
function strtold (line 870) | pub fn strtold(
function strtol (line 876) | pub fn strtol(
function strtoul (line 883) | pub fn strtoul(
function strtoq (line 890) | pub fn strtoq(
function strtouq (line 897) | pub fn strtouq(
function strtoll (line 904) | pub fn strtoll(
function strtoull (line 911) | pub fn strtoull(
function l64a (line 918) | pub fn l64a(__n: ::core::ffi::c_long) -> *mut ::core::ffi::c_char;
function a64l (line 921) | pub fn a64l(__s: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
type u_char (line 923) | pub type u_char = __u_char;
type u_short (line 924) | pub type u_short = __u_short;
type u_int (line 925) | pub type u_int = __u_int;
type u_long (line 926) | pub type u_long = __u_long;
type quad_t (line 927) | pub type quad_t = __quad_t;
type u_quad_t (line 928) | pub type u_quad_t = __u_quad_t;
type fsid_t (line 929) | pub type fsid_t = __fsid_t;
type loff_t (line 930) | pub type loff_t = __loff_t;
type ino_t (line 931) | pub type ino_t = __ino_t;
type dev_t (line 932) | pub type dev_t = __dev_t;
type gid_t (line 933) | pub type gid_t = __gid_t;
type mode_t (line 934) | pub type mode_t = __mode_t;
type nlink_t (line 935) | pub type nlink_t = __nlink_t;
type uid_t (line 936) | pub type uid_t = __uid_t;
type off_t (line 937) | pub type off_t = __off_t;
type pid_t (line 938) | pub type pid_t = __pid_t;
type id_t (line 939) | pub type id_t = __id_t;
type daddr_t (line 940) | pub type daddr_t = __daddr_t;
type caddr_t (line 941) | pub type caddr_t = __caddr_t;
type key_t (line 942) | pub type key_t = __key_t;
type clock_t (line 943) | pub type clock_t = __clock_t;
type time_t (line 944) | pub type time_t = __time_t;
type clockid_t (line 945) | pub type clockid_t = __clockid_t;
type timer_t (line 946) | pub type timer_t = __timer_t;
type ulong (line 947) | pub type ulong = ::core::ffi::c_ulong;
type ushort (line 948) | pub type ushort = ::core::ffi::c_ushort;
type uint (line 949) | pub type uint = ::core::ffi::c_uint;
type u_int8_t (line 950) | pub type u_int8_t = ::core::ffi::c_uchar;
type u_int16_t (line 951) | pub type u_int16_t = ::core::ffi::c_ushort;
type u_int32_t (line 952) | pub type u_int32_t = ::core::ffi::c_uint;
type u_int64_t (line 953) | pub type u_int64_t = ::core::ffi::c_ulong;
type register_t (line 954) | pub type register_t = ::core::ffi::c_long;
type __sig_atomic_t (line 955) | pub type __sig_atomic_t = ::core::ffi::c_int;
type __sigset_t (line 958) | pub struct __sigset_t {
function bindgen_test_layout___sigset_t (line 962) | fn bindgen_test_layout___sigset_t() {
type sigset_t (line 984) | pub type sigset_t = __sigset_t;
type timespec (line 987) | pub struct timespec {
function bindgen_test_layout_timespec (line 992) | fn bindgen_test_layout_timespec() {
type timeval (line 1026) | pub struct timeval {
function bindgen_test_layout_timeval (line 1031) | fn bindgen_test_layout_timeval() {
type suseconds_t (line 1063) | pub type suseconds_t = __suseconds_t;
type __fd_mask (line 1064) | pub type __fd_mask = ::core::ffi::c_long;
type fd_set (line 1067) | pub struct fd_set {
function bindgen_test_layout_fd_set (line 1071) | fn bindgen_test_layout_fd_set() {
type fd_mask (line 1093) | pub type fd_mask = __fd_mask;
function select (line 1095) | pub fn select(
function pselect (line 1104) | pub fn pselect(
function gnu_dev_major (line 1114) | pub fn gnu_dev_major(__dev: ::core::ffi::c_ulonglong) -> ::core::ffi::c_...
function gnu_dev_minor (line 1117) | pub fn gnu_dev_minor(__dev: ::core::ffi::c_ulonglong) -> ::core::ffi::c_...
function gnu_dev_makedev (line 1120) | pub fn gnu_dev_makedev(
type blksize_t (line 1125) | pub type blksize_t = __blksize_t;
type blkcnt_t (line 1126) | pub type blkcnt_t = __blkcnt_t;
type fsblkcnt_t (line 1127) | pub type fsblkcnt_t = __fsblkcnt_t;
type fsfilcnt_t (line 1128) | pub type fsfilcnt_t = __fsfilcnt_t;
type pthread_t (line 1129) | pub type pthread_t = ::core::ffi::c_ulong;
function bindgen_test_layout_pthread_attr_t (line 1138) | fn bindgen_test_layout_pthread_attr_t() {
type __pthread_internal_list (line 1172) | pub struct __pthread_internal_list {
function bindgen_test_layout___pthread_internal_list (line 1177) | fn bindgen_test_layout___pthread_internal_list() {
type __pthread_list_t (line 1209) | pub type __pthread_list_t = __pthread_internal_list;
type pthread_mutex_t___pthread_mutex_s (line 1220) | pub struct pthread_mutex_t___pthread_mutex_s {
function bindgen_test_layout_pthread_mutex_t___pthread_mutex_s (line 1231) | fn bindgen_test_layout_pthread_mutex_t___pthread_mutex_s() {
function bindgen_test_layout_pthread_mutex_t (line 1351) | fn bindgen_test_layout_pthread_mutex_t() {
function bindgen_test_layout_pthread_mutexattr_t (line 1401) | fn bindgen_test_layout_pthread_mutexattr_t() {
type pthread_cond_t__bindgen_ty_1 (line 1443) | pub struct pthread_cond_t__bindgen_ty_1 {
function bindgen_test_layout_pthread_cond_t__bindgen_ty_1 (line 1454) | fn bindgen_test_layout_pthread_cond_t__bindgen_ty_1() {
function bindgen_test_layout_pthread_cond_t (line 1567) | fn bindgen_test_layout_pthread_cond_t() {
function bindgen_test_layout_pthread_condattr_t (line 1617) | fn bindgen_test_layout_pthread_condattr_t() {
type pthread_key_t (line 1649) | pub type pthread_key_t = ::core::ffi::c_uint;
type pthread_once_t (line 1650) | pub type pthread_once_t = ::core::ffi::c_int;
type pthread_rwlock_t__bindgen_ty_1 (line 1661) | pub struct pthread_rwlock_t__bindgen_ty_1 {
function bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1 (line 1676) | fn bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1() {
function bindgen_test_layout_pthread_rwlock_t (line 1839) | fn bindgen_test_layout_pthread_rwlock_t() {
function bindgen_test_layout_pthread_rwlockattr_t (line 1889) | fn bindgen_test_layout_pthread_rwlockattr_t() {
type pthread_spinlock_t (line 1921) | pub type pthread_spinlock_t = ::core::ffi::c_int;
function bindgen_test_layout_pthread_barrier_t (line 1930) | fn bindgen_test_layout_pthread_barrier_t() {
function bindgen_test_layout_pthread_barrierattr_t (line 1970) | fn bindgen_test_layout_pthread_barrierattr_t() {
function random (line 2003) | pub fn random() -> ::core::ffi::c_long;
function srandom (line 2006) | pub fn srandom(__seed: ::core::ffi::c_uint);
function initstate (line 2009) | pub fn initstate(
function setstate (line 2016) | pub fn setstate(__statebuf: *mut ::core::ffi::c_char) -> *mut ::core::ff...
type random_data (line 2020) | pub struct random_data {
function bindgen_test_layout_random_data (line 2030) | fn bindgen_test_layout_random_data() {
function random_r (line 2113) | pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::core::...
function srandom_r (line 2116) | pub fn srandom_r(
function initstate_r (line 2122) | pub fn initstate_r(
function setstate_r (line 2130) | pub fn setstate_r(
function rand (line 2136) | pub fn rand() -> ::core::ffi::c_int;
function srand (line 2139) | pub fn srand(__seed: ::core::ffi::c_uint);
function rand_r (line 2142) | pub fn rand_r(__seed: *mut ::core::ffi::c_uint) -> ::core::ffi::c_int;
function drand48 (line 2145) | pub fn drand48() -> f64;
function erand48 (line 2148) | pub fn erand48(__xsubi: *mut ::core::ffi::c_ushort) -> f64;
function lrand48 (line 2151) | pub fn lrand48() -> ::core::ffi::c_long;
function nrand48 (line 2154) | pub fn nrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
function mrand48 (line 2157) | pub fn mrand48() -> ::core::ffi::c_long;
function jrand48 (line 2160) | pub fn jrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
function srand48 (line 2163) | pub fn srand48(__seedval: ::core::ffi::c_long);
function seed48 (line 2166) | pub fn seed48(__seed16v: *mut ::core::ffi::c_ushort) -> *mut ::core::ffi...
function lcong48 (line 2169) | pub fn lcong48(__param: *mut ::core::ffi::c_ushort);
type drand48_data (line 2173) | pub struct drand48_data {
function bindgen_test_layout_drand48_data (line 2181) | fn bindgen_test_layout_drand48_data() {
function drand48_r (line 2244) | pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::c...
function erand48_r (line 2247) | pub fn erand48_r(
function lrand48_r (line 2254) | pub fn lrand48_r(
function nrand48_r (line 2260) | pub fn nrand48_r(
function mrand48_r (line 2267) | pub fn mrand48_r(
function jrand48_r (line 2273) | pub fn jrand48_r(
function srand48_r (line 2280) | pub fn srand48_r(
function seed48_r (line 2286) | pub fn seed48_r(
function lcong48_r (line 2292) | pub fn lcong48_r(
function malloc (line 2298) | pub fn malloc(__size: usize) -> *mut ::core::ffi::c_void;
function calloc (line 2301) | pub fn calloc(__nmemb: usize, __size: usize) -> *mut ::core::ffi::c_void;
function realloc (line 2304) | pub fn realloc(
function free (line 2310) | pub fn free(__ptr: *mut ::core::ffi::c_void);
function cfree (line 2313) | pub fn cfree(__ptr: *mut ::core::ffi::c_void);
function alloca (line 2316) | pub fn alloca(__size: usize) -> *mut ::core::ffi::c_void;
function valloc (line 2319) | pub fn valloc(__size: usize) -> *mut ::core::ffi::c_void;
function posix_memalign (line 2322) | pub fn posix_memalign(
function aligned_alloc (line 2329) | pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::core::...
function abort (line 2332) | pub fn abort();
function atexit (line 2335) | pub fn atexit(__func: ::core::option::Option<unsafe extern "C" fn()>) ->...
function at_quick_exit (line 2338) | pub fn at_quick_exit(
function on_exit (line 2343) | pub fn on_exit(
function exit (line 2354) | pub fn exit(__status: ::core::ffi::c_int);
function quick_exit (line 2357) | pub fn quick_exit(__status: ::core::ffi::c_int);
function _Exit (line 2360) | pub fn _Exit(__status: ::core::ffi::c_int);
function getenv (line 2363) | pub fn getenv(__name: *const ::core::ffi::c_char) -> *mut ::core::ffi::c...
function putenv (line 2366) | pub fn putenv(__string: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
function setenv (line 2369) | pub fn setenv(
function unsetenv (line 2376) | pub fn unsetenv(__name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
function clearenv (line 2379) | pub fn clearenv() -> ::core::ffi::c_int;
function mktemp (line 2382) | pub fn mktemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi:...
function mkstemp (line 2385) | pub fn mkstemp(__template: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
function mkstemps (line 2388) | pub fn mkstemps(
function mkdtemp (line 2394) | pub fn mkdtemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi...
function system (line 2397) | pub fn system(__command: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
function realpath (line 2400) | pub fn realpath(
type __compar_fn_t (line 2405) | pub type __compar_fn_t = ::core::option::Option<
function bsearch (line 2410) | pub fn bsearch(
function qsort (line 2419) | pub fn qsort(
function abs (line 2427) | pub fn abs(__x: ::core::ffi::c_int) -> ::core::ffi::c_int;
function labs (line 2430) | pub fn labs(__x: ::core::ffi::c_long) -> ::core::ffi::c_long;
function llabs (line 2433) | pub fn llabs(__x: ::core::ffi::c_longlong) -> ::core::ffi::c_longlong;
function div (line 2436) | pub fn div(__numer: ::core::ffi::c_int, __denom: ::core::ffi::c_int) -> ...
function ldiv (line 2439) | pub fn ldiv(__numer: ::core::ffi::c_long, __denom: ::core::ffi::c_long) ...
function lldiv (line 2442) | pub fn lldiv(
function ecvt (line 2448) | pub fn ecvt(
function fcvt (line 2456) | pub fn fcvt(
function gcvt (line 2464) | pub fn gcvt(
function qecvt (line 2471) | pub fn qecvt(
function qfcvt (line 2479) | pub fn qfcvt(
function qgcvt (line 2487) | pub fn qgcvt(
function ecvt_r (line 2494) | pub fn ecvt_r(
function fcvt_r (line 2504) | pub fn fcvt_r(
function qecvt_r (line 2514) | pub fn qecvt_r(
function qfcvt_r (line 2524) | pub fn qfcvt_r(
function mblen (line 2534) | pub fn mblen(__s: *const ::core::ffi::c_char, __n: usize) -> ::core::ffi...
function mbtowc (line 2537) | pub fn mbtowc(
function wctomb (line 2544) | pub fn wctomb(__s: *mut ::core::ffi::c_char, __wchar: wchar_t) -> ::core...
function mbstowcs (line 2547) | pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::core::ffi::c_char, _...
function wcstombs (line 2550) | pub fn wcstombs(__s: *mut ::core::ffi::c_char, __pwcs: *const wchar_t, _...
function rpmatch (line 2553) | pub fn rpmatch(__response: *const ::core::ffi::c_char) -> ::core::ffi::c...
function getsubopt (line 2556) | pub fn getsubopt(
function getloadavg (line 2563) | pub fn getloadavg(__loadavg: *mut f64, __nelem: ::core::ffi::c_int)
type snd_aes_iec958 (line 2571) | pub struct snd_aes_iec958 {
function bindgen_test_layout_snd_aes_iec958 (line 2578) | fn bindgen_test_layout_snd_aes_iec958() {
type snd_cea_861_aud_if (line 2635) | pub struct snd_cea_861_aud_if {
function bindgen_test_layout_snd_cea_861_aud_if (line 2643) | fn bindgen_test_layout_snd_cea_861_aud_if() {
constant SNDRV_HWDEP_IFACE_OPL2 (line 2707) | pub const SNDRV_HWDEP_IFACE_OPL2: _bindgen_ty_1 = 0;
constant SNDRV_HWDEP_IFACE_OPL3 (line 2708) | pub const SNDRV_HWDEP_IFACE_OPL3: _bindgen_ty_1 = 1;
constant SNDRV_HWDEP_IFACE_OPL4 (line 2709) | pub const SNDRV_HWDEP_IFACE_OPL4: _bindgen_ty_1 = 2;
constant SNDRV_HWDEP_IFACE_SB16CSP (line 2710) | pub const SNDRV_HWDEP_IFACE_SB16CSP: _bindgen_ty_1 = 3;
constant SNDRV_HWDEP_IFACE_EMU10K1 (line 2711) | pub const SNDRV_HWDEP_IFACE_EMU10K1: _bindgen_ty_1 = 4;
constant SNDRV_HWDEP_IFACE_YSS225 (line 2712) | pub const SNDRV_HWDEP_IFACE_YSS225: _bindgen_ty_1 = 5;
constant SNDRV_HWDEP_IFACE_ICS2115 (line 2713) | pub const SNDRV_HWDEP_IFACE_ICS2115: _bindgen_ty_1 = 6;
constant SNDRV_HWDEP_IFACE_SSCAPE (line 2714) | pub const SNDRV_HWDEP_IFACE_SSCAPE: _bindgen_ty_1 = 7;
constant SNDRV_HWDEP_IFACE_VX (line 2715) | pub const SNDRV_HWDEP_IFACE_VX: _bindgen_ty_1 = 8;
constant SNDRV_HWDEP_IFACE_MIXART (line 2716) | pub const SNDRV_HWDEP_IFACE_MIXART: _bindgen_ty_1 = 9;
constant SNDRV_HWDEP_IFACE_USX2Y (line 2717) | pub const SNDRV_HWDEP_IFACE_USX2Y: _bindgen_ty_1 = 10;
constant SNDRV_HWDEP_IFACE_EMUX_WAVETABLE (line 2718) | pub const SNDRV_HWDEP_IFACE_EMUX_WAVETABLE: _bindgen_ty_1 = 11;
constant SNDRV_HWDEP_IFACE_BLUETOOTH (line 2719) | pub const SNDRV_HWDEP_IFACE_BLUETOOTH: _bindgen_ty_1 = 12;
constant SNDRV_HWDEP_IFACE_USX2Y_PCM (line 2720) | pub const SNDRV_HWDEP_IFACE_USX2Y_PCM: _bindgen_ty_1 = 13;
constant SNDRV_HWDEP_IFACE_PCXHR (line 2721) | pub const SNDRV_HWDEP_IFACE_PCXHR: _bindgen_ty_1 = 14;
constant SNDRV_HWDEP_IFACE_SB_RC (line 2722) | pub const SNDRV_HWDEP_IFACE_SB_RC: _bindgen_ty_1 = 15;
constant SNDRV_HWDEP_IFACE_HDA (line 2723) | pub const SNDRV_HWDEP_IFACE_HDA: _bindgen_ty_1 = 16;
constant SNDRV_HWDEP_IFACE_USB_STREAM (line 2724) | pub const SNDRV_HWDEP_IFACE_USB_STREAM: _bindgen_ty_1 = 17;
constant SNDRV_HWDEP_IFACE_FW_DICE (line 2725) | pub const SNDRV_HWDEP_IFACE_FW_DICE: _bindgen_ty_1 = 18;
constant SNDRV_HWDEP_IFACE_FW_FIREWORKS (line 2726) | pub const SNDRV_HWDEP_IFACE_FW_FIREWORKS: _bindgen_ty_1 = 19;
constant SNDRV_HWDEP_IFACE_FW_BEBOB (line 2727) | pub const SNDRV_HWDEP_IFACE_FW_BEBOB: _bindgen_ty_1 = 20;
constant SNDRV_HWDEP_IFACE_FW_OXFW (line 2728) | pub const SNDRV_HWDEP_IFACE_FW_OXFW: _bindgen_ty_1 = 21;
constant SNDRV_HWDEP_IFACE_FW_DIGI00X (line 2729) | pub const SNDRV_HWDEP_IFACE_FW_DIGI00X: _bindgen_ty_1 = 22;
constant SNDRV_HWDEP_IFACE_FW_TASCAM (line 2730) | pub const SNDRV_HWDEP_IFACE_FW_TASCAM: _bindgen_ty_1 = 23;
constant SNDRV_HWDEP_IFACE_LINE6 (line 2731) | pub const SNDRV_HWDEP_IFACE_LINE6: _bindgen_ty_1 = 24;
constant SNDRV_HWDEP_IFACE_FW_MOTU (line 2732) | pub const SNDRV_HWDEP_IFACE_FW_MOTU: _bindgen_ty_1 = 25;
constant SNDRV_HWDEP_IFACE_FW_FIREFACE (line 2733) | pub const SNDRV_HWDEP_IFACE_FW_FIREFACE: _bindgen_ty_1 = 26;
constant SNDRV_HWDEP_IFACE_LAST (line 2734) | pub const SNDRV_HWDEP_IFACE_LAST: _bindgen_ty_1 = 26;
type _bindgen_ty_1 (line 2735) | pub type _bindgen_ty_1 = u32;
type snd_hwdep_info (line 2738) | pub struct snd_hwdep_info {
function bindgen_test_layout_snd_hwdep_info (line 2747) | fn bindgen_test_layout_snd_hwdep_info() {
type snd_hwdep_dsp_status (line 2821) | pub struct snd_hwdep_dsp_status {
function bindgen_test_layout_snd_hwdep_dsp_status (line 2830) | fn bindgen_test_layout_snd_hwdep_dsp_status() {
type snd_hwdep_dsp_image (line 2904) | pub struct snd_hwdep_dsp_image {
function bindgen_test_layout_snd_hwdep_dsp_image (line 2912) | fn bindgen_test_layout_snd_hwdep_dsp_image() {
type snd_pcm_uframes_t (line 2974) | pub type snd_pcm_uframes_t = ::core::ffi::c_ulong;
type snd_pcm_sframes_t (line 2975) | pub type snd_pcm_sframes_t = ::core::ffi::c_long;
constant SNDRV_PCM_CLASS_GENERIC (line 2976) | pub const SNDRV_PCM_CLASS_GENERIC: _bindgen_ty_2 = 0;
constant SNDRV_PCM_CLASS_MULTI (line 2977) | pub const SNDRV_PCM_CLASS_MULTI: _bindgen_ty_2 = 1;
constant SNDRV_PCM_CLASS_MODEM (line 2978) | pub const SNDRV_PCM_CLASS_MODEM: _bindgen_ty_2 = 2;
constant SNDRV_PCM_CLASS_DIGITIZER (line 2979) | pub const SNDRV_PCM_CLASS_DIGITIZER: _bindgen_ty_2 = 3;
constant SNDRV_PCM_CLASS_LAST (line 2980) | pub const SNDRV_PCM_CLASS_LAST: _bindgen_ty_2 = 3;
type _bindgen_ty_2 (line 2981) | pub type _bindgen_ty_2 = u32;
constant SNDRV_PCM_SUBCLASS_GENERIC_MIX (line 2982) | pub const SNDRV_PCM_SUBCLASS_GENERIC_MIX: _bindgen_ty_3 = 0;
constant SNDRV_PCM_SUBCLASS_MULTI_MIX (line 2983) | pub const SNDRV_PCM_SUBCLASS_MULTI_MIX: _bindgen_ty_3 = 1;
constant SNDRV_PCM_SUBCLASS_LAST (line 2984) | pub const SNDRV_PCM_SUBCLASS_LAST: _bindgen_ty_3 = 1;
type _bindgen_ty_3 (line 2985) | pub type _bindgen_ty_3 = u32;
constant SNDRV_PCM_STREAM_PLAYBACK (line 2986) | pub const SNDRV_PCM_STREAM_PLAYBACK: _bindgen_ty_4 = 0;
constant SNDRV_PCM_STREAM_CAPTURE (line 2987) | pub const SNDRV_PCM_STREAM_CAPTURE: _bindgen_ty_4 = 1;
constant SNDRV_PCM_STREAM_LAST (line 2988) | pub const SNDRV_PCM_STREAM_LAST: _bindgen_ty_4 = 1;
type _bindgen_ty_4 (line 2989) | pub type _bindgen_ty_4 = u32;
type snd_pcm_access_t (line 2990) | pub type snd_pcm_access_t = ::core::ffi::c_int;
type snd_pcm_format_t (line 2991) | pub type snd_pcm_format_t = ::core::ffi::c_int;
type snd_pcm_subformat_t (line 2992) | pub type snd_pcm_subformat_t = ::core::ffi::c_int;
type snd_pcm_state_t (line 2993) | pub type snd_pcm_state_t = ::core::ffi::c_int;
constant SNDRV_PCM_MMAP_OFFSET_DATA (line 2994) | pub const SNDRV_PCM_MMAP_OFFSET_DATA: _bindgen_ty_5 = 0;
constant SNDRV_PCM_MMAP_OFFSET_STATUS (line 2995) | pub const SNDRV_PCM_MMAP_OFFSET_STATUS: _bindgen_ty_5 = 2147483648;
constant SNDRV_PCM_MMAP_OFFSET_CONTROL (line 2996) | pub const SNDRV_PCM_MMAP_OFFSET_CONTROL: _bindgen_ty_5 = 2164260864;
type _bindgen_ty_5 (line 2997) | pub type _bindgen_ty_5 = u32;
function bindgen_test_layout_snd_pcm_sync_id (line 3007) | fn bindgen_test_layout_snd_pcm_sync_id() {
type snd_pcm_info (line 3051) | pub struct snd_pcm_info {
function bindgen_test_layout_snd_pcm_info (line 3067) | fn bindgen_test_layout_snd_pcm_info() {
type snd_pcm_hw_param_t (line 3209) | pub type snd_pcm_hw_param_t = ::core::ffi::c_int;
type snd_interval (line 3212) | pub struct snd_interval {
method openmin (line 3253) | pub fn openmin(&self) -> ::core::ffi::c_uint {
method set_openmin (line 3257) | pub fn set_openmin(&mut self, val: ::core::ffi::c_uint) {
method openmax (line 3264) | pub fn openmax(&self) -> ::core::ffi::c_uint {
method set_openmax (line 3268) | pub fn set_openmax(&mut self, val: ::core::ffi::c_uint) {
method integer (line 3275) | pub fn integer(&self) -> ::core::ffi::c_uint {
method set_integer (line 3279) | pub fn set_integer(&mut self, val: ::core::ffi::c_uint) {
method empty (line 3286) | pub fn empty(&self) -> ::core::ffi::c_uint {
method set_empty (line 3290) | pub fn set_empty(&mut self, val: ::core::ffi::c_uint) {
method new_bitfield_1 (line 3297) | pub fn new_bitfield_1(
function bindgen_test_layout_snd_interval (line 3219) | fn bindgen_test_layout_snd_interval() {
type snd_mask (line 3326) | pub struct snd_mask {
function bindgen_test_layout_snd_mask (line 3330) | fn bindgen_test_layout_snd_mask() {
type snd_pcm_hw_params (line 3354) | pub struct snd_pcm_hw_params {
function bindgen_test_layout_snd_pcm_hw_params (line 3370) | fn bindgen_test_layout_snd_pcm_hw_params() {
constant SNDRV_PCM_TSTAMP_NONE (line 3512) | pub const SNDRV_PCM_TSTAMP_NONE: _bindgen_ty_6 = 0;
constant SNDRV_PCM_TSTAMP_ENABLE (line 3513) | pub const SNDRV_PCM_TSTAMP_ENABLE: _bindgen_ty_6 = 1;
constant SNDRV_PCM_TSTAMP_LAST (line 3514) | pub const SNDRV_PCM_TSTAMP_LAST: _bindgen_ty_6 = 1;
type _bindgen_ty_6 (line 3515) | pub type _bindgen_ty_6 = u32;
type snd_pcm_sw_params (line 3518) | pub struct snd_pcm_sw_params {
function bindgen_test_layout_snd_pcm_sw_params (line 3534) | fn bindgen_test_layout_snd_pcm_sw_params() {
type snd_pcm_channel_info (line 3684) | pub struct snd_pcm_channel_info {
function bindgen_test_layout_snd_pcm_channel_info (line 3691) | fn bindgen_test_layout_snd_pcm_channel_info() {
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT (line 3743) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT: _bindgen_ty_7 = 0;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT (line 3744) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT: _bindgen_ty_7 = 1;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK (line 3745) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK: _bindgen_ty_7 = 2;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE (line 3746) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE: _bindgen_ty_7 = 3;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED (line 3747) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED: _bindgen_ty_7 = 4;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED (line 3748) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED: _bindgen_ty_7 = 5;
constant SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST (line 3749) | pub const SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST: _bindgen_ty_7 = 5;
type _bindgen_ty_7 (line 3750) | pub type _bindgen_ty_7 = u32;
type snd_pcm_status (line 3753) | pub struct snd_pcm_status {
function bindgen_test_layout_snd_pcm_status (line 3771) | fn bindgen_test_layout_snd_pcm_status() {
type snd_pcm_mmap_status (line 3939) | pub struct snd_pcm_mmap_status {
function bindgen_test_layout_snd_pcm_mmap_status (line 3948) | fn bindgen_test_layout_snd_pcm_mmap_status() {
type snd_pcm_mmap_control (line 4026) | pub struct snd_pcm_mmap_control {
function bindgen_test_layout_snd_pcm_mmap_control (line 4031) | fn bindgen_test_layout_snd_pcm_mmap_control() {
type snd_pcm_sync_ptr (line 4065) | pub struct snd_pcm_sync_ptr {
function bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_1 (line 4078) | fn bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_1() {
function bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_2 (line 4122) | fn bindgen_test_layout_snd_pcm_sync_ptr__bindgen_ty_2() {
function bindgen_test_layout_snd_pcm_sync_ptr (line 4159) | fn bindgen_test_layout_snd_pcm_sync_ptr() {
type snd_xferi (line 4203) | pub struct snd_xferi {
function bindgen_test_layout_snd_xferi (line 4209) | fn bindgen_test_layout_snd_xferi() {
type snd_xfern (line 4253) | pub struct snd_xfern {
function bindgen_test_layout_snd_xfern (line 4259) | fn bindgen_test_layout_snd_xfern() {
constant SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY (line 4301) | pub const SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY: _bindgen_ty_8 = 0;
constant SNDRV_PCM_TSTAMP_TYPE_MONOTONIC (line 4302) | pub const SNDRV_PCM_TSTAMP_TYPE_MONOTONIC: _bindgen_ty_8 = 1;
constant SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW (line 4303) | pub const SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW: _bindgen_ty_8 = 2;
constant SNDRV_PCM_TSTAMP_TYPE_LAST (line 4304) | pub const SNDRV_PCM_TSTAMP_TYPE_LAST: _bindgen_ty_8 = 2;
type _bindgen_ty_8 (line 4305) | pub type _bindgen_ty_8 = u32;
constant SNDRV_CHMAP_UNKNOWN (line 4306) | pub const SNDRV_CHMAP_UNKNOWN: _bindgen_ty_9 = 0;
constant SNDRV_CHMAP_NA (line 4307) | pub const SNDRV_CHMAP_NA: _bindgen_ty_9 = 1;
constant SNDRV_CHMAP_MONO (line 4308) | pub const SNDRV_CHMAP_MONO: _bindgen_ty_9 = 2;
constant SNDRV_CHMAP_FL (line 4309) | pub const SNDRV_CHMAP_FL: _bindgen_ty_9 = 3;
constant SNDRV_CHMAP_FR (line 4310) | pub const SNDRV_CHMAP_FR: _bindgen_ty_9 = 4;
constant SNDRV_CHMAP_RL (line 4311) | pub const SNDRV_CHMAP_RL: _bindgen_ty_9 = 5;
constant SNDRV_CHMAP_RR (line 4312) | pub const SNDRV_CHMAP_RR: _bindgen_ty_9 = 6;
constant SNDRV_CHMAP_FC (line 4313) | pub const SNDRV_CHMAP_FC: _bindgen_ty_9 = 7;
constant SNDRV_CHMAP_LFE (line 4314) | pub const SNDRV_CHMAP_LFE: _bindgen_ty_9 = 8;
constant SNDRV_CHMAP_SL (line 4315) | pub const SNDRV_CHMAP_SL: _bindgen_ty_9 = 9;
constant SNDRV_CHMAP_SR (line 4316) | pub const SNDRV_CHMAP_SR: _bindgen_ty_9 = 10;
constant SNDRV_CHMAP_RC (line 4317) | pub const SNDRV_CHMAP_RC: _bindgen_ty_9 = 11;
constant SNDRV_CHMAP_FLC (line 4318) | pub const SNDRV_CHMAP_FLC: _bindgen_ty_9 = 12;
constant SNDRV_CHMAP_FRC (line 4319) | pub const SNDRV_CHMAP_FRC: _bindgen_ty_9 = 13;
constant SNDRV_CHMAP_RLC (line 4320) | pub const SNDRV_CHMAP_RLC: _bindgen_ty_9 = 14;
constant SNDRV_CHMAP_RRC (line 4321) | pub const SNDRV_CHMAP_RRC: _bindgen_ty_9 = 15;
constant SNDRV_CHMAP_FLW (line 4322) | pub const SNDRV_CHMAP_FLW: _bindgen_ty_9 = 16;
constant SNDRV_CHMAP_FRW (line 4323) | pub const SNDRV_CHMAP_FRW: _bindgen_ty_9 = 17;
constant SNDRV_CHMAP_FLH (line 4324) | pub const SNDRV_CHMAP_FLH: _bindgen_ty_9 = 18;
constant SNDRV_CHMAP_FCH (line 4325) | pub const SNDRV_CHMAP_FCH: _bindgen_ty_9 = 19;
constant SNDRV_CHMAP_FRH (line 4326) | pub const SNDRV_CHMAP_FRH: _bindgen_ty_9 = 20;
constant SNDRV_CHMAP_TC (line 4327) | pub const SNDRV_CHMAP_TC: _bindgen_ty_9 = 21;
constant SNDRV_CHMAP_TFL (line 4328) | pub const SNDRV_CHMAP_TFL: _bindgen_ty_9 = 22;
constant SNDRV_CHMAP_TFR (line 4329) | pub const SNDRV_CHMAP_TFR: _bindgen_ty_9 = 23;
constant SNDRV_CHMAP_TFC (line 4330) | pub const SNDRV_CHMAP_TFC: _bindgen_ty_9 = 24;
constant SNDRV_CHMAP_TRL (line 4331) | pub const SNDRV_CHMAP_TRL: _bindgen_ty_9 = 25;
constant SNDRV_CHMAP_TRR (line 4332) | pub const SNDRV_CHMAP_TRR: _bindgen_ty_9 = 26;
constant SNDRV_CHMAP_TRC (line 4333) | pub const SNDRV_CHMAP_TRC: _bindgen_ty_9 = 27;
constant SNDRV_CHMAP_TFLC (line 4334) | pub const SNDRV_CHMAP_TFLC: _bindgen_ty_9 = 28;
constant SNDRV_CHMAP_TFRC (line 4335) | pub const SNDRV_CHMAP_TFRC: _bindgen_ty_9 = 29;
constant SNDRV_CHMAP_TSL (line 4336) | pub const SNDRV_CHMAP_TSL: _bindgen_ty_9 = 30;
constant SNDRV_CHMAP_TSR (line 4337) | pub const SNDRV_CHMAP_TSR: _bindgen_ty_9 = 31;
constant SNDRV_CHMAP_LLFE (line 4338) | pub const SNDRV_CHMAP_LLFE: _bindgen_ty_9 = 32;
constant SNDRV_CHMAP_RLFE (line 4339) | pub const SNDRV_CHMAP_RLFE: _bindgen_ty_9 = 33;
constant SNDRV_CHMAP_BC (line 4340) | pub const SNDRV_CHMAP_BC: _bindgen_ty_9 = 34;
constant SNDRV_CHMAP_BLC (line 4341) | pub const SNDRV_CHMAP_BLC: _bindgen_ty_9 = 35;
constant SNDRV_CHMAP_BRC (line 4342) | pub const SNDRV_CHMAP_BRC: _bindgen_ty_9 = 36;
constant SNDRV_CHMAP_LAST (line 4343) | pub const SNDRV_CHMAP_LAST: _bindgen_ty_9 = 36;
type _bindgen_ty_9 (line 4344) | pub type _bindgen_ty_9 = u32;
constant SNDRV_RAWMIDI_STREAM_OUTPUT (line 4345) | pub const SNDRV_RAWMIDI_STREAM_OUTPUT: _bindgen_ty_10 = 0;
constant SNDRV_RAWMIDI_STREAM_INPUT (line 4346) | pub const SNDRV_RAWMIDI_STREAM_INPUT: _bindgen_ty_10 = 1;
constant SNDRV_RAWMIDI_STREAM_LAST (line 4347) | pub const SNDRV_RAWMIDI_STREAM_LAST: _bindgen_ty_10 = 1;
type _bindgen_ty_10 (line 4348) | pub type _bindgen_ty_10 = u32;
type snd_rawmidi_info (line 4351) | pub struct snd_rawmidi_info {
function bindgen_test_layout_snd_rawmidi_info (line 4365) | fn bindgen_test_layout_snd_rawmidi_info() {
type snd_rawmidi_params (line 4493) | pub struct snd_rawmidi_params {
method no_active_sensing (line 4555) | pub fn no_active_sensing(&self) -> ::core::ffi::c_uint {
method set_no_active_sensing (line 4559) | pub fn set_no_active_sensing(&mut self, val: ::core::ffi::c_uint) {
method new_bitfield_1 (line 4566) | pub fn new_bitfield_1(
function bindgen_test_layout_snd_rawmidi_params (line 4501) | fn bindgen_test_layout_snd_rawmidi_params() {
type snd_rawmidi_status (line 4580) | pub struct snd_rawmidi_status {
function bindgen_test_layout_snd_rawmidi_status (line 4588) | fn bindgen_test_layout_snd_rawmidi_status() {
constant SNDRV_TIMER_CLASS_NONE (line 4650) | pub const SNDRV_TIMER_CLASS_NONE: _bindgen_ty_11 = -1;
constant SNDRV_TIMER_CLASS_SLAVE (line 4651) | pub const SNDRV_TIMER_CLASS_SLAVE: _bindgen_ty_11 = 0;
constant SNDRV_TIMER_CLASS_GLOBAL (line 4652) | pub const SNDRV_TIMER_CLASS_GLOBAL: _bindgen_ty_11 = 1;
constant SNDRV_TIMER_CLASS_CARD (line 4653) | pub const SNDRV_TIMER_CLASS_CARD: _bindgen_ty_11 = 2;
constant SNDRV_TIMER_CLASS_PCM (line 4654) | pub const SNDRV_TIMER_CLASS_PCM: _bindgen_ty_11 = 3;
constant SNDRV_TIMER_CLASS_LAST (line 4655) | pub const SNDRV_TIMER_CLASS_LAST: _bindgen_ty_11 = 3;
type _bindgen_ty_11 (line 4656) | pub type _bindgen_ty_11 = i32;
constant SNDRV_TIMER_SCLASS_NONE (line 4657) | pub const SNDRV_TIMER_SCLASS_NONE: _bindgen_ty_12 = 0;
constant SNDRV_TIMER_SCLASS_APPLICATION (line 4658) | pub const SNDRV_TIMER_SCLASS_APPLICATION: _bindgen_ty_12 = 1;
constant SNDRV_TIMER_SCLASS_SEQUENCER (line 4659) | pub const SNDRV_TIMER_SCLASS_SEQUENCER: _bindgen_ty_12 = 2;
constant SNDRV_TIMER_SCLASS_OSS_SEQUENCER (line 4660) | pub const SNDRV_TIMER_SCLASS_OSS_SEQUENCER: _bindgen_ty_12 = 3;
constant SNDRV_TIMER_SCLASS_LAST (line 4661) | pub const SNDRV_TIMER_SCLASS_LAST: _bindgen_ty_12 = 3;
type _bindgen_ty_12 (line 4662) | pub type _bindgen_ty_12 = u32;
type snd_timer_id (line 4665) | pub struct snd_timer_id {
function bindgen_test_layout_snd_timer_id (line 4673) | fn bindgen_test_layout_snd_timer_id() {
type snd_timer_ginfo (line 4737) | pub struct snd_timer_ginfo {
function bindgen_test_layout_snd_timer_ginfo (line 4751) | fn bindgen_test_layout_snd_timer_ginfo() {
type snd_timer_gparams (line 4875) | pub struct snd_timer_gparams {
function bindgen_test_layout_snd_timer_gparams (line 4882) | fn bindgen_test_layout_snd_timer_gparams() {
type snd_timer_gstatus (line 4936) | pub struct snd_timer_gstatus {
function bindgen_test_layout_snd_timer_gstatus (line 4944) | fn bindgen_test_layout_snd_timer_gstatus() {
type snd_timer_select (line 5012) | pub struct snd_timer_select {
function bindgen_test_layout_snd_timer_select (line 5017) | fn bindgen_test_layout_snd_timer_select() {
type snd_timer_info (line 5051) | pub struct snd_timer_info {
function bindgen_test_layout_snd_timer_info (line 5061) | fn bindgen_test_layout_snd_timer_info() {
type snd_timer_params (line 5145) | pub struct snd_timer_params {
function bindgen_test_layout_snd_timer_params (line 5154) | fn bindgen_test_layout_snd_timer_params() {
type snd_timer_status (line 5228) | pub struct snd_timer_status {
function bindgen_test_layout_snd_timer_status (line 5237) | fn bindgen_test_layout_snd_timer_status() {
type snd_timer_read (line 5311) | pub struct snd_timer_read {
function bindgen_test_layout_snd_timer_read (line 5316) | fn bindgen_test_layout_snd_timer_read() {
constant SNDRV_TIMER_EVENT_RESOLUTION (line 5348) | pub const SNDRV_TIMER_EVENT_RESOLUTION: _bindgen_ty_13 = 0;
constant SNDRV_TIMER_EVENT_TICK (line 5349) | pub const SNDRV_TIMER_EVENT_TICK: _bindgen_ty_13 = 1;
constant SNDRV_TIMER_EVENT_START (line 5350) | pub const SNDRV_TIMER_EVENT_START: _bindgen_ty_13 = 2;
constant SNDRV_TIMER_EVENT_STOP (line 5351) | pub const SNDRV_TIMER_EVENT_STOP: _bindgen_ty_13 = 3;
constant SNDRV_TIMER_EVENT_CONTINUE (line 5352) | pub const SNDRV_TIMER_EVENT_CONTINUE: _bindgen_ty_13 = 4;
constant SNDRV_TIMER_EVENT_PAUSE (line 5353) | pub const SNDRV_TIMER_EVENT_PAUSE: _bindgen_ty_13 = 5;
constant SNDRV_TIMER_EVENT_EARLY (line 5354) | pub const SNDRV_TIMER_EVENT_EARLY: _bindgen_ty_13 = 6;
constant SNDRV_TIMER_EVENT_SUSPEND (line 5355) | pub const SNDRV_TIMER_EVENT_SUSPEND: _bindgen_ty_13 = 7;
constant SNDRV_TIMER_EVENT_RESUME (line 5356) | pub const SNDRV_TIMER_EVENT_RESUME: _bindgen_ty_13 = 8;
constant SNDRV_TIMER_EVENT_MSTART (line 5357) | pub const SNDRV_TIMER_EVENT_MSTART: _bindgen_ty_13 = 12;
constant SNDRV_TIMER_EVENT_MSTOP (line 5358) | pub const SNDRV_TIMER_EVENT_MSTOP: _bindgen_ty_13 = 13;
constant SNDRV_TIMER_EVENT_MCONTINUE (line 5359) | pub const SNDRV_TIMER_EVENT_MCONTINUE: _bindgen_ty_13 = 14;
constant SNDRV_TIMER_EVENT_MPAUSE (line 5360) | pub const SNDRV_TIMER_EVENT_MPAUSE: _bindgen_ty_13 = 15;
constant SNDRV_TIMER_EVENT_MSUSPEND (line 5361) | pub const SNDRV_TIMER_EVENT_MSUSPEND: _bindgen_ty_13 = 17;
constant SNDRV_TIMER_EVENT_MRESUME (line 5362) | pub const SNDRV_TIMER_EVENT_MRESUME: _bindgen_ty_13 = 18;
type _bindgen_ty_13 (line 5363) | pub type _bindgen_ty_13 = u32;
type snd_timer_tread (line 5366) | pub struct snd_timer_tread {
function bindgen_test_layout_snd_timer_tread (line 5372) | fn bindgen_test_layout_snd_timer_tread() {
type snd_ctl_card_info (line 5416) | pub struct snd_ctl_card_info {
function bindgen_test_layout_snd_ctl_card_info (line 5428) | fn bindgen_test_layout_snd_ctl_card_info() {
type snd_ctl_elem_type_t (line 5530) | pub type snd_ctl_elem_type_t = ::core::ffi::c_int;
type snd_ctl_elem_iface_t (line 5531) | pub type snd_ctl_elem_iface_t = ::core::ffi::c_int;
type snd_ctl_elem_id (line 5534) | pub struct snd_ctl_elem_id {
function bindgen_test_layout_snd_ctl_elem_id (line 5543) | fn bindgen_test_layout_snd_ctl_elem_id() {
type snd_ctl_elem_list (line 5617) | pub struct snd_ctl_elem_list {
function bindgen_test_layout_snd_ctl_elem_list (line 5626) | fn bindgen_test_layout_snd_ctl_elem_list() {
type snd_ctl_elem_info (line 5700) | pub struct snd_ctl_elem_info {
type snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_1 (line 5721) | pub struct snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_1 {
function bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_1 (line 5727) | fn bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_1() {
type snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_2 (line 5786) | pub struct snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_2 {
function bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_2 (line 5792) | fn bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_2() {
type snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_3 (line 5851) | pub struct snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_3 {
function bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_3 (line 5859) | fn bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1__bindgen_ty_3() {
function bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1 (line 5943) | fn bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_1() {
function bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_2 (line 6014) | fn bindgen_test_layout_snd_ctl_elem_info__bindgen_ty_2() {
function bindgen_test_layout_snd_ctl_elem_info (line 6051) | fn bindgen_test_layout_snd_ctl_elem_info() {
type snd_ctl_elem_value (line 6145) | pub struct snd_ctl_elem_value {
method indirect (line 6504) | pub fn indirect(&self) -> ::core::ffi::c_uint {
method set_indirect (line 6508) | pub fn set_indirect(&mut self, val: ::core::ffi::c_uint) {
method new_bitfield_1 (line 6515) | pub fn new_bitfield_1(
function bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_1 (line 6170) | fn bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_1() {
function bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_2 (line 6222) | fn bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_2() {
function bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_3 (line 6274) | fn bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_3() {
function bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_4 (line 6326) | fn bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1__bindgen_ty_4() {
function bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1 (line 6371) | fn bindgen_test_layout_snd_ctl_elem_value__bindgen_ty_1() {
function bindgen_test_layout_snd_ctl_elem_value (line 6450) | fn bindgen_test_layout_snd_ctl_elem_value() {
type snd_ctl_tlv (line 6529) | pub struct snd_ctl_tlv {
function bindgen_test_layout_snd_ctl_tlv (line 6535) | fn bindgen_test_layout_snd_ctl_tlv() {
constant sndrv_ctl_event_type_SNDRV_CTL_EVENT_ELEM (line 6577) | pub const sndrv_ctl_event_type_SNDRV_CTL_EVENT_ELEM: sndrv_ctl_event_typ...
constant sndrv_ctl_event_type_SNDRV_CTL_EVENT_LAST (line 6578) | pub const sndrv_ctl_event_type_SNDRV_CTL_EVENT_LAST: sndrv_ctl_event_typ...
type sndrv_ctl_event_type (line 6579) | pub type sndrv_ctl_event_type = u32;
type snd_ctl_event (line 6582) | pub struct snd_ctl_event {
type snd_ctl_event__bindgen_ty_1__bindgen_ty_1 (line 6595) | pub struct snd_ctl_event__bindgen_ty_1__bindgen_ty_1 {
function bindgen_test_layout_snd_ctl_event__bindgen_ty_1__bindgen_ty_1 (line 6600) | fn bindgen_test_layout_snd_ctl_event__bindgen_ty_1__bindgen_ty_1() {
function bindgen_test_layout_snd_ctl_event__bindgen_ty_1 (line 6645) | fn bindgen_test_layout_snd_ctl_event__bindgen_ty_1() {
function bindgen_test_layout_snd_ctl_event (line 6682) | fn bindgen_test_layout_snd_ctl_event() {
FILE: src/direct/ffi.rs
constant SNDRV_PCM_MMAP_OFFSET_STATUS (line 8) | pub const SNDRV_PCM_MMAP_OFFSET_STATUS: libc::c_uint = 0x80000000;
constant SNDRV_PCM_MMAP_OFFSET_CONTROL (line 9) | pub const SNDRV_PCM_MMAP_OFFSET_CONTROL: libc::c_uint = 0x81000000;
constant SNDRV_PCM_SYNC_PTR_HWSYNC (line 11) | pub const SNDRV_PCM_SYNC_PTR_HWSYNC: libc::c_uint = 1;
constant SNDRV_PCM_SYNC_PTR_APPL (line 12) | pub const SNDRV_PCM_SYNC_PTR_APPL: libc::c_uint = 2;
constant SNDRV_PCM_SYNC_PTR_AVAIL_MIN (line 13) | pub const SNDRV_PCM_SYNC_PTR_AVAIL_MIN: libc::c_uint = 4;
type snd_pcm_state_t (line 17) | pub type snd_pcm_state_t = libc::c_int;
type snd_pcm_uframes_t (line 21) | pub type snd_pcm_uframes_t = libc::c_ulong;
type __kernel_off_t (line 25) | pub type __kernel_off_t = libc::c_long;
type snd_pcm_mmap_status (line 29) | pub struct snd_pcm_mmap_status {
type snd_pcm_mmap_control (line 40) | pub struct snd_pcm_mmap_control {
type snd_pcm_channel_info (line 47) | pub struct snd_pcm_channel_info {
type snd_pcm_sync_ptr (line 70) | pub struct snd_pcm_sync_ptr {
function sndrv_pcm_ioctl_channel_info (line 170) | pub(crate) unsafe fn sndrv_pcm_ioctl_channel_info(
function sndrv_pcm_ioctl_sync_ptr (line 190) | pub(crate) unsafe fn sndrv_pcm_ioctl_sync_ptr(
function pagesize (line 210) | pub fn pagesize() -> usize {
FILE: src/direct/pcm.rs
type RawFd (line 32) | type RawFd = std::os::unix::io::RawFd;
type RawFd (line 35) | type RawFd = core::ffi::c_int;
type SyncPtrStatus (line 41) | pub struct SyncPtrStatus(snd_pcm_mmap_status);
method sync_ptr (line 49) | pub unsafe fn sync_ptr(fd: RawFd, hwsync: bool, appl_ptr: Option<pcm::...
method hw_ptr (line 73) | pub fn hw_ptr(&self) -> pcm::Frames { self.0.hw_ptr as pcm::Frames }
method state (line 74) | pub fn state(&self) -> pcm::State { unsafe { mem::transmute(self.0.sta...
method htstamp (line 75) | pub fn htstamp(&self) -> libc::timespec { self.0.tstamp }
type Status (line 96) | pub struct Status(DriverMemory<snd_pcm_mmap_status>);
method new (line 108) | pub fn new(p: &pcm::PCM) -> Result<Self> { Status::from_fd(pcm_to_fd(p...
method from_fd (line 110) | pub fn from_fd(fd: RawFd) -> Result<Self> {
method state (line 115) | pub fn state(&self) -> pcm::State {
method hw_ptr (line 130) | pub fn hw_ptr(&self) -> pcm::Frames {
method htstamp (line 141) | pub fn htstamp(&self) -> libc::timespec {
method audio_htstamp (line 152) | pub fn audio_htstamp(&self) -> libc::timespec {
function pcm_to_fd (line 98) | fn pcm_to_fd(p: &pcm::PCM) -> Result<RawFd> {
type Control (line 164) | pub struct Control(DriverMemory<snd_pcm_mmap_control>);
method new (line 167) | pub fn new(p: &pcm::PCM) -> Result<Self> { Self::from_fd(pcm_to_fd(p)?) }
method from_fd (line 169) | pub fn from_fd(fd: RawFd) -> Result<Self> {
method appl_ptr (line 176) | pub fn appl_ptr(&self) -> pcm::Frames {
method set_appl_ptr (line 187) | pub fn set_appl_ptr(&self, value: pcm::Frames) {
method avail_min (line 194) | pub fn avail_min(&self) -> pcm::Frames {
method set_avail_min (line 201) | pub fn set_avail_min(&self, value: pcm::Frames) {
type DriverMemory (line 208) | struct DriverMemory<S> {
function fmt (line 214) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Driver...
function new (line 218) | fn new(fd: RawFd, count: usize, offs: libc::off_t, writable: bool) -> Re...
method drop (line 237) | fn drop(&mut self) {
type SampleData (line 243) | struct SampleData<S> {
function new (line 250) | pub fn new(p: &pcm::PCM) -> Result<Self> {
type MmapDir (line 278) | pub trait MmapDir: fmt::Debug {
constant DIR (line 279) | const DIR: Direction;
method avail (line 280) | fn avail(hwptr: Frames, applptr: Frames, buffersize: Frames, boundary:...
constant DIR (line 288) | const DIR: Direction = Direction::Playback;
method avail (line 290) | fn avail(hwptr: Frames, applptr: Frames, buffersize: Frames, boundary:...
constant DIR (line 302) | const DIR: Direction = Direction::Capture;
method avail (line 304) | fn avail(hwptr: Frames, applptr: Frames, _buffersize: Frames, boundary...
type Playback (line 285) | pub struct Playback;
type Capture (line 299) | pub struct Capture;
type MmapPlayback (line 310) | pub type MmapPlayback<S> = MmapIO<S, Playback>;
type MmapCapture (line 312) | pub type MmapCapture<S> = MmapIO<S, Capture>;
type MmapIO (line 316) | pub struct MmapIO<S, D> {
type RawSamples (line 326) | pub struct RawSamples<S> {
function samples (line 335) | pub fn samples(&self) -> isize { self.frames as isize * (self.channels a...
function write_samples (line 341) | pub unsafe fn write_samples<I: Iterator<Item=S>>(&self, i: &mut I) -> (b...
function new (line 355) | fn new(p: &pcm::PCM) -> Result<Self> {
function new_mmap (line 370) | pub (crate) fn new_mmap<S, D: MmapDir>(p: &pcm::PCM) -> Result<MmapIO<S,...
function status (line 374) | pub fn status(&self) -> &Status { &self.ss }
function appl_ptr (line 380) | pub fn appl_ptr(&self) -> Frames { self.c.appl_ptr() }
function hw_ptr (line 386) | pub fn hw_ptr(&self) -> Frames { self.ss.hw_ptr() }
function boundary (line 390) | pub fn boundary(&self) -> Frames { self.bound }
function buffer_size (line 394) | pub fn buffer_size(&self) -> Frames { self.data.frames }
function channels (line 398) | pub fn channels(&self) -> u32 { self.data.channels }
function commit (line 403) | pub fn commit(&self, v: Frames) {
function avail (line 412) | pub fn avail(&self) -> Frames { D::avail(self.hw_ptr(), self.appl_ptr(),...
function data_ptr (line 422) | pub fn data_ptr(&self) -> (RawSamples<S>, Option<RawSamples<S>>) {
function write (line 446) | pub fn write<I: Iterator<Item=S>>(&mut self, i: &mut I) -> Frames {
function iter (line 467) | pub fn iter(&mut self) -> CaptureIter<'_, S> {
type CaptureIter (line 481) | pub struct CaptureIter<'a, S: 'static> {
function handle_max (line 490) | fn handle_max(&mut self) {
type Item (line 503) | type Item = S;
method next (line 506) | fn next(&mut self) -> Option<Self::Item> {
method drop (line 519) | fn drop(&mut self) {
function record_from_plughw_rw (line 527) | fn record_from_plughw_rw() {
function record_from_plughw_mmap (line 564) | fn record_from_plughw_mmap() {
function playback_to_plughw_mmap (line 610) | fn playback_to_plughw_mmap() {
FILE: src/error.rs
type Error (line 16) | pub struct Error(&'static str, c_int);
method new (line 69) | pub fn new(func: &'static str, res: c_int) -> Error {
method last (line 73) | pub fn last(func: &'static str) -> Error {
method unsupported (line 88) | pub fn unsupported(func: &'static str) -> Error {
method func (line 93) | pub fn func(&self) -> &'static str {
method errno (line 101) | pub fn errno(&self) -> i32 {
method fmt (line 117) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 123) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
type Result (line 18) | pub type Result<T> = ::core::result::Result<T, Error>;
function from_const (line 33) | pub fn from_const<'a>(func: &'static str, s: *const c_char) -> Result<&'...
function from_alloc (line 41) | pub fn from_alloc(func: &'static str, s: *mut c_char) -> Result<String> {
function from_code (line 60) | pub fn from_code(func: &'static str, r: c_int) -> Result<c_int> {
function invalid_str (line 106) | pub fn invalid_str(func: &'static str) -> Error {
method description (line 111) | fn description(&self) -> &str {
function desc (line 138) | fn desc(err: i32) -> &'static str {
function from (line 215) | fn from(_: Error) -> fmt::Error {
function broken_pcm_name (line 221) | fn broken_pcm_name() {
FILE: src/hctl.rs
type HCtl (line 47) | pub struct HCtl(*mut alsa::snd_hctl_t);
method new (line 57) | pub fn new(c: &str, nonblock: bool) -> Result<HCtl> {
method open (line 63) | pub fn open(c: &CStr, nonblock: bool) -> Result<HCtl> {
method from_card (line 71) | pub fn from_card(c: &Card, nonblock: bool) -> Result<HCtl> {
method load (line 76) | pub fn load(&self) -> Result<()> { acheck!(snd_hctl_load(self.0)).map(...
method elem_iter (line 78) | pub fn elem_iter(&self) -> ElemIter<'_> { ElemIter(self, ptr::null_mut...
method find_elem (line 80) | pub fn find_elem(&self, id: &ctl_int::ElemId) -> Option<Elem<'_>> {
method handle_events (line 85) | pub fn handle_events(&self) -> Result<u32> {
method wait (line 89) | pub fn wait(&self, timeout_ms: Option<u32>) -> Result<bool> {
method count (line 94) | fn count(&self) -> usize {
method fill (line 97) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
method revents (line 101) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
method drop (line 52) | fn drop(&mut self) { unsafe { alsa::snd_hctl_close(self.0) }; }
type ElemIter (line 110) | pub struct ElemIter<'a>(&'a HCtl, *mut alsa::snd_hctl_elem_t);
type Item (line 113) | type Item = Elem<'a>;
method next (line 114) | fn next(&mut self) -> Option<Elem<'a>> {
type Elem (line 125) | pub struct Elem<'a>(&'a HCtl, *mut alsa::snd_hctl_elem_t);
function get_id (line 128) | pub fn get_id(&self) -> Result<ctl_int::ElemId> {
function info (line 133) | pub fn info(&self) -> Result<ctl_int::ElemInfo> {
function read (line 137) | pub fn read(&self) -> Result<ctl_int::ElemValue> {
function write (line 143) | pub fn write(&self, v: &ctl_int::ElemValue) -> Result<bool> {
function print_hctls (line 149) | fn print_hctls() {
function print_jacks (line 163) | fn print_jacks() {
FILE: src/io.rs
type Output (line 9) | pub struct Output(*mut alsa::snd_output_t);
method buffer_open (line 24) | pub fn buffer_open() -> Result<Output> {
method buffer_string (line 29) | pub fn buffer_string<T, F: FnOnce(&[u8]) -> T>(&self, f: F) -> T {
method local_error_handler (line 46) | pub fn local_error_handler() -> Result<Rc<RefCell<Output>>> {
method fmt (line 56) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method fmt (line 65) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method drop (line 19) | fn drop(&mut self) { unsafe { alsa::snd_output_close(self.0) }; }
function output_handle (line 73) | pub fn output_handle(o: &Output) -> *mut alsa::snd_output_t { o.0 }
function our_error_handler (line 76) | unsafe extern "C" fn our_error_handler(_file: *const c_char,
FILE: src/lib.rs
type Direction (line 65) | pub enum Direction {
method input (line 71) | pub fn input() -> Direction { Direction::Capture }
method output (line 73) | pub fn output() -> Direction { Direction::Playback }
type ValueOr (line 80) | pub enum ValueOr {
type Round (line 91) | pub enum Round {
FILE: src/mixer.rs
constant SELEM_ID_SIZE (line 14) | const SELEM_ID_SIZE: usize = 64;
type Mixer (line 18) | pub struct Mixer(*mut alsa::snd_mixer_t);
method new (line 25) | pub fn new(name: &str, nonblock: bool) -> Result<Mixer> {
method find_selem (line 34) | pub fn find_selem(&self, id: &SelemId) -> Option<Selem<'_>> {
method open (line 41) | pub fn open(nonblock: bool) -> Result<Mixer> {
method attach (line 47) | pub fn attach(&mut self, name: &CStr) -> Result<()> {
method load (line 51) | pub fn load(&mut self) -> Result<()> {
method iter (line 55) | pub fn iter(&self) -> Iter<'_> {
method handle_events (line 62) | pub fn handle_events(&self) -> Result<u32> {
method wait (line 66) | pub fn wait(&self, timeout_ms: Option<u32>) -> Result<()> {
method count (line 79) | fn count(&self) -> usize {
method fill (line 82) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
method revents (line 86) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
method drop (line 72) | fn drop(&mut self) {
type MilliBel (line 100) | pub struct MilliBel(pub i64);
method to_db (line 103) | pub fn to_db(self) -> f32 { (self.0 as f32) / 100.0 }
method from_db (line 104) | pub fn from_db(db: f32) -> Self { MilliBel((db * 100.0) as i64) }
type Target (line 108) | type Target = i64;
method deref (line 109) | fn deref(&self) -> &i64 { &self.0 }
type Output (line 113) | type Output = MilliBel;
method add (line 114) | fn add(self, rhs: Self) -> Self { MilliBel(self.0 + rhs.0) }
method add_assign (line 118) | fn add_assign(&mut self, rhs: Self) { self.0 += rhs.0 }
type Output (line 122) | type Output = MilliBel;
method sub (line 123) | fn sub(self, rhs: Self) -> Self { MilliBel(self.0 - rhs.0) }
method sub_assign (line 127) | fn sub_assign(&mut self, rhs: Self) { self.0 -= rhs.0 }
type Elem (line 132) | pub struct Elem<'a>{
type Iter (line 139) | pub struct Iter<'a>{
type Item (line 145) | type Item = Elem<'a>;
method next (line 147) | fn next(&mut self) -> Option<Elem<'a>> {
type SelemId (line 168) | pub struct SelemId([u8; SELEM_ID_SIZE]);
method new (line 172) | pub fn new(name: &str, index: u32) -> SelemId {
method empty (line 181) | pub fn empty() -> SelemId {
method as_ptr (line 190) | fn as_ptr(&self) -> *mut alsa::snd_mixer_selem_id_t {
method get_name (line 194) | pub fn get_name(&self) -> Result<&str> {
method get_index (line 199) | pub fn get_index(&self) -> u32 {
method set_name (line 203) | pub fn set_name(&mut self, name: &CStr) {
method set_index (line 207) | pub fn set_index(&mut self, index: u32) {
type Selem (line 216) | pub struct Selem<'a>(Elem<'a>);
function new (line 220) | pub fn new(elem: Elem<'a>) -> Option<Selem<'a>> {
function register (line 226) | pub fn register(mixer: &mut Mixer) -> Result<()> {
function get_id (line 230) | pub fn get_id(&self) -> SelemId {
function has_capture_volume (line 236) | pub fn has_capture_volume(&self) -> bool {
function has_capture_switch (line 240) | pub fn has_capture_switch(&self) -> bool {
function has_playback_volume (line 244) | pub fn has_playback_volume(&self) -> bool {
function has_playback_switch (line 248) | pub fn has_playback_switch(&self) -> bool {
function can_capture (line 252) | pub fn can_capture(&self) -> bool {
function can_playback (line 256) | pub fn can_playback(&self) -> bool {
function has_volume (line 260) | pub fn has_volume(&self) -> bool {
function get_capture_volume_range (line 265) | pub fn get_capture_volume_range(&self) -> (i64, i64) {
function get_capture_db_range (line 273) | pub fn get_capture_db_range(&self) -> (MilliBel, MilliBel) {
function get_playback_volume_range (line 281) | pub fn get_playback_volume_range(&self) -> (i64, i64) {
function get_playback_db_range (line 289) | pub fn get_playback_db_range(&self) -> (MilliBel, MilliBel) {
function is_capture_mono (line 296) | pub fn is_capture_mono(&self) -> bool {
function is_playback_mono (line 300) | pub fn is_playback_mono(&self) -> bool {
function has_capture_channel (line 304) | pub fn has_capture_channel(&self, channel: SelemChannelId) -> bool {
function has_playback_channel (line 308) | pub fn has_playback_channel(&self, channel: SelemChannelId) -> bool {
function channel_name (line 313) | pub fn channel_name(channel: SelemChannelId) -> Result<&'static str> {
function get_playback_volume (line 318) | pub fn get_playback_volume(&self, channel: SelemChannelId) -> Result<i64> {
function get_playback_vol_db (line 324) | pub fn get_playback_vol_db(&self, channel: SelemChannelId) -> Result<Mil...
function ask_playback_vol_db (line 330) | pub fn ask_playback_vol_db(&self, volume: i64) -> Result<MilliBel> {
function ask_playback_db_vol (line 337) | pub fn ask_playback_db_vol(&self, db: MilliBel, dir: Round) -> Result<i6...
function get_capture_volume (line 343) | pub fn get_capture_volume(&self, channel: SelemChannelId) -> Result<i64> {
function get_capture_vol_db (line 349) | pub fn get_capture_vol_db(&self, channel: SelemChannelId) -> Result<Mill...
function ask_capture_vol_db (line 355) | pub fn ask_capture_vol_db(&self, volume: i64) -> Result<MilliBel> {
function ask_capture_db_vol (line 362) | pub fn ask_capture_db_vol(&self, db: MilliBel, dir: Round) -> Result<i64> {
function set_playback_volume (line 368) | pub fn set_playback_volume(&self, channel: SelemChannelId, value: i64) -...
function set_playback_volume_range (line 372) | pub fn set_playback_volume_range(&self, min: i64, max: i64) -> Result<()> {
function set_playback_volume_all (line 376) | pub fn set_playback_volume_all(&self, value: i64) -> Result<()> {
function set_playback_db (line 380) | pub fn set_playback_db(&self, channel: SelemChannelId, value: MilliBel, ...
function set_capture_db (line 384) | pub fn set_capture_db(&self, channel: SelemChannelId, value: MilliBel, d...
function set_playback_db_all (line 388) | pub fn set_playback_db_all(&self, value: MilliBel, dir: Round) -> Result...
function set_capture_db_all (line 392) | pub fn set_capture_db_all(&self, value: MilliBel, dir: Round) -> Result<...
function set_capture_volume (line 396) | pub fn set_capture_volume(&self, channel: SelemChannelId, value: i64) ->...
function set_capture_volume_range (line 400) | pub fn set_capture_volume_range(&self, min: i64, max: i64) -> Result<()> {
function set_capture_volume_all (line 404) | pub fn set_capture_volume_all(&self, value: i64) -> Result<()> {
function set_playback_switch (line 408) | pub fn set_playback_switch(&self, channel: SelemChannelId, value: i32) -...
function set_playback_switch_all (line 412) | pub fn set_playback_switch_all(&self, value: i32) -> Result<()> {
function set_capture_switch (line 416) | pub fn set_capture_switch(&self, channel: SelemChannelId, value: i32) ->...
function set_capture_switch_all (line 420) | pub fn set_capture_switch_all(&self, value: i32) -> Result<()> {
function get_playback_switch (line 424) | pub fn get_playback_switch(&self, channel: SelemChannelId) -> Result<i32> {
function get_capture_switch (line 429) | pub fn get_capture_switch(&self, channel: SelemChannelId) -> Result<i32> {
function is_enumerated (line 434) | pub fn is_enumerated(&self) -> bool {
function is_enum_playback (line 438) | pub fn is_enum_playback(&self) -> bool {
function is_enum_capture (line 442) | pub fn is_enum_capture(&self) -> bool {
function get_enum_items (line 446) | pub fn get_enum_items(&self) -> Result<u32> {
function get_enum_item_name (line 450) | pub fn get_enum_item_name(&self, idx: u32) -> Result<String> {
function iter_enum (line 458) | pub fn iter_enum(&self) -> Result<IterEnum<'_>> {
function get_enum_item (line 462) | pub fn get_enum_item(&self, channel: SelemChannelId) -> Result<u32> {
function set_enum_item (line 468) | pub fn set_enum_item(&self, channel: SelemChannelId, idx: u32) -> Result...
type Target (line 475) | type Target = Elem<'a>;
function deref (line 478) | fn deref(&self) -> &Elem<'a> {
type IterEnum (line 484) | pub struct IterEnum<'a>(&'a Selem<'a>, u32, u32);
type Item (line 487) | type Item = Result<String>;
method next (line 488) | fn next(&mut self) -> Option<Self::Item> {
method mono (line 512) | pub fn mono() -> SelemChannelId { SelemChannelId::FrontLeft }
method fmt (line 516) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
function print_mixer_of_cards (line 522) | fn print_mixer_of_cards() {
function get_and_set_playback_volume (line 613) | fn get_and_set_playback_volume() {
function get_and_set_capture_volume (line 643) | fn get_and_set_capture_volume() {
function print_sizeof (line 673) | fn print_sizeof() {
FILE: src/pcm.rs
type Frames (line 62) | pub type Frames = alsa::snd_pcm_sframes_t;
type Info (line 66) | pub struct Info(pub(crate) *mut alsa::snd_pcm_info_t);
method new (line 69) | pub fn new() -> Result<Info> {
method get_card (line 74) | pub fn get_card(&self) -> i32 {
method get_device (line 78) | pub fn get_device(&self) -> u32 {
method get_subdevice (line 82) | pub fn get_subdevice(&self) -> u32 {
method get_id (line 86) | pub fn get_id(&self) -> Result<&str> {
method get_name (line 91) | pub fn get_name(&self) -> Result<&str> {
method get_subdevice_name (line 96) | pub fn get_subdevice_name(&self) -> Result<&str> {
method get_stream (line 101) | pub fn get_stream(&self) -> Direction {
method get_subdevices_count (line 109) | pub fn get_subdevices_count(&self) -> u32 {
method get_subdevices_avail (line 113) | pub fn get_subdevices_avail(&self) -> u32 {
method set_device (line 117) | pub(crate) fn set_device(&mut self, device: u32) {
method set_stream (line 121) | pub(crate) fn set_stream(&mut self, direction: Direction) {
method set_subdevice (line 129) | pub(crate) fn set_subdevice(&mut self, subdevice: u32) {
method drop (line 135) | fn drop(&mut self) { unsafe { alsa::snd_pcm_info_free(self.0) }; }
type PCM (line 140) | pub struct PCM(*mut alsa::snd_pcm_t, cell::Cell<bool>);
method check_has_io (line 145) | fn check_has_io(&self) {
method new (line 150) | pub fn new(name: &str, dir: Direction, nonblock: bool) -> Result<PCM> {
method open (line 155) | pub fn open(name: &CStr, dir: Direction, nonblock: bool) -> Result<PCM> {
method start (line 165) | pub fn start(&self) -> Result<()> { acheck!(snd_pcm_start(self.0)).map...
method drop (line 166) | pub fn drop(&self) -> Result<()> { acheck!(snd_pcm_drop(self.0)).map(|...
method pause (line 167) | pub fn pause(&self, pause: bool) -> Result<()> {
method resume (line 169) | pub fn resume(&self) -> Result<()> { acheck!(snd_pcm_resume(self.0)).m...
method drain (line 170) | pub fn drain(&self) -> Result<()> { acheck!(snd_pcm_drain(self.0)).map...
method prepare (line 171) | pub fn prepare(&self) -> Result<()> { acheck!(snd_pcm_prepare(self.0))...
method reset (line 172) | pub fn reset(&self) -> Result<()> { acheck!(snd_pcm_reset(self.0)).map...
method recover (line 173) | pub fn recover(&self, err: c_int, silent: bool) -> Result<()> {
method try_recover (line 180) | pub fn try_recover(&self, err: Error, silent: bool) -> Result<()> {
method wait (line 184) | pub fn wait(&self, timeout_ms: Option<u32>) -> Result<bool> {
method state (line 187) | pub fn state(&self) -> State {
method state_raw (line 198) | pub fn state_raw(&self) -> c_int { unsafe { alsa::snd_pcm_state(self.0...
method bytes_to_frames (line 200) | pub fn bytes_to_frames(&self, i: isize) -> Frames { unsafe { alsa::snd...
method frames_to_bytes (line 201) | pub fn frames_to_bytes(&self, i: Frames) -> isize { unsafe { alsa::snd...
method avail_update (line 203) | pub fn avail_update(&self) -> Result<Frames> { acheck!(snd_pcm_avail_u...
method avail (line 204) | pub fn avail(&self) -> Result<Frames> { acheck!(snd_pcm_avail(self.0)) }
method avail_delay (line 206) | pub fn avail_delay(&self) -> Result<(Frames, Frames)> {
method delay (line 210) | pub fn delay(&self) -> Result<Frames> {
method status (line 215) | pub fn status(&self) -> Result<Status> {
method verify_format (line 219) | fn verify_format(&self, f: Format) -> Result<()> {
method io_i8 (line 228) | pub fn io_i8(&self) -> Result<IO<'_, i8>> { self.io_checked() }
method io_u8 (line 229) | pub fn io_u8(&self) -> Result<IO<'_, u8>> { self.io_checked() }
method io_i16 (line 230) | pub fn io_i16(&self) -> Result<IO<'_, i16>> { self.io_checked() }
method io_u16 (line 231) | pub fn io_u16(&self) -> Result<IO<'_, u16>> { self.io_checked() }
method io_i32 (line 232) | pub fn io_i32(&self) -> Result<IO<'_, i32>> { self.io_checked() }
method io_u32 (line 233) | pub fn io_u32(&self) -> Result<IO<'_, u32>> { self.io_checked() }
method io_f32 (line 234) | pub fn io_f32(&self) -> Result<IO<'_, f32>> { self.io_checked() }
method io_f64 (line 235) | pub fn io_f64(&self) -> Result<IO<'_, f64>> { self.io_checked() }
method io_i32_s24 (line 238) | pub fn io_i32_s24(&self) -> Result<IO<'_, i32>> { self.verify_format(F...
method io_u32_u24 (line 240) | pub fn io_u32_u24(&self) -> Result<IO<'_, u32>> { self.verify_format(F...
method io_checked (line 242) | pub fn io_checked<S: IoFormat>(&self) -> Result<IO<'_, S>> {
method io_unchecked (line 251) | pub unsafe fn io_unchecked<S: IoFormat>(&self) -> IO<'_, S> {
method io (line 256) | pub fn io(&self) -> IO<'_, u8> { IO::new(self) }
method io_bytes (line 261) | pub fn io_bytes(&self) -> IO<'_, u8> { IO::new(self) }
method direct_mmap_capture (line 264) | pub fn direct_mmap_capture<S>(&self) -> Result<crate::direct::pcm::Mma...
method direct_mmap_playback (line 270) | pub fn direct_mmap_playback<S>(&self) -> Result<crate::direct::pcm::Mm...
method hw_free (line 276) | pub fn hw_free(&self) -> Result<()> {
method hw_params (line 283) | pub fn hw_params(&self, h: &HwParams) -> Result<()> {
method hw_params_current (line 289) | pub fn hw_params_current(&self) -> Result<HwParams<'_>> {
method sw_params (line 294) | pub fn sw_params(&self, h: &SwParams) -> Result<()> {
method sw_params_current (line 298) | pub fn sw_params_current(&self) -> Result<SwParams<'_>> {
method get_params (line 304) | pub fn get_params(&self) -> Result<(u64, u64)> {
method info (line 312) | pub fn info(&self) -> Result<Info> {
method dump (line 317) | pub fn dump(&self, o: &mut Output) -> Result<()> {
method dump_hw_setup (line 321) | pub fn dump_hw_setup(&self, o: &mut Output) -> Result<()> {
method dump_sw_setup (line 325) | pub fn dump_sw_setup(&self, o: &mut Output) -> Result<()> {
method query_chmaps (line 329) | pub fn query_chmaps(&self) -> ChmapsQuery {
method set_chmap (line 333) | pub fn set_chmap(&self, c: &Chmap) -> Result<()> {
method get_chmap (line 337) | pub fn get_chmap(&self) -> Result<Chmap> {
method link (line 343) | pub fn link(&self, other: &PCM) -> Result<()> {
method unlink (line 347) | pub fn unlink(&self) -> Result<()> {
method count (line 358) | fn count(&self) -> usize {
method fill (line 361) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
method revents (line 365) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
method drop (line 353) | fn drop(&mut self) { unsafe { alsa::snd_pcm_close(self.0) }; }
type IO (line 377) | pub struct IO<'a, S: Copy>(&'a PCM, PhantomData<S>);
method drop (line 380) | fn drop(&mut self) { (self.0).1.set(false) }
function new (line 385) | fn new(a: &'a PCM) -> IO<'a, S> {
function new_unchecked (line 391) | unsafe fn new_unchecked(a: &'a PCM) -> IO<'a, S> {
function to_frames (line 396) | fn to_frames(&self, b: usize) -> alsa::snd_pcm_uframes_t {
function from_frames (line 401) | fn from_frames(&self, b: alsa::snd_pcm_uframes_t) -> usize {
function writei (line 408) | pub fn writei(&self, buf: &[S]) -> Result<usize> {
function readi (line 414) | pub fn readi(&self, buf: &mut [S]) -> Result<usize> {
function writen (line 425) | pub unsafe fn writen(&self, bufs: &[*const S], frames: usize) -> Result<...
function readn (line 437) | pub unsafe fn readn(&self, bufs: &mut [*mut S], frames: usize) -> Result...
function mmap (line 452) | pub fn mmap<F: FnOnce(&mut [S]) -> usize>(&self, frames: usize, func: F)...
function read (line 477) | fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
function write (line 487) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
function flush (line 493) | fn flush(&mut self) -> std::io::Result<()> { Ok(()) }
method fmt (line 572) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Err (line 632) | type Err = Infallible;
method from_str (line 634) | fn from_str(s: &str) -> core::result::Result<Self, Self::Err> {
method s16 (line 694) | pub const fn s16() -> Format { <i16 as IoFormat>::FORMAT }
method u16 (line 695) | pub const fn u16() -> Format { <u16 as IoFormat>::FORMAT }
method s32 (line 696) | pub const fn s32() -> Format { <i32 as IoFormat>::FORMAT }
method u32 (line 697) | pub const fn u32() -> Format { <u32 as IoFormat>::FORMAT }
method float (line 698) | pub const fn float() -> Format { <f32 as IoFormat>::FORMAT }
method float64 (line 699) | pub const fn float64() -> Format { <f64 as IoFormat>::FORMAT }
method s24 (line 701) | pub const fn s24() -> Format { Format::S24LE }
method s24 (line 702) | pub const fn s24() -> Format { Format::S24BE }
method s24_3 (line 704) | pub const fn s24_3() -> Format { Format::S243LE }
method s24_3 (line 705) | pub const fn s24_3() -> Format { Format::S243BE }
method u24 (line 707) | pub const fn u24() -> Format { Format::U24LE }
method u24 (line 708) | pub const fn u24() -> Format { Format::U24BE }
method u24_3 (line 710) | pub const fn u24_3() -> Format { Format::U243LE }
method u24_3 (line 711) | pub const fn u24_3() -> Format { Format::U243BE }
method s20 (line 713) | pub const fn s20() -> Format { Format::S20LE }
method s20 (line 714) | pub const fn s20() -> Format { Format::S20BE }
method s20_3 (line 716) | pub const fn s20_3() -> Format { Format::S203LE }
method s20_3 (line 717) | pub const fn s20_3() -> Format { Format::S203BE }
method u20 (line 719) | pub const fn u20() -> Format { Format::U20LE }
method u20 (line 720) | pub const fn u20() -> Format { Format::U20BE }
method u20_3 (line 722) | pub const fn u20_3() -> Format { Format::U203LE }
method u20_3 (line 723) | pub const fn u20_3() -> Format { Format::U203BE }
method s18_3 (line 725) | pub const fn s18_3() -> Format { Format::S183LE }
method s18_3 (line 726) | pub const fn s18_3() -> Format { Format::S183BE }
method u18_3 (line 728) | pub const fn u18_3() -> Format { Format::U183LE }
method u18_3 (line 729) | pub const fn u18_3() -> Format { Format::U183BE }
method dsd_u16 (line 731) | pub const fn dsd_u16() -> Format { Format::DSDU16LE }
method dsd_u16 (line 732) | pub const fn dsd_u16() -> Format { Format::DSDU16BE }
method dsd_u32 (line 734) | pub const fn dsd_u32() -> Format { Format::DSDU32LE }
method dsd_u32 (line 735) | pub const fn dsd_u32() -> Format { Format::DSDU32BE }
method iec958_subframe (line 737) | pub const fn iec958_subframe() -> Format { Format::IEC958SubframeLE }
method iec958_subframe (line 738) | pub const fn iec958_subframe() -> Format { Format::IEC958SubframeBE }
method physical_width (line 740) | pub fn physical_width(&self) -> Result<i32> {
method width (line 744) | pub fn width(&self) -> Result<i32> {
method silence_16 (line 748) | pub fn silence_16(&self) -> u16 {
method little_endian (line 752) | pub fn little_endian(&self) -> Result<bool> {
type IoFormat (line 758) | pub trait IoFormat: Copy {
constant FORMAT (line 759) | const FORMAT: Format;
constant FORMAT (line 762) | const FORMAT: Format = Format::S8;
constant FORMAT (line 763) | const FORMAT: Format = Format::U8;
constant FORMAT (line 767) | const FORMAT: Format = Format::S16LE;
constant FORMAT (line 769) | const FORMAT: Format = Format::S16BE;
constant FORMAT (line 773) | const FORMAT: Format = Format::U16LE;
constant FORMAT (line 775) | const FORMAT: Format = Format::U16BE;
constant FORMAT (line 779) | const FORMAT: Format = Format::S32LE;
constant FORMAT (line 781) | const FORMAT: Format = Format::S32BE;
constant FORMAT (line 785) | const FORMAT: Format = Format::U32LE;
constant FORMAT (line 787) | const FORMAT: Format = Format::U32BE;
constant FORMAT (line 791) | const FORMAT: Format = Format::FloatLE;
constant FORMAT (line 793) | const FORMAT: Format = Format::FloatBE;
constant FORMAT (line 797) | const FORMAT: Format = Format::Float64LE;
constant FORMAT (line 799) | const FORMAT: Format = Format::Float64BE;
type HwParams (line 824) | pub struct HwParams<'a>(*mut alsa::snd_pcm_hw_params_t, &'a PCM);
method drop (line 827) | fn drop(&mut self) { unsafe { alsa::snd_pcm_hw_params_free(self.0) }; }
function new (line 831) | fn new(a: &'a PCM) -> Result<HwParams<'a>> {
function any (line 836) | pub fn any(a: &'a PCM) -> Result<HwParams<'a>> { HwParams::new(a).and_th...
function get_rate_resample (line 840) | pub fn get_rate_resample(&self) -> Result<bool> {
function set_rate_resample (line 845) | pub fn set_rate_resample(&self, resample: bool) -> Result<()> {
function set_channels_near (line 849) | pub fn set_channels_near(&self, v: u32) -> Result<u32> {
function set_channels (line 854) | pub fn set_channels(&self, v: u32) -> Result<()> {
function get_channels (line 858) | pub fn get_channels(&self) -> Result<u32> {
function get_channels_max (line 863) | pub fn get_channels_max(&self) -> Result<u32> {
function get_channels_min (line 868) | pub fn get_channels_min(&self) -> Result<u32> {
function test_channels (line 873) | pub fn test_channels(&self, v: u32) -> Result<()> {
function set_rate_near (line 877) | pub fn set_rate_near(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_rate (line 883) | pub fn set_rate(&self, v: u32, dir: ValueOr) -> Result<()> {
function get_rate (line 887) | pub fn get_rate(&self) -> Result<u32> {
function get_rate_max (line 892) | pub fn get_rate_max(&self) -> Result<u32> {
function get_rate_min (line 901) | pub fn get_rate_min(&self) -> Result<u32> {
function test_rate (line 908) | pub fn test_rate(&self, rate: u32) -> Result<()> {
function set_format (line 912) | pub fn set_format(&self, v: Format) -> Result<()> {
function get_format (line 916) | pub fn get_format(&self) -> Result<Format> {
function test_format (line 922) | pub fn test_format(&self, v: Format) -> Result<()> {
function test_access (line 926) | pub fn test_access(&self, v: Access) -> Result<()> {
function set_access (line 930) | pub fn set_access(&self, v: Access) -> Result<()> {
function get_access (line 934) | pub fn get_access(&self) -> Result<Access> {
function set_period_size_near (line 940) | pub fn set_period_size_near(&self, v: Frames, dir: ValueOr) -> Result<Fr...
function set_period_size (line 946) | pub fn set_period_size(&self, v: Frames, dir: ValueOr) -> Result<()> {
function set_period_time_near (line 950) | pub fn set_period_time_near(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_period_size_min (line 956) | pub fn set_period_size_min(&self, v: Frames, dir: ValueOr) -> Result<Fra...
function set_period_size_max (line 962) | pub fn set_period_size_max(&self, v: Frames, dir: ValueOr) -> Result<Fra...
function set_period_time (line 968) | pub fn set_period_time(&self, v: u32, dir: ValueOr) -> Result<()> {
function set_period_time_min (line 972) | pub fn set_period_time_min(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_period_time_max (line 978) | pub fn set_period_time_max(&self, v: u32, dir: ValueOr) -> Result<u32> {
function get_period_time (line 984) | pub fn get_period_time(&self) -> Result<u32> {
function get_period_time_min (line 989) | pub fn get_period_time_min(&self) -> Result<u32> {
function get_period_time_max (line 994) | pub fn get_period_time_max(&self) -> Result<u32> {
function get_period_size (line 999) | pub fn get_period_size(&self) -> Result<Frames> {
function get_period_size_min (line 1004) | pub fn get_period_size_min(&self) -> Result<Frames> {
function get_period_size_max (line 1009) | pub fn get_period_size_max(&self) -> Result<Frames> {
function set_periods_near (line 1014) | pub fn set_periods_near(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_periods (line 1020) | pub fn set_periods(&self, v: u32, dir: ValueOr) -> Result<()> {
function set_periods_min (line 1024) | pub fn set_periods_min(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_periods_max (line 1030) | pub fn set_periods_max(&self, v: u32, dir: ValueOr) -> Result<u32> {
function get_periods (line 1036) | pub fn get_periods(&self) -> Result<u32> {
function get_periods_min (line 1041) | pub fn get_periods_min(&self) -> Result<u32> {
function get_periods_max (line 1046) | pub fn get_periods_max(&self) -> Result<u32> {
function set_buffer_size_near (line 1051) | pub fn set_buffer_size_near(&self, v: Frames) -> Result<Frames> {
function set_buffer_size_max (line 1056) | pub fn set_buffer_size_max(&self, v: Frames) -> Result<Frames> {
function set_buffer_size_min (line 1061) | pub fn set_buffer_size_min(&self, v: Frames) -> Result<Frames> {
function set_buffer_size (line 1066) | pub fn set_buffer_size(&self, v: Frames) -> Result<()> {
function set_buffer_time_near (line 1070) | pub fn set_buffer_time_near(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_buffer_time (line 1076) | pub fn set_buffer_time(&self, v: u32, dir: ValueOr) -> Result<()> {
function set_buffer_time_min (line 1080) | pub fn set_buffer_time_min(&self, v: u32, dir: ValueOr) -> Result<u32> {
function set_buffer_time_max (line 1086) | pub fn set_buffer_time_max(&self, v: u32, dir: ValueOr) -> Result<u32> {
function get_buffer_size (line 1092) | pub fn get_buffer_size(&self) -> Result<Frames> {
function get_buffer_size_min (line 1097) | pub fn get_buffer_size_min(&self) -> Result<Frames> {
function get_buffer_size_max (line 1102) | pub fn get_buffer_size_max(&self) -> Result<Frames> {
function get_buffer_time (line 1107) | pub fn get_buffer_time(&self) -> Result<u32> {
function get_buffer_time_min (line 1112) | pub fn get_buffer_time_min(&self) -> Result<u32> {
function get_buffer_time_max (line 1117) | pub fn get_buffer_time_max(&self) -> Result<u32> {
function can_pause (line 1127) | pub fn can_pause(&self) -> bool {
function can_resume (line 1136) | pub fn can_resume(&self) -> bool {
function supports_audio_ts_type (line 1145) | pub fn supports_audio_ts_type(&self, type_: AudioTstampType) -> bool {
function dump (line 1149) | pub fn dump(&self, o: &mut Output) -> Result<()> {
function copy_from (line 1153) | pub fn copy_from(&mut self, other: &HwParams<'a>) {
method clone (line 1160) | fn clone(&self) -> HwParams<'a> {
function fmt (line 1168) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
type SwParams (line 1181) | pub struct SwParams<'a>(*mut alsa::snd_pcm_sw_params_t, &'a PCM);
method drop (line 1184) | fn drop(&mut self) { unsafe { alsa::snd_pcm_sw_params_free(self.0) }; }
function new (line 1189) | fn new(a: &'a PCM) -> Result<SwParams<'a>> {
function set_avail_min (line 1194) | pub fn set_avail_min(&self, v: Frames) -> Result<()> {
function get_avail_min (line 1198) | pub fn get_avail_min(&self) -> Result<Frames> {
function get_boundary (line 1203) | pub fn get_boundary(&self) -> Result<Frames> {
function set_start_threshold (line 1208) | pub fn set_start_threshold(&self, v: Frames) -> Result<()> {
function get_start_threshold (line 1212) | pub fn get_start_threshold(&self) -> Result<Frames> {
function set_stop_threshold (line 1217) | pub fn set_stop_threshold(&self, v: Frames) -> Result<()> {
function get_stop_threshold (line 1221) | pub fn get_stop_threshold(&self) -> Result<Frames> {
function set_tstamp_mode (line 1226) | pub fn set_tstamp_mode(&self, v: bool) -> Result<()> {
function get_tstamp_mode (line 1231) | pub fn get_tstamp_mode(&self) -> Result<bool> {
function set_tstamp_type (line 1236) | pub fn set_tstamp_type(&self, v: TstampType) -> Result<()> {
function get_tstamp_type (line 1240) | pub fn get_tstamp_type(&self) -> Result<TstampType> {
function dump (line 1246) | pub fn dump(&self, o: &mut Output) -> Result<()> {
function fmt (line 1252) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
constant STATUS_SIZE (line 1259) | const STATUS_SIZE: usize = 152;
type Status (line 1263) | pub struct Status([u64; (STATUS_SIZE+7)/8]);
method new (line 1266) | fn new() -> Status {
method ptr (line 1271) | fn ptr(&self) -> *mut alsa::snd_pcm_status_t { self.0.as_ptr() as *con...
method get_htstamp (line 1273) | pub fn get_htstamp(&self) -> timespec {
method get_trigger_htstamp (line 1279) | pub fn get_trigger_htstamp(&self) -> timespec {
method get_audio_htstamp (line 1285) | pub fn get_audio_htstamp(&self) -> timespec {
method get_state (line 1291) | pub fn get_state(&self) -> State { State::from_c_int(
method get_avail (line 1294) | pub fn get_avail(&self) -> Frames { unsafe { alsa::snd_pcm_status_get_...
method get_delay (line 1295) | pub fn get_delay(&self) -> Frames { unsafe { alsa::snd_pcm_status_get_...
method get_avail_max (line 1296) | pub fn get_avail_max(&self) -> Frames { unsafe { alsa::snd_pcm_status_...
method get_overrange (line 1297) | pub fn get_overrange(&self) -> Frames { unsafe { alsa::snd_pcm_status_...
method dump (line 1299) | pub fn dump(&self, o: &mut Output) -> Result<()> {
type StatusBuilder (line 1309) | pub struct StatusBuilder(Status);
method new (line 1312) | pub fn new() -> Self {
method audio_htstamp_config (line 1316) | pub fn audio_htstamp_config(
method build (line 1328) | pub fn build(mut self, pcm: &PCM) -> Result<Status> {
function info_from_default (line 1348) | fn info_from_default() {
function drop (line 1363) | fn drop() {
function record_from_default (line 1371) | fn record_from_default() {
function open_s24 (line 1386) | fn open_s24() {
function playback_to_default (line 1399) | fn playback_to_default() {
function print_sizeof (line 1440) | fn print_sizeof() {
function format_display_from_str (line 1450) | fn format_display_from_str() {
FILE: src/poll.rs
type Descriptors (line 24) | pub trait Descriptors {
method count (line 25) | fn count(&self) -> usize;
method fill (line 26) | fn fill(&self, _: &mut [pollfd]) -> Result<usize>;
method revents (line 27) | fn revents(&self, _: &[pollfd]) -> Result<Flags>;
method get (line 30) | fn get(&self) -> Result<Vec<pollfd>> {
method count (line 38) | fn count(&self) -> usize { 1 }
method fill (line 39) | fn fill(&self, a: &mut [pollfd]) -> Result<usize> { a[0] = *self; Ok(1) }
method revents (line 40) | fn revents(&self, a: &[pollfd]) -> Result<Flags> { Ok(Flags::from_bits...
function poll (line 44) | pub fn poll(fds: &mut[pollfd], timeout: i32) -> Result<usize> {
function poll_all (line 59) | pub fn poll_all<'a>(desc: &[&'a dyn Descriptors], timeout: i32) -> Resul...
FILE: src/rawmidi.rs
type Iter (line 15) | pub struct Iter<'a> {
type Info (line 25) | pub struct Info(*mut alsa::snd_rawmidi_info_t);
method new (line 32) | fn new() -> Result<Info> {
method from_iter (line 37) | fn from_iter(c: &Ctl, device: i32, sub: i32, dir: Direction) -> Result...
method subdev_count (line 49) | fn subdev_count(c: &Ctl, device: c_int) -> Result<(i32, i32)> {
method get_device (line 56) | pub fn get_device(&self) -> i32 { unsafe { alsa::snd_rawmidi_info_get_...
method get_subdevice (line 57) | pub fn get_subdevice(&self) -> i32 { unsafe { alsa::snd_rawmidi_info_g...
method get_stream (line 58) | pub fn get_stream(&self) -> super::Direction {
method get_subdevice_name (line 63) | pub fn get_subdevice_name(&self) -> Result<String> {
method get_id (line 67) | pub fn get_id(&self) -> Result<String> {
method drop (line 28) | fn drop(&mut self) { unsafe { alsa::snd_rawmidi_info_free(self.0) }; }
type Status (line 75) | pub struct Status(*mut alsa::snd_rawmidi_status_t);
method new (line 78) | fn new() -> Result<Self> {
method get_avail (line 85) | pub fn get_avail(&self) -> usize { unsafe { alsa::snd_rawmidi_status_g...
method get_xruns (line 86) | pub fn get_xruns(&self) -> usize { unsafe { alsa::snd_rawmidi_status_g...
method drop (line 90) | fn drop(&mut self) { unsafe { alsa::snd_rawmidi_status_free(self.0) }; }
function new (line 95) | pub fn new(c: &'a Ctl) -> Iter<'a> { Iter { ctl: c, device: -1, in_count...
type Item (line 99) | type Item = Result<Info>;
method next (line 100) | fn next(&mut self) -> Option<Result<Info>> {
type Rawmidi (line 131) | pub struct Rawmidi(*mut alsa::snd_rawmidi_t);
method new (line 142) | pub fn new(name: &str, dir: Direction, nonblock: bool) -> Result<Self> {
method open (line 146) | pub fn open(name: &CStr, dir: Direction, nonblock: bool) -> Result<Raw...
method info (line 156) | pub fn info(&self) -> Result<Info> {
method status (line 160) | pub fn status(&self) -> Result<Status> {
method drop (line 164) | pub fn drop(&self) -> Result<()> { acheck!(snd_rawmidi_drop(self.0)).m...
method drain (line 165) | pub fn drain(&self) -> Result<()> { acheck!(snd_rawmidi_drain(self.0))...
method name (line 166) | pub fn name(&self) -> Result<String> {
method io (line 171) | pub fn io(&self) -> IO<'_> { IO(self) }
method count (line 175) | fn count(&self) -> usize {
method fill (line 178) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
method revents (line 182) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
method drop (line 136) | fn drop(&mut self) { unsafe { alsa::snd_rawmidi_close(self.0) }; }
type IO (line 191) | pub struct IO<'a>(&'a Rawmidi);
function read (line 195) | fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
function write (line 204) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
function flush (line 209) | fn flush(&mut self) -> std::io::Result<()> { Ok(()) }
function print_rawmidis (line 214) | fn print_rawmidis() {
FILE: src/seq.rs
type EvExtPacked (line 15) | struct EvExtPacked {
type Seq (line 26) | pub struct Seq(*mut alsa::snd_seq_t, cell::Cell<bool>);
method check_has_input (line 35) | fn check_has_input(&self) {
method open (line 42) | pub fn open(name: Option<&CStr>, dir: Option<Direction>, nonblock: boo...
method set_client_name (line 55) | pub fn set_client_name(&self, name: &CStr) -> Result<()> {
method set_client_event_filter (line 59) | pub fn set_client_event_filter(&self, event_type: i32) -> Result<()> {
method set_client_pool_output (line 63) | pub fn set_client_pool_output(&self, size: u32) -> Result<()> {
method set_client_pool_input (line 67) | pub fn set_client_pool_input(&self, size: u32) -> Result<()> {
method set_client_pool_output_room (line 71) | pub fn set_client_pool_output_room(&self, size: u32) -> Result<()> {
method client_id (line 75) | pub fn client_id(&self) -> Result<i32> {
method drain_output (line 79) | pub fn drain_output(&self) -> Result<i32> {
method get_any_client_info (line 83) | pub fn get_any_client_info(&self, client: i32) -> Result<ClientInfo> {
method get_any_port_info (line 88) | pub fn get_any_port_info(&self, a: Addr) -> Result<PortInfo> {
method create_port (line 93) | pub fn create_port(&self, port: &PortInfo) -> Result<()> {
method create_simple_port (line 97) | pub fn create_simple_port(&self, name: &CStr, caps: PortCap, t: PortTy...
method set_port_info (line 101) | pub fn set_port_info(&self, port: i32, info: &mut PortInfo) -> Result<...
method delete_port (line 105) | pub fn delete_port(&self, port: i32) -> Result<()> {
method subscribe_port (line 109) | pub fn subscribe_port(&self, info: &PortSubscribe) -> Result<()> {
method unsubscribe_port (line 113) | pub fn unsubscribe_port(&self, sender: Addr, dest: Addr) -> Result<()> {
method control_queue (line 120) | pub fn control_queue(&self, q: i32, t: EventType, value: i32, e: Optio...
method event_output (line 126) | pub fn event_output(&self, e: &mut Event) -> Result<u32> {
method event_output_buffer (line 131) | pub fn event_output_buffer(&self, e: &mut Event) -> Result<u32> {
method event_output_direct (line 136) | pub fn event_output_direct(&self, e: &mut Event) -> Result<u32> {
method get_queue_tempo (line 141) | pub fn get_queue_tempo(&self, q: i32) -> Result<QueueTempo> {
method set_queue_tempo (line 146) | pub fn set_queue_tempo(&self, q: i32, value: &QueueTempo) -> Result<()> {
method get_queue_status (line 150) | pub fn get_queue_status(&self, q: i32) -> Result<QueueStatus> {
method free_queue (line 155) | pub fn free_queue(&self, q: i32) -> Result<()> { acheck!(snd_seq_free_...
method alloc_queue (line 156) | pub fn alloc_queue(&self) -> Result<i32> { acheck!(snd_seq_alloc_queue...
method alloc_named_queue (line 157) | pub fn alloc_named_queue(&self, n: &CStr) -> Result<i32> {
method sync_output_queue (line 161) | pub fn sync_output_queue(&self) -> Result<()> {
method drop_output (line 165) | pub fn drop_output(&self) -> Result<()> {
method input (line 171) | pub fn input(&self) -> Input<'_> {
method remove_events (line 175) | pub fn remove_events(&self, condition: RemoveEvents) -> Result<()> {
method drop (line 31) | fn drop(&mut self) { unsafe { alsa::snd_seq_close(self.0) }; }
type Input (line 188) | pub struct Input<'a>(&'a Seq);
method drop (line 191) | fn drop(&mut self) { (self.0).1.set(false) }
function new (line 195) | fn new(s: &'a Seq) -> Input<'a> {
function event_input (line 201) | pub fn event_input(&mut self) -> Result<Event<'_>> {
function event_input_pending (line 211) | pub fn event_input_pending(&self, fetch_sequencer: bool) -> Result<u32> {
function set_input_buffer_size (line 215) | pub fn set_input_buffer_size(&self, size: u32) -> Result<()> {
function drop_input (line 219) | pub fn drop_input(&self) -> Result<()> {
function polldir (line 224) | fn polldir(o: Option<Direction>) -> c_short {
function count (line 234) | fn count(&self) -> usize {
function fill (line 238) | fn fill(&self, p: &mut [pollfd]) -> Result<usize> {
function revents (line 243) | fn revents(&self, p: &[pollfd]) -> Result<poll::Flags> {
type ClientInfo (line 251) | pub struct ClientInfo(*mut alsa::snd_seq_client_info_t);
method new (line 262) | fn new() -> Result<Self> {
method set_client (line 268) | fn set_client(&self, client: i32) {
method get_client (line 272) | pub fn get_client(&self) -> i32 {
method get_name (line 276) | pub fn get_name(&self) -> Result<&str> {
method get_card (line 281) | pub fn get_card(&self) -> Result<i32> {
method fmt (line 287) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method drop (line 256) | fn drop(&mut self) {
type ClientIter (line 294) | pub struct ClientIter<'a>(&'a Seq, i32);
function new (line 297) | pub fn new(seq: &'a Seq) -> Self { ClientIter(seq, -1) }
type Item (line 301) | type Item = ClientInfo;
method next (line 302) | fn next(&mut self) -> Option<Self::Item> {
type PortInfo (line 313) | pub struct PortInfo(*mut alsa::snd_seq_port_info_t);
method new (line 324) | fn new() -> Result<Self> {
method empty (line 330) | pub fn empty() -> Result<Self> {
method get_client (line 336) | pub fn get_client(&self) -> i32 {
method get_port (line 340) | pub fn get_port(&self) -> i32 {
method set_client (line 345) | fn set_client(&self, client: i32) {
method set_port (line 350) | fn set_port(&self, port: i32) {
method get_name (line 354) | pub fn get_name(&self) -> Result<&str> {
method set_name (line 359) | pub fn set_name(&mut self, name: &CStr) {
method get_capability (line 364) | pub fn get_capability(&self) -> PortCap {
method get_type (line 368) | pub fn get_type(&self) -> PortType {
method set_capability (line 372) | pub fn set_capability(&self, c: PortCap) {
method set_type (line 376) | pub fn set_type(&self, c: PortType) {
method addr (line 381) | pub fn addr(&self) -> Addr {
method get_midi_channels (line 388) | pub fn get_midi_channels(&self) -> i32 { unsafe { alsa::snd_seq_port_i...
method get_midi_voices (line 389) | pub fn get_midi_voices(&self) -> i32 { unsafe { alsa::snd_seq_port_inf...
method get_synth_voices (line 390) | pub fn get_synth_voices(&self) -> i32 { unsafe { alsa::snd_seq_port_in...
method get_read_use (line 391) | pub fn get_read_use(&self) -> i32 { unsafe { alsa::snd_seq_port_info_g...
method get_write_use (line 392) | pub fn get_write_use(&self) -> i32 { unsafe { alsa::snd_seq_port_info_...
method get_port_specified (line 393) | pub fn get_port_specified(&self) -> bool { unsafe { alsa::snd_seq_port...
method get_timestamping (line 394) | pub fn get_timestamping(&self) -> bool { unsafe { alsa::snd_seq_port_i...
method get_timestamp_real (line 395) | pub fn get_timestamp_real(&self) -> bool { unsafe { alsa::snd_seq_port...
method get_timestamp_queue (line 396) | pub fn get_timestamp_queue(&self) -> i32 { unsafe { alsa::snd_seq_port...
method set_midi_channels (line 398) | pub fn set_midi_channels(&self, value: i32) { unsafe { alsa::snd_seq_p...
method set_midi_voices (line 399) | pub fn set_midi_voices(&self, value: i32) { unsafe { alsa::snd_seq_por...
method set_synth_voices (line 400) | pub fn set_synth_voices(&self, value: i32) { unsafe { alsa::snd_seq_po...
method set_port_specified (line 401) | pub fn set_port_specified(&self, value: bool) { unsafe { alsa::snd_seq...
method set_timestamping (line 402) | pub fn set_timestamping(&self, value: bool) { unsafe { alsa::snd_seq_p...
method set_timestamp_real (line 403) | pub fn set_timestamp_real(&self, value: bool) { unsafe { alsa::snd_seq...
method set_timestamp_queue (line 404) | pub fn set_timestamp_queue(&self, value: i32) { unsafe { alsa::snd_seq...
method fmt (line 408) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method drop (line 318) | fn drop(&mut self) {
type PortIter (line 415) | pub struct PortIter<'a>(&'a Seq, i32, i32);
function new (line 418) | pub fn new(seq: &'a Seq, client: i32) -> Self { PortIter(seq, client, -1) }
type Item (line 422) | type Item = PortInfo;
method next (line 423) | fn next(&mut self) -> Option<Self::Item> {
type Addr (line 494) | pub struct Addr {
method system_timer (line 522) | pub fn system_timer() -> Addr { Addr { client: alsa::SND_SEQ_CLIENT_SY...
method system_announce (line 523) | pub fn system_announce() -> Addr { Addr { client: alsa::SND_SEQ_CLIENT...
method broadcast (line 524) | pub fn broadcast() -> Addr { Addr { client: alsa::SND_SEQ_ADDRESS_BROA...
type Err (line 500) | type Err = Box<dyn core::error::Error>;
method from_str (line 502) | fn from_str(s: &str) -> core::result::Result<Self, Self::Err> {
type PortSubscribe (line 529) | pub struct PortSubscribe(*mut alsa::snd_seq_port_subscribe_t);
method new (line 538) | fn new() -> Result<Self> {
method empty (line 544) | pub fn empty() -> Result<Self> {
method get_sender (line 550) | pub fn get_sender(&self) -> Addr { unsafe {
method get_dest (line 555) | pub fn get_dest(&self) -> Addr { unsafe {
method get_queue (line 560) | pub fn get_queue(&self) -> i32 { unsafe { alsa::snd_seq_port_subscribe...
method get_exclusive (line 561) | pub fn get_exclusive(&self) -> bool { unsafe { alsa::snd_seq_port_subs...
method get_time_update (line 562) | pub fn get_time_update(&self) -> bool { unsafe { alsa::snd_seq_port_su...
method get_time_real (line 563) | pub fn get_time_real(&self) -> bool { unsafe { alsa::snd_seq_port_subs...
method set_sender (line 565) | pub fn set_sender(&self, value: Addr) {
method set_dest (line 570) | pub fn set_dest(&self, value: Addr) {
method set_queue (line 575) | pub fn set_queue(&self, value: i32) { unsafe { alsa::snd_seq_port_subs...
method set_exclusive (line 576) | pub fn set_exclusive(&self, value: bool) { unsafe { alsa::snd_seq_port...
method set_time_update (line 577) | pub fn set_time_update(&self, value: bool) { unsafe { alsa::snd_seq_po...
method set_time_real (line 578) | pub fn set_time_real(&self, value: bool) { unsafe { alsa::snd_seq_port...
method drop (line 534) | fn drop(&mut self) { unsafe { alsa::snd_seq_port_subscribe_free(self.0) ...
type QuerySubsType (line 584) | pub enum QuerySubsType {
type QuerySubscribe (line 591) | struct QuerySubscribe(*mut alsa::snd_seq_query_subscribe_t);
method new (line 600) | pub fn new() -> Result<Self> {
method get_index (line 605) | pub fn get_index(&self) -> i32 { unsafe { alsa::snd_seq_query_subscrib...
method get_addr (line 606) | pub fn get_addr(&self) -> Addr { unsafe {
method get_queue (line 610) | pub fn get_queue(&self) -> i32 { unsafe { alsa::snd_seq_query_subscrib...
method get_exclusive (line 611) | pub fn get_exclusive(&self) -> bool { unsafe { alsa::snd_seq_query_sub...
method get_time_update (line 612) | pub fn get_time_update(&self) -> bool { unsafe { alsa::snd_seq_query_s...
method get_time_real (line 613) | pub fn get_time_real(&self) -> bool { unsafe { alsa::snd_seq_query_sub...
method set_root (line 615) | pub fn set_root(&self, value: Addr) { unsafe {
method set_type (line 619) | pub fn set_type(&self, value: QuerySubsType) { unsafe {
method set_index (line 622) | pub fn set_index(&self, value: i32) { unsafe { alsa::snd_seq_query_sub...
method drop (line 596) | fn drop(&mut self) { unsafe { alsa::snd_seq_query_subscribe_free(self.0)...
type PortSubscribeIter (line 627) | pub struct PortSubscribeIter<'a> {
function new (line 635) | pub fn new(seq: &'a Seq, addr: Addr, query_subs_type: QuerySubsType) -> ...
type Item (line 641) | type Item = PortSubscribe;
method next (line 643) | fn next(&mut self) -> Option<Self::Item> {
type Event (line 684) | pub struct Event<'a>(alsa::snd_seq_event_t, EventType, Option<Cow<'a, [u...
function new (line 690) | pub fn new<D: EventData>(t: EventType, data: &D) -> Event<'static> {
function new_ext (line 701) | pub fn new_ext<D: Into<Cow<'a, [u8]>>>(t: EventType, data: D) -> Event<'...
function into_owned (line 712) | pub fn into_owned(self) -> Event<'static> {
function get_length_flag (line 716) | fn get_length_flag(t: EventType) -> u8 {
function has_ext_data (line 729) | fn has_ext_data(t: EventType) -> bool {
function extract (line 734) | unsafe fn extract<'any>(z: &mut alsa::snd_seq_event_t, func: &'static st...
function ensure_buf (line 750) | fn ensure_buf(&mut self) {
function get_type (line 764) | pub fn get_type(&self) -> EventType { self.1 }
function get_data (line 768) | pub fn get_data<D: EventData>(&self) -> Option<D> { if D::has_data(self....
function get_ext (line 771) | pub fn get_ext(&self) -> Option<&[u8]> {
function set_subs (line 784) | pub fn set_subs(&mut self) {
function set_source (line 789) | pub fn set_source(&mut self, p: i32) { self.0.source.port = p as u8 }
function set_dest (line 790) | pub fn set_dest(&mut self, d: Addr) { self.0.dest.client = d.client as c...
function set_tag (line 791) | pub fn set_tag(&mut self, t: u8) { self.0.tag = t as c_uchar; }
function set_queue (line 792) | pub fn set_queue(&mut self, q: i32) { self.0.queue = q as c_uchar; }
function get_source (line 794) | pub fn get_source(&self) -> Addr { Addr { client: self.0.source.client a...
function get_dest (line 795) | pub fn get_dest(&self) -> Addr { Addr { client: self.0.dest.client as i3...
function get_tag (line 796) | pub fn get_tag(&self) -> u8 { self.0.tag as u8 }
function get_queue (line 797) | pub fn get_queue(&self) -> i32 { self.0.queue as i32 }
function schedule_real (line 799) | pub fn schedule_real(&mut self, queue: i32, relative: bool, rtime: time:...
function schedule_tick (line 808) | pub fn schedule_tick(&mut self, queue: i32, relative: bool, ttime: u32) {
function set_direct (line 816) | pub fn set_direct(&mut self) { self.0.queue = alsa::SND_SEQ_QUEUE_DIRECT }
function get_relative (line 818) | pub fn get_relative(&self) -> bool { (self.0.flags & alsa::SND_SEQ_TIME_...
function get_time (line 820) | pub fn get_time(&self) -> Option<time::Duration> {
function get_tick (line 828) | pub fn get_tick(&self) -> Option<u32> {
function get_priority (line 837) | pub fn get_priority(&self) -> bool { (self.0.flags & alsa::SND_SEQ_PRIOR...
function set_priority (line 839) | pub fn set_priority(&mut self, is_high_prio: bool) {
method clone (line 846) | fn clone(&self) -> Self { Event(unsafe { ptr::read(&self.0) }, self.1, s...
function fmt (line 850) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
type EventData (line 871) | pub trait EventData {
method get_data (line 873) | fn get_data(ev: &Event) -> Self;
method has_data (line 875) | fn has_data(e: EventType) -> bool;
method set_data (line 877) | fn set_data(&self, ev: &mut Event);
method get_data (line 881) | fn get_data(_: &Event) -> Self {}
method has_data (line 882) | fn has_data(e: EventType) -> bool {
method set_data (line 889) | fn set_data(&self, _: &mut Event) {}
method get_data (line 893) | fn get_data(ev: &Event) -> Self {
method has_data (line 898) | fn has_data(e: EventType) -> bool {
method set_data (line 913) | fn set_data(&self, ev: &mut Event) {
method get_data (line 930) | fn get_data(ev: &Event) -> Self {
method has_data (line 934) | fn has_data(e: EventType) -> bool {
method set_data (line 941) | fn set_data(&self, ev: &mut Event) {
method get_data (line 959) | fn get_data(ev: &Event) -> Self {
method has_data (line 963) | fn has_data(e: EventType) -> bool {
method set_data (line 978) | fn set_data(&self, ev: &mut Event) {
method get_data (line 987) | fn get_data(ev: &Event) -> Self {
method has_data (line 991) | fn has_data(e: EventType) -> bool {
method set_data (line 1000) | fn set_data(&self, ev: &mut Event) {
method get_data (line 1015) | fn get_data(ev: &Event) -> Self {
method has_data (line 1023) | fn has_data(e: EventType) -> bool {
method set_data (line 1028) | fn set_data(&self, ev: &mut Event) {
method get_data (line 1049) | fn get_data(ev: &Event) -> Self {
method has_data (line 1054) | fn has_data(e: EventType) -> bool {
method set_data (line 1062) | fn set_data(&self, ev: &mut Event) {
method get_data (line 1069) | fn get_data(ev: &Event) -> Self { unsafe {
method has_data (line 1074) | fn has_data(e: EventType) -> bool {
method set_data (line 1078) | fn set_data(&self, ev: &mut Event) { unsafe {
method get_data (line 1086) | fn get_data(ev: &Event) -> Self { unsafe {
method has_data (line 1091) | fn has_data(e: EventType) -> bool {
method set_data (line 1097) | fn set_data(&self, ev: &mut Event) { unsafe {
method get_data (line 1105) | fn get_data(ev: &Event) -> Self { unsafe {
method has_data (line 1111) | fn has_data(e: EventType) -> bool {
method set_data (line 1115) | fn set_data(&self, ev: &mut Event) { unsafe {
method get_data (line 1134) | fn get_data(ev: &Event) -> Self {
method has_data (line 1139) | fn has_data(e: EventType) -> bool {
method set_data (line 1144) | fn set_data(&self, ev: &mut Event) {
type EvNote (line 921) | pub struct EvNote {
type EvCtrl (line 952) | pub struct EvCtrl {
type Connect (line 1009) | pub struct Connect {
type EvQueueControl (line 1043) | pub struct EvQueueControl<T> {
type EvResult (line 1128) | pub struct EvResult {
type QueueTempo (line 1221) | pub struct QueueTempo(*mut alsa::snd_seq_queue_tempo_t);
method new (line 1230) | fn new() -> Result<Self> {
method empty (line 1236) | pub fn empty() -> Result<Self> {
method get_queue (line 1242) | pub fn get_queue(&self) -> i32 { unsafe { alsa::snd_seq_queue_tempo_ge...
method get_tempo (line 1243) | pub fn get_tempo(&self) -> u32 { unsafe { alsa::snd_seq_queue_tempo_ge...
method get_ppq (line 1244) | pub fn get_ppq(&self) -> i32 { unsafe { alsa::snd_seq_queue_tempo_get_...
method get_skew (line 1245) | pub fn get_skew(&self) -> u32 { unsafe { alsa::snd_seq_queue_tempo_get...
method get_skew_base (line 1246) | pub fn get_skew_base(&self) -> u32 { unsafe { alsa::snd_seq_queue_temp...
method set_tempo (line 1249) | pub fn set_tempo(&self, value: u32) { unsafe { alsa::snd_seq_queue_tem...
method set_ppq (line 1250) | pub fn set_ppq(&self, value: i32) { unsafe { alsa::snd_seq_queue_tempo...
method set_skew (line 1251) | pub fn set_skew(&self, value: u32) { unsafe { alsa::snd_seq_queue_temp...
method set_skew_base (line 1252) | pub fn set_skew_base(&self, value: u32) { unsafe { alsa::snd_seq_queue...
method drop (line 1226) | fn drop(&mut self) { unsafe { alsa::snd_seq_queue_tempo_free(self.0) } }
type QueueStatus (line 1257) | pub struct QueueStatus(*mut alsa::snd_seq_queue_status_t);
method new (line 1266) | fn new() -> Result<Self> {
method empty (line 1272) | pub fn empty() -> Result<Self> {
method get_queue (line 1278) | pub fn get_queue(&self) -> i32 { unsafe { alsa::snd_seq_queue_status_g...
method get_events (line 1279) | pub fn get_events(&self) -> i32 { unsafe { alsa::snd_seq_queue_status_...
method get_tick_time (line 1280) | pub fn get_tick_time(&self) -> u32 { unsafe {alsa::snd_seq_queue_statu...
method get_real_time (line 1281) | pub fn get_real_time(&self) -> time::Duration { unsafe {
method get_status (line 1285) | pub fn get_status(&self) -> u32 { unsafe { alsa::snd_seq_queue_status_...
method drop (line 1262) | fn drop(&mut self) { unsafe { alsa::snd_seq_queue_status_free(self.0) } }
type RemoveEvents (line 1290) | pub struct RemoveEvents(*mut alsa::snd_seq_remove_events_t);
method new (line 1299) | pub fn new() -> Result<Self> {
method get_condition (line 1304) | pub fn get_condition(&self) -> Remove { unsafe {
method get_queue (line 1307) | pub fn get_queue(&self) -> i32 { unsafe { alsa::snd_seq_remove_events_...
method get_time (line 1308) | pub fn get_time(&self) -> time::Duration { unsafe {
method get_dest (line 1314) | pub fn get_dest(&self) -> Addr { unsafe {
method get_channel (line 1319) | pub fn get_channel(&self) -> i32 { unsafe { alsa::snd_seq_remove_event...
method get_event_type (line 1320) | pub fn get_event_type(&self) -> Result<EventType> { unsafe {
method get_tag (line 1323) | pub fn get_tag(&self) -> u8 { unsafe { alsa::snd_seq_remove_events_get...
method set_condition (line 1326) | pub fn set_condition(&self, value: Remove) { unsafe {
method set_queue (line 1329) | pub fn set_queue(&self, value: i32) { unsafe { alsa::snd_seq_remove_ev...
method set_time (line 1330) | pub fn set_time(&self, value: time::Duration) { unsafe {
method set_dest (line 1339) | pub fn set_dest(&self, value: Addr) { unsafe {
method set_channel (line 1344) | pub fn set_channel(&self, value: i32) { unsafe { alsa::snd_seq_remove_...
method set_event_type (line 1345) | pub fn set_event_type(&self, value: EventType) { unsafe { alsa::snd_se...
method set_tag (line 1346) | pub fn set_tag(&self, value: u8) { unsafe { alsa::snd_seq_remove_event...
method drop (line 1295) | fn drop(&mut self) { unsafe { alsa::snd_seq_remove_events_free(self.0) } }
type MidiEvent (line 1353) | pub struct MidiEvent(*mut alsa::snd_midi_event_t);
method new (line 1360) | pub fn new(bufsize: u32) -> Result<MidiEvent> {
method resize_buffer (line 1365) | pub fn resize_buffer(&self, bufsize: u32) -> Result<()> { acheck!(snd_...
method enable_running_status (line 1370) | pub fn enable_running_status(&self, enable: bool) { unsafe { alsa::snd...
method init (line 1373) | pub fn init(&self) { unsafe { alsa::snd_midi_event_init(self.0) } }
method reset_encode (line 1375) | pub fn reset_encode(&self) { unsafe { alsa::snd_midi_event_reset_encod...
method reset_decode (line 1377) | pub fn reset_decode(&self) { unsafe { alsa::snd_midi_event_reset_decod...
method decode (line 1379) | pub fn decode(&self, buf: &mut [u8], ev: &mut Event) -> Result<usize> {
method encode (line 1385) | pub fn encode<'a>(&'a mut self, buf: &[u8]) -> Result<(usize, Option<E...
method drop (line 1356) | fn drop(&mut self) { unsafe { alsa::snd_midi_event_free(self.0) } }
function print_seqs (line 1402) | fn print_seqs() {
function seq_subscribe (line 1416) | fn seq_subscribe() {
function seq_loopback (line 1431) | fn seq_loopback() {
function seq_encode_sysex (line 1475) | fn seq_encode_sysex() {
function seq_decode_sysex (line 1486) | fn seq_decode_sysex() {
function seq_get_input_twice (line 1497) | fn seq_get_input_twice() {
function seq_has_data (line 1507) | fn seq_has_data() {
function seq_remove_events (line 1528) | fn seq_remove_events() -> core::result::Result<(), Box<dyn core::error::...
function seq_portsubscribeiter (line 1552) | fn seq_portsubscribeiter() {
FILE: synth-example/src/main.rs
type Res (line 8) | type Res<T> = Result<T, Box<dyn error::Error>>;
function connect_midi_source_ports (line 10) | fn connect_midi_source_ports(s: &alsa::Seq, our_port: i32) -> Res<()> {
function open_midi_dev (line 36) | fn open_midi_dev() -> Res<alsa::Seq> {
function open_audio_dev (line 56) | fn open_audio_dev() -> Res<(alsa::PCM, u32)> {
type SF (line 97) | type SF = i16;
type SigGen (line 99) | type SigGen = signal::Sine<signal::ConstHz>;
constant BAR_FREQS (line 102) | const BAR_FREQS: [f64; 9] = [16., 5.+1./3., 8., 4., 2.+2./3., 2., 1.+3./...
type Sig (line 105) | struct Sig {
type Synth (line 114) | struct Synth {
method add_note (line 122) | fn add_note(&mut self, note: u8, vol: f64) {
method remove_note (line 135) | fn remove_note(&mut self, note: u8) {
method cc (line 142) | fn cc(&mut self, ctrl: u32, value: i32) {
type Item (line 161) | type Item = SF;
method next (line 162) | fn next(&mut self) -> Option<Self::Item> {
function write_samples_direct (line 198) | fn write_samples_direct(p: &alsa::PCM, mmap: &mut alsa::direct::pcm::Mma...
function write_samples_io (line 216) | fn write_samples_io(p: &alsa::PCM, io: &mut alsa::pcm::IO<SF>, synth: &m...
function read_midi_event (line 243) | fn read_midi_event(input: &mut seq::Input, synth: &mut Synth) -> Res<boo...
function run (line 270) | fn run() -> Res<()> {
function main (line 309) | fn main() {
Condensed preview — 31 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (494K chars).
[
{
"path": ".github/workflows/rust.yml",
"chars": 671,
"preview": "name: Rust\n\non:\n push:\n branches: [ master ]\n pull_request:\n branches: [ master ]\n\nenv:\n CARGO_TERM_COLOR: alwa"
},
{
"path": ".gitignore",
"chars": 37,
"preview": "target/\n**/*.rs.bk\nCargo.lock\n.idea/\n"
},
{
"path": "Cargo.toml",
"chars": 839,
"preview": "[package]\nname = \"alsa\"\nversion = \"0.11.0\"\nauthors = [\"David Henningsson <coding@diwic.se>\"]\n\ndescription = \"Thin but sa"
},
{
"path": "LICENSE-APACHE",
"chars": 10174,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "LICENSE-MIT",
"chars": 1104,
"preview": "MIT License\n\nCopyright (c) 2015-2021 David Henningsson, and other contributors.\n\nPermission is hereby granted, free of c"
},
{
"path": "README.md",
"chars": 2226,
"preview": "ALSA bindings for Rust\n=======================\n\nThin but safe wrappers for [ALSA](https://alsa-project.org), the most\nco"
},
{
"path": "examples/ctl_list.rs",
"chars": 766,
"preview": "//! Example that enumerates controls for a device.\n\nuse alsa::Card;\nuse alsa::card::Iter;\nuse alsa::ctl::Ctl;\nuse alsa::"
},
{
"path": "examples/midi_enumerate.rs",
"chars": 2311,
"preview": "//! Example that enumerates hardware and PCM devices.\n\nuse alsa::Card;\nuse alsa::card::Iter as CardIter;\nuse alsa::ctl::"
},
{
"path": "examples/pcm_enumerate.rs",
"chars": 2643,
"preview": "//! Example that enumerates hardware and PCM devices.\n\nuse alsa::Card;\nuse alsa::card::Iter;\nuse alsa::device_name::Hint"
},
{
"path": "examples/pcm_record.rs",
"chars": 1482,
"preview": "//! Example that continously reads data and displays its RMS volume.\n\nuse alsa::pcm::*;\nuse alsa::{Direction, ValueOr, E"
},
{
"path": "examples/trigger_hstamp.rs",
"chars": 1931,
"preview": "use alsa::{\n pcm::{Access, Format, HwParams},\n Direction, ValueOr, PCM,\n};\n\nuse anyhow::Result; // Sorry for the e"
},
{
"path": "src/card.rs",
"chars": 1625,
"preview": "//! Sound card enumeration\nuse libc::{c_int, c_char};\nuse super::error::*;\nuse crate::alsa;\nuse core::ffi::CStr;\nuse ::a"
},
{
"path": "src/chmap.rs",
"chars": 5451,
"preview": "use crate::alsa;\nuse core::{fmt, mem, slice};\nuse super::error::*;\nuse ::alloc::vec::Vec;\nuse ::alloc::vec;\n\nalsa_enum!("
},
{
"path": "src/config.rs",
"chars": 1246,
"preview": "//! Configuration file API\n//!\n//! For now, just contains functions regarding the global configuration\n//! stored as a c"
},
{
"path": "src/ctl_int.rs",
"chars": 23064,
"preview": "\nuse crate::alsa;\nuse super::pcm::Info;\nuse core::ffi::CStr;\nuse ::alloc::ffi::CString;\nuse super::Direction;\nuse super:"
},
{
"path": "src/device_name.rs",
"chars": 2947,
"preview": "//! Enumerate devices in the alsa library configuration\n//!\n//! # Example\n//! Print all devices found in various categor"
},
{
"path": "src/direct/asound_ioctl.rs",
"chars": 200185,
"preview": "/* automatically generated by rust-bindgen */\n\n#[repr(C)]\n#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq"
},
{
"path": "src/direct/ffi.rs",
"chars": 6807,
"preview": "//! Some definitions from the kernel headers\n\n#![allow(non_camel_case_types)]\n\nuse cfg_if::cfg_if;\n\n// const SNDRV_PCM_M"
},
{
"path": "src/direct/pcm.rs",
"chars": 22608,
"preview": "/*!\nThis module bypasses alsa-lib and directly read and write into memory mapped kernel memory.\nIn case of the sample me"
},
{
"path": "src/direct.rs",
"chars": 92,
"preview": "//! Functions that bypass alsa-lib and talk directly to the kernel.\n\npub mod pcm;\n\nmod ffi;\n"
},
{
"path": "src/error.rs",
"chars": 7650,
"preview": "#![macro_use]\n\nuse libc::{c_char, c_int, c_void, free};\nuse core::error::Error as StdError;\nuse core::ffi::CStr;\nuse cor"
},
{
"path": "src/hctl.rs",
"chars": 6933,
"preview": "//! HCtl API - for mixer control and jack detection\n//!\n//! # Example\n//! Print all jacks and their status\n//!\n//! ```\n/"
},
{
"path": "src/io.rs",
"chars": 2855,
"preview": "use crate::alsa;\nuse super::error::*;\nuse core::{slice, ptr, fmt};\nuse core::cell::RefCell;\nuse ::alloc::rc::Rc;\nuse lib"
},
{
"path": "src/lib.rs",
"chars": 3481,
"preview": "//! Thin but safe wrappers for [ALSA](https://alsa-project.org).\n//!\n//! [GitHub repo](https://github.com/diwic/alsa-rs)"
},
{
"path": "src/mixer.rs",
"chars": 25084,
"preview": "//! Mixer API - Simple Mixer API for mixer control\n//!\nuse core::ffi::CStr;\nuse ::alloc::ffi::CString;\nuse ::alloc::stri"
},
{
"path": "src/pcm.rs",
"chars": 56737,
"preview": "//! Audio playback and capture\n//!\n//! # Example\n//! Playback a sine wave through the \"default\" device.\n//!\n//! ```\n//! "
},
{
"path": "src/poll.rs",
"chars": 2535,
"preview": "//! Tiny poll ffi\n//!\n//! A tiny wrapper around libc's poll system call.\n\nuse libc;\nuse super::error::*;\npub use libc::p"
},
{
"path": "src/rawmidi.rs",
"chars": 8407,
"preview": "//! MIDI devices I/O and enumeration\n\nuse libc::{c_int, c_uint, c_void, size_t, c_short, pollfd};\nuse super::ctl_int::{c"
},
{
"path": "src/seq.rs",
"chars": 63202,
"preview": "//! MIDI sequencer I/O and enumeration\n\nuse libc::{c_uint, c_int, c_short, c_uchar, c_void, c_long, size_t, pollfd};\nuse"
},
{
"path": "synth-example/Cargo.toml",
"chars": 226,
"preview": "[package]\nname = \"synth-example\"\nversion = \"0.1.0\"\nauthors = [\"David Henningsson <coding@diwic.se>\"]\nedition = \"2021\"\n\n["
},
{
"path": "synth-example/src/main.rs",
"chars": 10412,
"preview": "// A quickly made Hammond organ.\n\nuse std::{iter, error};\nuse alsa::{seq, pcm};\nuse std::ffi::CString;\nuse dasp::signal;"
}
]
About this extraction
This page contains the full source code of the diwic/alsa-rs GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 31 files (464.6 KB), approximately 133.4k tokens, and a symbol index with 1750 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.