× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mihael:

ILE RPG IV does not support the use of __PTR64 pointers (aka. "short pointers"). So, you would need to create a thin layer or jacket or wrapper set of functions that takes care of marshaling the pointers back and forth, accepting __PTR128 pointers from RPG IV, and then converting them into __PTR64 pointers, and vice versa. There are some restrictions -- the contents of the __PTR128 must be a pointer into teraspace storage, and not a single level storage address, or it cannot be converted into a __PTR64 short pointer.

Assuming your library creates (allocates) any "objects" (or dynamically allocated data structures) pointed to by these short pointers, you could just return any such pointers to RPG IV (via the thin wrapper layer) as 64-bit integers, assuming the RPG IV code would never attempt to directly use or de-reference such pointers, but would just call other functions or procedures, passing these short pointers as parameters, to act upon whatever-it-is that is pointed to by these "opaque" pointers. (This is akin to using "handles" instead of pointers, and is a common "best practice" technique used when writing libraries, to encapsulate private data structures, for "information hiding" purposes.)

Does that help at all?

Mark

> On 12/3/2010 9:25 AM, Schmidt, Mihael wrote:
I am trying to build a serviceprogram with ILE C modules so that the functions/procedures are accessable from RPG.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.