Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
I don't have a C string that's terminated by null. I have a CArray[int16] of length 260 that's passed to and filled in by the windows api. https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread ToddAndMargo via perl6-users
On 1/2/21 8:13 PM, Paul Procacci wrote: What I'm trying to attempt to do now is display the contents of that CArray (raku member a).  In my mind, this is an "array of utf16LE byte sequences terminated by 0". Hi Paul, If I understand your problem, you are having trouble extracting something

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
A follow-up to my initial message. I think the following is relevant: https://github.com/rakudo/rakudo/issues/3633 I think my inlined array is actually being filled with zero's. say $a.a[0]; say $a.a[1]; Yields: 0 0 I'm using the comma ide: >raku -v Welcome to Rakudo(tm) v2020.12.

Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
Hey gents (again), I'm having on awful time with decoding UTF16LE character sequences that are placed into a Nativecall CArray that I've defined as an interface between Raku and a windows library call. The structure used by the windows function includes a static wchar_t field that's PATH_MAX in

Re: NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
nativesizeof is what I was looking for. Thanks, ~Paul On Sat, Jan 2, 2021 at 8:39 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 1/2/21 4:58 PM, Paul Procacci wrote: > > Hey Gents, > > > > Hopefully a simple question that I could not find the answer to. > > > > Given the

Re: NativeCall -- size of data structure

2021-01-02 Thread ToddAndMargo via perl6-users
On 1/2/21 4:58 PM, Paul Procacci wrote: Hey Gents, Hopefully a simple question that I could not find the answer to. Given the following: class PROCESSENTRY32 is repr('CStruct') { has int32 $.dwSize; has int32 $.cntUsage; has int32 $.th32ProcessID; has Pointer

Re: NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
Apologies. I just came across it. nativesizeof is the subroutine you're looking for. Again, sorry for the noise. ~Paul On Sat, Jan 2, 2021 at 7:58 PM Paul Procacci wrote: > Hey Gents, > > Hopefully a simple question that I could not find the answer to. > > Given the following: > > class

NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
Hey Gents, Hopefully a simple question that I could not find the answer to. Given the following: class PROCESSENTRY32 is repr('CStruct') { has int32 $.dwSize; has int32 $.cntUsage; has int32 $.th32ProcessID; has Pointer $.th32DefaultHeapID; has int32 $.th32ModuleID; has

Re: for and ^ question

2021-01-02 Thread ToddAndMargo via perl6-users
On 1/1/21 10:47 PM, Patrick R. Michaud wrote: On Fri, Jan 01, 2021 at 05:41:04PM -0800, ToddAndMargo via perl6-users wrote: On 1/1/21 6:32 AM, David Santiago wrote: say $_ for {0.1+$_}...^5 Is there a way to do this without the finger wagging? say $_ for {0.1+$_}...^2 If you're going to a

Re: concurrency of asynchronous events - input from multiple keyboards

2021-01-02 Thread Nathan Gray
On Fri, Jan 01, 2021 at 03:20:09PM -0500, Vadim Belman wrote: > As it seems that Audio::PortMIDI lacks non-blocking interface, I think a > solution would be to read events in a dedicated thread and re-submit them > into a Supplier. Something like: > > my Supplier $midi-events; > > start { >