By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

setvect and getvect in dos.h

P: n/a
hi all,
I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

thanks..
nagehan
Nov 14 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
nagehan wrote:
hi all,
I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?


Try comp.os.ms-dos.programmer

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #2

P: n/a

"nagehan" <na*********@hotmail.com> wrote in message

I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

"far" is a DOS patch on C, and isn't ANSI. The ANSI way to do what you are
trying to achieve is to compile your program with the "large" or "huge"
models and do away with "far" altogether. Unfortunately this will have a
performance impact on your code, ranging from serious to not mattering at
all depending on the application, which is why these compilers include the
use of "far".
Probably the syntax for returning a far pointer from a function will be
someting like

char far *foo(void)
{
char far *answer;
...
return answer;
}

There won't be such a thing as a far pointer to a function (ie a far
function pointer). These will just be regualar ANSI C function pointers.
Nov 14 '05 #3

P: n/a
On 12 Dec 2003 11:01:52 -0800, in comp.lang.c ,
na*********@hotmail.com (nagehan) wrote:
hi all,
I try to write setvect and getvect functions of dos.h,
you mean you're trying to emulate them on some other platform than
DOS? You should ask in a group specialising in that platform.
but I don't
know how can I return a far pointer to a function?


There's no such thing as a "far pointer" in C. this is a dos-ism and
you'd need to ask in a DOS group
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #4

P: n/a
"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote in
news:br**********@news7.svr.pol.co.uk on Fri 12 Dec 2003 01:47:38p:

"nagehan" <na*********@hotmail.com> wrote in message

I try to write setvect and getvect functions of dos.h, but I don't
know how can I return a far pointer to a function?
if anybody know it, or where I can find this information, please send
e-mail to group or "na*********@hotmail.com"

"far" is a DOS patch on C, and isn't ANSI. The ANSI way to do what you
are trying to achieve is to compile your program with the "large" or
"huge" models and do away with "far" altogether.


Well, maybe on some compilers that would allow ANSI compliant code to
compile correctly. But it isn't an ANSI solution at all, in and of itself.

In Standard C, a pointer is a pointer (assuming they're both pointers to
the same type), and there is no notion of near, far, or memory models. As
far as the Standard is concerned, the compiler is supposed to figure all
of that out without help from you.

Nov 14 '05 #5

P: n/a
August Derleth wrote:
"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote in
news:br**********@news7.svr.pol.co.uk on Fri 12 Dec 2003 01:47:38p:
<snip>
In Standard C, a pointer is a pointer (assuming they're both pointers to
the same type), and there is no notion of near, far, or memory models. As
far as the Standard is concerned, the compiler is supposed to figure all
of that out without help from you.


First sentence is right, second is wrong. The Standard does not specify
how compilers treat source files in non-conforming modes of operation.
Invoking the compiler properly is up to you, and there's no implicit
guarantee that any compiler is going to figure much of anything out
unless you invoke it with the proper options, presumably listed
somewhere in the compiler documentation.

Mark F. Haigh
mf*****@sbcglobal.net

Nov 14 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.