delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/01/22:17:10

From: Peter Gerwinski <peter AT agnes DOT dida DOT physik DOT uni-essen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pascal & C
Date: 2 Mar 1998 02:15:38 GMT
Organization: Universitaet Essen
Lines: 28
Message-ID: <6dd4oa$hm47@mx2.hrz.uni-essen.de>
References: <000e01bd454c$8eed2860$3d5272c0 AT darkstar-server>
NNTP-Posting-Host: agnes.Dida.Physik.Uni-Essen.DE
User-Agent: tin/pre-1.4-971123 (UNIX) (Linux/2.0.33 (i486))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eran Rundstein <talrun AT actcom DOT co DOT il> wrote:
> Yes, But how do I call functions in C/C++ that sit in a Pascal file?

If your Pascal source reads

    Procedure foo ( Var bar: Integer );

    begin (* foo *)
      writeln ( 'bar = ', bar );
    end (* foo *);

then you can call it from C using

    extern void Foo ( int *bar );

(* The First Letter Of Pascal Identifiers Is Capitalized
unless you specified otherwise with the `asmname' directive. *)

Of course, I am referring to GNU Pascal and GNU C.  (What else?;-)

Hope this helps,

    Peter
-- 
    Peter Gerwinski, Essen, Germany, free physicist and programmer
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - 1 Oct 1997
PGP key fingerprint:  AC 6C 94 45 BE 28 A4 96  0E CC E9 12 47 25 82 75
                Fight the SPAM! - http://maps.vix.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019