[Commotion-admin] [commotiond] Lua bindings (#46)

LEGO notifications at github.com
Wed Jul 2 01:28:31 EDT 2014


I'm working a quick and dirty wrapper around co_obj_t and family... Just to get started.. Few obserbations:

I find unconfortable that  co_obj_t's "extended subtypes" have a different struct wrapper aroud them (with common elements)...
I was thinking is wrapping all extension subtypes of co_obj_t in 

typedef struct co_extobj_t {
  co_obj_t _header;
  uint8_t _exttype;
  uint8_t _len;
} co_extobj_t;

and then refactor all subtypes for it:
i.e.
struct co_iface_t {
  co_extobj_t _header;
...
} __attribute__((packed));

Nothing changes in the way data is layout, so it shouldn't have any impact, but this allows for easier constructs dealing generically with extended objects.

Then to the main issue:
As with Wireshark an issue here is how to deal with the different lifespan of objects in the environment and in the language, so that garbage-collection on either side of the thing does not leave broken pointers on the other side.

I haven't studied the issue yet as currently I'm more involved with finding the "patterns" for the macros for adding easily the API to Lua .

My question is obj type _ptr already thought for ?
It be so nice to use it for keeping references to an object, so that we can tell Lua the pointer is invalid when the other side deletes it.

\Lego


---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/commotiond/issues/46#issuecomment-47738686
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20140701/73454364/attachment.html>


More information about the Commotion-admin mailing list