0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-13 22:58:42 +00:00
bird/filter/struct.m4

74 lines
1.9 KiB
Plaintext
Raw Normal View History

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;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(ARG_ANY, `m4_divert(2)const struct f_inst *f$1;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(LINE, `m4_divert(2)const struct f_inst *f$1;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(LINEP, `m4_divert(2)const struct f_line *fl$1;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(SYMBOL, `m4_divert(2)const struct symbol *sym;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(VALI, `m4_divert(2)struct f_val vali;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(VALP, `m4_divert(2)const struct f_val *valp;
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;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(ECS, `m4_divert(2)enum ec_subtype ecs;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(RTC, `m4_divert(2)const struct rtable_config *rtc;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(STATIC_ATTR, `m4_divert(2)struct f_static_attr sa;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(DYNAMIC_ATTR, `m4_divert(2)struct f_dynamic_attr da;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(COUNT, `m4_divert(2)uint count;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(TREE, `m4_divert(2)const struct f_tree *tree;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(STRING, `m4_divert(2)const char *s;
m4_divert(-1)')
2019-02-06 13:41:39 +00:00
m4_define(STRUCT, `m4_divert(2)$1
m4_divert(-1)')
m4_m4wrap(`
2019-02-06 13:41:39 +00:00
INST_FLUSH()
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)
};
};
')
m4_changequote([[,]])