Re: C chars_ptr STORAGE_ERROR in Imported function
- From: Kim Rostgaard Christensen <krc@xxxxxxxxxx>
- Date: Sat, 23 Aug 2008 00:54:11 +0200
Niklas Holsti wrote:
....
I think it would be better to use the To_Chars_Ptr function, which makes a chars_ptr that points to Errbuf itself, without allocating another char_array, so there is no need to Free anything. This also needs a change in the declaration of Errbuf:....
Errbuf : aliased Char_Array := (1 .. 256 => Interfaces.C.nul);
Errbuf_Ptr := To_Chars_Ptr (Errbuf'Unchecked_Access, False);....
followed by:
Device := pcap_lookupdev(Errbuf_ptr);
HTH
This works like a charm, thanks a lot.
KRC
.
- References:
- C chars_ptr STORAGE_ERROR in Imported function
- From: Kim Rostgaard Christensen
- Re: C chars_ptr STORAGE_ERROR in Imported function
- From: Niklas Holsti
- Re: C chars_ptr STORAGE_ERROR in Imported function
- From: Kim Rostgaard Christensen
- Re: C chars_ptr STORAGE_ERROR in Imported function
- From: Niklas Holsti
- C chars_ptr STORAGE_ERROR in Imported function
- Prev by Date: Re: Problems with Ada.Streams.Read (blocking)
- Next by Date: Re: Access to function returning class-wide type
- Previous by thread: Re: C chars_ptr STORAGE_ERROR in Imported function
- Next by thread: Re: C chars_ptr STORAGE_ERROR in Imported function
- Index(es):