Support passing enum values to Lua in cvalue_push()
Support passing enum values to Lua in cvalue_push()

This implements passing values of "enum" types to the Lua world. Values are
passed as integers (for now). This is easy enough to implement, and fast,
as it does not involve looking up the associated symbol. Looking up the
symbol is supported by using the ErisTypeInfo introspection capabilities,
and can be done with a function like this (while no other more convenient
method is provided):

  local function enum_symbol(enum_type, value)
    for i = 1, #enum_type do
      local item = enum_type[i]
      if value == item.value then
        return item.name
      end
    end
    return tostring(value) .. "(no symbolic name)"
  end

  local libfoo = eris.load "libfoo"
  print(enum_symbol(eris.type(libfoo, "foo_enum"), 0))

Ideally, getting the value of an "enum" type enumerator should be much
easier, or "enum" values could be passed to lua as strings. Strings
are interned in Lua anyway, so comparing the pushed value once it is
in Lua would be (almost) as cheap as a pointer comparison. Another
option is to pass enum values as userdata which contains a pointer
to an ErisTypeInfoMember with the value. Anyway, the current approach
gets the support in there, and the rest is food for thought right now.

aperezdc/lua-eol,aperezdc/eris,aperezdc/eris,aperezdc/lua-eol