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

Improve Documentation on importing other hexpat files into hexpat file #269

Open
KevinCCucumber opened this issue Jul 10, 2024 · 3 comments

Comments

@KevinCCucumber
Copy link

I am analyzing a file containing compressed chunks.
I imported the zstd.hexpat file and managed to highlight some code blocks on executing it.
However, now I want to integrate this function into my main hexpat file that I use to analyze the whole file, but I cannot manage to import or use the type zstd_frame_t, but I can import the function from hex::dec::zstd_decompress(pattern, section) when copying all the definitions into my hexpat file.

I would like the documentation to be augmented on how the hexpat files work with each other.
I love what you do. Keep up the great work!

@WerWolv
Copy link
Owner

WerWolv commented Jul 10, 2024

Hey, as of right now patterns cannot really import other patterns. This is an active point of development though, ultimately the goal is that you can just import other patterns using the import statement and place them somewhere but that sadly isn't possible yet as of right now.

@C3pa
Copy link
Contributor

C3pa commented Aug 20, 2024

As mentioned in WerWolv/Documentation#18, user patterns can import other custom pattern headers just fine. But that usually involves adding a new directory to the pattern search paths in the Extras > Settings > Folders menu.

@WerWolv I believe that the only quality of life thing missing from the described workflow is a feature of C++ #include directive where using double quotes will also add the current directory to the search paths. IMHO, that would result in seamless importing/including other files that are part of a multi-file pattern project.

WerWolv pushed a commit to WerWolv/Documentation that referenced this issue Aug 20, 2024
As we discussed on Discord, I am now submitting an initial version of
the `import` statement documentation. All suggestions are welcome.

Fixes: #15.
Fixes: #11.

I am not sure if this is considered controversial, but adding a folder
with multiple of your pattern files to the search paths using `Extras >
Settings > Folders` will allow the user to correctly `import` their
pattern files to other pattern files. If I understand the request/issue
correctly, that's also the point of the issue:
WerWolv/ImHex-Patterns#269

**Edit**: I think it also fixes:
WerWolv/ImHex#1641 since ImHex won't crash
anymore in that issue, and this PR explains how to properly use standard
library headers.

---------

Co-authored-by: paxcut <[email protected]>
@C3pa
Copy link
Contributor

C3pa commented Aug 23, 2024

@KevinCCucumber, a new page called Importing Modules was recently added to the documentation. Can you see if it provides the info you were interested in?

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