[Y-devel] libYc-0.2

Richard Hills richard at playford.net
Sat Feb 28 11:01:27 GMT 2004


On Fri, 2004-02-27 at 21:22, Casey Winans wrote:
> Ok. I respect that and it's not much to ask. I'll just have to do some
> research and/or find someone that has experience passing structs to C
> code. There are quite a few ways to get hung up there.

        As far as the client and your libYc# are concerned, it shouldn't matter
that they are structs, since you are only dealing with pointers to them.
C# has pointers does it not? You don't have to reference items within
the structs, so that's not important. I'm guessing it's like c++, in
which case you'll have something like:

class object {
        YObject object;
        vector <*message> message_queue;
        etc
};

        Where YObject is typedefed as a "struct object*". Never will you do
object::object -> anything. Okay, this is yet to be implemented, but you
get the idea. I'll try and do it sometime today.

> I think I'm going to use YSignal_Connect once I get the struct issue
> resolved. Another hickup is the second argument of the callback
> function... I'm not sure how to handle a void type because there is no
> equivalent type or concept in C# (another topic to research). If nothing
> else I'm definitely learning a bunch as I go, about C# and Y itself.

        I think you should have your own callback function system, since I
think it'll be hard for C code to call into C#. processMessage makes the
callback, so have you own version of this in C#, and I can add a hook so
it gets called. Hope this helps,

Richard Hills




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved