From 35f5090e07f70ed8f6747b0177a57ef83c377bb7 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 1 Sep 2026 20:09:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20`sources=5Fdish`=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/framework/chef.c | 8 +++----- src/framework/dish.c | 17 ++++++++++++++++- src/framework/struct.h | 4 +++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/framework/chef.c b/src/framework/chef.c index 60fa30c5..ff8b6d2f 100644 --- a/src/framework/chef.c +++ b/src/framework/chef.c @@ -5,7 +5,7 @@ * File Authors : @ccmywish * Contributors : @BingChunMoLi * Created On : <2025-08-09> - * Last Modified : <2026-08-22> + * Last Modified : <2026-09-01> * * 本文件的函数能够帮助 chefs 为一个 dish 定义 recipe * ------------------------------------------------------------*/ @@ -16,7 +16,7 @@ #define def_combo_dish(t, aliases) Dish_t t##_dish={aliases}; /* 仅内部使用的 "源dish",只用来存储源信息,请参考 pl_nodejs_binary 以及 pl_pypi */ -#define def_sources_dish(t, name) Dish_t t##_dish={"__internal_dish_only_for_storing_sources__" name "__"} +#define def_sources_dish(t, name) Dish_t t##_dish={"__internal__sources_only_dish__" name "__"} @@ -297,9 +297,6 @@ chef_set_rest_smURL_with_postfix (Dish_t *dish, char *postfix) } -/** - * @note 用于: 组中的 sub dish 在 standalone 模式时正确填充源信息 - */ void chef_use_other_dish_sources (Dish_t *this, Dish_t *other) { @@ -314,6 +311,7 @@ chef_use_other_dish_sources (Dish_t *this, Dish_t *other) } } + this->sources_dish = other; this->sources = other->sources; this->sources_n = other->sources_n; } diff --git a/src/framework/dish.c b/src/framework/dish.c index f9864ec1..fe2ab420 100644 --- a/src/framework/dish.c +++ b/src/framework/dish.c @@ -6,7 +6,7 @@ * Contributors : @Mikachu2333 * | * Created On : <2026-08-13> - * Last Modified : <2026-08-20> + * Last Modified : <2026-09-01> * * dish 为主体的一些函数 * ------------------------------------------------------------*/ @@ -39,6 +39,21 @@ dish_has_sub_dishes (Dish_t *dish) +bool +dish_use_other_dish_sources (Dish_t *dish) +{ + if (dish->sources_dish) + { + return true; + } + else + { + return false; + } +} + + + void push_combo_stack (Dish_t *combo_dish) { diff --git a/src/framework/struct.h b/src/framework/struct.h index b0f4cde1..10b82ee3 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-19> + * Last Modified : <2026-09-01> * * chsrc struct * ------------------------------------------------------------*/ @@ -200,6 +200,8 @@ typedef struct Dish_t Source_t *sources; int sources_n; + struct Dish_t *sources_dish; /* 有些Dish用的是其它Dish的sources */ + /* Features */ bool can_english; /* 是否支持英文输出 */