DEBUG 模式下运行所有 prelude

This commit is contained in:
Aoran Zeng 2025-08-22 16:06:16 +08:00
parent e7aae2808d
commit 4237e8272a
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -505,6 +505,36 @@ iterate_menu (XySeq_t *menu, const char *input, Target_t **target)
} }
void
callback_perform_all_prelude_for_menu (void *data, void *NOUSE)
{
Target_t *target = (Target_t *) data;
if (!target->preludefn)
{
chef_debug_target (target);
chsrc_panic ("未定义 _prelude() !");
}
target->preludefn();
}
/**
* @brief _prelude()
*
* DEBUG Get, Set, Reset
*
*/
void
chsrc_perform_all_prelude ()
{
chsrc_debug ("prelude", "DEBUG模式下, 额外检查所有 _prelude() 是否能正常工作");
xy_seq_each (ProgStore.pl, callback_perform_all_prelude_for_menu, NULL);
xy_seq_each (ProgStore.os, callback_perform_all_prelude_for_menu, NULL);
xy_seq_each (ProgStore.wr, callback_perform_all_prelude_for_menu, NULL);
}
/** /**
* @brief * @brief
*/ */
@ -618,7 +648,10 @@ get_target (const char *input, TargetOp code, char *option)
chsrc_op_epilogue (); chsrc_op_epilogue ();
} }
#ifdef XY_DEBUG
chef_debug_target (target); chef_debug_target (target);
chsrc_perform_all_prelude ();
#endif
return true; return true;
} }