开发者

How do I write a Java JNI wrapper for a set of Pascal library functions?

There is a certain library I would like to make use of from Java.

The library itself is written in Pascal and compiled down to a DLL. I have r开发者_开发知识库ead access to all relevant source code (it is free and open source) but it is unlikely I could influence any change proposals to the original code of the library. I have very little Pascal knowledge or experience. The library itself deals to a certain extent with passing in and getting back structures in memory. (If it were C, the functions would take and return struct pointers. I am unfortunately unaware of the equivalent names in Pascal.)

What I would like to make is a Java wrapper to this library. I would like to be able to make calls to these functions. I have read a number of tutorials about the Java Native Interface. What makes some sense is how to interface these functions. What does not make sense to me is how I am meant to deal with these structures in memory.

I would really appreciate if someone could help me figure out how to do this, or point me towards a good resource for it. What I've read so far mostly excludes or glosses over what seems to be the most important part for what I need, dealing with these structures I have in memory.

Thank you all.


Based on my experience, I'd avoid JNI (way too complicated) & use JNA instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