Re: Need help understand "class"

2020-12-08 Thread Curt Tilmes
On Tue, Dec 8, 2020 at 7:05 PM ToddAndMargo via perl6-users wrote: > I guess what I am missing is how > > int cupsEnumDests(unsigned flags, int msec, int *cancel, cups_ptype_t > type, cups_ptype_t mask, cups_dest_cb_t cb, void *user_data); > > matches up with > > class CupsDest is

Re: Need help understand "class"

2020-12-08 Thread ToddAndMargo via perl6-users
Hi All, In the following piece of code: use NativeCall; class CupsDest is repr('CStruct') { has Str $.name; has Str $.instance; has int32 $.is-default; has Pointer $.options; } sub cupsGetDests(Pointer is rw --> int32) is native('cups', v2) {} Would some kind soul

Re: Need help understand "class"

2020-12-08 Thread Andy Bach
))); The "nativesizeof" gives the size of the struct, so the $ptr + $i * nativesizeof(CupsDest) moves the new Pointer down the list one struct at a time. From: ToddAndMargo via perl6-users Sent: Monday, December 7, 2020 10:36 PM To: perl6-users Subject: Need

Need help understand "class"

2020-12-07 Thread ToddAndMargo via perl6-users
Hi All, In the following piece of code: use NativeCall; class CupsDest is repr('CStruct') { has Str $.name; has Str $.instance; has int32 $.is-default; has Pointer $.options; } sub cupsGetDests(Pointer is rw --> int32) is native('cups', v2) {} Would some kind soul please