logo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::ffi::CStr;

use crate::extn::prelude::*;

const ARTICHOKE_CSTR: &CStr = qed::const_cstr_from_str!("Artichoke\0");

pub fn init(interp: &mut crate::Artichoke) -> InitializeResult<()> {
    if interp.is_module_defined::<Artichoke>() {
        return Ok(());
    }

    let spec = module::Spec::new(interp, "Artichoke", ARTICHOKE_CSTR, None)?;
    module::Builder::for_spec(interp, &spec).define()?;
    interp.def_module::<Artichoke>(spec)?;

    Ok(())
}

#[derive(Debug, Clone, Copy)]
pub struct Artichoke;

#[derive(Debug, Clone, Copy)]
pub struct Kernel;