Dear members:
I am not familiar with Pascal, but I would like to call some C routines inside the main Pascal program, is there any way, to pass function pointers from Pascal to the C subroutines?
Thanks in Advance
Armando
Mailing lists / fpc-pascal / 2006-10
mixing C and Pascal and function pointers
4 messages · 4 people · –
- AArmando Navarro Vázquez 1
- KKen G. Brown 1
- LLeonardo M. Ram� 1
- WWolfe, Robert 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
You may want to convert the code for the function using the h2pas or c2pas conversion utilities that are available out there to do this.
Robert Wolfe ( / )
Computer Programmer/Analyst & Web Programmer
SRDAR, Roswell Park Cancer Institute, Buffalo, New York 716-845-5788 | http://www.srdar.org
Show quoted text 23 lines
This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
Dear members: I am not familiar with Pascal, but I would like to call some C routines…
The C routines are inside a shared library?. Can you post the "C" code to call these routines?
--- Armando Navarro Vázquez wrote 16 lines
Leonardo M. Ramé
http://leonardorame.blogspot.com
__________________________________________________ Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
I've been experimenting with calling C routines in a library from Pascal. This seems to work:
In the Pascal source do
Procedure croutine; cdecl; alias : '_croutine'; External;If there is trouble finding the routines when building, you can give the location of the routines in the Pascal source file with:
{$L libcroutines.a}When compiling, the 'lib' is automatically added to the front of the file name for the library source.
So far I have passed an SInt32 to the C routines so maybe you could pass the appropriately sized variable.
Good luck.
Ken
