1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Sibling registration entry-point macro.
//!
//! Each sibling crate that ships a codec / container / filter / source
//! invokes [`crate::register!`] at module scope to declare its
//! `register(ctx)` function as the canonical entry point. The
//! [`oxideav-meta`](https://crates.io/crates/oxideav-meta) crate's
//! build script enumerates the enabled sibling deps in its Cargo.toml
//! and emits a `register_all(ctx)` body that calls the macro-generated
//! entry point of each.
//!
//! The macro is the dispatch contract between sibling and meta. Today
//! it expands to a thin `pub fn __oxideav_entry(ctx)` wrapper around
//! the user-supplied register fn. The macro body is the only place
//! that needs to change if the dispatch transport switches in the
//! future (e.g. add a metadata arg, defer init, async-init, audit
//! hook) — sibling call sites stay untouched.
//!
//! # Standalone opt-out
//!
//! Each sibling's `register!()` call lives behind that crate's
//! default-on `registry` cargo feature. Consumers that want the
//! standalone (no-`oxideav-core`-dep) build path turn the feature off
//! and the macro call disappears.
/// Declare the canonical sibling entry point.
///
/// Place at module scope inside the sibling crate, gated behind the
/// crate's `registry` cargo feature so the standalone build path
/// stays decoupled from `oxideav-core`:
///
/// ```ignore
/// pub fn register(ctx: &mut oxideav_core::RuntimeContext) {
/// /* install factories */
/// }
///
/// #[cfg(feature = "registry")]
/// oxideav_core::register!("aac", register);
/// ```
///
/// The macro expands to a `pub fn __oxideav_entry(ctx)` wrapper that
/// invokes the supplied function. `oxideav-meta`'s `register_all`
/// calls `crate::__oxideav_entry(ctx)` for each enabled sibling dep.
///
/// The display-name argument (first literal) is reserved for future
/// dispatch-transport changes; it is currently ignored by the
/// expansion but kept in the macro signature for forward
/// compatibility.