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-Thread: 103376,d9e66bfe9beb10b9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: C array to ada record interface References: <404ee0af.0407141517.30cacac7@posting.google.com> From: Brian May X-Home-Page: http://snoopy.apana.org.au/~bam/ Date: Thu, 15 Jul 2004 10:36:17 +1000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:R5PrauGknKlkjIhfTlh6tP/58X4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: dsl-202-173-153-89.vic.westnet.com.au X-Trace: news.melbourne.pipenetworks.com 1089851777 202.173.153.89 (15 Jul 2004 10:36:17 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news1.google.com!news.glorb.com!news.moat.net!border1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!news1.optus.net.au!optus!news.mel.connect.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:2177 Date: 2004-07-15T10:36:17+10:00 List-Id: >>>>> "Francisco" == Francisco Javier Loma Daza writes: Francisco> It may be a FAQ, but I had not succeed to find some info so ... Francisco> I have a C struct like that Francisco> struct Francisco> { Francisco> int a,b,c: Francisco> int len; Francisco> struct b* arr; Francisco> } A; What is the b type? Francisco> And I would love to interface in Ada with a record with Francisco> a discriminant Francisco> type B_array(len: Positive) is record Francisco> arr: array of B(1..len); Francisco> end record; Francisco> type A(len: Positive) is Francisco> a,b,c: Integer; Francisco> arr: A(len); Did you really mean to create a recursive type here? Shouldn't this be B_Array? Francisco> end record; Francisco> What representation clauses and interfacing pragmas I Francisco> need to use? Is there a repository of examples about C Francisco> interfacing? -- Brian May