<div dir="ltr"><div><div>Hi,<br><br></div>In OpenJDK project panama, we are working on a tool to take in a header file and spit out Java APIs utilizing libclang. A proof-of-concept can be found at [1].<br><br></div><div>I would like to get the function type if a field of struct is a function pointer, but I am not sure how to do that. I was expecting to get a pointee type of FunctionProto on that field, but looks like I only get an Unexposed.<br><br></div><div>Attached are a cursor visitor code I did to dump cursors and their type, and the result of the dump for following snippet. <br><br>typedef struct foo {<br>    int(*fn)(char* arg1, long arg2);<br>    struct bar *ptr;<br>} foo;<br><br></div><div>I got a FieldDecl for fn, which has a type of Pointer whose pointeeType is Unexposed. In case of struct, pointee type is also Unexposed, but there is a TypeRef and StructDecl for bar, so at least I can figureout there is a Record type, but how figure out the function type for fn?<br><br></div><div>Are there test cases or document that I can reference to figure out what kind of cursor or type I can get with various style of code? I am guessing there are test cases to verify the correct output of visitor, but a quick glance to the source code didn't reveal them. I hope you experts would give me some pointers.<br><br></div><div>Thanks for the good work.<br></div><div><div><div><br>Cheers,<br>Henry<br><br><br>[1] <a href="http://hg.openjdk.java.net/panama/panama/jdk/file/tip/src/jdk.dev/share/classes/com/sun/tools/jextract">http://hg.openjdk.java.net/panama/panama/jdk/file/tip/src/jdk.dev/share/classes/com/sun/tools/jextract</a>.<span style="color:rgb(0,0,0);font-family:"Droid Sans Fallback";font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:rgb(255,255,255)"></span></div></div></div></div>