Hello again!

OK, I got it, it's working flawlessly:

SV* getNext(SV* obj) {
    SWFDisplayItem item = SvITEM(obj)->next;
    
    if(item == NULL)
        return &PL_sv_undef;
    
    SV* obj_ref = newSViv(0);
    SV* itemobj = newSVrv(obj_ref,
"SWFMing::DisplayItem");
    sv_setiv(itemobj, (IV)item);
   SvREADONLY_on(itemobj);
    return obj_ref;
}

Hope this is the right way... Apparently, as a Perl
API newbee  I'm still dealing with making the right
connections between the SVs , the C Library, and the
Perl
Classes.





--- Ogla Sungutay <[EMAIL PROTECTED]> wrote:
> Hello all!!
> 
> My first message to the list!
> Folks, how can I access a C linked list (of an
> external library) from Perl? 
> 
> Let me illustrate what I'm trying to do:
> 
> // from Ming-C SWF Output Library
> // ming.sourceforge.net
> 
> struct SWFDisplayList_s
> {
>       
>       SWFDisplayItem head;
>       SWFDisplayItem tail;
>       byte isSprite;
>       int depth;
> };
> struct SWFDisplayItem_s
> {
>       SWFDisplayItem next;
> 
>       int flags;
>       int depth;
>         SWFCharacter character;
>       SWFPosition position;
>       SWFMatrix matrix;
>       
> };
> 
> SWF* type definitions are all pointers to structs. 
> Then, in Perl I should loop through the
> SWFDisplayList!
> 
> This problem is a very generic one I presume; am I
> missing something in the C-Cookbook??
> 
> Any help is appreciated.
> 
> 
> Ogla 
> 
> 
> 
> 
> 
> 
> 
>    
> 
> 
> 
> 
> 
>       
>               
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! - Internet access at a great low price.
> http://promo.yahoo.com/sbc/



        
                
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

Reply via email to