Merge branch 'dev' into fix/free_hwnd

This commit is contained in:
曾奥然
2025-10-28 13:09:06 +08:00
committed by GitHub
62 changed files with 231 additions and 129 deletions

2
.gitignore vendored
View File

@@ -22,7 +22,7 @@
*.dll
*.out
*.exe
*.res
##############################

View File

@@ -2,13 +2,13 @@
# --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# Build File : Makefile
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Yangmoooo <yangmoooo@outlook.com>
# Build File : Makefile
# File Authors : 曾奥然 <ccmywish@qq.com>
# Contributors : Yangmoooo <yangmoooo@outlook.com>
# | sanchuanhehe <wyihe5520@gmail.com>
# |
# Created On : <2023-08-28>
# Last Modified : <2025-07-22>
# Last Modified : <2025-10-15>
#
# 请阅读 ./doc/01-开发与构建.md 来使用
# --------------------------------------------------------------
@@ -26,10 +26,12 @@ ifeq ($(shell uname), Darwin)
On-macOS = 1
endif
# 只有Windows会定义$(OS)变量
# 只有 MSYS2 会定义 $(OS) 变量
ifeq ($(OS), Windows_NT)
On-Windows = 1
endif
# 注意, 原生 Windows 会定义 $(ComSpec) 变量,且区分大小写
# 但是 MSYS2 并不会定义
#=====================================
@@ -196,6 +198,7 @@ test-cli: $(DevMode-Target-Name)
clean:
-@rm *.exe 2>/dev/null
-@rm *.res 2>/dev/null
-@rm xy 2>/dev/null
-@rm fw 2>/dev/null
-@rm README.md.bak* 2>/dev/null

View File

@@ -3,11 +3,11 @@
! -------------------------------------------------------------
! Doc Type : Markdown
! Doc Name : 01-开发与构建.md
! Doc Authors : 曾奥然 <ccmywish@qq.com>
! Contributors : Nul None <nul@none.org>
! Doc Authors : 曾奥然 <ccmywish@qq.com>
! Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
! |
! Created On : <2024-12-27>
! Last Modified : <2025-08-22>
! Last Modified : <2025-10-11>
! ---------------------------------------------------------- -->
# 开发 chsrc

