Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssetSys: Mount from Memory #53

Closed
RobLoach opened this issue Nov 9, 2022 · 2 comments
Closed

AssetSys: Mount from Memory #53

RobLoach opened this issue Nov 9, 2022 · 2 comments

Comments

@RobLoach
Copy link
Contributor

RobLoach commented Nov 9, 2022

Would be awesome to have a assetsys_mount_memory() or similar to mount from an already loaded file data.

assetsys_mount_memory(assetsys_t* sys, void* file_data, uint file_size, char const* mount_as);

Would this be out of scope for assetsys?

@RandyGaul
Copy link
Contributor

Since it’s using minizip mounting a zip file from memory could be fairly easy. But for folders it would be significantly more work

@mattiasgustavsson
Copy link
Owner

If someone made a PR for it, I wouldn’t mind adding it (assuming it’s done in a way consistent with the library overall), but it’s not something I’d have the time to do myself

RobLoach added a commit to RobLoach/libs that referenced this issue Sep 3, 2023
This change attempts to tackle mattiasgustavsson#53 and adds a `assetsys_mount_data()` function to mount data from an archive data buffer. This paves the path to allow disabling STDIO, and cases in which the target already has the file loaded into memory.

It splits the `assetsys_mount()` into two different internal functions to save on code duplication. These functions may or may not be named correctly:
- `assetsys_internal_create_mount()`: Prepares a new mount for the assetsys instance
- `assetsys_internal_mount_zip(): Iterates through the mount system and indexes the files
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

No branches or pull requests

3 participants