burow@cernvax.cern.ch (burkhard burow) (10/30/90)
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