9
doc/image/chsrc.svg Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g>
<path d="M13.392,207.176L130.909,79.868L369.203,79.868L486.608,207.055L486.608,210.821L255.801,459.814L244.311,459.814L13.392,210.7L13.392,207.176ZM250.056,118.434C186.007,118.434 134.008,170.433 134.008,234.482C134.008,298.53 186.007,350.53 250.056,350.53C314.104,350.53 366.104,298.53 366.104,234.482C366.104,170.433 314.104,118.434 250.056,118.434Z" style="fill:#a52019;"/>
<path d="M189.09,222.379C183.346,222.379 178.683,217.716 178.683,211.972C178.683,209.1 179.849,206.498 181.733,204.614L204.205,182.142C204.253,182.092 204.302,182.042 204.351,181.993C208.413,177.931 215.007,177.931 219.069,181.993C223.131,186.055 223.131,192.649 219.069,196.711C219.02,196.76 218.97,196.808 218.921,196.856L214.212,201.565L312.183,201.565C317.927,201.565 322.59,206.228 322.59,211.972C322.59,217.716 317.927,222.379 312.183,222.379L189.09,222.379Z" style="fill:#a52019;"/>
<path d="M311.547,245.378C317.29,245.378 321.954,250.042 321.954,255.785C321.954,258.657 320.788,261.259 318.904,263.143L296.431,285.616C296.383,285.665 296.335,285.715 296.286,285.764C292.224,289.826 285.629,289.826 281.568,285.764C277.506,281.703 277.506,275.108 281.568,271.046C281.617,270.997 281.666,270.949 281.716,270.901L286.424,266.193L188.453,266.193C182.71,266.193 178.046,261.529 178.046,255.785C178.046,250.042 182.71,245.378 188.453,245.378L311.547,245.378Z" style="fill:#a52019;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -2,12 +2,12 @@
# --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# Build File : justfile
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Nul None <nul@none.org>
# |
# Build File : justfile
# File Authors : 曾奥然 <ccmywish@qq.com>
# Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
# |
# Created On : <2025-06-18>
# Last Modified : <2025-07-21>
# Last Modified : <2025-10-15>
#
# 该文件主要用于在原生Windows上执行项目的基本任务而不借助于
# GNU make 以及相应的 MSYS2、Cygwin 环境
@@ -104,9 +104,9 @@ alias c := clean
default: build-in-dev-mode
build-in-dev-mode:
@echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}}
@{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}}
@echo Finished: Build in DEV mode
@echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}}
@{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}}
@echo Finished: Build in DEV mode
build-in-debug-mode:
@echo Starting: Build in DEBUG mode: '{{CC}}' {{CFLAGS_debug_mode_prompt}} -o {{DebugMode-Target-Name}}
@@ -114,9 +114,17 @@ build-in-debug-mode:
@echo Finished: Build in DEBUG mode
build-in-release-mode:
@echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}}
@{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}
@echo Finished: Build in RELEASE mode
@echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}}
@{{ if os() == 'windows' { \
'(if exist chsrc.res del chsrc.res)' + \
' & windres src/resource/chsrc.rc -O coff -o chsrc.res' \
} else { '' } }}
@{{ if os() == 'windows' { \
CC + ' src/chsrc-main.c chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \
} else { \
CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name \
} }}
@echo Finished: Build in RELEASE mode
debug: build-in-debug-mode
@{{DEBUGGER}} {{DebugMode-Target-Name}}
@@ -140,6 +148,7 @@ test-cli:
clean:
-@{{BIN_rm}} *.exe
-@{{BIN_rm}} *.res
-@{{BIN_rm}} xy
-@{{BIN_rm}} fw
-@{{BIN_rm}} chsrc

View File

@@ -9,7 +9,7 @@
* | BingChunMoLi <bingchunmoli@bingchunmoli.com>
* |
* Created On : <2023-08-28>
* Last Modified : <2025-10-07>
* Last Modified : <2025-10-15>
*
*
* xy: 襄阳、咸阳
@@ -122,15 +122,24 @@ xy =
#define assert_str(a, b) assert (xy_streql ((a), (b)))
#define xy_panic(reason) assert(!reason)
#define xy_throw(reason) assert(!reason)
// @flavor Perl, PHP, Raku
#define die xy_panic
/**
* @depreacated 避免消极用语
*
* @flavor Perl, PHP, Raku
*/
// #define die xy_throw
#define xy_unsupported() xy_panic("Unsuppoted")
#define xy_unimplemented() xy_panic("Unimplemented temporarily")
#define xy_unreached() xy_panic("This code shouldn't be reached")
#define xy_cant_be_null(p) if(!p) xy_panic("This pointer can't be null")
/**
* @depreacated 避免消极用语
*/
// #define xy_panic xy_throw
#define xy_unsupported() xy_throw("Unsuppoted")
#define xy_unimplemented() xy_throw("Unimplemented temporarily")
#define xy_unreached() xy_throw("This code shouldn't be reached")
#define xy_cant_be_null(p) if(!p) xy_throw("This pointer can't be null")
@@ -164,7 +173,7 @@ static void _xy_println_const_str (const char *str) {printf ("%s\n", str);}
bool: _xy_print_bool, \
char *: _xy_print_str, \
const char *: _xy_print_const_str, \
default: xy_panic("Unsupported type for print()!") \
default: xy_throw("Unsupported type for print()!") \
)(x)
/**
@@ -179,7 +188,7 @@ static void _xy_println_const_str (const char *str) {printf ("%s\n", str);}
bool: _xy_println_bool, \
char *: _xy_println_str, \
const char *: _xy_println_const_str, \
default: xy_panic("Unsupported type for println()/say()!") \
default: xy_throw("Unsupported type for println()/say()!") \
)(x)
/* @flavor Raku, Perl */
#define say println
@@ -1332,18 +1341,21 @@ xy_detect_os ()
char buf[256] = {0};
fread (buf, 1, sizeof (buf) - 1, fp);
fclose (fp);
if (strstr (buf, "Android"))
{
xy.on_android = true;
return;
}
else if (strstr (buf, "Linux"))
if (strstr (buf, "Linux"))
{
xy.on_linux = true;
return;
}
}
// @consult https://android.googlesource.com/platform/system/core/+/refs/heads/main/rootdir/init.environ.rc.in
char *android_env = getenv ("ANDROID_ROOT");
if (xy_str_find (android_env, "/system").found)
{
xy.on_android = true;
return;
}
/* 判断 macOS */
DIR *d = opendir ("/System/Applications");
if (d)
@@ -1354,6 +1366,7 @@ xy_detect_os ()
{
xy.on_macos = true;
closedir (d);
return;
}
}
@@ -1376,10 +1389,11 @@ xy_detect_os ()
pclose (fp);
if (strstr (buf, "BSD") != NULL)
xy.on_bsd = true;
return;
}
if (!(xy.on_windows || xy.on_linux || xy.on_android || xy.on_macos || xy.on_bsd))
xy_panic ("Unknown operating system");
xy_throw ("Unknown operating system");
}
@@ -1488,7 +1502,7 @@ xy_seq_at (XySeq_t *seq, int n)
{
xy_cant_be_null (seq);
if (0 == n) xy_panic ("The index must begin from 1, not 0");
if (0 == n) xy_throw ("The index must begin from 1, not 0");
if (1 == n) return seq->first_item ? seq->first_item->data : NULL;

View File

@@ -30,11 +30,10 @@
* 然的加入,逐渐成长为互相支持的伙伴。
* ------------------------------------------------------------*/
#define Chsrc_Version "0.2.3"
#define Chsrc_Release_Date "2025/10/06"
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
#include "framework/version.h"
#include "framework/core.c"
#include "framework/chef.c"

View File

@@ -5,7 +5,7 @@
* File Authors : 曾奥然 <ccmywish@qq.com>
* Contributors : BingChunMoLi <bingchunmoli@bingchunmoli.com>
* Created On : <2025-08-09>
* Last Modified : <2025-08-27>
* Last Modified : <2025-10-27>
*
* chef DSL: for chefs (recipe makers) to define a target
* ------------------------------------------------------------*/
@@ -186,7 +186,7 @@ chef_allow_english (Target_t *target)
}
void
chef_forbid_english (Target_t *target)
chef_deny_english (Target_t *target)
{
xy_cant_be_null (target);
target->can_english = false;
@@ -226,7 +226,7 @@ chef_allow_user_define (Target_t *target)
}
void
chef_forbid_user_define (Target_t *target)
chef_deny_user_define (Target_t *target)
{
xy_cant_be_null (target);

23
src/framework/version.h Normal file
View File

@@ -0,0 +1,23 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Name : version.h
* File Authors : 曾奥然 <ccmywish@qq.com>
* | Mikachu2333 <mikachu.23333@zohomail.com>
* Contributors : Nil Null <nil@null.org>
* |
* Created On : <2025-10-10>
* Last Modified : <See 'Chsrc_Release_Date'>
*
* 发布新版本前请修改此文件
* ------------------------------------------------------------*/
#define Chsrc_Version "0.2.3.1-dev1"
// 以下四个宏仅用于 resource/chsrc.rc
#define Chsrc_Version_Major 0
#define Chsrc_Version_Minor 2
#define Chsrc_Version_Patch 3
#define Chsrc_Version_Pre 1
#define Chsrc_Release_Date "2025/10/15"

View File

@@ -18,7 +18,7 @@ pl_clojure_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -32,7 +32,7 @@ pl_go_prelude ()
chef_set_sauciers (this, 2, "@czyt", "@techoc");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);

