Mapping opaque pointers
Posted: Thu Apr 07, 2016 12:42 pm
Hi,
in C there is something called an opaque pointer (https://en.wikipedia.org/wiki/Opaque_pointer):
typedef struct MyDataStruct_t *PtrToMyDataStr;
which allows to hide any implementation details of MyDataStruct.
I need to write a BBox interface to a DLL that uses this approach.
I am not sure if I should do something like this:
TYPE MyDataStruct_t* = INTEGER;
or
TYPE MyDataStruct_t* = POINTER [untagged] TO RECORD END;
and the in an interfacing procedure
PROCEDURE DoSomethig*["MyDll"](VAR [nil] PtrStruct : MyDataStruct_t ....)
Any experience with mapping of this construct? How it should be implemented?
Cheers,
Darek
in C there is something called an opaque pointer (https://en.wikipedia.org/wiki/Opaque_pointer):
typedef struct MyDataStruct_t *PtrToMyDataStr;
which allows to hide any implementation details of MyDataStruct.
I need to write a BBox interface to a DLL that uses this approach.
I am not sure if I should do something like this:
TYPE MyDataStruct_t* = INTEGER;
or
TYPE MyDataStruct_t* = POINTER [untagged] TO RECORD END;
and the in an interfacing procedure
PROCEDURE DoSomethig*["MyDll"](VAR [nil] PtrStruct : MyDataStruct_t ....)
Any experience with mapping of this construct? How it should be implemented?
Cheers,
Darek