* How to convert a C "char *" value to Ada string? @ 2014-07-21 23:44 Victor Porton 2014-07-22 0:19 ` Victor Porton 2014-07-22 0:28 ` Randy Brukardt 0 siblings, 2 replies; 3+ messages in thread From: Victor Porton @ 2014-07-21 23:44 UTC (permalink / raw) How to convert a C "char *" value to Ada string? There is function To_Ada (Item : in char_array; Trim_Nul : in Boolean := True) return String; in package Interfaces.C, but it receives an array not a pointer (= access). So I don't understand how to do this simple thing. -- Victor Porton - http://portonvictor.org ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to convert a C "char *" value to Ada string? 2014-07-21 23:44 How to convert a C "char *" value to Ada string? Victor Porton @ 2014-07-22 0:19 ` Victor Porton 2014-07-22 0:28 ` Randy Brukardt 1 sibling, 0 replies; 3+ messages in thread From: Victor Porton @ 2014-07-22 0:19 UTC (permalink / raw) Victor Porton wrote: > How to convert a C "char *" value to Ada string? > > There is > > function To_Ada (Item : in char_array; > Trim_Nul : in Boolean := True) > return String; > > in package Interfaces.C, but it receives an array not a pointer (= > access). > > So I don't understand how to do this simple thing. Oh, Interfaces.C.Strings. -- Victor Porton - http://portonvictor.org ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to convert a C "char *" value to Ada string? 2014-07-21 23:44 How to convert a C "char *" value to Ada string? Victor Porton 2014-07-22 0:19 ` Victor Porton @ 2014-07-22 0:28 ` Randy Brukardt 1 sibling, 0 replies; 3+ messages in thread From: Randy Brukardt @ 2014-07-22 0:28 UTC (permalink / raw) "Victor Porton" <porton@narod.ru> wrote in message news:lqk8lm$hss$1@speranza.aioe.org... > How to convert a C "char *" value to Ada string? > > There is > > function To_Ada (Item : in char_array; > Trim_Nul : in Boolean := True) > return String; > > in package Interfaces.C, but it receives an array not a pointer (= > access). > > So I don't understand how to do this simple thing. You didn't look far enough in the RM. Look at Interfaces.C.Strings and/or Interfaces.C.Pointers (B.3.1 and B.3.2, respectively). You probably want Interfaces.C.Strings. Randy. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-22 0:28 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-07-21 23:44 How to convert a C "char *" value to Ada string? Victor Porton 2014-07-22 0:19 ` Victor Porton 2014-07-22 0:28 ` Randy Brukardt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox