generate correct code for init/disable/set_opts