added moo_genpfmethods() and moo_findpfimpl() for convenience of writing primitive modules

This commit is contained in:
hyunghwan.chung
2017-02-14 10:25:26 +00:00
parent 71aa1110ed
commit f89d809cdc
10 changed files with 121 additions and 208 deletions

View File

@ -824,6 +824,16 @@ typedef moo_pfrc_t (*moo_pfimpl_t) (
moo_ooi_t nargs
);
typedef struct moo_pfinfo_t moo_pfinfo_t;
struct moo_pfinfo_t
{
moo_method_type_t type;
moo_ooch_t mthname[32];
int variadic;
moo_pfimpl_t handler;
};
typedef struct moo_mod_t moo_mod_t;
typedef int (*moo_mod_load_t) (
@ -1347,6 +1357,14 @@ MOO_EXPORT moo_oop_t moo_instantiate (
moo_oow_t vlen
);
MOO_EXPORT moo_oop_t moo_instantiatewithtrailer (
moo_t* moo,
moo_oop_t _class,
moo_oow_t vlen,
const moo_oob_t* trptr,
moo_oow_t trlen
);
MOO_EXPORT moo_oop_t moo_shallowcopy (
moo_t* moo,
moo_oop_t oop
@ -1497,6 +1515,21 @@ MOO_EXPORT int moo_genpfmethod (
const moo_ooch_t* name
);
MOO_EXPORT int moo_genpfmethods (
moo_t* moo,
moo_mod_t* mod,
moo_oop_t _class,
const moo_pfinfo_t* pfinfo,
moo_oow_t pfcount
);
MOO_EXPORT moo_pfimpl_t moo_findpfimpl (
moo_t* moo,
const moo_pfinfo_t* pfinfo,
moo_oow_t pfcount,
const moo_ooch_t* name
);
/* =========================================================================
* STRING ENCODING CONVERSION
* ========================================================================= */