diff --git a/src/framework/chef.c b/src/framework/chef.c index 0da81194..9ca0230d 100644 --- a/src/framework/chef.c +++ b/src/framework/chef.c @@ -30,7 +30,7 @@ chef_debug_dish (Dish_t *dish) printf (" Reset Function: %p\n", dish->resetfn); printf (" Prepare Function: %p\n", dish->preparefn); - printf (" Inited?: %d\n", dish->inited); + printf (" Prepared?: %d\n", dish->prepared); printf (" Sources: %p\n", dish->sources); printf (" Sources Count: %d\n", dish->sources_n); @@ -251,7 +251,7 @@ chef_set_rest_smURL_with_postfix (Dish_t *dish, char *postfix) void chef_use_other_dish_sources (Dish_t *this, Dish_t *other) { - if (!other->inited) + if (!other->prepared) { if (other->preparefn) other->preparefn(); diff --git a/src/framework/dish.c b/src/framework/dish.c index a531432c..388fd9aa 100644 --- a/src/framework/dish.c +++ b/src/framework/dish.c @@ -93,7 +93,7 @@ subdish_sibling_has_source_from_mirror (Dish_t *dish, const char *mirror_code) if (sub_dish == current) continue; - if (!sub_dish->inited) + if (!sub_dish->prepared) sub_dish->preparefn (); if (dish_has_source_from_mirror (sub_dish, mirror_code)) diff --git a/src/framework/source.c b/src/framework/source.c index ef8d93b0..f0cf595a 100644 --- a/src/framework/source.c +++ b/src/framework/source.c @@ -626,7 +626,7 @@ chsrc_yield_source (Dish_t *dish, char *option) * * 目前可能出现这种情况的时候:组换源的时候,sub dishes 的 _setsrc() 被直接调用 */ - if (!dish->inited) dish->preparefn(); + if (!dish->prepared) dish->preparefn(); Source_t source; if (chsrc_in_dish_group_mode() && option) diff --git a/src/framework/struct.h b/src/framework/struct.h index e305c432..52f052fc 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -7,7 +7,7 @@ * Contributors : @livelycode36 * | * Created On : <2023-08-29> - * Last Modified : <2026-08-14> + * Last Modified : <2026-08-19> * * chsrc struct * ------------------------------------------------------------*/ @@ -186,7 +186,7 @@ typedef struct Dish_t * 2. recipe 内部手动调用,如 "源dish" */ void (*preparefn) (void); - bool inited; /* 是否执行过了 preparefn() */ + bool prepared; /* 是否执行过了 preparefn() */ XySeq_t *sub_dishes; /* 某些 dish 为 combo dish,完全由 sub dishes 定义 */ @@ -234,10 +234,10 @@ Dish_t; #define chef_allow_sr(t) this->getfn = NULL; this->setfn = t##_setsrc; this->resetfn = t##_resetsrc; #define chef_allow_gs(t) this->getfn = t##_getsrc; this->setfn = t##_setsrc; this->resetfn = NULL; #define chef_allow_NOOP(t) -#define chef_prep_this_dish(t,op) Dish_t *this = &t##_dish; this->inited = true; chef_allow_##op(t); +#define chef_prep_this_dish(t,op) Dish_t *this = &t##_dish; this->prepared = true; chef_allow_##op(t); /* 简化 "源dish" 的编写 */ -#define chef_prep_this_sources_dish(t) Dish_t *this = &t##_dish; this->inited = true; chef_allow_NOOP(t); +#define chef_prep_this_sources_dish(t) Dish_t *this = &t##_dish; this->prepared = true; chef_allow_NOOP(t); /* 内部 "源dish" 的 preparefn 未通过 menu.c 的 add() 注册, 手动挂载 */ #define chef_set_preparefn_for_sources_dish(t) t##_dish.preparefn = t##_prepare;