Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site uw-beaver
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxj!houxm!vax135!cornell!uw-beaver!info-mac
From: info-mac@uw-beaver
Newsgroups: fa.info-mac
Subject: sumacc C/Pascal-routine interface routines
Message-ID:
Date: Fri, 25-Jan-85 06:46:58 EST
Article-I.D.: uw-beave.552
Posted: Fri Jan 25 06:46:58 1985
Date-Received: Sun, 27-Jan-85 05:59:57 EST
Sender: daemon@uw-beaver
Organization: U of Washington Computer Science
Lines: 30
From: edmoy%ucbopal.CC@UCB-VAX
Here are some useful routines to allow a C routine to call a Pascal
routine directly, as in the case where you have changed the window
definition procedure handle in a window to point to your own routine,
but this routine still calls the original window def proc. They are in
shar format.
getpargs is an existing routine that gets the pascal argument list when
your C routine is called. It has just been slightly optimized and included
for completeness.
setpargs sets up the stack for a call to a pascal routine, in a matter
exactly opposite of getpargs. For pascal function that pass back a value
on the stack, we must use allocpval to allocate space on the stack, and
afterwards, deallocate the space with freepval.
allocpval with a zero allocate value will return the current value of the
stack register. One could theoretically use it to manipulate the stack,
but this would really be a kludge!
Edward Moy
Computing Services
University of California
Berkeley, CA 94720
[email protected]
ucbvax!ucbopal!edmoy
[filed on getpargs.shar]
