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
//! Macros for creating compile-time EOSIO names and symbols.
//!
//! Creating EOSIO names:
//!
//! ```
//! use eosio_macros::n;
//! assert_eq!(n!("test"), 14_605_613_396_213_628_928);
//! assert_eq!(n!("1234"), 614_248_767_926_829_056);
//! assert_eq!(n!("123451234512"), 614_251_535_012_020_768);
//! assert_eq!(n!("eosio.token"), 6_138_663_591_592_764_928);
//! ```
//!
//! Creating EOSIO symbols:
//!
//! ```
//! use eosio_macros::s;
//! assert_eq!(s!(4, "EOS"), 1397703940);
//! ```
#![no_std]
#![allow(clippy::missing_docs_in_private_items)]

use proc_macro_hack::proc_macro_hack;

/// Macro for converting EOSIO names into `u64` representations at compile
/// time.
///
/// # Examples
///
/// ```
/// use eosio_macros::n;
/// assert_eq!(n!("test"), 14_605_613_396_213_628_928);
/// assert_eq!(n!("1234"), 614_248_767_926_829_056);
/// assert_eq!(n!("123451234512"), 614_251_535_012_020_768);
/// assert_eq!(n!("eosio.token"), 6_138_663_591_592_764_928);
/// ```
#[proc_macro_hack]
pub use eosio_macros_internal::n;

/// Macro for converting EOSIO symbols into `u64` representations at
/// compile time.
///
/// # Examples
///
/// ```
/// use eosio_macros::s;
/// assert_eq!(s!(4, "EOS"), 1397703940);
/// ```
#[proc_macro_hack]
pub use eosio_macros_internal::s;

pub use eosio_macros_internal::{
    abi, action, table, NumBytes, Read, Table, Write,
};