View File

@@ -18,7 +18,7 @@ pl_haskell_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -18,7 +18,7 @@ pl_java_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
// 阿里巴巴开源镜像站需要修改为此才能测速

View File

@@ -25,7 +25,7 @@ pl_lua_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -18,8 +18,8 @@ pl_nuget_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://www.nuget.org/api/v3/", DelegateToUpstream},

View File

@@ -18,7 +18,7 @@ pl_ocaml_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -18,7 +18,7 @@ pl_php_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -18,7 +18,7 @@ pl_perl_prelude ()
chef_set_sauciers (this, 2, "@hezonglun", "@Mikachu2333");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english (this);
chef_deny_english (this);
chef_allow_user_define (this);
def_sources_begin()

View File

@@ -18,7 +18,7 @@ pl_r_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
// 以下注释的是不含有bioconductor的镜像站我们在换cran的同时也直接帮助用户换bioconductor

View File

@@ -18,7 +18,7 @@ pl_rust_cargo_prelude (void)
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_forbid_english (this);
chef_deny_english (this);
chef_allow_user_define (this);
@@ -75,7 +75,6 @@ pl_rust_cargo_getsrc (char *option)
char *raw_content = xy_file_read (cargo_config_file);
char *formatted_content = xy_str_gsub (raw_content, " ", "");
formatted_content = xy_str_gsub (formatted_content, "'", "\"");
free (raw_content);
XyStrFindResult_t result_has_mirror = xy_str_find (formatted_content, "replace-with");
if (result_has_mirror.found)
@@ -112,7 +111,6 @@ pl_write_rust_config (const char *path, const char *url)
char *content = RAWSTR_pl_rust_cargo_config;
content = xy_str_gsub (content, "@url@", url);
chsrc_overwrite_file (content, path);
free (content);
}
/**
@@ -172,7 +170,6 @@ pl_rust_cargo_setsrc (char *option)
char *final_content = xy_str_gsub (raw_content, mirror_url, xy_2strcat ("sparse+", source.url));
chsrc_overwrite_file (final_content, cargo_config_file);
free (final_content);
goto finish;
}

View File

@@ -21,7 +21,7 @@ pl_rust_rustup_prelude (void)
chef_set_sauciers (this, 2, "@Yangmoooo", "@Mikachu2333");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english (this);
chef_deny_english (this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -18,8 +18,8 @@ os_armbian_prelude ()
chef_set_sauciers (this, 2, "@ccmywish", "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_debian_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_kali_prelude ()
chef_set_sauciers (this, 2, "@Yangmoooo", "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_linuxlite_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_linuxmint_prelude ()
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
/* @note 实际上镜像站里的内容和Ubuntu的不太一样 */

