simple jstruct plugin
    Maurizio Cimadamore 
    maurizio.cimadamore at oracle.com
       
    Thu May  7 15:52:34 UTC 2020
    
    
  
Hi,
it can be sometimes useful to have a tool which parses header files and 
generates all the structs found inside them. This is useful when working 
with network protocols and the like, where a Java program might wish to 
use the memory access API w/o necessarily having a need to call any 
native function - or in any case where an interesting layout definition 
is provided as a struct/union in some header file.
To validate the jextract API, I wrote a very simple plugin that does 
exactly that; it is very rough (e.g. endianness is assumed to be always 
little_endian), but is good enough to handle some basic use cases 
encountered inside the JDK code base itself. I thought I'd share it here:
https://gist.github.com/mcimadamore/5f002d8177e05780f068dd7874a5020b
Cheers
Maurizio
    
    
More information about the panama-dev
mailing list