comp.lang.ada
 help / color / mirror / Atom feed
* Interfaces.C.String.Update
@ 2011-11-28 15:55 awdorrin
  2011-11-28 16:09 ` Interfaces.C.String.Update Adam Beneschan
  2011-11-28 16:22 ` Interfaces.C.String.Update Ludovic Brenta
  0 siblings, 2 replies; 5+ messages in thread
From: awdorrin @ 2011-11-28 15:55 UTC (permalink / raw)


What is the suggested method to null terminate an Ada string being
passed back to C via Interfaces.C.Strings.Update() ?

I've been looking at the code for i-cstrin.adb, and it seems that by
default that the procedure, when passing in an Ada String, uses To_C
with Append_Null  set to False.

I was trying to determine if I should manually place the null
character, or instead call Update like:

Update( cPtr, 0, To_C( AStr, Append_Nul => True), False);

I haven't been able to find any discussions on this, so I'm just not
sure what the 'best' approach for this would be.



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

end of thread, other threads:[~2011-11-28 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-28 15:55 Interfaces.C.String.Update awdorrin
2011-11-28 16:09 ` Interfaces.C.String.Update Adam Beneschan
2011-11-28 16:22 ` Interfaces.C.String.Update Ludovic Brenta
2011-11-28 16:35   ` Interfaces.C.String.Update awdorrin
2011-11-28 17:37     ` Interfaces.C.String.Update Ludovic Brenta

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