View File

@@ -18,8 +18,8 @@ os_ros_prelude ()
chef_set_sauciers (this, 2, "@ccmywish", "@zouri");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, "该换源方案中URL存在拼凑因此不能手动使用某URL来换源", "In this switching method, URLs are constructed, so manual URL specification is not supported");

View File

@@ -20,8 +20,8 @@ os_raspberrypi_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_termux_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, "该 recipe 存在对应的 bootstrapper", "This recipe has a corresponding bootstrapper");

View File

@@ -20,8 +20,8 @@ os_trisquel_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -19,8 +19,8 @@ os_ubuntu_prelude ()
chef_set_sauciers (this, 1, "@XUANJI233");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_deepin_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -21,8 +21,8 @@ os_openkylin_prelude ()
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -19,7 +19,7 @@ os_alpine_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
chef_forbid_user_define(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_freebsd_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
// 2023-09-24: 以下三个USTC, NJU, Netease 均维护了 freebsd-pkg freebsd-ports

View File

@@ -19,8 +19,8 @@ os_netbsd_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/", DelegateToUpstream},

View File

@@ -18,8 +18,8 @@ os_openbsd_prelude ()
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://cdn.openbsd.org/pub/OpenBSD/", DelegateToUpstream},

View File

@@ -19,7 +19,7 @@ os_gentoo_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
chef_forbid_user_define(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -19,7 +19,7 @@ os_solus_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,7 +18,7 @@ os_voidlinux_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_almalinux_prelude ()
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_anolis_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_fedora_prelude ()
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_rockylinux_prelude ()
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://dl.rockylinux.org", DelegateToUpstream},

View File

@@ -18,8 +18,8 @@ os_openeuler_prelude ()
chef_set_sauciers (this, 3, "@ccmywish", "@Yangmoooo", "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -18,8 +18,8 @@ os_opensuse_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note(this, NULL, NULL);

View File

@@ -21,8 +21,8 @@ os_arch_prelude ()
chef_set_sauciers (this, 2, "@happy-game", "@Young-Lord");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note (this,
"可额外使用 chsrc set archlinuxcn 来更换 Arch Linux CN Repository 源",
@@ -124,8 +124,8 @@ os_archlinuxcn_prelude ()
chef_set_sauciers (this, 2, "@happy-game", "@Young-Lord");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note (this,
"可额外使用 chsrc set arch 来更换 Arch Linux 源",

View File

@@ -18,8 +18,8 @@ os_msys2_prelude ()
chef_set_sauciers (this, 2, "@ccmywish", "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://mirror.msys2.org/", DelegateToUpstream},

View File

@@ -17,8 +17,8 @@ os_manjaro_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream}

View File

@@ -73,10 +73,10 @@ void
chef_allow_local_mode (this, PartiallyCan, "具体说明是否支持项目级换源...", "Tell users the local mode support");
// chef_allow_english(this); // 项目是否支持英文
chef_forbid_english(this);
chef_deny_english(this);
// chef_allow_user_define(this); // 是否支持用户自定义镜像源
chef_forbid_user_define(this);
chef_deny_user_define(this);
chef_set_note ("中文备注说明...", "English note...");

View File

@@ -20,8 +20,8 @@ wr_anaconda_prelude ()
chef_set_sauciers (this, 2, "@Yangmoooo", "@xyx1926885268");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://repo.anaconda.com", DelegateToUpstream},

View File

@@ -19,7 +19,7 @@ wr_cocoapods_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -35,7 +35,7 @@ wr_docker_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -25,8 +25,8 @@ wr_emacs_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note (this, "Emacs用户往往只需要一次性换源只会极少次调用 chsrc我们只给用户提供文档",
"Emacs users typically only need to switch sources once and rarely call chsrc, so we only provide documentation to users");

View File

@@ -18,7 +18,7 @@ wr_flatpak_prelude ()
chef_set_sauciers (this, 1, "@jialinlvcn");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
chef_set_note (this, "对Flathub目标进行测速的文件非常小测速效果严重失真若你知道可供测速的URL欢迎参与贡献: chsrc issue",

View File

@@ -18,8 +18,8 @@ wr_guix_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
chef_set_note (this, "目前只有一个源, guixcn 的源不知道是否可用",
"Currently only one source available, guixcn source availability unknown");

View File

@@ -21,7 +21,7 @@ wr_homebrew_prelude ()
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
chef_forbid_user_define(this);
chef_deny_user_define(this);
chef_set_note (this, "该换源通过写入环境变量实现若多次换源请手动清理profile文件",
"This source switching is implemented by writing environment variables. If switching sources multiple times, please manually clean the profile file");

View File

@@ -18,8 +18,8 @@ wr_nix_prelude ()
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_deny_english(this);
chef_deny_user_define(this);
def_sources_begin()
{&UpstreamProvider, "https://channels.nixos.org/", DelegateToUpstream},

View File

@@ -20,7 +20,7 @@ wr_tex_prelude ()
chef_set_sauciers (this, 1, "@Mikachu2333");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

View File

@@ -17,7 +17,7 @@ wr_winget_prelude ()
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Mikachu2333");
chef_forbid_english(this);
chef_deny_english(this);
chef_allow_user_define(this);
def_sources_begin()

48
src/resource/chsrc.rc Normal file
View File

@@ -0,0 +1,48 @@
// chsrc.rc - Windows Resource Script
// SPDX-License-Identifier: GPL-3.0-or-later
#include <windows.h>
#include "../framework/version.h"
// 图标资源
IDI_ICON1 ICON DISCARDABLE "logo.ico"
// 版本信息
VS_VERSION_INFO VERSIONINFO
FILEVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,Chsrc_Version_Pre
// 经实验,该值会被下面的 ProductVersion 替换
// PRODUCTVERSION Chsrc_Version_Major,Chsrc_Version_Minor,Chsrc_Version_Patch,Chsrc_Version_Pre
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "RubyMetric"
VALUE "FileDescription", "Change Source everywhere for every software"
// 经实验,该值会被上面的 FILEVERSION 替换
// VALUE "FileVersion", Chsrc_Version
VALUE "InternalName", "chsrc"
VALUE "LegalCopyright", "Copyright (c) 2023-2025 RubyMetric"
VALUE "OriginalFilename", "chsrc.exe"
VALUE "ProductName", "chsrc"
VALUE "ProductVersion", Chsrc_Version
VALUE "Comments", "Released on " Chsrc_Release_Date " (GPLv3+)"
VALUE "LegalTrademarks", "RubyMetric"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0804, 1200, 0x0409, 1200 // 简体中文和英语
END
END

BIN
src/resource/logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB