GUI wrapper for jextract

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Mon Oct 3 03:34:26 UTC 2022


  1.  & 2 You may want to checkout https://github.com/openjdk/jextract
  2.
[https://opengraph.githubassets.com/fae24ba8d2ba2540bcc8e0d3b7e967e23bfb4a570d101dbcac2074b92aeb7d9f/openjdk/jextract]<https://github.com/openjdk/jextract>
GitHub - openjdk/jextract: https://openjdk.org/projects/code-tools<https://github.com/openjdk/jextract>
Jextract. jextract is a tool which mechanically generates Java bindings from a native library headers. This tools leverages the clang C API in order to parse the headers associated with a given native library, and the generated Java bindings build upon the Foreign Function & Memory API.The jextract tool was originally developed in the context of Project Panama (and then made available in the ...
github.com

  3. Options like -I and -l try to mimic same C compiler driver options
    4. Need to check consistency with the rest of the JDK bin tools on this. Btw for embedding use case, you can use ToolProvider API which jextract supports. No need to fork a separate process and deal with streams etc.
    5. Not getting your use case. "dump" is to get all symbols from header parsed - which you can edit and use it as argument in a later jextract session. That's use the intended use case.
   6. jextract supports only C language - the file extensions that "clang" compiler accepts for C programs should work.

-Sundar

________________________________
From: jextract-dev <jextract-dev-retn at openjdk.org> on behalf of Nir Lisker <nlisker at gmail.com>
Sent: 03 October 2022 03:01
To: jextract-dev at openjdk.org <jextract-dev at openjdk.org>
Subject: GUI wrapper for jextract

Hi,

After a short talk with Maurizio off-list, I started making a GUI wrapper for jextract. I have several question/comments that came up during development:

1. In order to help the user give the correct inputs, is there more info somewhere on what each command accepts exactly? For example, what does '-I <path>' look for exactly in the path? What does '-D <macro>' look for?
2. What are the default values for options that aren't specified and have to have a default, like the output path, package name, and header class name?
3. I think that having a capital I and a lowercase l options is confusing in many fonts. Is there a reason not to use lowercase or uppercase on everything?
4. I execute jextract using a java.lang.Process object and read its output and error streams. I noticed that the process writes the output of '--version' and '--help' to the error stream, while it makes more sense to write them to the output stream. I'm on Windows in case it's OS dependent.
5. When analyzing the symbols of a header using the dump option, I need to read the file that jextract creates from disk and then delete it. Is there a way to read the jextract output directly? Either through the output stream, or writing to a file in memory? Dealing with disk I/O is cumbersome, comes with permission restrictions, and might be slow if done for many files in a batch.
6. What file formats, except for .h, can jextract expect as a target? .c? .hh?

Thanks,
Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jextract-dev/attachments/20221003/fbc6f23b/attachment-0001.htm>


More information about the jextract-dev mailing list