pascal call in C

K

kkrish

hi,
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .


Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?
Thanks in advance.
Krishna.V.J.
 
K

Keith Thompson

kkrish said:
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .


Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?

Consult the documentation for your compiler. Both "far" and "pascal"
are non-standard. (I think "pascal" specifies a calling convention
compatible with whatever Pascal compiler it's supposed to work with;
"far" has something to do with pointer representations and memory
models, but I don't know how it applies here.)
 
A

Alf P. Steinbach

* kkrish:
hi,
I am working on an old program written in c.The program uses a
function like this

"unsigned long int far pascal ReadFile(char *buff,unsigned long int
*size)" .


Is this a PASCAL function CALL from C?Do I need to have Pascal
installed in my system.This has been written in Turbo C 2.0 under
DOS.Any information on this?
Thanks in advance.
Krishna.V.J.

The above is platform-specific (PC running DOS or 16-bit Windows) and
outdated -- forget it, and implement ReadFile yourself.
 
W

Walter Roberson

non-standard. (I think "pascal" specifies a calling convention
compatible with whatever Pascal compiler it's supposed to work with;
"far" has something to do with pointer representations and memory
models, but I don't know how it applies here.)

My guess would be that the 'far' probably indicated that you
might need a 'far' (bigger than normal) pointer to the
ReadFile function itself.
 
K

kkrish

> The above is platform-specific (PC running DOS or 16-bit Windows) and
outdated -- forget it, and implement ReadFile yourself.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please
Krishna V.J
 
A

Alf P. Steinbach

* kkrish:
> [quoting signature]

Please don't quote signatures -- removed.
Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please

'far' signified a 32-bit pointer as opposed to a 'near' 16-bit pointer;
see the FAQ item "What are ``near'' and ``far'' pointers?" at <url:
http://c-faq.com/osdep/nearfar.html>.

'pascal' signified a Pascal-like calling convention, essentially that
the function was responsible for adjusting the stack pointer on exit.

Anyway, it doesn't matter: just implement the function yourself.
 
M

Mark McIntyre

Yes , it is platform specific.Seems you know something about this,
can you provide some more info ,please

both "far" and "pascal" are nonstandard extensions to C which date
back to the eighties when 16-bit computing was new. A websearch for
"pascal calling convention" will probably reveal all. Further
discussion is offtopic here.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,978
Members
47,561
Latest member
gjsign

Latest Threads

Top