comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Convert chars_ptr to Ada String
Date: Sat, 08 Jul 2017 01:48:46 +0300
Date: 2017-07-08T01:48:46+03:00	[thread overview]
Message-ID: <ojp35c$1vi8$1@gioia.aioe.org> (raw)
In-Reply-To: 567a23f5-a7dc-4b3d-8c16-942a8551c02f@googlegroups.com

Anh Vo wrote:

> On Friday, July 7, 2017 at 2:03:32 PM UTC-7, Victor Porton wrote:
>> Remind me how to convert a pair of Ptr: chars_ptr and Size: size_t to an
>> Ada string.
>> 
>> Ptr may contain NULs and this should not influence the length of the
>> resulting string.
> 
> Look at APIs defined in package Interfaces.C.Strings.

I've done it:

https://github.com/vporton/redland-bindings/blob/ada2012/ada/src/rdf-auxiliary-convert.adb

It requires not only Interfaces.C.Strings but also Interfaces.C.Pointers
to make things more confusing.

-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2017-07-07 22:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 21:03 Convert chars_ptr to Ada String Victor Porton
2017-07-07 22:23 ` Anh Vo
2017-07-07 22:48   ` Victor Porton [this message]
2017-07-07 23:14     ` Anh Vo
2017-07-09  6:49       ` Victor Porton
2017-07-10  4:58         ` Anh Vo
2017-07-10  9:31           ` Victor Porton
2017-07-10  9:48             ` Dmitry A. Kazakov
2017-07-10 12:41               ` Mark Lorenzen
2017-07-10 14:24                 ` Dmitry A. Kazakov
2017-07-10 21:21                   ` Victor Porton
replies disabled

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