comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Converting pointers to non nul-terminated C "strings" to Ada string
Date: Sat, 14 Feb 2009 01:28:26 -0800 (PST)
Date: 2009-02-14T01:28:26-08:00	[thread overview]
Message-ID: <08d021c3-8373-4056-ab5d-17aef057aae4@l1g2000yqj.googlegroups.com> (raw)
In-Reply-To: df6e5b77-2d9f-4428-9e34-5f63bea39816@u13g2000yqg.googlegroups.com

On Feb 14, 6:58 am, xorquew...@googlemail.com wrote:

> Is it possible to properly convert unterminated C strings or do I
> need to start messing about with raw System.Address types?

I think you may need this from Interfaces.C (after all, what you're
looking at isn't a C string, which is what Interfaces.C.Strings is
for).

   function To_Ada
     (Item     : char_array;
      Trim_Nul : Boolean := True) return String;

You'll need to define your own pointer-to-Interfaces.C.char_array, I
think.



  parent reply	other threads:[~2009-02-14  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-14  6:58 Converting pointers to non nul-terminated C "strings" to Ada string xorquewasp
2009-02-14  9:26 ` Dmitry A. Kazakov
2009-02-14 10:38   ` xorquewasp
2009-02-14 11:16     ` Dmitry A. Kazakov
2009-02-14 11:37       ` xorquewasp
2009-02-14  9:27 ` Hibou57 (Yannick Duchêne)
2009-02-14 10:41   ` xorquewasp
2009-02-15 17:44     ` Georg Bauhaus
2009-02-14 11:47   ` Jacob Sparre Andersen
2009-02-14 14:25     ` Hibou57 (Yannick Duchêne)
2009-02-14  9:28 ` sjw [this message]
2009-02-14  9:33 ` likai3g
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox