Xref: utzoo comp.os.vms:31865 comp.lang.c:33251 comp.lang.fortran:4022 Path: utzoo!attcan!uunet!mcsun!cernvax!cernvax.cern.ch From: burow@cernvax.cern.ch (burkhard burow) Newsgroups: comp.os.vms,comp.lang.c,comp.lang.fortran Subject: CFORTRAN Announcement Message-ID: <2959@cernvax.UUCP> Date: 29 Oct 90 20:55:25 GMT Sender: burow@cernvax.UUCP Followup-To: comp.os.vms Organization: CERN, European Laboratory for Particle Physics Lines: 41 I have have posted, to vmsnet.sources, my CFORTRAN package which provides a near painless interface between C and FORTRAN routines. Unfortunately, it's currently available only for VAX VMS. From cfortran.doc: ------------------------------------------------------------------------------ Example 1 - CFORTRAN has been used to make the C header file hbook.h, which then gives any C programmer full and completely transparent access to CERN's HBOOK library of routines. Each HBOOK routine required about 3 lines of simple code in hbook.h. /* hbook.h */ #include "cfortran.h" : PROTOCCALLSFSUB6(HBOOK1,INT,STRING,INT,FLOAT,FLOAT,FLOAT) #define hbook1(ID,CHTITLE,NX,XMI,XMA,VMX) \ CCALLSFSUB6(HBOOK1,INT,STRING,INT,FLOAT,FLOAT,FLOAT, \ ID,CHTITLE,NX,XMI,XMA,VMX) : /* example.c */ #include "hbook.h" : main () { : hbook1(1,"pT spectrum of pi+",100,0.,5.,0.); /* c.f. the call in FORTRAN: call hbook1(1,'pT spectrum of pi+',100,0.,5.,0.) */ : } N.B. i) Calling the routine is almost language independant. ii) hbook.h is machine independant. iii) Obviously the code using the routines is machine independant. ----------------------------------------------------------------------------- tschuss INTERNET: burow%13313.hepnet@csa3.lbl.gov burkhard DECNET: 13313::burow