8000 add extract_file_to_string by cooldome · Pull Request #8 · h3rald/nim-miniz · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 13, 2026. It is now read-only.

add extract_file_to_string - #8

Merged
h3rald merged 1 commit into
h3rald:masterfrom
cooldome:master
Mar 21, 2020
Merged

h3rald merged 1 commit into
h3rald:masterfrom
cooldome:master

Conversation

@cooldome
Copy link
Copy Markdown

The major goal of this PR is to add proc extract_file_to_string() proc to bypass file creation step.
Unfortunately I have found that mz_zip_archive_file_stat() proc doesn't work because mz_zip_archive_file_stat object is inside importc push block, so I had to break up importc block.
Also I have found that mz_zip_reader_extract_to_callback() doesn't work because mz_file_write_func proc type doesn't have calling connevntion specified, fixed it as well.

Summary of changes

  • Break up {.push: importc.} block into individual importc for procs
  • Add {.noconv.} to callback proc types.
  • Added extract_file_to_string() proc
  • Factored out common logic between extract_file() and extract_file_to_string() into new function file_index_inexact(). file_index_inexact() is private function not exported.
  • Added test for extract_file_to_string()

@h3rald
h3rald commented Mar 19, 2020
Copy link
Copy Markdown
Owner

Thanks mate, I'll take a look at it when I have a chance and hopefully merge it without issues.

Been a bit busy with RL lately, but will try to remember...

@h3rald
h3rald merged commit a6dad37 into h3rald:master Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0