<-25@<kXtFgop at quack.sac.ca.us>>
doug at tisgate.tis.tandy.com
doug at tisgate.tis.tandy.com
Fri Jun 28 03:38:20 AEST 1991
/* Written 5:38 pm Jun 26, 1991 by doug at tisgate.tis.tandy.com in tisgate:comp.lang.c */
> /* ---------- "Calling TP functions from TC" ---------- */
> Hi.
> I have been told by a few people that it is impossible to call turbo
> pascal functions from turbo C, and a few others told me they thought
> you could do it, but wasn't sure.
> Please help, I'm pretty desperate in this situation, I have little to
> no knowledge of pascal, and this is one of those time where I can't
> use a pascal to C translator.
> If there is a way, does someone know how?
> Please help, and any help is GREATLY appreciated!!!
You may have figured this out by now but I'll send a message anyway.
You can simply declare the Pascal functions to be pascal functions. If
you have a routine such as
procedure foo(a:integer; var b:integer);
you could declare it in your C program as
extern pascal void foo(int a, int *b);
You can also have C function compiled using Pascal style parameter
passing by using the -p option. If you have any function in the
code that you keep with the C style parameter passing then use the
keyword 'cdelc' in the function declaration. Notice that if you declare
a function to be a pascal routine then you cannot pass a variable number
of parameters to it as you can in C.
Doug Scott
More information about the Comp.lang.c
mailing list