mie: func name and args are now specified separately from func creation
func args are added manually using mie_func_add_arg, while the func's name is specified when the func is added to a module, to allow the module to generate a unique name.
This commit is contained in:
@@ -10,4 +10,6 @@ struct mie_arg {
|
||||
struct mie_type *arg_type;
|
||||
};
|
||||
|
||||
extern struct mie_arg *mie_arg_create(struct mie_type *type);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,8 +31,9 @@ struct mie_func {
|
||||
};
|
||||
|
||||
extern struct mie_func *mie_func_create(
|
||||
const char *name, enum mie_func_type type, struct mie_type *ret_type,
|
||||
struct mie_arg **args, unsigned int nr_args);
|
||||
enum mie_func_type type, struct mie_type *ret_type);
|
||||
extern struct mie_value *mie_func_add_arg(
|
||||
struct mie_func *func, struct mie_type *type, const char *name);
|
||||
extern struct mie_block *mie_func_create_block(
|
||||
struct mie_func *func, const char *name);
|
||||
extern void mie_func_insert_block(
|
||||
|
||||
@@ -22,7 +22,8 @@ struct mie_module {
|
||||
};
|
||||
|
||||
extern struct mie_module *mie_module_create(void);
|
||||
extern void mie_module_add_function(struct mie_module *mod, struct mie_func *func);
|
||||
extern void mie_module_add_function(
|
||||
struct mie_module *mod, struct mie_func *func, const char *name);
|
||||
extern struct mie_data *mie_module_get_string_ptr(
|
||||
struct mie_module *mod, const char *s);
|
||||
extern struct mie_data *mie_module_get_data(
|
||||
|
||||
@@ -16,6 +16,7 @@ enum mie_type_id {
|
||||
MIE_TYPE_ARRAY = 0x08u,
|
||||
MIE_TYPE_LABEL = 0x09u,
|
||||
MIE_TYPE_SELECTOR = 0x0Au,
|
||||
MIE_TYPE_FUNC = 0x0Bu,
|
||||
__MIE_TYPE_COUNT,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user