Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Keyed Access to UnManagedStruct?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chromatic  
View profile  
 More options Feb 8 2004, 4:00 pm
Newsgroups: perl.perl6.internals
From: chroma...@wgz.org (Chromatic)
Date: Sun, 08 Feb 2004 12:55:58 -0800
Local: Sun, Feb 8 2004 3:55 pm
Subject: Keyed Access to UnManagedStruct?
Hi there,

What's the best way to access fields within an UnManagedStruct, one
returned from an NCI call?  For example, if I call _new_SDL_Screen, how
can I access the w and h fields of the SDL_Surface it returns?

I've tried creating an OrderedHash called layout and then doing:

        set screen, layout

Is there a better way?  I can provide more code if necessary.

-- c


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Feb 8 2004, 6:48 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 9 Feb 2004 00:06:34 +0100
Local: Sun, Feb 8 2004 6:06 pm
Subject: Re: Keyed Access to UnManagedStruct?

Chromatic <chroma...@wgz.org> wrote:
> Hi there,
> What's the best way to access fields within an UnManagedStruct, one
> returned from an NCI call?  For example, if I call _new_SDL_Screen, how
> can I access the w and h fields of the SDL_Surface it returns?
> I've tried creating an OrderedHash called layout and then doing:
>    set screen, layout

Above statement just aliases both P-registers to point to the same thing,

_new_SDL_screen has a return type of 'p' - that is an UnManagedStruct
pointing to that. You know, that the return type is a struct screen *.

So you create an initializer for that struct (above layout? - a bad name
BTW) and *assign* it to the screen:

  assign screen, screen_struct_layout
  w = screen["w"]   # presumed your struct initializer defines that

s. docs/pmcs/struct.pod

> ... I can provide more code if necessary.

If its still not clear, yes please.

> -- c

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chromatic  
View profile  
 More options Feb 9 2004, 4:48 pm
Newsgroups: perl.perl6.internals
From: chroma...@wgz.org (Chromatic)
Date: Mon, 09 Feb 2004 13:07:52 -0800
Local: Mon, Feb 9 2004 4:07 pm
Subject: Re: Keyed Access to UnManagedStruct?

On Sun, 2004-02-08 at 15:06, Leopold Toetsch wrote:
> So you create an initializer for that struct (above layout? - a bad name
> BTW) and *assign* it to the screen:

>   assign screen, screen_struct_layout
>   w = screen["w"]   # presumed your struct initializer defines that

> s. docs/pmcs/struct.pod

Hmm, I wasn't adding the _struct property for struct pointers, but it
looks like I should do that.  That's workable.

Now, I'm seeing an odd error whenever I use the 'loadlib' op, though:

        set_pmc_keyed_str() not implemented in class 'PerlInt'

The backtrace oddness starts in imcc/parser.c 352, when it calls
Parrot_load_lib().

-- c


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options Feb 9 2004, 4:48 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 9 Feb 2004 22:34:16 +0100
Local: Mon, Feb 9 2004 4:34 pm
Subject: Re: Keyed Access to UnManagedStruct?

Chromatic <chroma...@wgz.org> wrote:
> Now, I'm seeing an odd error whenever I use the 'loadlib' op, though:
>    set_pmc_keyed_str() not implemented in class 'PerlInt'

Time for an example ;)

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chromatic  
View profile  
 More options Feb 9 2004, 5:49 pm
Newsgroups: perl.perl6.internals
From: chroma...@wgz.org (Chromatic)
Date: Mon, 09 Feb 2004 13:40:08 -0800
Local: Mon, Feb 9 2004 4:40 pm
Subject: Re: Keyed Access to UnManagedStruct?

On Mon, 2004-02-09 at 13:34, Leopold Toetsch wrote:
> chromatic <chroma...@wgz.org> wrote:
> > Now, I'm seeing an odd error whenever I use the 'loadlib' op, though:

> >       set_pmc_keyed_str() not implemented in class 'PerlInt'
> Time for an example ;)

I see it on examples/sdl/anim_parrot_logo.imc with a fresh build.

-- c


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chromatic  
View profile  
 More options Feb 9 2004, 9:48 pm
Newsgroups: perl.perl6.internals
From: chroma...@wgz.org (Chromatic)
Date: Mon, 09 Feb 2004 17:56:16 -0800
Local: Mon, Feb 9 2004 8:56 pm
Subject: Re: Keyed Access to UnManagedStruct?

On Mon, 2004-02-09 at 13:40, chromatic wrote:
> I see it on examples/sdl/anim_parrot_logo.imc with a fresh build.

Oops, now I don't.  Ignore that; I'll have a better example of weirdness
shortly.

-- c


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »