comp.lang.ada
 help / color / mirror / Atom feed
* is type String from Ada Binary-Safe ?
@ 2016-09-14 12:51 Daniel Norte Moraes
  2016-09-14 13:12 ` Dmitry A. Kazakov
  2016-09-15 13:21 ` Daniel Norte Moraes
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Norte Moraes @ 2016-09-14 12:51 UTC (permalink / raw)


Hi, All!

Type String from Ada is Binary-Safe ?

I want use it with a 'recfrom()' from C with udp . 

Thanks in Advance,

[]'s Dani.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: is type String from Ada Binary-Safe ?
  2016-09-14 12:51 is type String from Ada Binary-Safe ? Daniel Norte Moraes
@ 2016-09-14 13:12 ` Dmitry A. Kazakov
  2016-09-14 19:55   ` Jeffrey R. Carter
  2016-09-15  5:32   ` AdaMagica
  2016-09-15 13:21 ` Daniel Norte Moraes
  1 sibling, 2 replies; 5+ messages in thread
From: Dmitry A. Kazakov @ 2016-09-14 13:12 UTC (permalink / raw)


On 14/09/2016 14:51, Daniel Norte Moraes wrote:

> Type String from Ada is Binary-Safe ?
>
> I want use it with a 'recfrom()' from C with udp .

1. No array with dynamic bounds is. You need a flat array without 
bounds, e.g. a string subtype or object.

2. Whether Character'Size = 8, AFAIK there is no requirement for that in 
Ada.

3. Whether String is packed is not mandated either.

For recfrom the safe choice is to use flat char_array or chars_ptr, see 
the package Interfaces.C.

BTW, Why don't you use GNAT.Sockets?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: is type String from Ada Binary-Safe ?
  2016-09-14 13:12 ` Dmitry A. Kazakov
@ 2016-09-14 19:55   ` Jeffrey R. Carter
  2016-09-15  5:32   ` AdaMagica
  1 sibling, 0 replies; 5+ messages in thread
From: Jeffrey R. Carter @ 2016-09-14 19:55 UTC (permalink / raw)


On 09/14/2016 06:12 AM, Dmitry A. Kazakov wrote:
> 
> 3. Whether String is packed is not mandated either.

Type String is defined as packed in ARM A.1.

-- 
Jeff Carter
"Since I strongly believe that overpopulation is by
far the greatest problem in the world, this [Soylent
Green] would be my only message movie."
Charleton Heston
123


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: is type String from Ada Binary-Safe ?
  2016-09-14 13:12 ` Dmitry A. Kazakov
  2016-09-14 19:55   ` Jeffrey R. Carter
@ 2016-09-15  5:32   ` AdaMagica
  1 sibling, 0 replies; 5+ messages in thread
From: AdaMagica @ 2016-09-15  5:32 UTC (permalink / raw)


Am Mittwoch, 14. September 2016 15:12:59 UTC+2 schrieb Dmitry A. Kazakov:
> 3. Whether String is packed is not mandated either.

RM A.1(37/3) type String is array(Positive range <>) of Character with Pack;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: is type String from Ada Binary-Safe ?
  2016-09-14 12:51 is type String from Ada Binary-Safe ? Daniel Norte Moraes
  2016-09-14 13:12 ` Dmitry A. Kazakov
@ 2016-09-15 13:21 ` Daniel Norte Moraes
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Norte Moraes @ 2016-09-15 13:21 UTC (permalink / raw)


quarta-feira, 14 de Setembro de 2016 às 09:51:53 UTC-3, Daniel Norte Moraes escreveu:
> Hi, All!
> 
> Type String from Ada is Binary-Safe ?
> 
> I want use it with a 'recfrom()' from C with udp . 
> 
> Thanks in Advance,
> 
> []'s Dani.

Very Very Thanks Dmitry, Jeffrey and AdaMagica

I'll try with char_array and chars_ptr mas before this I'll will look at Gnat.Sockets.

Thanks A Lot!!

[]'s Dani.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-15 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 12:51 is type String from Ada Binary-Safe ? Daniel Norte Moraes
2016-09-14 13:12 ` Dmitry A. Kazakov
2016-09-14 19:55   ` Jeffrey R. Carter
2016-09-15  5:32   ` AdaMagica
2016-09-15 13:21 ` Daniel Norte Moraes

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