eolian: resolve to Eolian_Objects instead of voids
This commit is contained in:
parent
c7fd43ad4e
commit
342974977f
|
@ -481,7 +481,7 @@ ffi.cdef [[
|
|||
void eolian_doc_token_init(Eolian_Doc_Token *tok);
|
||||
Eolian_Doc_Token_Type eolian_doc_token_type_get(const Eolian_Doc_Token *tok);
|
||||
char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
|
||||
Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
|
||||
Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
|
||||
]]
|
||||
|
||||
local cutil = require("cutil")
|
||||
|
@ -1853,7 +1853,7 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
|
|||
end,
|
||||
|
||||
ref_get = function(self, unit)
|
||||
local stor = ffi.new("const void *[2]")
|
||||
local stor = ffi.new("const Eolian_Object *[2]")
|
||||
local tp = tonumber(eolian.eolian_doc_token_ref_get(unit, self, stor, stor + 1))
|
||||
local reft = M.object_type
|
||||
if tp == reft.CLASS then
|
||||
|
|
|
@ -2780,7 +2780,7 @@ EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
|
|||
* @param[out] data2 the secondary data
|
||||
* @return the kind of reference this is
|
||||
*/
|
||||
EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
|
||||
EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -290,8 +290,8 @@ eolian_doc_token_text_get(const Eolian_Doc_Token *tok)
|
|||
}
|
||||
|
||||
static Eolian_Object_Type
|
||||
_resolve_event(const Eolian_Unit *src, char *name, const void **data,
|
||||
const void **data2)
|
||||
_resolve_event(const Eolian_Unit *src, char *name, const Eolian_Object **data,
|
||||
const Eolian_Object **data2)
|
||||
{
|
||||
/* never trust the user */
|
||||
if (name[0] == ',')
|
||||
|
@ -310,14 +310,14 @@ _resolve_event(const Eolian_Unit *src, char *name, const void **data,
|
|||
if (!ev)
|
||||
return EOLIAN_OBJECT_UNKNOWN;
|
||||
|
||||
if (data) *data = cl;
|
||||
if (data2) *data2 = ev;
|
||||
if (data) *data = &cl->base;
|
||||
if (data2) *data2 = &ev->base;
|
||||
return EOLIAN_OBJECT_EVENT;
|
||||
}
|
||||
|
||||
EAPI Eolian_Object_Type
|
||||
eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
|
||||
const void **data, const void **data2)
|
||||
const Eolian_Object **data, const Eolian_Object **data2)
|
||||
{
|
||||
if (tok->type != EOLIAN_DOC_TOKEN_REF)
|
||||
return EOLIAN_OBJECT_UNKNOWN;
|
||||
|
@ -374,8 +374,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
|
|||
/* field itself is invalid */
|
||||
if (!fld)
|
||||
return EOLIAN_OBJECT_UNKNOWN;
|
||||
if (data) *data = tpd;
|
||||
if (data2) *data2 = fld;
|
||||
if (data) *data = &tpd->base;
|
||||
if (data2) *data2 = &fld->base;
|
||||
return EOLIAN_OBJECT_STRUCT_FIELD;
|
||||
}
|
||||
|
||||
|
@ -387,8 +387,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
|
|||
/* field itself is invalid */
|
||||
if (!fld)
|
||||
return EOLIAN_OBJECT_UNKNOWN;
|
||||
if (data) *data = tpd;
|
||||
if (data2) *data2 = fld;
|
||||
if (data) *data = &tpd->base;
|
||||
if (data2) *data2 = &fld->base;
|
||||
return EOLIAN_OBJECT_ENUM_FIELD;
|
||||
}
|
||||
|
||||
|
@ -419,8 +419,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
|
|||
return EOLIAN_OBJECT_UNKNOWN;
|
||||
|
||||
/* got a func */
|
||||
if (data) *data = cl;
|
||||
if (data2) *data2 = fid;
|
||||
if (data) *data = &cl->base;
|
||||
if (data2) *data2 = &fid->base;
|
||||
return EOLIAN_OBJECT_FUNCTION;
|
||||
}
|
||||
|
||||
|
|
|
@ -831,7 +831,7 @@ lib.eolian_doc_token_type_get.restype = c_int
|
|||
lib.eolian_doc_token_text_get.argtypes = [c_void_p,]
|
||||
lib.eolian_doc_token_text_get.restype = c_void_p # char* TO BE FREED
|
||||
|
||||
# EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
|
||||
# EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
|
||||
# lib.eolian_doc_token_ref_get.argtypes = [c_void_p, c_void_p, ???, ???]
|
||||
# lib.eolian_doc_token_ref_get.restype = c_int
|
||||
|
||||
|
|
Loading…
Reference in New Issue