Skip to content

Commit 99b7b10

Browse files
committed
Add missing docs.
1 parent 0dc413e commit 99b7b10

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,25 @@ fn get_api() -> &'static Api {
470470
unsafe { ptr.as_ref().unwrap() }
471471
}
472472

473+
/// Initialisation function for OSes other than Neotron OS
474+
///
475+
/// If you are using this SDK on Windows or UNIX, your main function should
476+
/// call this function as the first thing it does. It will set up the SDK
477+
/// and then jump to `neotron_main()`.
478+
///
479+
/// ```
480+
/// #[cfg(not(target_os = "none"))]
481+
/// fn main() {
482+
/// neotron_sdk::init();
483+
/// }
484+
///
485+
///
486+
/// #[no_mangle]
487+
/// extern "C" fn neotron_main() -> i32 {
488+
/// // Your code here
489+
/// 0
490+
/// }
491+
/// ```
473492
#[cfg(not(target_os = "none"))]
474493
pub fn init() {
475494
API.store(fake_os_api::get_ptr() as *mut Api, Ordering::Relaxed);

0 commit comments

Comments
 (0)