lua-utils: PRIVREFS flag and handling, userdata/data conversion routines.
authorKrisztian Litkey <kli@iki.fi>
Thu, 14 Nov 2013 10:30:21 +0000 (12:30 +0200)
committerKrisztian Litkey <kli@iki.fi>
Thu, 21 Nov 2013 15:48:40 +0000 (17:48 +0200)
commit9e64492d6689e5adbcf7f4d6faa1e0d56ffdd809
treea7769f574e93281fa1fe95697dd04f47bd15ddeb
parent1096076a40820dbd515a2604994c8238f184a1e9
lua-utils: PRIVREFS flag and handling, userdata/data conversion routines.

Added MRP_LUA_CLASS_PRIVREFS, supporting classes to choose between a
private and common reference tables. For instances of classes with a
private, all references the object owns will be automatically cleaned
up when the object is destroyed along with its privte reference table.

Also added static inline retrieval routines for getting to an object
from its userdata and vice versa (instead of the manual +/- 1-ing) to
help hide the internal details of the association mechanism. Still
need to go through the code and replace all +/- 1 instances with calls
to these.
src/core/lua-utils/object.c
src/core/lua-utils/object.h