<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">1 & 2 You may want to checkout <a href="https://github.com/openjdk/jextract">https://github.com/openjdk/jextract</a><br></blockquote><div>I already read everything there. I don't see the answers there.</div><div>What happens if a package name or header class name are not specified?</div><div>What does the path of -I need to point at? A folder? What file types are accepted?</div><div>What format does a macro for -D come as? A file?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">3. Options like -I and -l try to mimic same C compiler driver options<br></blockquote><div>Alright.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br></blockquote><div>I wasn't familiar with this API; I will study it. Thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.<br></blockquote><div>The GUI wrapper reads all the symbols and allows the user to choose which ones they want to bind to. This replaces the need for the user to modify a text file. Think of a tree view:</div><div><br></div><div>[ ] myheader.h</div><div>  [ ] funcions</div><div>    [X] myfunc1</div><div>    [ ]  myfunc2</div><div>  [X] structs</div><div>    [X] mystruct1</div><div>    [X] mystruct2</div><div> </div><div>This representation is easier to work with (batch selection etc,), but to build it, a dump output is required. When the tool gets a header, it runs --dump-includes on it, but doesn't want a file to be created, read, and deleted. It wants the output directly "in memory".</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">6. jextract supports only C language - the file extensions that "clang" compiler accepts for C programs should work.</blockquote><div>Alright, thanks.</div><div><br></div><div>- Nir</div><div> </div><div dir="ltr"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 3, 2022 at 6:34 AM Sundararajan Athijegannathan <<a href="mailto:sundararajan.athijegannathan@oracle.com">sundararajan.athijegannathan@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6036192498336257334">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<ol>
<li><span>& 2 You may want to checkout <a href="https://github.com/openjdk/jextract" id="m_6036192498336257334LPlnkOWALinkPreview" target="_blank">https://github.com/openjdk/jextract</a></span></li><li style="display:block"><br>
<span></span>
<div>
<div id="m_6036192498336257334LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL29wZW5qZGsvamV4dHJhY3Q." style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px">
<table id="m_6036192498336257334LPContainer619022" role="presentation" style="padding:12px 36px 12px 12px;width:100%;border:1px solid rgb(200,200,200);border-radius:2px">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td>
<div id="m_6036192498336257334LPImageContainer619022" style="margin-right:12px;height:120px;overflow:hidden;width:240px">
<a id="m_6036192498336257334LPImageAnchor619022" href="https://github.com/openjdk/jextract" target="_blank"><img id="m_6036192498336257334LPThumbnailImageId619022" alt="" height="120" style="display: block;" width="240" src="https://opengraph.githubassets.com/fae24ba8d2ba2540bcc8e0d3b7e967e23bfb4a570d101dbcac2074b92aeb7d9f/openjdk/jextract"></a></div>
</td>
<td style="width:100%">
<div id="m_6036192498336257334LPTitle619022" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px">
<a id="m_6036192498336257334LPUrlAnchor619022" href="https://github.com/openjdk/jextract" style="text-decoration:none" target="_blank">GitHub - openjdk/jextract: https://openjdk.org/projects/code-tools</a></div>
<div id="m_6036192498336257334LPDescription619022" style="font-size:14px;max-height:100px;color:rgb(102,102,102);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;margin-bottom:12px;margin-right:8px;overflow:hidden">
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 ...</div>
<div id="m_6036192498336257334LPMetadata619022" style="font-size:14px;font-weight:400;color:rgb(166,166,166);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
<a href="http://github.com" target="_blank">github.com</a></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</li></ol>
<div><br>
</div>
<div><span>  </span>3. Options like -I and -l try to mimic same C compiler driver options</div>
<div>    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.</div>
<div>    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.</div>
<div>   6. jextract supports only C language - the file extensions that "clang" compiler accepts for C programs should work.</div>
<div><br>
</div>
<div>-Sundar</div>
<div><br>
</div>
</div>
<div id="m_6036192498336257334appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="m_6036192498336257334divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> jextract-dev <<a href="mailto:jextract-dev-retn@openjdk.org" target="_blank">jextract-dev-retn@openjdk.org</a>> on behalf of Nir Lisker <<a href="mailto:nlisker@gmail.com" target="_blank">nlisker@gmail.com</a>><br>
<b>Sent:</b> 03 October 2022 03:01<br>
<b>To:</b> <a href="mailto:jextract-dev@openjdk.org" target="_blank">jextract-dev@openjdk.org</a> <<a href="mailto:jextract-dev@openjdk.org" target="_blank">jextract-dev@openjdk.org</a>><br>
<b>Subject:</b> GUI wrapper for jextract</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div>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?</div>
<div>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?</div>
<div>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?</div>
<div>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.</div>
<div>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.</div>
<div>6. What file formats, except for .h, can jextract expect as a target? .c? .hh?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Nir</div>
</div>
</div>
</div>

</div></blockquote></div></div>