Port flags for HookCode/HookAPI, but make them typesafe.