From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,610e53a911ec64b3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-23 10:55:02 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!news.ksu.ksu.edu!lazrus.cca.rockwell.com!cacd.rockwell.com!usenet From: rswhite@cacd.rockwell.com (Robert S. White) Newsgroups: comp.lang.ada Subject: Re: Importing C Structures Date: 23 Mar 1995 18:55:02 GMT Organization: Rockwell International, CACD Message-ID: <3ksg66$h1c@newssvr.cacd.rockwell.com> References: <3kr4q3$jd9@newsflash.concordia.ca> NNTP-Posting-Host: pc110437.cacd.rockwell.com Mime-Version: 1.0 X-Newsreader: WinVN 0.93.11 Date: 1995-03-23T18:55:02+00:00 List-Id: In article , vladimir@speedy.intrepid.com says... > >If there is some some struct that you need to map to Ada, it should be >farily straightforward. i.e. > - Vladimir Do you have a clean way to handle hardware registers that have one meaning when you read them and another when you write to them with nice seperate names for each type of usage? I know "use at" for Ada 83 can overide this but it seems to be not in the spirit of the 83 LRM; 13.5 "Address clauses should not be used to achieve overlays of objects...Any program using address clauses to achieve such effects is erroneous." A work around is to have a dual meaning name for the register and use one procedure, appropriately named, to write to it and a function, again with a suitable name, for reading it. This is a case where C programmers use the union structure. I confess that I have not ferreted out in the Ada 95 RM or Rational the right (and very concise) way to do this now. Recommendations? Robert S. White 76166.1137@compuserve.com -- speaking for myself only