[src]

Crate fourcc

Syntax extension to generate FourCCs.

Once loaded, fourcc!() is called with a single 4-character string, and an optional ident that is either big, little, or target. The ident represents endianness, and specifies in which direction the characters should be read. If the ident is omitted, it is assumed to be big, i.e. left-to-right order. It returns a u32.

Examples

To load the extension and use it:

#[phase(syntax)]
extern crate fourcc;

fn main() {
    let val = fourcc!("\xC0\xFF\xEE!");
    assert_eq!(val, 0xC0FFEE21u32);
    let little_val = fourcc!("foo ", little);
    assert_eq!(little_val, 0x21EEFFC0u32);
}

References

expand_syntax_ext
macro_registrar