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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cf493b045fffb8e4,start X-Google-Attributes: gid103376,public From: Greg Baker Subject: How to supply pointer to C? Date: 1996/08/27 Message-ID: <85ybj1zcdu.fsf@walleroo.rp.CSIRO.AU>#1/1 X-Deja-AN: 176713413 sender: usenet@rp.CSIRO.AU (Network news) x-nntp-posting-host: walleroo.rp.csiro.au organization: CSIRO Division of Radiophysics/Australia Telescope National Facility newsgroups: comp.lang.ada Date: 1996-08-27T00:00:00+00:00 List-Id: Interfaces.C.Pointers.Value can get you from a C array to an Ada array, and Interfaces.C.To_C can get you from a String to a null-terminated block of chars, but what if I want to get a block of ints, for examples? More generally, what if I have some object and I want to pass its address to some C function. (The question arises as I am trying to write an Ada gdbm interface - gdbm_store takes as arguments structs of the form- struct { char * dptr; int data_size; }. (i.e. record dptr : Interfaces.C.Pointers.??? data_size : Interfaces.C.int end; ) I'm kind of hoping to do something like x.dptr := Magical_Conversion_function ( object'Access ); x.data_size = object'Size; Any suggestions? -- Gregory D. Baker gbaker@rp.csiro.au CSIRO Radiophysics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - predictions of the future - quantum computers - silly poetry - - the "langue musicale universale" (Solresol) revival project - - - - - - - - - http://www.rp.csiro.au/~gbaker - - - - - - - - - I'm an eccentric mathematician/IT guru/communicator, and I'm looking for a new job in Sydney, Australia.