2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)m4_dnl
|
|
|
|
#
|
|
|
|
# BIRD -- Definition of per-instruction structures
|
|
|
|
#
|
|
|
|
# (c) 2018 Maria Matejka <mq@jmq.cz>
|
|
|
|
#
|
|
|
|
# Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Common aliases
|
|
|
|
m4_define(DNL, `m4_dnl')
|
|
|
|
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(INST_FLUSH, `m4_ifdef([[INST_NAME]], [[
|
|
|
|
m4_divert(1)
|
|
|
|
struct f_inst_[[]]INST_NAME() {
|
|
|
|
m4_undivert(2)
|
|
|
|
};
|
|
|
|
m4_divert(3)
|
|
|
|
struct f_inst_[[]]INST_NAME() i_[[]]INST_NAME();
|
|
|
|
m4_divert(-1)
|
|
|
|
]])')
|
|
|
|
m4_define(INST, `INST_FLUSH()m4_define([[INST_NAME]], [[$1]])')
|
|
|
|
|
|
|
|
m4_define(ARG, `m4_divert(2)const struct f_inst *f$1;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(ARG_ANY, `m4_divert(2)const struct f_inst *f$1;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(LINE, `m4_divert(2)const struct f_inst *f$1;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(LINEP, `m4_divert(2)const struct f_line *fl$1;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(SYMBOL, `m4_divert(2)const struct symbol *sym;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(VALI, `m4_divert(2)struct f_val vali;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(VALP, `m4_divert(2)const struct f_val *valp;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
|
|
|
m4_define(VAR, `VALP()SYMBOL()')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(FRET, `m4_divert(2)enum filter_return fret;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(ECS, `m4_divert(2)enum ec_subtype ecs;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(RTC, `m4_divert(2)const struct rtable_config *rtc;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(STATIC_ATTR, `m4_divert(2)struct f_static_attr sa;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(DYNAMIC_ATTR, `m4_divert(2)struct f_dynamic_attr da;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(COUNT, `m4_divert(2)uint count;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(TREE, `m4_divert(2)const struct f_tree *tree;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(STRING, `m4_divert(2)const char *s;
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_define(STRUCT, `m4_divert(2)$1
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(-1)')
|
|
|
|
|
|
|
|
m4_m4wrap(`
|
2019-02-06 13:41:39 +00:00
|
|
|
INST_FLUSH()
|
2019-01-21 08:17:54 +00:00
|
|
|
m4_divert(0)DNL
|
|
|
|
m4_undivert(1)
|
|
|
|
|
|
|
|
struct f_inst {
|
|
|
|
const struct f_inst *next; /* Next instruction */
|
|
|
|
enum f_instruction_code fi_code; /* Instruction code */
|
|
|
|
int lineno; /* Line number */
|
|
|
|
union {
|
2019-02-06 13:41:39 +00:00
|
|
|
m4_undivert(3)
|
2019-01-21 08:17:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
')
|
|
|
|
|
|
|
|
m4_changequote([[,]])
|