Skip to content

Commit 89df66c

Browse files
authored
Merge pull request #7 from Neotron-Compute/release/v0.2.0
Release/v0.2.0
2 parents da034fb + 3987432 commit 89df66c

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "neotron-api"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2021"
55
authors = [
66
"Jonathan 'theJPster' Pallant <github@thejpster.org.uk>",

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Note that this API must be FFI-safe, because the [Neotron OS] and the Applicatio
1515

1616
* None
1717

18+
### v0.2.0
19+
20+
* Introduce new type for application entry points (supports passing arguments)
21+
1822
### v0.1.0
1923

2024
* First Version

src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@ pub struct Api {
154154
pub free: extern "C" fn(ptr: *mut core::ffi::c_void, size: usize, alignment: usize),
155155
}
156156

157+
/// The type of the entry function for an application
158+
///
159+
/// * `api` is a pointer to the [`Api`] callback table
160+
/// * `argc` is the number of arguments passed. If this is non-zero, then `argv`
161+
/// must be non-null.
162+
/// * `argv` is a pointer to the start of an array of arguments to the program.
163+
/// Every item in that array is a [`FfiString`]. There are `argc` items in the
164+
/// array.
165+
///
166+
/// The function should return `0` on success, or anything else to indicate an
167+
/// error.
168+
pub type AppStartFn = extern "C" fn(api: *const Api, argc: usize, argv: *const FfiString) -> i32;
169+
157170
/// Describes how something has failed
158171
#[repr(C)]
159172
#[derive(Debug, Copy, Clone, PartialEq, Eq)]

0 commit comments

Comments
 (0)