[comp.unix.questions] Pascal to Unix Libraries

hurf@batcomputer.tn.cornell.edu (Hurf Sheldon) (04/27/87)

	Is ther a way to call system subroutines from Pascal in the
Berkeley Pascal Compiler. I have a user who is trying to call plot(3x)
from a pascal program. Can fortran library functions be called from
pascal?. I have tried some fortran type calls - ie '_function()' and
'_system(function)' but it was a stab in the dark and didn't seem to
work.
thanks,
hurf


-- 
     Hurf Sheldon			 Network: hurf@ionvax.tn.cornell.edu
     Lab of Plasma Studies		  Bitnet: hurf@CRNLION
     369 Upson Hall, Cornell University, Ithaca, N.Y. 14853  ph:607 255 7267
     I sold my Elan, got a job in science; Now, no one takes me seriously.

schwartz@swatsun (Scott Schwartz) (04/29/87)

In article <826@batcomputer.tn.cornell.edu>, hurf@batcomputer.tn.cornell.edu (Hurf Sheldon) writes:
> 	Is ther a way to call system subroutines from Pascal in the
> Berkeley Pascal Compiler. ... Can fortran library functions be called from
> pascal?. 

The "pascal programmer's guide" (I have Sun unix: is this part of the 
berkley distribution?) says you can declare C library calls as:

	procedure thingy( <appropriate declarations> );
	external c;

and calls to fortran as:

	procedure thingy( <appropriate declarations> );
	external fortran;

Any you have to look up how do declare various kinds of parameters.
For C, at least, strings get declared as conformant arrays of characters;
most things get passed as "var".  Then you also have to link in the
appropriate library (i.e. -lc)
-- 
# Scott Schwartz  @  Swarthmore College Computer Science Program
# UUCP: ...{{seismo,ihnp4}!bpa, cbmvax!vu-vlsi, sun!liberty}!swatsun!schwartz
# AT&T: (215)-328-8610	/* lab phone */