[][src]Type Definition sciter::types::SciterLibraryInit

type SciterLibraryInit = extern "system" fn(api: &'static ISciterAPI, exported: &mut VALUE) -> BOOL;

Signature of Sciter extension library.

  • api - Sciter API to be used inside the extension.
  • exported - extension object, it can be asset, function, or other sciter::Value supported type.

Return true if the exported object was initialized.

The extension should be placed in the same folder as "sciter.dll" and export a SciterLibraryInit function:

use sciter::types::{BOOL, VALUE};
use sciter::Value;

#[no_mangle]
pub extern "system"
fn SciterLibraryInit(api: &'static sciter::ISciterAPI, exported: &mut VALUE) -> BOOL
{
  sciter::set_host_api(api);

  unimplemented!("export some extension functions");

  true as BOOL
}

In script such extension library can be imported as:

const exported = include library "library-name";

See the blog post for more details.