Skip to content

Add a module with a read-only std::env-style interface that reads from apple args#2

Draft
thomcc wants to merge 5 commits into
BlackHoleFox:masterfrom
thomcc:kv
Draft

Add a module with a read-only std::env-style interface that reads from apple args#2
thomcc wants to merge 5 commits into
BlackHoleFox:masterfrom
thomcc:kv

Conversation

@thomcc

@thomcc thomcc commented Aug 1, 2022

Copy link
Copy Markdown

Needs tests and docs I guess. Also has other stuff too -- mostly because I had intended to make most of these functions more testable by allowing them to be passed a &'static [&'static [u8]]. As a result, it's a slightly larger patch than is needed.

Not sure when I'll finish this so feel free to take and do with it what you like (even if that's "discard it").

@thomcc thomcc left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are a bit of a mess.

Comment thread src/env.rs
//! not writing) functions in [`std::env`], but which use the apple arguments
//! instead.
//!
//! The used for the apple arguments may be unstable, so the functions in this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to delete this paragraph.

Comment thread src/lib.rs Outdated
}

fn args_slice_iter() -> core::slice::Iter<'static, Vec<u8>> {
fn args_slice() -> &'static [&'static [u8]] {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change didn't end up being needed.

Comment thread src/lib.rs Outdated
fn strlen(s: *const c_char) -> usize;
}

struct AbortGuard;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated but a good idea (I didn't think of it when you asked me to look before).

@thomcc

thomcc commented Sep 22, 2022

Copy link
Copy Markdown
Author

I updated this quite a bit, but most of these changes I made a while ago, and it does feel like some of them shouldn't really be part of the same patchset...

@thomcc

thomcc commented Sep 22, 2022

Copy link
Copy Markdown
Author

I also am pretty sure I intended to add more tests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant