Xref: utzoo comp.lang.c:11423 comp.lang.fortran:930 Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!eos!labrea!denali!karish From: karish@denali.stanford.edu (Chuck Karish) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: How do I access f77 common variables from C ? Summary: External structures Message-ID: <23114@labrea.Stanford.EDU> Date: 20 Jul 88 13:52:25 GMT References: <1324@maccs.McMaster.CA> Sender: news@labrea.Stanford.EDU Reply-To: karish@denali.stanford.edu (Chuck Karish) Distribution: na Organization: Mindcraft, Inc. Lines: 18 In article <1324@maccs.McMaster.CA> peter@maccs.UUCP (peter) writes: >How does one access common variables (in blank or named common block) from >a C function linked to an f77 program ? I've done this (pcc, f77) by declaring an external structure in the C program with the same name as the common block. The obvious pitfall in this is that you assume that the alignment and data representation in the structure are the same as in the common block. If there is a difference, it may be necessary to insert dummy variables into one or the other to make things fit. For blank common, individual external variables should work; I haven't tried this, though. Chuck Karish ARPA: karish@denali.stanford.edu BITNET: karish%denali@forsythe.stanford.edu UUCP: {decvax,hplabs!hpda}!mindcrf!karish USPS: 1825 California St. #5 Mountain View, CA 94041