[Kde-bindings] KDE/kdebindings/csharp/qyoto

Richard Dale rdale at foton.es
Fri May 18 12:47:10 UTC 2007


On Friday 18 May 2007, Arno Rehn wrote:
> SVN commit 665951 by arnorehn:
>
> * Made 'ref' arguments work.
Oh, I wasn't going to implement them like this. It should be just a matter of 
adding marshallers for the various ref types, and copying a pointer to the 
item on the C# stack to the smoke stack like Marshall::ToObject below:

static void marshall_intR(Marshall *m) {
    switch(m->action()) {
    case Marshall::FromObject:
    {
       int * i = new int;
       *i = m->var().s_int;
       m->item().s_voidp = i;
       m->next();
       if (m->cleanup() && m->type().isConst()) {
           delete i;
       } else {
//         m->item().s_voidp = new int((int)NUM2INT(rv));
       }
    }
    break;

    case Marshall::ToObject:
    {
        m->var().s_voidp = &(m->item().s_int);
    }
    break;

    default:
        m->unsupported();
        break;
    }
}

-- Richard




More information about the Kde-bindings mailing list