static void dump_constant_collect_hook (str fname) { str csafe_fname = make_csafe_filename (fname); str cch = make_constant_collect_hook (fname); aout << "/*\n" << " *\n" << " * MK note on RPC constant collection:\n" << " *\n" << " * The goal of this magic is to aggregate ALL of the RPC contants\n" << " * in ALL of the .x files recursively included by your server\n" << " * to be accessible at runtime to your server. Thus, every\n" << " * autogenerated .h protocol file will have one of these static\n" << " * objects in it. The static object itself doesn't do anything\n" << " * other than call a constructor function, which in turn will\n" << " * add this rpc_constant_collector_t hook (" << cch << ")\n" << " * to a global list of hooks (see rpc_add_cch_t in" << " extensible_arpc.C)\n" << " *\n" << " */\n"; aout << "extern void " << cch << " (rpc_constant_collector_t *rcc);\n" << "static rpc_add_cch_t " << csafe_fname << "_obj (" << cch << ");\n\n"; }
str make_constant_collect_hook (str fname) { strbuf b; str csafe_fname = make_csafe_filename (fname); b << csafe_fname << "_constant_collect"; return b; }
static void dump_constant_collect_hook (str fname) { str csafe_fname = make_csafe_filename (fname); str cch = make_constant_collect_hook (fname); aout << "extern void " << cch << " (rpc_constant_collector_t *rcc);\n" << "static rpc_add_cch_t " << csafe_fname << "_obj (" << cch << ");\n\n"; }