MEDIUM: init: convert all trivial registration calls to initcalls
This switches explicit calls to various trivial registration methods for
keywords, muxes or protocols from constructors to INITCALL1 at stage
STG_REGISTER. All these calls have in common to consume a single pointer
and return void. Doing this removes 26 constructors. The following calls
were addressed :
- acl_register_keywords
- bind_register_keywords
- cfg_register_keywords
- cli_register_kw
- flt_register_keywords
- http_req_keywords_register
- http_res_keywords_register
- protocol_register
- register_mux_proto
- sample_register_convs
- sample_register_fetches
- srv_register_keywords
- tcp_req_conn_keywords_register
- tcp_req_cont_keywords_register
- tcp_req_sess_keywords_register
- tcp_res_cont_keywords_register
- flt_register_keywords
diff --git a/doc/internals/filters.txt b/doc/internals/filters.txt
index 61a0155..09090e5 100644
--- a/doc/internals/filters.txt
+++ b/doc/internals/filters.txt
@@ -353,13 +353,7 @@
{ NULL, NULL, NULL },
}
};
-
- __attribute__((constructor))
- static void
- __my_filter_init(void)
- {
- flt_register_keywords(&flt_kws);
- }
+ INITCALL1(STG_REGISTER, flt_register_keywords, &flt_kws);
Then you must define the internal configuration your filter will use. For