Most tools will generate the correct header file for use in your DPI code. Please refer to your tool documentation or contact your vendor support team for additional assistance.
In reply to cgales:
May be I did not explain the question well. The header is there and the implementation is working fine when I give the static size to the array arguments. The problem arises when the import declaration has dynamic array argument.
The argument that is passed to the DPI is defined to be of a certain size prior to calling the DPI. This seems not OK to the tool and hence the segmentation fault.
How to approach this scenario where the size of the array argument is known only during run-time? The DPI implementation in C has pointer argument. sth like:
When you use more complex datatypes, such as an unbounded array, you need to use specific DPI datatypes. In this case, you will need to use svOpenArrayHandle.
As I mentioned, tools will typically generate the C function prototype required to handle these functions. In this case, to match your DPI import, you will get:
In reply to cgales:
Thanks for the response @cgales. I have come across the solution that you mentioned while doing a little google search. Is there any work around if I do not have privilege of making change to the C implementation?