WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit ca0d77bf authored by qinsoon's avatar qinsoon
Browse files

api mod

parent 327e1fdc
......@@ -15,18 +15,16 @@
#![allow(non_snake_case)] // It's generated code.
#![allow(dead_code)] // Seems Rust do not consider "taking the function pointer" as "use"
/**
* This file contains the bridge between the C interface and the Rust implementation.
*
* This file contains the the functions in the C-API's `MuVM`, `MuCtx` and `MuIRBuilder` structs.
* These functions will convert the low-level C-style argument types to the high-level Rust-level
* argument types, and attempt to call the methods of the same name on the corresponding Rust
* structs in api_impl.
*
* NOTE: Parts of this file (between GEN:BEGIN:* and GEN:END:*) are automatically generated. Do not
* edit those parts manually because they will be overwritten. Instead, edit the muapi2rustapi.py
* script to generate the desired code.
*/
//! This file contains the bridge between the C interface and the Rust implementation.
//! This file contains the the functions in the C-API's `MuVM`, `MuCtx` and `MuIRBuilder` structs.
//! These functions will convert the low-level C-style argument types to the high-level Rust-level
//! argument types, and attempt to call the methods of the same name on the corresponding Rust
//! structs in api_impl.
//!
//! NOTE: Parts of this file (between GEN:BEGIN:* and GEN:END:*) are automatically generated.
//! Do not edit those parts manually because they will be overwritten. Instead, edit the
//! muapi2rustapi.py script to generate the desired code.
use std::ptr;
use std::os::raw::*;
use std::ffi::CStr;
......
......@@ -14,16 +14,14 @@
#![allow(non_camel_case_types)] // Generated code
#![allow(dead_code)] // This is a public module that mirrors muapi.h
/**
* This file contains the C-facing interfaces.
*
* It is basically the muapi.h header written in Rust. It does not contain any
* implementation-specific code. Most codes are simply generated from muapi.h.
*
* NOTE: Parts of this file (between GEN:BEGIN:* and GEN:END:*) are automatically generated. Do not
* edit those parts manually because they will be overwritten. Instead, edit the muapi2rustapi.py
* script to generate the desired code.
*/
//! This file contains the C-facing interfaces.
//! It is basically the muapi.h header written in Rust. It does not contain any
//! implementation-specific code. Most codes are simply generated from muapi.h.
//!
//! NOTE: Parts of this file (between GEN:BEGIN:* and GEN:END:*) are automatically
//! generated. Do not edit those parts manually because they will be overwritten.
//! Instead, edit the muapi2rustapi.py script to generate the desired code.
// This file is for interfacing with C, so it is not idiomatic Rust code.
......
......@@ -12,12 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/*!
* This module contains the high-level implementation of the Mu API.
*
* Structs are written in idiomatic Rust code. The internal structures of these structs are
* implementation-specific. Methods are defined using `impl`.
*/
//! This module contains the high-level implementation of the Mu API.
//!
//! Structs are written in idiomatic Rust code. The internal structures of these structs are
//! implementation-specific. Methods are defined using `impl`.
#![allow(unused_imports)] // work in progress
#![allow(unused_variables)] // stubs
......
......@@ -12,11 +12,34 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! This module implements the Mu C API (defined in Mu spec:
//! https://gitlab.anu.edu.au/mu/mu-spec/blob/master/muapi.h) for Zebu.
//!
//! The API that Zebu exposes to native is "mu-fastimpl.h". A client
//! should include the header file, link against the static/dynmic library
//! of Zebu and access Mu functionality through the API functions.
//!
//! This module bridges the exposed C API and Zebu's internal representation.
//! Due to the fact that the API is long, formatted, and subject to change, this module
//! contains a lot of generated code from the C API header file (by Python scripts
//! within the same directory).
/// generated from muapi.h, and it declares structs/types in API
pub mod api_c; // This is pub because `api_c` can be used directly. It is just an interface.
/// generated code to bridge C API to internal representation in a Rust-friendly way
mod api_bridge; // This is mostly auto-generatd code, and should not be used externally.
/// implements __api_impl_stubs.rs that is generated from the API
/// this actually implements the API calls
mod api_impl; // Mostly private.
/// creates a Zebu instance with default options
/// There is no standard API to create a Mu VM (it is implementation dependent)
pub use self::api_impl::mu_fastimpl_new;
/// creates a Zebu instance with specified options
/// See vm_options.rs for supported options.
pub use self::api_impl::mu_fastimpl_new_with_opts;
mod deps {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment